Type: reference · Imported reference (adopted from the clarity backend developer docs)
Endpoints for discovering an OSI PI hierarchy (via the PI Web API), onboarding a unit, and starting a historical backfill. See PI connector for how the connectors work.
All routes are POST with a JSON body, under /exactapi/pi/. The common body fields are the PI Web API connection details; several endpoints stream NDJSON (application/x-ndjson, one JSON object per line).
Common body fields
| Field | Type | Notes |
|---|---|---|
api_url |
string | PI Web API root URL. |
username |
string | PI Basic-auth user. |
password |
string | PI Basic-auth password. |
verify_ssl |
bool | Default true. |
web_id (aliases: webid, element_web_id, server_web_id) |
string | The element/server to act on. |
/exactapi/pi/list_asset_serversBody: api_url, username, password, verify_ssl. Response — a JSON map of server name → { webId, elementCount, attributeCount }.
/exactapi/pi/list_databasesBody: + web_id/server_web_id. Response — a map of database summaries.
/exactapi/pi/list_childrenBody: + web_id/element_web_id, is_database (bool). Response — a map of child element summaries (element + attribute counts).
/exactapi/pi/list_attributesBody: + web_id. Response — a JSON array of the element's raw PI attribute items.
/exactapi/pi/all_hierarchy_streamBody: api_url, username, password, verify_ssl. Streaming NDJSON of server/database/element nodes (depth-first, depth ≤ 5).
/exactapi/pi/dump_hierarchyBody: + connectionId. Writes {connectionId}_AF.json and returns { "status": "success", "path": "…" }.
/exactapi/pi/dump_and_streamBody: + connectionId. Streaming NDJSON with init/server/database/element/complete nodes (tree-friendly pathIds, isLastChild) while also persisting {connectionId}_AF.json.
/exactapi/pi/onboard_unitBody: common fields + web_id/unit_element_webid, connectionId (an Authorization header is optional). Maps the element's PI points to Clarity tags, updates the target collection's metadata, and starts the live pi-driver task.
Streaming NDJSON response:
{"status":"started"}
{"status":"tag","tag":{ … }}
{"status":"tag","tag":{ … }}
{"status":"completed","total_tags":128}
(or {"status":"error", …}).
/exactapi/pi/map_tagsBody: industry, equipment, unitsId, siteId, orgsId, tags[] (an Authorization header is optional). Proxies an ML tag-mapping service, streams the mapped rows, then orchestrates equipment/dashboard/tagmeta creation on the local API. Streaming NDJSON.
/exactapi/pi/start_backfillBody:
| Field | Type | Default |
|---|---|---|
connection_id |
string | |
start_time |
string | ISO8601 or "AUTO" |
end_time |
string | ISO8601 or "AUTO" |
pi_url |
string | |
username / password |
string | |
resolution_ms |
int | 60000 |
concurrency |
int | 4 |
pacing_ms |
int | 0 |
tag_filter |
string[] | (PI WebIds) |
Response:
{ "status": "success", "process_id": 4213 }
Spawns the pi-backfill managed task (resumable; see PI connector).
pi-driver/pi-backfill tasksAdopted from clarity backend developer docs (
docs/developer/api/connectors-pi.md), imported reference.
Primary handlers:clarity:backend/src-tauri/src/connectors/webpi/mod.rs,webpi_meta_connector.rs.
Last updated: 2026-07-16 from clarity@bff451d