Class: QgsServerOgcApi¶
- class qgis.server.QgsServerOgcApi(serverIface: QgsServerInterface, rootPath: str, name: str, description: str = '', version: str = '')¶
Bases:
qgis._server.QgsServerApi
QgsServerOgcApi
constructor- Parameters
serverIface – pointer to the server interface
rootPath – root path for this API (usually starts with a “/”, e.g. “/wfs3”)
name – API name
description – API description
version – API version
QgsServerOgcApi(
QgsServerOgcApi
)QGIS Server OGC API endpoint.
QgsServerOgcApi
provides the foundation for the new generation of REST-API based OGC services (e.g. WFS3).This class can be used directly and configured by registering handlers as instances of
QgsServerOgcApiHandler
.class Handler1(:py:class:`.QgsServerOgcApiHandler`): """A handler, see :py:class:`.QgsServerOgcApiHandler` for an example""" ... h = Handler1() api = QgsServerOgcApi(serverInterface(), "/api1", "apione", "A firs API", "1.0") api.registerHandler(h) server.serverInterface().serviceRegistry().registerApi(api)
Methods
Returns the Content-Type value corresponding to
extension
.Returns the file extension for a
ct
(Content-Type).Returns the string representation of a
ct
(Content-Type) attribute.Returns the string representation of a
ct
(Content-Type) attribute.- rtype
str
Executes a request by passing the given
context
to the API handlers.Returns the mime-type for the
contentType
or an empty string if not found- rtype
str
Registers an OGC API
handler
, ownership of the handler is transferred to the APIReturns the string representation of
rel
attribute.- rtype
str
Returns a sanitized
url
with extra slashes removed- rtype
str
Attributes
- class ContentType¶
Bases:
int
- baseClass¶
alias of
qgis._server.QgsServerOgcApi
- GEOJSON = 0¶
- HTML = 3¶
- JSON = 2¶
- OPENAPI3 = 1¶
- class Rel¶
Bases:
int
- baseClass¶
alias of
qgis._server.QgsServerOgcApi
- XML = 4¶
- alternate = 0¶
- collection = 2¶
- conformance = 11¶
- contenTypeFromExtension(extension: object) → QgsServerOgcApi.ContentType¶
Returns the Content-Type value corresponding to
extension
.- Parameters
extension (object) –
- Return type
- contentTypeToExtension(ct: QgsServerOgcApi.ContentType) → str¶
Returns the file extension for a
ct
(Content-Type).- Parameters
ct (QgsServerOgcApi.ContentType) –
- Return type
str
- contentTypeToStdString(ct: QgsServerOgcApi.ContentType) → object¶
Returns the string representation of a
ct
(Content-Type) attribute.- Parameters
ct (QgsServerOgcApi.ContentType) –
- Return type
object
- contentTypeToString(ct: QgsServerOgcApi.ContentType) → str¶
Returns the string representation of a
ct
(Content-Type) attribute.- Parameters
ct (QgsServerOgcApi.ContentType) –
- Return type
str
- data = 12¶
- describedBy = 1¶
- description(self) → str¶
- Return type
str
- executeRequest(self, context: QgsServerApiContext)¶
Executes a request by passing the given
context
to the API handlers.- Parameters
context (QgsServerApiContext) –
- item = 3¶
- items = 10¶
- license = 9¶
- mimeType(contentType: QgsServerOgcApi.ContentType) → object¶
Returns the mime-type for the
contentType
or an empty string if not found- Parameters
contentType (QgsServerOgcApi.ContentType) –
- Return type
object
- name(self) → str¶
- Return type
str
- next = 8¶
- prev = 7¶
- registerHandler(self, handler: QgsServerOgcApiHandler)¶
Registers an OGC API
handler
, ownership of the handler is transferred to the API- Parameters
handler (QgsServerOgcApiHandler) –
- relToString(rel: QgsServerOgcApi.Rel) → object¶
Returns the string representation of
rel
attribute.- Parameters
rel (QgsServerOgcApi.Rel) –
- Return type
object
- rootPath(self) → str¶
- Return type
str
- sanitizeUrl(url: QUrl) → QUrl¶
Returns a sanitized
url
with extra slashes removed- Parameters
url (QUrl) –
- Return type
QUrl
- self = 4¶
- service_desc = 5¶
- service_doc = 6¶
- staticMetaObject = <PyQt5.QtCore.QMetaObject object>¶
- version(self) → str¶
- Return type
str