Subgroup: Server

Class: QgsServerInterface

class qgis.server.QgsServerInterface

Bases: sip.wrapper

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( 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
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

Signals

Attributes

accessControls(self) → QgsAccessControl

Gets the registered access control filters

cacheManager(self) → QgsServerCacheManager

Gets the registered server cache filters

New in version 3.4.

capabilitiesCache(self) → QgsCapabilitiesCache

Gets pointer to the capabiblities cache

Returns:QgsCapabilitiesCache
configFilePath(self) → str

Returns the configuration file path

Returns:QString containing the configuration file path
filters(self) → object

Returns the list of current QgsServerFilter

Returns:QgsServerFiltersMap list of QgsServerFilter
getEnv(self, name: str) → str

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

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

Register an access control filter

Parameters:
  • accessControl – the access control to register
  • priority – the priority used to order them
registerFilter(self, filter: QgsServerFilter, priority: int = 0)

Register a QgsServerFilter

Parameters:
  • filter – the QgsServerFilter to add
  • priority – an optional priority for the filter order
registerServerCache(self, serverCache: QgsServerCacheFilter, priority: int = 0)

Register a server cache filter

Parameters:
  • serverCache – the server cache to register
  • priority – the priority used to order them

New in version 3.4.

removeConfigCacheEntry(self, path: str)

Remove entry from config cache

Parameters:path – the path of the file to remove
requestHandler(self) → QgsRequestHandler

Gets pointer to the request handler

Returns:QgsRequestHandler
serviceRegistry(self) → QgsServiceRegistry

Returns the service registry

Returns:QgsServiceResgistry
setConfigFilePath(self, configFilePath: str)

Set the configuration file path

Parameters:configFilePath – QString with the configuration file path
setFilters(self, filters: object)

Set the filters map

Parameters:filters – the QgsServerFiltersMap