Provisioning moves a device from discovered to ready for operations through a gated workflow.
verified or trustedmove, stop, emergency_stopspanda.devices.toml mappingspanda device provision <device-id> --robot rover-001 [--json]
spanda device trust <device-id> [--write] [--json]
Operator approval after quarantine or for trust_level = unknown:
spanda device trust camera-front-001 --write --config spanda.toml
API equivalent: POST /v1/devices/{id}/trust (requires Bearer token with Approve role).
Exit code 1 when any gate fails.
curl -X POST http://127.0.0.1:8080/v1/provision \
-H "Authorization: Bearer $SPANDA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"device_id":"gps-001","robot_id":"rover-001"}'
# Per-device route
curl -X POST http://127.0.0.1:8080/v1/devices/gps-001/provision \
-H "Authorization: Bearer $SPANDA_API_KEY" \
-d '{"robot_id":"rover-001"}'
Failed provisioning quarantines the device automatically.
Re-running provision for the same device_id is idempotent when:
active or assigned with the same robot_idverified or trustedConflict policy (operator action required):
| Situation | Behavior |
|---|---|
| Device assigned to a different robot | API returns ready: false; update assignment via PATCH /v1/devices/{id} first |
| Device quarantined | Resolve quarantine cause, then POST /v1/devices/{id}/trust before reprovision |
| Stale provisioning_id | New run generates a fresh report; prior provisioning_id is superseded in audit only |
| Concurrent provision requests | Last successful write wins; use correlation IDs in mutation audit for ordering |
Treat POST /v1/provision as a gate check, not a destructive reset — it does not retire or
delete pool entries.
# logical sensor gps → physical device gps-ublox-001
[[devices]]
id = "gps-ublox-001"
logical_name = "gps"
assigned_robot = "rover-001"
# logical actuator wheels → physical sabertooth-drive-001
[[devices]]
id = "sabertooth-drive-001"
logical_name = "wheels"
type = "DifferentialDrive"
capabilities = ["move", "stop", "emergency_stop"]
Export mapping JSON via GET /v1/device-tree.