Appearance
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.
Two metadata keys carry the protocol:
| Key | Purpose |
|---|---|
fleet.update-proto.token | A JSON token object — the primary communication channel. |
fleet.update-proto.release | The 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:
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
}| Field | Description |
|---|---|
deployment | The ID of the deployment action in Fleet. |
release | The ID of the release being offered. |
vendorRelease | A 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. UseNOWfor 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
askAgainUpdateis in the future, Fleet reschedules the update and re-sends a freshINVITEwhen that time arrives. - If
askAgainUpdatehas 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:
| Type | When |
|---|---|
INPROGRESS | Installation has started (a new step was posted to the device). |
DONE | The update completed successfully. |
CANCELED | The deployment was canceled in Fleet. |
ERROR | The 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.tokenWrite 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"
}'Related
- Push methods & rollouts — the wait-for-acceptance method this protocol implements.
- Deployment actions — what each token's
deploymentrefers to.