Class: QgsServerInterface

class qgis.server.QgsServerInterface

Bases: sip.wrapper

QgsServerInterface Class defining 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( :py:class:`QgsServerFilter`* , int) method.

Methods

accessControls

Gets the registered access control filters

cacheManager

Gets the registered server cache filters

capabilitiesCache

Gets pointer to the capabiblities cache

configFilePath

Returns the configuration file path

filters

Returns the list of current QgsServerFilter

getEnv

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

registerAccessControl

Register an access control filter

registerFilter

Register a QgsServerFilter

registerServerCache

Register a server cache filter

reloadSettings

Reloads the server settings re-reading the configuration.

removeConfigCacheEntry

Remove entry from config cache

requestHandler

Gets pointer to the request handler

serviceRegistry

Returns the service registry

setConfigFilePath

Set the configuration file path

setFilters

Set the filters map

accessControls(self) QgsAccessControl

Gets the registered access control filters

Return type:

QgsAccessControl

cacheManager(self) QgsServerCacheManager

Gets the registered server cache filters

New in version 3.4.

Return type:

QgsServerCacheManager

capabilitiesCache(self) QgsCapabilitiesCache

Gets pointer to the capabiblities cache

Return type:

QgsCapabilitiesCache

Returns:

QgsCapabilitiesCache

configFilePath(self) str

Returns the configuration file path

Return type:

str

Returns:

QString containing the configuration file path

filters(self) object

Returns the list of current QgsServerFilter

Return type:

object

Returns:

QgsServerFiltersMap list of QgsServerFilter

getEnv(self, name: str) str

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

Parameters:

name (str) –

Return type:

str

registerAccessControl(self, accessControl: QgsAccessControlFilter, priority: int = 0)

Register an access control filter

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

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

registerFilter(self, filter: QgsServerFilter, priority: int = 0)

Register a QgsServerFilter

Parameters:
registerServerCache(self, serverCache: QgsServerCacheFilter, priority: int = 0)

Register a server cache filter

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

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

New in version 3.4.

reloadSettings(self)

Reloads the server settings re-reading the configuration.

New in version 3.28.

removeConfigCacheEntry(self, path: str)

Remove entry from config cache

Parameters:

path (str) – the path of the file to remove

requestHandler(self) QgsRequestHandler

Gets pointer to the request handler

Return type:

QgsRequestHandler

Returns:

QgsRequestHandler

serviceRegistry(self) QgsServiceRegistry

Returns the service registry

Return type:

QgsServiceRegistry

Returns:

QgsServiceResgistry

setConfigFilePath(self, configFilePath: str)

Set the configuration file path

Parameters:

configFilePath (str) – QString with the configuration file path

setFilters(self, filters: object)

Set the filters map

Parameters:

filters (object) – the QgsServerFiltersMap