Skip to content

Commands & OTA Updates

The Cloud Backend pushes commands to Edge appliances via poll-based long-poll: the device asks for pending commands (also refreshes last_seen_at). Online window: 90 seconds.

sequenceDiagram
    participant Edge as Edge Appliance
    participant CloudAPI as Cloud Backend
    participant SQL as Azure SQL

    loop Long-poll
        Edge->>CloudAPI: GET /v1/commands
        Note right of Edge: Backend mount /api/v1/commands
        CloudAPI->>SQL: pending commands for device
        CloudAPI-->>Edge: command list or empty
        Edge->>CloudAPI: POST /v1/commands/:id/ack
    end

Auth: X-Device-Key / api_key from claim-complete (optional mTLS).

OTA: RAUC (current Edge) and snaps (still in Backend)

Section titled “OTA: RAUC (current Edge) and snaps (still in Backend)”
PathWho uses itBackend routes
RAUC bundlesCurrent Edge image / updater/api/v1/bundles/latest, /api/v1/bundles/download/:version, publish POST /api/v1/admin/bundles/publish
SnapsLegacy / still mounted/api/v1/snaps/:name/latest, download, GET /api/v1/devices/:id/snaps

Edge product direction is RAUC (Updates CA signing — PKI). Backend still exposes both snap and bundle APIs (Backend/internal/domain/updates/routes.go). Do not delete snap docs until the Backend routes and tables are removed.

sequenceDiagram
    participant CI as CI/CD
    participant CloudAPI as Cloud Backend
    participant Edge as Edge Appliance

    CI->>CloudAPI: Publish RAUC bundle metadata
    Edge->>CloudAPI: Poll commands or GET bundles/latest
    CloudAPI-->>Edge: version plus download URL
    Edge->>Edge: Verify signature and rauc install
    Edge->>CloudAPI: Ack / report version

Publish auth for bundles uses a CI bearer token (Edge pipelines: BUNDLE_PUBLISH_TOKEN). Snap publish may still use a separate token — check Key Vault / ADO variable groups.

AreaNotes
CommandsPending command rows per device
Snap releasesStill present (e.g. V21-era tables)
Bundle releasesNewer migrations (e.g. V47)