#[non_exhaustive]pub struct Service {Show 28 fields
pub service: String,
pub state: ServiceState,
pub container_running: bool,
pub image: String,
pub builds_image: bool,
pub image_digest: String,
pub image_size_bytes: u64,
pub command: Vec<String>,
pub run_as_user: String,
pub start_time: Option<Timestamp>,
pub finish_time: Option<Timestamp>,
pub exit_code: Option<i32>,
pub out_of_memory: bool,
pub restart_count: u32,
pub cpu_used_cores: f64,
pub memory_used_bytes: u64,
pub memory_limit_bytes: u64,
pub cpu_limit_cores: f64,
pub writable_layer_bytes: u64,
pub ports: Vec<u32>,
pub listening_ports: Vec<u32>,
pub published_ports: Vec<PublishedPort>,
pub volume_mounts: Vec<VolumeMount>,
pub restart_policy: RestartPolicy,
pub health_check: Option<HealthCheck>,
pub environment: Vec<EnvironmentVariable>,
pub env_files: Vec<String>,
pub ssh_command: String,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.service: String§state: ServiceState§container_running: boolTrue = its container runs, as Client::run_service_command, OpenTerminal and Client::read_path of its own files (outside volumes) need: in RUNNING, HEALTHY and UNHEALTHY, and in STARTING once its process started.
image: StringThe image as compose.yaml names it; for build: without image:, the name Compose gives.
builds_image: boolBuilt on the machine from a build: section.
image_digest: StringThe registry digest it was pulled as, "sha256:...". Empty for a built image.
image_size_bytes: u64Absent until the machine next measures sizes, every few minutes, as after a build or pull.
command: Vec<String>What the main process runs, as compose.yaml writes it (entrypoint, then command), ${...} not interpolated, so that no value of an env file shows; the image’s own argv when compose.yaml writes neither. Empty = not known without those values: compose.yaml loads only interpolated, e.g. with an include path from .env.
run_as_user: String§start_time: Option<Timestamp>Of the current or last run.
finish_time: Option<Timestamp>Set once it exited, and while Docker waits to restart it: when, with what code (0 = a clean exit: a job that finished, or a server stopped; 137 = killed), and whether a process of it was killed for exceeding its memory.
exit_code: Option<i32>§out_of_memory: bool§restart_count: u32Restarts by Docker since the container was created.
cpu_used_cores: f64§memory_used_bytes: u64§memory_limit_bytes: u640 = no limit: it shares the machine.
cpu_limit_cores: f640 = no limit.
writable_layer_bytes: u64Written outside volumes: lost on a recreate.
ports: Vec<u32>The ports it is reached at, as far as the machine knows: those compose.yaml or its image declares and those its routes send to. The project’s other services reach it at <service>:<port>.
listening_ports: Vec<u32>The TCP ports its processes listen on now, at an address the proxy and the other services reach: a route’s port must be one of them. Empty = it does not run, or listens on none.
published_ports: Vec<PublishedPort>The ports ports: opens on the machine now: not one a route serves, nor one bound to 127.0.0.1.
volume_mounts: Vec<VolumeMount>§restart_policy: RestartPolicy§health_check: Option<HealthCheck>Absent = no healthcheck.
environment: Vec<EnvironmentVariable>What the container is configured with, not what its image sets.
env_files: Vec<String>The files its env_file: names, as compose.yaml writes them, e.g. "./.env": relative to the project directory. Change them with DeployProjectRequest::files.
ssh_command: StringWhat the person runs in their own terminal for a shell in its container, e.g. "ssh web.notes@m1.pethost.dev"; scp, sftp, rsync and ssh -L tunnels take the same address. It works once one of their public keys is among Machine::ssh_keys.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Service
From the API’s JSON. A field this version does not know is refused, as the API
refuses one it does not have.
impl<'de> Deserialize<'de> for Service
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>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Serialize for Service
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.
impl Serialize for Service
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.