1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/server/qgsserverogcapi.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsServerOgcApi : QgsServerApi
{
%Docstring(signature="appended")
QGIS Server OGC API endpoint. :py:class:`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 :py:class:`QgsServerOgcApiHandler`.
.. code-block:: python
class Handler1(QgsServerOgcApiHandler):
"""A handler, see QgsServerOgcApiHandler for an example"""
...
h = Handler1()
api = QgsServerOgcApi(serverInterface(), "/api1", "apione", "A firs API", "1.0")
api.registerHandler(h)
server.serverInterface().serviceRegistry().registerApi(api)
.. versionadded:: 3.10
%End
%TypeHeaderCode
#include "qgsserverogcapi.h"
%End
public:
static const QMetaObject staticMetaObject;
public:
enum Rel /BaseType=IntEnum/
{
// The following registered link relation types are used
alternate,
describedBy,
collection,
item,
self,
service_desc,
service_doc,
prev,
next,
license,
// In addition the following link relation types are used for which no applicable registered link relation type could be identified:
items,
conformance,
data
};
enum ContentType /BaseType=IntEnum/
{
GEOJSON,
OPENAPI3,
JSON,
HTML,
XML
};
QgsServerOgcApi( QgsServerInterface *serverIface, const QString &rootPath, const QString &name, const QString &description = QString(), const QString &version = QString() );
%Docstring
QgsServerOgcApi constructor
:param serverIface: pointer to the server interface
:param rootPath: root path for this API (usually starts with a "/", e.g.
"/wfs3")
:param name: API name
:param description: API description
:param version: API version
%End
virtual const QString name() const;
virtual const QString description() const;
virtual const QString version() const;
virtual const QString rootPath() const;
~QgsServerOgcApi();
virtual void executeRequest( const QgsServerApiContext &context ) const throw( QgsServerApiBadRequestException ) /VirtualErrorHandler=serverapi_badrequest_exception_handler/;
%Docstring
Executes a request by passing the given ``context`` to the API handlers.
%End
void registerHandler( QgsServerOgcApiHandler *handler /Transfer/ );
%Docstring
Registers an OGC API ``handler``, ownership of the handler is
transferred to the API
%End
static QUrl sanitizeUrl( const QUrl &url );
%Docstring
Returns a sanitized ``url`` with extra slashes removed and the path URL
component that always starts with a slash.
%End
static std::string relToString( const QgsServerOgcApi::Rel &rel );
%Docstring
Returns the string representation of ``rel`` attribute.
%End
static QString contentTypeToString( const QgsServerOgcApi::ContentType &ct );
%Docstring
Returns the string representation of a ``ct`` (Content-Type) attribute.
%End
static std::string contentTypeToStdString( const QgsServerOgcApi::ContentType &ct );
%Docstring
Returns the string representation of a ``ct`` (Content-Type) attribute.
%End
static QString contentTypeToExtension( const QgsServerOgcApi::ContentType &ct );
%Docstring
Returns the file extension for a ``ct`` (Content-Type).
%End
static QgsServerOgcApi::ContentType contenTypeFromExtension( const std::string &extension ) /Deprecated/;
%Docstring
Returns the Content-Type value corresponding to ``extension``.
.. deprecated:: 3.40
Use :py:func:`~QgsServerOgcApi.contentTypeFromExtension`.
%End
static QgsServerOgcApi::ContentType contentTypeFromExtension( const std::string &extension );
%Docstring
Returns the Content-Type value corresponding to ``extension``.
.. versionadded:: 3.38
%End
static std::string mimeType( const QgsServerOgcApi::ContentType &contentType );
%Docstring
Returns the mime-type for the ``contentType`` or an empty string if not
found
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/server/qgsserverogcapi.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|