Gateway module REST API¶
The PDK module mounts its API at /data/pdk/v1 on the gateway, for example
http://127.0.0.1:8088/data/pdk/v1/health. The Python client (pdk.gateway.client) is the supported way to
use it; this page documents it for reference and for other tools.
Access¶
Every request must:
arrive over loopback (
127.0.0.0/8or::1) and carry no proxy forwarding headers (Forwarded,X-Forwarded-For,X-Real-IP); otherwise the answer is403;carry the header
X-PDK-Tokenwith the token the module writes to<ignition>/data/pdk-gateway.tokenon every start; otherwise the answer is401.
Writes are further limited to the sandbox (-Dpdk.sandbox), the target project’s finished views
(-Dpdk.target) and tags under [provider]PDK/ (UDT definitions under [provider]_types_/PDK/).
Endpoints¶
Method |
Path |
Purpose |
|---|---|---|
GET |
|
Module, Ignition, Perspective and Java versions, edition, sandbox and target (and whether they exist), whether writes are enabled, and the availability of the session API, the log tap and tags. |
GET |
|
A resource’s files, signature and last modification; for a folder, its listing. |
PUT |
|
Create or modify a resource. Body: |
DELETE |
|
Delete a resource if its signature still matches. |
POST |
|
Ask the gateway to rescan projects from disk. |
GET |
|
Resource change events in the sandbox (who, what, when) after a sequence number. |
GET |
|
The Perspective components registered on the running gateway. |
GET |
|
The expression functions ( |
POST |
|
Compile Jython sources with the gateway’s Jython, never running them. Body:
|
GET |
|
Open Perspective sessions of a project, with their pages and views. |
DELETE |
|
Close the sandbox session that owns that page (PDK’s own browser sessions, when it closes the browser). |
GET |
|
The evaluated component tree of a page: props and binding qualities. |
GET |
|
Gateway log events captured by the module, filtered by project or view. |
GET |
|
Browse tags under a folder (any provider): type, value and quality. |
PUT |
|
Import a tag export JSON under |
DELETE |
|
Delete tags under |
POST |
|
Read the values and qualities of a list of tag paths. |
POST |
|
Write values, optionally with a quality, to tags under |
GET |
|
Alarm events of the tags under a path. |
POST |
|
Acknowledge the alarms of the tags under a path. |
GET |
|
The gateway’s tag history providers. |
POST |
|
Store synthetic history points for tags under |
Errors¶
Failures are JSON objects {"error": "<CODE>", "message": "…"}, sometimes with extra fields (a 409 includes
the current version). The Python client maps them to the G codes in Diagnostic codes.
Status |
Codes |
|---|---|
400 |
|
401 |
missing or wrong token |
403 |
not loopback or proxied; |
404 |
|
409 |
|
413 |
|
422 |
|
500 |
|
501 |
|
503 |
|
504 |
|