pub struct StatusResponseBuilder<S: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<S: State> StatusResponseBuilder<S>
impl<S: State> StatusResponseBuilder<S>
Sourcepub fn build(self) -> StatusResponsewhere
S: IsComplete,
pub fn build(self) -> StatusResponsewhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn applications(
self,
value: HashMap<String, TargetResponse>,
) -> StatusResponseBuilder<SetApplications<S>>where
S::Applications: IsUnset,
pub fn applications(
self,
value: HashMap<String, TargetResponse>,
) -> StatusResponseBuilder<SetApplications<S>>where
S::Applications: IsUnset,
Optional (Some / Option setters). Canopy’s answer about each application the push described, keyed by the key the reporter named it with. Present only for a push in the current format.
A key Canopy holds no application for is absent rather than empty, which is what a source whose pushes are ignored sees: nothing was created for it to be told about.
Sourcepub fn maybe_applications(
self,
value: Option<HashMap<String, TargetResponse>>,
) -> StatusResponseBuilder<SetApplications<S>>where
S::Applications: IsUnset,
pub fn maybe_applications(
self,
value: Option<HashMap<String, TargetResponse>>,
) -> StatusResponseBuilder<SetApplications<S>>where
S::Applications: IsUnset,
Optional (Some / Option setters). Canopy’s answer about each application the push described, keyed by the key the reporter named it with. Present only for a push in the current format.
A key Canopy holds no application for is absent rather than empty, which is what a source whose pushes are ignored sees: nothing was created for it to be told about.
Sourcepub fn backup_now(
self,
value: Vec<String>,
) -> StatusResponseBuilder<SetBackupNow<S>>where
S::BackupNow: IsUnset,
pub fn backup_now(
self,
value: Vec<String>,
) -> StatusResponseBuilder<SetBackupNow<S>>where
S::BackupNow: IsUnset,
Required.
Backup types the server should back up now: operator-requested
one-offs plus scheduled backups that are due. Each serializes as a
plain string (e.g. "tamanu-postgres"). The device should run each
listed type, then report via POST /backup-report; an empty list
means nothing to do. Only sent to alertd pushes (the agent that
runs backups); other sources always receive an empty list.
Sourcepub fn check_severities(
self,
value: HashMap<String, CheckSeverity>,
) -> StatusResponseBuilder<SetCheckSeverities<S>>where
S::CheckSeverities: IsUnset,
pub fn check_severities(
self,
value: HashMap<String, CheckSeverity>,
) -> StatusResponseBuilder<SetCheckSeverities<S>>where
S::CheckSeverities: IsUnset,
Required.
The effective handling of every healthcheck canopy knows about, keyed
by check name (as reported in health[].check): skip (silenced for
this server, or classified below warning), warn (warning), or fail
(error or critical). Only the static severity baseline is reflected —
operator-defined conditional rules are evaluated per push and not
included. Checks absent from the map are new to canopy and default to
warn. Clients that predate this field can safely ignore it; the
same mapping is served on demand at GET /status/{server_id}/check-severities.
Sourcepub fn machine(
self,
value: TargetResponse,
) -> StatusResponseBuilder<SetMachine<S>>where
S::Machine: IsUnset,
pub fn machine(
self,
value: TargetResponse,
) -> StatusResponseBuilder<SetMachine<S>>where
S::Machine: IsUnset,
Sourcepub fn maybe_machine(
self,
value: Option<TargetResponse>,
) -> StatusResponseBuilder<SetMachine<S>>where
S::Machine: IsUnset,
pub fn maybe_machine(
self,
value: Option<TargetResponse>,
) -> StatusResponseBuilder<SetMachine<S>>where
S::Machine: IsUnset,
Sourcepub fn names(self, value: Entitlements) -> StatusResponseBuilder<SetNames<S>>where
S::Names: IsUnset,
pub fn names(self, value: Entitlements) -> StatusResponseBuilder<SetNames<S>>where
S::Names: IsUnset,
Required.
What this server is entitled to do with names: the domains its group
controls, the grants it holds, whether it is paused, and the names and
certificates it already has. A server-wide fact, so returned to every
source — an agent already reporting status learns of a new domain or a
newly granted permission without asking separately. Identical to what
GET /names/entitlements returns. Clients that predate this field can
safely ignore it.
Required.
The server’s effective tags: its own tags overlaid on its group’s,
plus the synthetic read-only canopy: tags and effective billing.*
labels. Identical to what the standalone GET /tags endpoint
returns — see that endpoint for the full contract. Clients that
predate this field can safely ignore it.
On a push in the current format this is the machine’s, the push being
the machine’s; each application’s own are under applications.