Class: QgsServerInterface

Defines interfaces exposed by QGIS Server and made available to plugins.

This class provides methods to access the request handler and the capabilities cache. A method to read the environment variables set in the main FCGI loop is also available. Plugins can add listeners (instances of QgsServerFilter) with a certain priority through the registerFilter() method.

class qgis.server.QgsServerInterface[source]

Bases: object

abstract accessControls(self) QgsAccessControl | None[source]

Gets the registered access control filters

Return type:

Optional[QgsAccessControl]

abstract cacheManager(self) QgsServerCacheManager | None[source]

Gets the registered server cache filters

Added in version 3.4.

Return type:

Optional[QgsServerCacheManager]

abstract capabilitiesCache(self) QgsCapabilitiesCache | None[source]

Gets pointer to the capabiblities cache

Return type:

Optional[QgsCapabilitiesCache]

Returns:

QgsCapabilitiesCache

abstract configFilePath(self) str[source]

Returns the configuration file path

Return type:

str

Returns:

string containing the configuration file path

abstract filters(self) Any[source]

Returns the list of current QgsServerFilter

Return type:

Any

Returns:

QgsServerFiltersMap list of QgsServerFilter

abstract getEnv(self, name: str | None) str[source]

Returns an enrironment variable, used to pass environment variables to Python

Parameters:

name (Optional[str])

Return type:

str

abstract registerAccessControl(self, accessControl: QgsAccessControlFilter | None, priority: int = 0)[source]

Register an access control filter

Parameters:
  • accessControl (Optional[QgsAccessControlFilter]) – the access control to register

  • priority (int = 0) – the priority used to order them

abstract registerFilter(self, filter: QgsServerFilter | None, priority: int = 0)[source]

Register a QgsServerFilter

Parameters:
abstract registerServerCache(self, serverCache: QgsServerCacheFilter | None, priority: int = 0)[source]

Register a server cache filter

Parameters:
  • serverCache (Optional[QgsServerCacheFilter]) – the server cache to register

  • priority (int = 0) – the priority used to order them

Added in version 3.4.

abstract reloadSettings(self)[source]

Reloads the server settings re-reading the configuration.

Added in version 3.28.

abstract removeConfigCacheEntry(self, path: str | None)[source]

Remove entry from config cache

Parameters:

path (Optional[str]) – the path of the file to remove

abstract requestHandler(self) QgsRequestHandler | None[source]

Gets pointer to the request handler

Return type:

Optional[QgsRequestHandler]

Returns:

QgsRequestHandler

abstract serviceRegistry(self) QgsServiceRegistry | None[source]

Returns the service registry

Return type:

Optional[QgsServiceRegistry]

Returns:

QgsServiceResgistry

abstract setConfigFilePath(self, configFilePath: str | None)[source]

Set the configuration file path

Parameters:

configFilePath (Optional[str]) – string with the configuration file path

abstract setFilters(self, filters: Any | None)[source]

Set the filters map

Parameters:

filters (Optional[Any]) – the QgsServerFiltersMap