Skip to main content

Module cloud_link

Module cloud_link 

Source
Expand description

The cloud-link sidecar: whether this node’s cloud relay is actually talking to the cloud.

ados-cloud rewrites it on every heartbeat tick with the MQTT broker session state (the transport’s ConnAck-driven flag, never “the task is alive”) and the outcome of the last /agent/status POST. ados-control serves it at GET /api/cloud/link for the dashboard. A file not rewritten within CLOUD_LINK_STALE_MS reads as absent, so a dead relay process never leaves a frozen “connected” behind.

Structs§

CloudLink
The relay’s live link state.

Constants§

CLOUD_LINK_SIDECAR
The cloud-link sidecar path (tmpfs, cleared on boot).
CLOUD_LINK_SIDECAR_VERSION
The sidecar schema version, stamped on write and checked (warn-only) on read.
CLOUD_LINK_STALE_MS
Four heartbeat ticks (5 s each): past this the writer is gone.

Functions§

read_cloud_link
Read the sidecar from its default path.
read_cloud_link_from
Read the sidecar at path, or None when absent, unparseable, undated or stale at now_ms.
write_cloud_link
Atomically write link to the default path.
write_cloud_link_to
Atomically write link to path (tmp + rename).