Skip to main content

StatusResponseBuilder

Struct StatusResponseBuilder 

Source
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>

Source

pub fn build(self) -> StatusResponse
where S: IsComplete,

Finish building and return the requested object

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn machine( self, value: TargetResponse, ) -> StatusResponseBuilder<SetMachine<S>>
where S::Machine: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_machine( self, value: Option<TargetResponse>, ) -> StatusResponseBuilder<SetMachine<S>>
where S::Machine: IsUnset,

Optional (Some / Option setters).

Source

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.

Source

pub fn tags(self, value: TagMap) -> StatusResponseBuilder<SetTags<S>>
where S::Tags: IsUnset,

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.