HTTP inspection API¶
StratoWeave orchestrators expose a small HTTP inspection API rooted at /.
This API is useful for inspecting devices, layer state, configuration queues, and rendered southbound configuration.
Conventions¶
You can call these endpoints against any StratoWeave orchestrator with a base URL like this:
A few conventions matter when you call these endpoints directly:
- Device names in
/device/<name>/...are case-sensitive. - The
/device/<name>/*config endpoints select output format with theformatquery parameter. - The
/layer/<idx>endpoint does not use?format=. It selects output from theAcceptheader instead. - For Acton adata output, both
/device/<name>/*and/layer/<idx>support aloosequery parameter. It defaults totrue.
SORESPO quicklab examples¶
SORESPO quicklab Makefiles use these inspection endpoints today:
GET /layer/<idx>GET /device/<name>/target?format=<fmt>GET /device/<name>/running?format=<fmt>GET /device/<name>/diff?format=<fmt>GET /device/<name>/resync
Typical Make targets include:
make get-config0
make get-config-json2
make get-config-adata3
make get-target-ams-core-1
make get-running-ams-core-1
make get-diff-ams-core-1
make resync-ams-core-1
Inspection API¶
GET /device¶
Returns the list of managed device names as JSON.
Example response:
GET /device/<name>/info¶
Returns device metadata and current orchestration state as JSON.
This includes:
- device name and configured type
- approval mode
- configured addresses
- configured username
has_running_confighas_target_configqueue_lengthpending_approvals- feature flags
- discovered module list
This is the best summary endpoint when you need to understand whether a device is configured, queued, or missing data.
GET /device/<name>/capabilities¶
Returns device capabilities as JSON.
Example response shape:
GET /device/<name>/modules¶
Returns the device module set as JSON.
Each module entry contains the module name, namespace, revision, and features. This is useful when you need to confirm the live schema seen by the device manager.
GET /device/<name>/running?format=<fmt>¶
Returns the current running configuration known for the device.
Supported formats:
jsonxmlgdataadata
Example:
If no running configuration is available, the endpoint returns a 200 with the
plain-text message # No running configuration available.
GET /device/<name>/target?format=<fmt>¶
Returns StratoWeave's target configuration for the device: the config the orchestrator wants the device to have.
Supported formats:
jsonxmlgdataadata
Example:
If no target configuration is available, the endpoint returns a 200 with the
plain-text message # No target configuration available.
GET /device/<name>/diff?format=<fmt>¶
Returns the difference between running and target configuration for the device.
Supported formats:
jsonxmlgdataadata
Example:
If there is no diff, the endpoint returns # No differences. If either side is
missing, it returns # Configuration not available.
GET /device/<name>/log?format=<fmt>¶
Returns the device configuration event log as JSON.
Each log item contains:
timestampeventconf_diff
Supported diff renderings inside the JSON payload:
jsonxmlgdata
adata is not implemented for this endpoint.
GET /device/<name>/q¶
Returns the device's configuration queue as JSON.
The response is a map keyed by queue item id. Each value currently includes the transaction id.
Example response shape:
GET /device/<name>/q/<id>?format=<fmt>¶
Returns one queue item in JSON, including the diff awaiting approval or application.
Fields include:
tidconfig_diffdevice_txidformat
Supported diff formats for this endpoint are narrower than the device config endpoints:
xml(default)gdatajsonreturns# JSON diff not availableadatareturns# Adata diff not available
POST /device/<name>/q/<id>/set_approval¶
Sets approval for a queued device config item.
Request body:
Response:
This is the approval action behind configuration approval workflows such as the SORESPO queue UI.
GET /config-queue¶
Returns all pending approvals across all devices as JSON.
Each device entry contains:
device_idpending_countitems
Each item contains:
queue_idtiddevice_txidapproved
This is the best endpoint for a global approval queue view.
GET /device/<name>/resync¶
Triggers a device resynchronization and returns a JSON acknowledgement.
Example:
Response:
Layer inspection¶
GET /layer/<idx>¶
Returns the stored configuration for one StratoWeave layer.
Unlike the device config endpoints, serialization is selected with the
Accept header:
application/yang-data+xmlapplication/yang-data+jsonapplication/yang-data+acton-adata
Examples:
curl -H "Accept: application/yang-data+xml" \
"$STRATOWEAVE_API_ORIGIN/layer/0"
curl -H "Accept: application/yang-data+json" \
"$STRATOWEAVE_API_ORIGIN/layer/2"
curl -H "Accept: application/yang-data+acton-adata" \
"$STRATOWEAVE_API_ORIGIN/layer/3?loose=true"
The meaning of each layer index depends on the system specification.
For example, in SORESPO the layer numbers are:
0: CFS1: Inter2: RFS3: Device
If the index is out of range, the endpoint returns 404.
Choosing the right endpoint¶
Use /layer/<idx> when you want to inspect StratoWeave's stored state at a
specific transform layer. Use /device/<name>/target and
/device/<name>/running when you want to compare the orchestrator's intended
southbound device config with the device's current running config. Use
/device/<name>/diff and /config-queue when you are diagnosing rollout or
approval behavior.
Embedded static assets (web UI)¶
Applications can embed a built web UI (or any set of text files) into their
binary and have the HTTP server serve it alongside the APIs. Pass a
static_assets map (URL path -> file content) to stratoweave.main(); it is
forwarded to HttpServer and installed by the static_assets module.
Behavior:
- Every asset is served on
GET <path>on the same listener and port as the APIs.GET /serves/index.htmlwhen present. Assets are served by a catch-allGET /*pathroute that the router ranks below every static or parameterized route, so registered API routes always take precedence and can never be shadowed by an asset. Installing fails if the application already registered its own root-levelGETwildcard. - Assets under
/_app/immutable/(content-hashed filenames) are served withCache-Control: public, max-age=31536000, immutable; everything else withno-cache. - SPA fallback: a
GETrequest that matches no route and carries anAcceptheader that explicitly allowstext/html(a browser navigation) receives/index.html, so client-side routed pages survive a browser refresh. Requests without such anAcceptheader — API clients, curl — keep receiving a plain404, and registered API routes always win over the fallback. - The flip side of route precedence: an asset whose path an existing GET
route already matches — including parameterized and wildcard routes such as
/device/{name}/infoor/restconf/data/*— is unreachable. Keep asset paths (/index.html,/_app/...) out of the API namespace.
Limitations:
- Only text assets can be served (response bodies are UTF-8 strings). Binary files such as images or fonts must be inlined by the frontend build, e.g. as data URIs.
HEADis not supported by the HTTP server; usecurl -sD- -o /dev/nullrather thancurl -Iwhen inspecting response headers.