pub struct HealthCheckRequest {
pub check_type: String,
pub port: Option<u16>,
pub url: Option<String>,
pub expect_status: Option<u16>,
pub command: Option<Vec<String>>,
pub interval: Option<String>,
pub timeout: Option<String>,
pub retries: Option<u32>,
pub start_period: Option<String>,
}Expand description
Container health check request.
Mirrors the on-disk HealthCheck enum (see zlayer_spec::HealthCheck) as a
discriminated union keyed on type. Translated to zlayer_spec::HealthSpec
by HealthCheckRequest::to_health_spec. Durations are humantime strings
(for example "10s", "500ms", "1m").
§Variants
type: "tcp"— requiresport(1-65535).type: "http"— requiresurl;expect_statusdefaults to 200.type: "command"— requirescommand(array of argv tokens; joined with spaces and passed tosh -cby the health monitor, matching the existing compose-to-ZLayer conversion inzlayer-docker).
Fields§
§check_type: StringCheck variant: "tcp", "http", or "command".
port: Option<u16>TCP port (required when type == "tcp").
url: Option<String>HTTP URL (required when type == "http").
expect_status: Option<u16>HTTP status code expected from url (defaults to 200).
command: Option<Vec<String>>Command argv (required when type == "command"). Joined with spaces
and passed to sh -c.
interval: Option<String>Interval between checks, humantime format (e.g. "30s"). Defaults to 30s.
timeout: Option<String>Timeout per individual check, humantime format.
retries: Option<u32>Number of consecutive failures before marking unhealthy. Defaults to 3.
start_period: Option<String>Grace period before the first check runs, humantime format. Maps to
HealthSpec::start_grace.
Trait Implementations§
Source§impl Clone for HealthCheckRequest
impl Clone for HealthCheckRequest
Source§fn clone(&self) -> HealthCheckRequest
fn clone(&self) -> HealthCheckRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more