Skip to main content

Machine

Struct Machine 

Source
#[non_exhaustive]
pub struct Machine {
Show 26 fields pub name: String, pub location: String, pub sample_time: Option<Timestamp>, pub cpu_used_cores: f64, pub cpu_total_cores: f64, pub memory_used_bytes: u64, pub memory_total_bytes: u64, pub disk_used_bytes: u64, pub disk_total_bytes: u64, pub disk_usage: Option<DiskUsage>, pub hostname: String, pub ssh_host_key_fingerprint: String, pub ssh_keys: Vec<SshKey>, pub backups_enabled: bool, pub snapshot_list_time: Option<Timestamp>, pub snapshot_list_failure_message: String, pub backup_retention_hours: u32, pub acme_enabled: bool, pub apps_domain: String, pub daemon_version: String, pub docker_version: String, pub boot_time: Option<Timestamp>, pub restart_required_time: Option<Timestamp>, pub scheduled_restart_time: Option<Timestamp>, pub sessions: Vec<MachineSession>, pub alert_channels: Vec<AlertDestination>,
}

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Its plan’s name, e.g. "Starter".

§location: String

Where it runs, e.g. "Europe". Empty = not known.

§sample_time: Option<Timestamp>

When the figures below were read.

§cpu_used_cores: f64

By projects and builds.

§cpu_total_cores: f64§memory_used_bytes: u64

Without page cache, as docker stats counts.

§memory_total_bytes: u64

The machine’s, less a reserve for the system.

§disk_used_bytes: u64

The projects' disk. The operating system has its own partition outside it, and the machine’s own files are left out: a new machine uses 0.

§disk_total_bytes: u64§disk_usage: Option<DiskUsage>§hostname: String

The machine’s name: what the person’s own domains point at (a CNAME), and where they log in to a service’s container (Service::ssh_command). Client::create_transfer's URLs are on it as well, and no route can take it.

§ssh_host_key_fingerprint: String

"SHA256:...", to check on the first connection.

§ssh_keys: Vec<SshKey>

The person’s public keys: each logs in to every container. Empty = none yet: nobody can log in until RunMachineActionRequestAction::AddSshKey adds one.

§backups_enabled: bool

True = every project is backed up nightly, and on demand. False, always written = nothing is backed up: there are no snapshots, and a deleted project or volume is gone for good.

§snapshot_list_time: Option<Timestamp>

When the machine last read the backup repository’s list of snapshots whole. Absent = not yet (snapshot_list_failure_message says why, once a read failed), or backups are off: snapshot counts, Volume::last_backup_time, Project::snapshots and GetMachineResponse::deleted_projects are then not known, rather than none.

§snapshot_list_failure_message: String

Why the machine could not read that list, while backups are on and snapshot_list_time is absent: the backup repository’s error, e.g. a wrong password or a host that does not answer. The machine keeps trying. Empty = no read has failed, or the list is known, or backups are off.

§backup_retention_hours: u32

Snapshots are pruned once they are this many hours older than their project’s newest. 0 = kept forever: nothing deletes them.

§acme_enabled: bool

True = a host that no certificate installed on the machine covers gets one from Let’s Encrypt once it resolves to the machine. False, always written = such a host serves plain HTTP only.

§apps_domain: String

The person’s domain on Pethost, e.g. "sam.pethost.app": theirs alone, so "my domain" or "my Pethost domain" means this one unless they name another. A route’s host <name>.<apps_domain>, or apps_domain itself, works at once over HTTPS, with no DNS record to make, and a web port a project publishes gets such a host by itself (Client::create_project). Only the person changes it, in the panel’s settings. Empty = there is none: every host is a domain the person owns, and published ports all open on the machine.

§daemon_version: String§docker_version: String§boot_time: Option<Timestamp>§restart_required_time: Option<Timestamp>

When an update started to need a machine restart. Absent = none is needed.

§scheduled_restart_time: Option<Timestamp>

When RunMachineActionRequestAction::RestartMachine will restart it; later while what it waits for is still going on (RestartMachineAction::interrupt_operations). Absent = not scheduled.

§sessions: Vec<MachineSession>

What people have open in the containers now, oldest first: at most 100, the most the machine holds at once.

§alert_channels: Vec<AlertDestination>

Where Pethost tells the person of incidents: the account’s channels that are on, email first, then the oldest. The person sets them in the panel’s Settings → Alerts; no tool does. Empty = alerts reach nobody.

Trait Implementations§

Source§

impl Clone for Machine

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Machine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Machine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Machine

From the API’s JSON. A field this version does not know is refused, as the API refuses one it does not have.

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Machine

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Machine

As the API’s JSON: the proto’s field names, an enum as its value’s name, a 64-bit integer as a string, a time as RFC 3339, bytes as base64.

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Machine

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> JsonDeserialize for T

Source§

impl<T> JsonSerialize for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more