Skip to content

Device update protocol ​

This reference describes the Fleet update protocol — the token-based exchange that coordinates a software update between Fleet (the cloud controller) and a device in the field. It's intended for anyone implementing the device side of the protocol.

It is the wire-level counterpart to the wait-for-acceptance push method: Fleet offers a release, and the device accepts, skips, or postpones it.

How it works ​

Communication happens through device metadata:

  • Fleet writes to the device's user-meta, which the device reads.
  • The device writes its response to device-meta, which Fleet reads.
Fleetcloud controllerDevicein the fieldwrites user-meta — INVITE, INPROGRESS, DONE, ERROR…writes device-meta — ACCEPT, SKIP, ASKAGAINboth directions carry a fleet.update-proto.token JSON object

Two metadata keys carry the protocol:

KeyPurpose
fleet.update-proto.tokenA JSON token object — the primary communication channel.
fleet.update-proto.releaseThe release ID of the currently installed release.

Every token carries #spec: "fleet-update-proto@v1" and a type. The defined token types are:

INVITE, ACCEPT, SKIP, SKIPPED, ASKAGAIN, WITHOUT_ANSWER, INPROGRESS, DONE, ERROR, CANCELED, PAUSED.

Protocol flow ​

The full exchange, with the three ways a device can answer an invitation:

FleetDeviceINVITE — offers the releaseACCEPT — installs at preferredUpdate (or NOW)INPROGRESS — installation has startedDONE — update completed (ERROR if it failed)or — the device skipsSKIP — declines this releaseSKIPPED — Fleet confirms; deployment endsor — the device defersASKAGAIN — remind me at askAgainUpdateINVITE — re-sent when that time arrives

1. Fleet invites the device to update ​

Fleet writes an INVITE token to the device's user-meta:

json
{
   "#spec": "fleet-update-proto@v1",
   "type": "INVITE",
   "deployment": "deployment-id",
   "release": "release-id",
   "vendorRelease": "vendor-release-id",
   "earliestUpdate": "DATE",
   "latestUpdate": "DATE",
   "mandatory": true
}
FieldDescription
deploymentThe ID of the deployment action in Fleet.
releaseThe ID of the release being offered.
vendorReleaseA release identifier for external systems.
earliestUpdate (optional)Earliest time the update may be scheduled.
latestUpdate (optional)Deadline for applying the update.
mandatory (optional)If true, the device must accept the update.

2. The device responds ​

The device writes one of three responses to its device-meta.

Accept ​

json
{
   "#spec": "fleet-update-proto@v1",
   "type": "ACCEPT",
   "deployment": "deployment-id",
   "release": "release-id",
   "vendorRelease": "vendor-release-id",
   "preferredUpdate": "DATE-TIME|NOW"
}
  • preferredUpdate (optional): the preferred time for the update. Use NOW for immediate installation.

Behavior: if preferredUpdate is in the future, the update is scheduled for that time and installation begins when it arrives. If it is NOW, missing, or already in the past, installation proceeds immediately.

Skip ​

json
{
   "#spec": "fleet-update-proto@v1",
   "type": "SKIP",
   "deployment": "deployment-id",
   "release": "release-id",
   "vendorRelease": "vendor-release-id"
}

Behavior: Fleet marks the deployment as skipped and writes a SKIPPED token back to the device to confirm.

Ask again ​

json
{
   "#spec": "fleet-update-proto@v1",
   "type": "ASKAGAIN",
   "deployment": "deployment-id",
   "release": "release-id",
   "askAgainUpdate": "DATE-TIME"
}
  • askAgainUpdate: when the device wants to be reminded.

Behavior:

  • If askAgainUpdate is in the future, Fleet reschedules the update and re-sends a fresh INVITE when that time arrives.
  • If askAgainUpdate has already passed, Fleet issues a fresh invitation for the same release so the normal accept/skip flow can start again.

3. Fleet reports progress ​

As the update proceeds, Fleet writes status tokens to the device's user-meta:

TypeWhen
INPROGRESSInstallation has started (a new step was posted to the device).
DONEThe update completed successfully.
CANCELEDThe deployment was canceled in Fleet.
ERRORThe update failed; message carries the details.

Example INPROGRESS / DONE token:

json
{
   "#spec": "fleet-update-proto@v1",
   "type": "DONE",
   "release": "release-id",
   "deployment": "deployment-id"
}

Example ERROR token:

json
{
   "#spec": "fleet-update-proto@v1",
   "type": "ERROR",
   "release": "release-id",
   "deployment": "deployment-id",
   "message": "ERROR DETAILS"
}

Example CANCELED token:

json
{
   "#spec": "fleet-update-proto@v1",
   "type": "CANCELED",
   "release": "release-id",
   "deployment": "deployment-id",
   "vendorRelease": "vendor-release-id",
   "mandatory": false,
   "rev": "fleet-release-revision"
}

Testing manually ​

You can drive the protocol by hand to test a device integration.

Set the invitation on the device's user-meta:

sh
pvr dev set $DEVICE_ID fleet.update-proto.token='{
   "#spec": "fleet-update-proto@v1",
   "type": "INVITE",
   "deployment": "deployment-id",
   "release": "release-id",
   "vendorRelease": "vendor-release-id",
   "earliestUpdate": "DATE",
   "latestUpdate": "DATE",
   "mandatory": false
}'

Read the invitation on the device:

sh
cat /pantavisor/user-meta/fleet.update-proto.token

Write the device's answer to device-meta:

sh
pvcontrol devmeta save fleet.update-proto.token '{
   "#spec": "fleet-update-proto@v1",
   "type": "ACCEPT",
   "deployment": "deployment-id",
   "release": "release-id",
   "preferredUpdate": "NOW"
}'