Class: QgsServiceRegistry

class qgis.server.QgsServiceRegistry

Bases: sip.wrapper

Constructor

QgsServiceRegistry(QgsServiceRegistry)

QgsServiceRegistry Class defining the registry manager for QGIS server services

This class provides methods for registering and retrieving services.

IMPORTANT: The registry hold ownership of registered services and will call ‘delete’ on cleanup

New in version 3.0: Methods

cleanUp Clean up registered service and unregister modules
getService Retrieve a service from its name
init Initialize registry, load modules and auto register services
registerService Register a service by its name and version
unregisterService Unregister service from its name and version

Signals

Attributes

cleanUp(self)

Clean up registered service and unregister modules

getService(self, name: str, version: str = '') → QgsService

Retrieve a service from its name

Parameters:
  • name – the name of the service
  • version – the version string (optional)
Returns:

QgsService

If the version is not provided the higher version of the service is returned

init(self, nativeModulepath: str, serverIface: QgsServerInterface = None)

Initialize registry, load modules and auto register services

Parameters:
  • serverIface – the server interface
  • nativeModulepath – the native module path
registerService(self, service: QgsService)

Register a service by its name and version

This method is intended to be called by modules for registering services. A module may register multiple services.

The registry gain ownership of services and will call ‘delete’ on cleanup

Parameters:service – a QgsService to be registered
unregisterService(self, name: str, version: str = '') → int

Unregister service from its name and version

Parameters:
  • name – the tame of the service
  • version – (optional) the specific version to unload
Returns:

the number of services unregistered

If the version is not specified then all versions from the specified service are unloaded