Management API (experimental)

The management API is a REST api for inspecting the server state and controlling some of the server behavior.

Starting from version 1.7.0, this is an experimental feature and it will be subject to change. The api will be considered as stable from the 1.8.0 version.

Plugins API

The plugins api enable inspecting and managing Qgis server plugins.

GET /plugins/(name)

Return plugin status from its name name

If name is not given, return a summary of plugins that the worker has attempted to load

Status Codes:

example:

GET /plugins/myplugin HTTP/1.1
Host: example.com
Accept: application/json

response:

HTTP/1.1 200 OK
Vary: *
Content-Type: application/json

{
  "metadata": {
     "general": {
         "author": "3liz",
         "description": "Test plugin",
         "email": "",
         "name": "myplugin",
         "qgisminimumversion": "3.0",
         "server": "True",
         "version": "1.0.0",
     },
     "path"   : "/plugins/myplugin/__init__.py"
  },
  "name": "myplugin",
  "status": "loaded"
}

Cache API

The cache api allow qgis project introspection

GET /cache/(project_uri)

Return the project informations

Status Codes:

example:

GET /cache/myproject HTTP/1.1
Host: example.com
Accept: application/json

response:

HTTP/1.1 200 OK
Vary: *
Content-Type: application/json

{
  "bad_layers_count": 0,
  "cache_key": "myproject",
  "crs": "EPSG:4326 - WGS 84",
  "last_modified": "2021-06-24T08:04:26",
  "layers" : [
     {
         "crs": "EPSG:4326 - WGS 84",
         "id": "myproject_8d8d649f_7748_43cc_8bde_b013e17ede29",
         "name": "my project layer",
         "source": "/src/tests/data/myproject/myproject.shp"
     }
  ]
}

Pool API

The pool api allow inspecting workers and projects cache associated to them.

GET /pool/

Return the list of worker state and the cache for each of them.

Status Codes:

example:

GET /cache/pool/ HTTP/1.1
Host: example.com
Accept: application/json

response:

HTTP/1.1 200 OK
Vary: *
Content-Type: application/json

{
  "num_workers": 2,
  "workers": [
      {
        "cache": [
          {
            "filename":
            "/tests/data/myporject.qgs",
            "key": "myproject",
            "last_modified": "2021-06-24T08:04:26",
            "link": "http://localhost:19876/cache/myproject",
            "num_layers": 1
          }
        ],
        "mem_percent": 0.4297396825334563,
        "mem_usage": 143597568,
        "pid": 34
      },
      {
        "cache": [],
        "mem_percent": 0.41044564806749534,
        "mem_usage": 137150464,
        "pid": 31
      }
  ]
}
POST /pool/restart

Restart workers gracefully.

Status Codes:

Qgis API

The /qgis/ api endpoint is a passthrough for accessing directly the Qgis server api and services. Some services may install some management api that will be accessible from this endpoint.