#![allow(
unused_imports,
unused_qualifications,
unused_extern_crates,
clippy::all
)]
#[cfg(feature = "buildkit")]
use prost::Message;
use serde::de::{DeserializeOwned, Deserializer};
use serde::ser::Serializer;
use serde::{Deserialize, Serialize};
use std::cmp::Eq;
use std::collections::HashMap;
use std::default::Default;
use std::hash::Hash;
fn deserialize_nonoptional_vec<'de, D: Deserializer<'de>, T: DeserializeOwned>(
d: D,
) -> Result<Vec<T>, D::Error> {
serde::Deserialize::deserialize(d).map(|x: Option<_>| x.unwrap_or(Vec::new()))
}
fn deserialize_nonoptional_map<'de, D: Deserializer<'de>, T: DeserializeOwned>(
d: D,
) -> Result<HashMap<String, T>, D::Error> {
serde::Deserialize::deserialize(d).map(|x: Option<_>| x.unwrap_or(HashMap::new()))
}
#[cfg(feature = "time")]
pub type BollardDate = time::OffsetDateTime;
#[cfg(all(feature = "chrono", not(feature = "time")))]
pub type BollardDate = chrono::DateTime<chrono::Utc>;
#[cfg(not(any(feature = "chrono", feature = "time")))]
pub type BollardDate = String;
#[cfg(feature = "time")]
fn deserialize_timestamp<'de, D: Deserializer<'de>>(
d: D
) -> Result<Option<BollardDate>, D::Error> {
let opt: Option<String> = serde::Deserialize::deserialize(d)?;
if let Some(s) = opt {
Ok(Some(
time::OffsetDateTime::parse(&s, &time::format_description::well_known::Rfc3339)
.map_err(|e| serde::de::Error::custom(format!("{:?}", e)))?,
))
} else {
Ok(None)
}
}
#[cfg(not(feature = "time"))]
fn deserialize_timestamp<'de, D: Deserializer<'de>>(
d: D
) -> Result<Option<BollardDate>, D::Error> {
serde::Deserialize::deserialize(d)
}
#[cfg(feature = "time")]
fn serialize_timestamp<S: Serializer>(date: &Option<BollardDate>, s: S) -> Result<S::Ok, S::Error> {
match date {
Some(inner) => Ok(s.serialize_str(&inner.format(&time::format_description::well_known::Rfc3339)
.map_err(|e| serde::ser::Error::custom(format!("{:?}", e)))?)?),
None => Ok(s.serialize_str("")?)
}
}
#[cfg(not(feature = "time"))]
fn serialize_timestamp<S: Serializer>(date: &Option<BollardDate>, s: S) -> Result<S::Ok, S::Error> {
match date {
Some(inner) => s.serialize_some(inner),
None => s.serialize_none()
}
}
#[cfg(feature = "buildkit")]
fn deserialize_buildinfo_aux<'de, D: Deserializer<'de>>(
d: D,
) -> Result<crate::moby::buildkit::v1::StatusResponse, D::Error> {
let aux: String = serde::Deserialize::deserialize(d)?;
let raw = base64::decode(&aux).map_err(|e| serde::de::Error::custom(format!("{:?}", e)))?;
let buf = bytes::BytesMut::from(&raw[..]);
let res = crate::moby::buildkit::v1::StatusResponse::decode(buf)
.map_err(|e| serde::de::Error::custom(format!("{:?}", e)))?;
Ok(res)
}
#[cfg(feature = "buildkit")]
#[derive(Debug, Clone, PartialEq, Deserialize)]
#[serde(untagged)]
pub enum BuildInfoAux {
#[serde(deserialize_with = "deserialize_buildinfo_aux")]
BuildKit(crate::moby::buildkit::v1::StatusResponse),
Default(ImageId)
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Address {
#[serde(rename = "Addr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub addr: Option<String>,
#[serde(rename = "PrefixLen")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefix_len: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct AuthConfig {
#[serde(rename = "username")]
#[serde(skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
#[serde(rename = "password")]
#[serde(skip_serializing_if = "Option::is_none")]
pub password: Option<String>,
#[serde(rename = "email")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
#[serde(rename = "serveraddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub serveraddress: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct BuildCache {
#[serde(rename = "ID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Parent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parent: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub typ: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "InUse")]
#[serde(skip_serializing_if = "Option::is_none")]
pub in_use: Option<bool>,
#[serde(rename = "Shared")]
#[serde(skip_serializing_if = "Option::is_none")]
pub shared: Option<bool>,
#[serde(rename = "Size")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<i64>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub created_at: Option<BollardDate>,
#[serde(rename = "LastUsedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub last_used_at: Option<BollardDate>,
#[serde(rename = "UsageCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub usage_count: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Deserialize)]
pub struct BuildInfo {
#[serde(rename = "id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "stream")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stream: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "errorDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_detail: Option<ErrorDetail>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "progress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress: Option<String>,
#[serde(rename = "progressDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress_detail: Option<ProgressDetail>,
#[serde(rename = "aux")]
#[serde(skip_serializing_if = "Option::is_none")]
#[cfg(feature = "buildkit")]
pub aux: Option<BuildInfoAux>,
#[serde(rename = "aux")]
#[serde(skip_serializing_if = "Option::is_none")]
#[cfg(not(feature = "buildkit"))]
pub aux: Option<ImageId>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct BuildPruneResponse {
#[serde(rename = "CachesDeleted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub caches_deleted: Option<Vec<String>>,
#[serde(rename = "SpaceReclaimed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub space_reclaimed: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ClusterInfo {
#[serde(rename = "ID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<ObjectVersion>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub created_at: Option<BollardDate>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub updated_at: Option<BollardDate>,
#[serde(rename = "Spec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spec: Option<SwarmSpec>,
#[serde(rename = "TLSInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tls_info: Option<TlsInfo>,
#[serde(rename = "RootRotationInProgress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub root_rotation_in_progress: Option<bool>,
#[serde(rename = "DataPathPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_path_port: Option<u32>,
#[serde(rename = "DefaultAddrPool")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_addr_pool: Option<Vec<String>>,
#[serde(rename = "SubnetSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_size: Option<u32>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Commit {
#[serde(rename = "ID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Expected")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expected: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Config {
#[serde(rename = "ID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<ObjectVersion>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub created_at: Option<BollardDate>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub updated_at: Option<BollardDate>,
#[serde(rename = "Spec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spec: Option<ConfigSpec>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ConfigSpec {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
#[serde(rename = "Data")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<String>,
#[serde(rename = "Templating")]
#[serde(skip_serializing_if = "Option::is_none")]
pub templating: Option<Driver>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerChangeResponseItem {
#[serde(rename = "Path")]
pub path: String,
#[serde(rename = "Kind")]
pub kind: i64,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerConfig {
#[serde(rename = "Hostname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hostname: Option<String>,
#[serde(rename = "Domainname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub domainname: Option<String>,
#[serde(rename = "User")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user: Option<String>,
#[serde(rename = "AttachStdin")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attach_stdin: Option<bool>,
#[serde(rename = "AttachStdout")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attach_stdout: Option<bool>,
#[serde(rename = "AttachStderr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attach_stderr: Option<bool>,
#[serde(rename = "ExposedPorts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub exposed_ports: Option<HashMap<String, HashMap<(), ()>>>,
#[serde(rename = "Tty")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tty: Option<bool>,
#[serde(rename = "OpenStdin")]
#[serde(skip_serializing_if = "Option::is_none")]
pub open_stdin: Option<bool>,
#[serde(rename = "StdinOnce")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stdin_once: Option<bool>,
#[serde(rename = "Env")]
#[serde(skip_serializing_if = "Option::is_none")]
pub env: Option<Vec<String>>,
#[serde(rename = "Cmd")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cmd: Option<Vec<String>>,
#[serde(rename = "Healthcheck")]
#[serde(skip_serializing_if = "Option::is_none")]
pub healthcheck: Option<HealthConfig>,
#[serde(rename = "ArgsEscaped")]
#[serde(skip_serializing_if = "Option::is_none")]
pub args_escaped: Option<bool>,
#[serde(rename = "Image")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image: Option<String>,
#[serde(rename = "Volumes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volumes: Option<HashMap<String, HashMap<(), ()>>>,
#[serde(rename = "WorkingDir")]
#[serde(skip_serializing_if = "Option::is_none")]
pub working_dir: Option<String>,
#[serde(rename = "Entrypoint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entrypoint: Option<Vec<String>>,
#[serde(rename = "NetworkDisabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_disabled: Option<bool>,
#[serde(rename = "MacAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mac_address: Option<String>,
#[serde(rename = "OnBuild")]
#[serde(skip_serializing_if = "Option::is_none")]
pub on_build: Option<Vec<String>>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
#[serde(rename = "StopSignal")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stop_signal: Option<String>,
#[serde(rename = "StopTimeout")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stop_timeout: Option<i64>,
#[serde(rename = "Shell")]
#[serde(skip_serializing_if = "Option::is_none")]
pub shell: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerCreateResponse {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "Warnings")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub warnings: Vec<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerInspectResponse {
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<String>,
#[serde(rename = "Path")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<String>,
#[serde(rename = "Args")]
#[serde(skip_serializing_if = "Option::is_none")]
pub args: Option<Vec<String>>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<ContainerState>,
#[serde(rename = "Image")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image: Option<String>,
#[serde(rename = "ResolvConfPath")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resolv_conf_path: Option<String>,
#[serde(rename = "HostnamePath")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hostname_path: Option<String>,
#[serde(rename = "HostsPath")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hosts_path: Option<String>,
#[serde(rename = "LogPath")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_path: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "RestartCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub restart_count: Option<i64>,
#[serde(rename = "Driver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub driver: Option<String>,
#[serde(rename = "Platform")]
#[serde(skip_serializing_if = "Option::is_none")]
pub platform: Option<String>,
#[serde(rename = "MountLabel")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mount_label: Option<String>,
#[serde(rename = "ProcessLabel")]
#[serde(skip_serializing_if = "Option::is_none")]
pub process_label: Option<String>,
#[serde(rename = "AppArmorProfile")]
#[serde(skip_serializing_if = "Option::is_none")]
pub app_armor_profile: Option<String>,
#[serde(rename = "ExecIDs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub exec_ids: Option<Vec<String>>,
#[serde(rename = "HostConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub host_config: Option<HostConfig>,
#[serde(rename = "GraphDriver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub graph_driver: Option<GraphDriverData>,
#[serde(rename = "SizeRw")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_rw: Option<i64>,
#[serde(rename = "SizeRootFs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_root_fs: Option<i64>,
#[serde(rename = "Mounts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mounts: Option<Vec<MountPoint>>,
#[serde(rename = "Config")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config: Option<ContainerConfig>,
#[serde(rename = "NetworkSettings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_settings: Option<NetworkSettings>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerPruneResponse {
#[serde(rename = "ContainersDeleted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub containers_deleted: Option<Vec<String>>,
#[serde(rename = "SpaceReclaimed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub space_reclaimed: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerState {
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<ContainerStateStatusEnum>,
#[serde(rename = "Running")]
#[serde(skip_serializing_if = "Option::is_none")]
pub running: Option<bool>,
#[serde(rename = "Paused")]
#[serde(skip_serializing_if = "Option::is_none")]
pub paused: Option<bool>,
#[serde(rename = "Restarting")]
#[serde(skip_serializing_if = "Option::is_none")]
pub restarting: Option<bool>,
#[serde(rename = "OOMKilled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub oom_killed: Option<bool>,
#[serde(rename = "Dead")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dead: Option<bool>,
#[serde(rename = "Pid")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pid: Option<i64>,
#[serde(rename = "ExitCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub exit_code: Option<i64>,
#[serde(rename = "Error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "StartedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub started_at: Option<String>,
#[serde(rename = "FinishedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub finished_at: Option<String>,
#[serde(rename = "Health")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health: Option<Health>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum ContainerStateStatusEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "created")]
CREATED,
#[serde(rename = "running")]
RUNNING,
#[serde(rename = "paused")]
PAUSED,
#[serde(rename = "restarting")]
RESTARTING,
#[serde(rename = "removing")]
REMOVING,
#[serde(rename = "exited")]
EXITED,
#[serde(rename = "dead")]
DEAD,
}
impl ::std::fmt::Display for ContainerStateStatusEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
ContainerStateStatusEnum::EMPTY => write!(f, ""),
ContainerStateStatusEnum::CREATED => write!(f, "{}", "created"),
ContainerStateStatusEnum::RUNNING => write!(f, "{}", "running"),
ContainerStateStatusEnum::PAUSED => write!(f, "{}", "paused"),
ContainerStateStatusEnum::RESTARTING => write!(f, "{}", "restarting"),
ContainerStateStatusEnum::REMOVING => write!(f, "{}", "removing"),
ContainerStateStatusEnum::EXITED => write!(f, "{}", "exited"),
ContainerStateStatusEnum::DEAD => write!(f, "{}", "dead"),
}
}
}
impl ::std::str::FromStr for ContainerStateStatusEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(ContainerStateStatusEnum::EMPTY),
"created" => Ok(ContainerStateStatusEnum::CREATED),
"running" => Ok(ContainerStateStatusEnum::RUNNING),
"paused" => Ok(ContainerStateStatusEnum::PAUSED),
"restarting" => Ok(ContainerStateStatusEnum::RESTARTING),
"removing" => Ok(ContainerStateStatusEnum::REMOVING),
"exited" => Ok(ContainerStateStatusEnum::EXITED),
"dead" => Ok(ContainerStateStatusEnum::DEAD),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for ContainerStateStatusEnum {
fn as_ref(&self) -> &str {
match self {
ContainerStateStatusEnum::EMPTY => "",
ContainerStateStatusEnum::CREATED => "created",
ContainerStateStatusEnum::RUNNING => "running",
ContainerStateStatusEnum::PAUSED => "paused",
ContainerStateStatusEnum::RESTARTING => "restarting",
ContainerStateStatusEnum::REMOVING => "removing",
ContainerStateStatusEnum::EXITED => "exited",
ContainerStateStatusEnum::DEAD => "dead",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerSummary {
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Names")]
#[serde(skip_serializing_if = "Option::is_none")]
pub names: Option<Vec<String>>,
#[serde(rename = "Image")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image: Option<String>,
#[serde(rename = "ImageID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_id: Option<String>,
#[serde(rename = "Command")]
#[serde(skip_serializing_if = "Option::is_none")]
pub command: Option<String>,
#[serde(rename = "Created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<i64>,
#[serde(rename = "Ports")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ports: Option<Vec<Port>>,
#[serde(rename = "SizeRw")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_rw: Option<i64>,
#[serde(rename = "SizeRootFs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_root_fs: Option<i64>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "HostConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub host_config: Option<ContainerSummaryHostConfig>,
#[serde(rename = "NetworkSettings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_settings: Option<ContainerSummaryNetworkSettings>,
#[serde(rename = "Mounts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mounts: Option<Vec<MountPoint>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerSummaryHostConfig {
#[serde(rename = "NetworkMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_mode: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerSummaryNetworkSettings {
#[serde(rename = "Networks")]
#[serde(skip_serializing_if = "Option::is_none")]
pub networks: Option<HashMap<String, EndpointSettings>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerTopResponse {
#[serde(rename = "Titles")]
#[serde(skip_serializing_if = "Option::is_none")]
pub titles: Option<Vec<String>>,
#[serde(rename = "Processes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub processes: Option<Vec<Vec<String>>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerUpdateResponse {
#[serde(rename = "Warnings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub warnings: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerWaitExitError {
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerWaitResponse {
#[serde(rename = "StatusCode")]
pub status_code: i64,
#[serde(rename = "Error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<ContainerWaitExitError>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct CreateImageInfo {
#[serde(rename = "id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "progress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress: Option<String>,
#[serde(rename = "progressDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress_detail: Option<ProgressDetail>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DeviceMapping {
#[serde(rename = "PathOnHost")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path_on_host: Option<String>,
#[serde(rename = "PathInContainer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path_in_container: Option<String>,
#[serde(rename = "CgroupPermissions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cgroup_permissions: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DeviceRequest {
#[serde(rename = "Driver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub driver: Option<String>,
#[serde(rename = "Count")]
#[serde(skip_serializing_if = "Option::is_none")]
pub count: Option<i64>,
#[serde(rename = "DeviceIDs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_ids: Option<Vec<String>>,
#[serde(rename = "Capabilities")]
#[serde(skip_serializing_if = "Option::is_none")]
pub capabilities: Option<Vec<Vec<String>>>,
#[serde(rename = "Options")]
#[serde(skip_serializing_if = "Option::is_none")]
pub options: Option<HashMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DistributionInspect {
#[serde(rename = "Descriptor")]
pub descriptor: OciDescriptor,
#[serde(rename = "Platforms")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub platforms: Vec<OciPlatform>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Driver {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Options")]
#[serde(skip_serializing_if = "Option::is_none")]
pub options: Option<HashMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EndpointIpamConfig {
#[serde(rename = "IPv4Address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipv4_address: Option<String>,
#[serde(rename = "IPv6Address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipv6_address: Option<String>,
#[serde(rename = "LinkLocalIPs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub link_local_i_ps: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EndpointPortConfig {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Protocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol: Option<EndpointPortConfigProtocolEnum>,
#[serde(rename = "TargetPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_port: Option<i64>,
#[serde(rename = "PublishedPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub published_port: Option<i64>,
#[serde(rename = "PublishMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub publish_mode: Option<EndpointPortConfigPublishModeEnum>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum EndpointPortConfigProtocolEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "tcp")]
TCP,
#[serde(rename = "udp")]
UDP,
#[serde(rename = "sctp")]
SCTP,
}
impl ::std::fmt::Display for EndpointPortConfigProtocolEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
EndpointPortConfigProtocolEnum::EMPTY => write!(f, ""),
EndpointPortConfigProtocolEnum::TCP => write!(f, "{}", "tcp"),
EndpointPortConfigProtocolEnum::UDP => write!(f, "{}", "udp"),
EndpointPortConfigProtocolEnum::SCTP => write!(f, "{}", "sctp"),
}
}
}
impl ::std::str::FromStr for EndpointPortConfigProtocolEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(EndpointPortConfigProtocolEnum::EMPTY),
"tcp" => Ok(EndpointPortConfigProtocolEnum::TCP),
"udp" => Ok(EndpointPortConfigProtocolEnum::UDP),
"sctp" => Ok(EndpointPortConfigProtocolEnum::SCTP),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for EndpointPortConfigProtocolEnum {
fn as_ref(&self) -> &str {
match self {
EndpointPortConfigProtocolEnum::EMPTY => "",
EndpointPortConfigProtocolEnum::TCP => "tcp",
EndpointPortConfigProtocolEnum::UDP => "udp",
EndpointPortConfigProtocolEnum::SCTP => "sctp",
}
}
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum EndpointPortConfigPublishModeEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "ingress")]
INGRESS,
#[serde(rename = "host")]
HOST,
}
impl ::std::fmt::Display for EndpointPortConfigPublishModeEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
EndpointPortConfigPublishModeEnum::EMPTY => write!(f, ""),
EndpointPortConfigPublishModeEnum::INGRESS => write!(f, "{}", "ingress"),
EndpointPortConfigPublishModeEnum::HOST => write!(f, "{}", "host"),
}
}
}
impl ::std::str::FromStr for EndpointPortConfigPublishModeEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(EndpointPortConfigPublishModeEnum::EMPTY),
"ingress" => Ok(EndpointPortConfigPublishModeEnum::INGRESS),
"host" => Ok(EndpointPortConfigPublishModeEnum::HOST),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for EndpointPortConfigPublishModeEnum {
fn as_ref(&self) -> &str {
match self {
EndpointPortConfigPublishModeEnum::EMPTY => "",
EndpointPortConfigPublishModeEnum::INGRESS => "ingress",
EndpointPortConfigPublishModeEnum::HOST => "host",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EndpointSettings {
#[serde(rename = "IPAMConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipam_config: Option<EndpointIpamConfig>,
#[serde(rename = "Links")]
#[serde(skip_serializing_if = "Option::is_none")]
pub links: Option<Vec<String>>,
#[serde(rename = "Aliases")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aliases: Option<Vec<String>>,
#[serde(rename = "NetworkID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_id: Option<String>,
#[serde(rename = "EndpointID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_id: Option<String>,
#[serde(rename = "Gateway")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway: Option<String>,
#[serde(rename = "IPAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_address: Option<String>,
#[serde(rename = "IPPrefixLen")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_prefix_len: Option<i64>,
#[serde(rename = "IPv6Gateway")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipv6_gateway: Option<String>,
#[serde(rename = "GlobalIPv6Address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub global_ipv6_address: Option<String>,
#[serde(rename = "GlobalIPv6PrefixLen")]
#[serde(skip_serializing_if = "Option::is_none")]
pub global_ipv6_prefix_len: Option<i64>,
#[serde(rename = "MacAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mac_address: Option<String>,
#[serde(rename = "DriverOpts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub driver_opts: Option<HashMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EndpointSpec {
#[serde(rename = "Mode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mode: Option<EndpointSpecModeEnum>,
#[serde(rename = "Ports")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ports: Option<Vec<EndpointPortConfig>>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum EndpointSpecModeEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "vip")]
VIP,
#[serde(rename = "dnsrr")]
DNSRR,
}
impl ::std::fmt::Display for EndpointSpecModeEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
EndpointSpecModeEnum::EMPTY => write!(f, ""),
EndpointSpecModeEnum::VIP => write!(f, "{}", "vip"),
EndpointSpecModeEnum::DNSRR => write!(f, "{}", "dnsrr"),
}
}
}
impl ::std::str::FromStr for EndpointSpecModeEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(EndpointSpecModeEnum::EMPTY),
"vip" => Ok(EndpointSpecModeEnum::VIP),
"dnsrr" => Ok(EndpointSpecModeEnum::DNSRR),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for EndpointSpecModeEnum {
fn as_ref(&self) -> &str {
match self {
EndpointSpecModeEnum::EMPTY => "",
EndpointSpecModeEnum::VIP => "vip",
EndpointSpecModeEnum::DNSRR => "dnsrr",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EngineDescription {
#[serde(rename = "EngineVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_version: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
#[serde(rename = "Plugins")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plugins: Option<Vec<EngineDescriptionPlugins>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EngineDescriptionPlugins {
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub typ: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ErrorDetail {
#[serde(rename = "code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<i64>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ErrorResponse {
#[serde(rename = "message")]
pub message: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EventActor {
#[serde(rename = "ID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Attributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attributes: Option<HashMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EventMessage {
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub typ: Option<EventMessageTypeEnum>,
#[serde(rename = "Action")]
#[serde(skip_serializing_if = "Option::is_none")]
pub action: Option<String>,
#[serde(rename = "Actor")]
#[serde(skip_serializing_if = "Option::is_none")]
pub actor: Option<EventActor>,
#[serde(rename = "scope")]
#[serde(skip_serializing_if = "Option::is_none")]
pub scope: Option<EventMessageScopeEnum>,
#[serde(rename = "time")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time: Option<i64>,
#[serde(rename = "timeNano")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_nano: Option<i64>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum EventMessageTypeEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "builder")]
BUILDER,
#[serde(rename = "config")]
CONFIG,
#[serde(rename = "container")]
CONTAINER,
#[serde(rename = "daemon")]
DAEMON,
#[serde(rename = "image")]
IMAGE,
#[serde(rename = "network")]
NETWORK,
#[serde(rename = "node")]
NODE,
#[serde(rename = "plugin")]
PLUGIN,
#[serde(rename = "secret")]
SECRET,
#[serde(rename = "service")]
SERVICE,
#[serde(rename = "volume")]
VOLUME,
}
impl ::std::fmt::Display for EventMessageTypeEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
EventMessageTypeEnum::EMPTY => write!(f, ""),
EventMessageTypeEnum::BUILDER => write!(f, "{}", "builder"),
EventMessageTypeEnum::CONFIG => write!(f, "{}", "config"),
EventMessageTypeEnum::CONTAINER => write!(f, "{}", "container"),
EventMessageTypeEnum::DAEMON => write!(f, "{}", "daemon"),
EventMessageTypeEnum::IMAGE => write!(f, "{}", "image"),
EventMessageTypeEnum::NETWORK => write!(f, "{}", "network"),
EventMessageTypeEnum::NODE => write!(f, "{}", "node"),
EventMessageTypeEnum::PLUGIN => write!(f, "{}", "plugin"),
EventMessageTypeEnum::SECRET => write!(f, "{}", "secret"),
EventMessageTypeEnum::SERVICE => write!(f, "{}", "service"),
EventMessageTypeEnum::VOLUME => write!(f, "{}", "volume"),
}
}
}
impl ::std::str::FromStr for EventMessageTypeEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(EventMessageTypeEnum::EMPTY),
"builder" => Ok(EventMessageTypeEnum::BUILDER),
"config" => Ok(EventMessageTypeEnum::CONFIG),
"container" => Ok(EventMessageTypeEnum::CONTAINER),
"daemon" => Ok(EventMessageTypeEnum::DAEMON),
"image" => Ok(EventMessageTypeEnum::IMAGE),
"network" => Ok(EventMessageTypeEnum::NETWORK),
"node" => Ok(EventMessageTypeEnum::NODE),
"plugin" => Ok(EventMessageTypeEnum::PLUGIN),
"secret" => Ok(EventMessageTypeEnum::SECRET),
"service" => Ok(EventMessageTypeEnum::SERVICE),
"volume" => Ok(EventMessageTypeEnum::VOLUME),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for EventMessageTypeEnum {
fn as_ref(&self) -> &str {
match self {
EventMessageTypeEnum::EMPTY => "",
EventMessageTypeEnum::BUILDER => "builder",
EventMessageTypeEnum::CONFIG => "config",
EventMessageTypeEnum::CONTAINER => "container",
EventMessageTypeEnum::DAEMON => "daemon",
EventMessageTypeEnum::IMAGE => "image",
EventMessageTypeEnum::NETWORK => "network",
EventMessageTypeEnum::NODE => "node",
EventMessageTypeEnum::PLUGIN => "plugin",
EventMessageTypeEnum::SECRET => "secret",
EventMessageTypeEnum::SERVICE => "service",
EventMessageTypeEnum::VOLUME => "volume",
}
}
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum EventMessageScopeEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "local")]
LOCAL,
#[serde(rename = "swarm")]
SWARM,
}
impl ::std::fmt::Display for EventMessageScopeEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
EventMessageScopeEnum::EMPTY => write!(f, ""),
EventMessageScopeEnum::LOCAL => write!(f, "{}", "local"),
EventMessageScopeEnum::SWARM => write!(f, "{}", "swarm"),
}
}
}
impl ::std::str::FromStr for EventMessageScopeEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(EventMessageScopeEnum::EMPTY),
"local" => Ok(EventMessageScopeEnum::LOCAL),
"swarm" => Ok(EventMessageScopeEnum::SWARM),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for EventMessageScopeEnum {
fn as_ref(&self) -> &str {
match self {
EventMessageScopeEnum::EMPTY => "",
EventMessageScopeEnum::LOCAL => "local",
EventMessageScopeEnum::SWARM => "swarm",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ExecConfig {
#[serde(rename = "AttachStdin")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attach_stdin: Option<bool>,
#[serde(rename = "AttachStdout")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attach_stdout: Option<bool>,
#[serde(rename = "AttachStderr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attach_stderr: Option<bool>,
#[serde(rename = "DetachKeys")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detach_keys: Option<String>,
#[serde(rename = "Tty")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tty: Option<bool>,
#[serde(rename = "Env")]
#[serde(skip_serializing_if = "Option::is_none")]
pub env: Option<Vec<String>>,
#[serde(rename = "Cmd")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cmd: Option<Vec<String>>,
#[serde(rename = "Privileged")]
#[serde(skip_serializing_if = "Option::is_none")]
pub privileged: Option<bool>,
#[serde(rename = "User")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user: Option<String>,
#[serde(rename = "WorkingDir")]
#[serde(skip_serializing_if = "Option::is_none")]
pub working_dir: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ExecInspectResponse {
#[serde(rename = "CanRemove")]
#[serde(skip_serializing_if = "Option::is_none")]
pub can_remove: Option<bool>,
#[serde(rename = "DetachKeys")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detach_keys: Option<String>,
#[serde(rename = "ID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Running")]
#[serde(skip_serializing_if = "Option::is_none")]
pub running: Option<bool>,
#[serde(rename = "ExitCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub exit_code: Option<i64>,
#[serde(rename = "ProcessConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub process_config: Option<ProcessConfig>,
#[serde(rename = "OpenStdin")]
#[serde(skip_serializing_if = "Option::is_none")]
pub open_stdin: Option<bool>,
#[serde(rename = "OpenStderr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub open_stderr: Option<bool>,
#[serde(rename = "OpenStdout")]
#[serde(skip_serializing_if = "Option::is_none")]
pub open_stdout: Option<bool>,
#[serde(rename = "ContainerID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub container_id: Option<String>,
#[serde(rename = "Pid")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pid: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ExecStartConfig {
#[serde(rename = "Detach")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detach: Option<bool>,
#[serde(rename = "Tty")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tty: Option<bool>,
}
pub type GenericResources = GenericResourcesInner;
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GenericResourcesInner {
#[serde(rename = "NamedResourceSpec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub named_resource_spec: Option<GenericResourcesInnerNamedResourceSpec>,
#[serde(rename = "DiscreteResourceSpec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub discrete_resource_spec: Option<GenericResourcesInnerDiscreteResourceSpec>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GenericResourcesInnerDiscreteResourceSpec {
#[serde(rename = "Kind")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kind: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GenericResourcesInnerNamedResourceSpec {
#[serde(rename = "Kind")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kind: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GraphDriverData {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Data")]
#[serde(deserialize_with = "deserialize_nonoptional_map")]
pub data: HashMap<String, String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Health {
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<HealthStatusEnum>,
#[serde(rename = "FailingStreak")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failing_streak: Option<i64>,
#[serde(rename = "Log")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log: Option<Vec<HealthcheckResult>>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum HealthStatusEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "none")]
NONE,
#[serde(rename = "starting")]
STARTING,
#[serde(rename = "healthy")]
HEALTHY,
#[serde(rename = "unhealthy")]
UNHEALTHY,
}
impl ::std::fmt::Display for HealthStatusEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
HealthStatusEnum::EMPTY => write!(f, ""),
HealthStatusEnum::NONE => write!(f, "{}", "none"),
HealthStatusEnum::STARTING => write!(f, "{}", "starting"),
HealthStatusEnum::HEALTHY => write!(f, "{}", "healthy"),
HealthStatusEnum::UNHEALTHY => write!(f, "{}", "unhealthy"),
}
}
}
impl ::std::str::FromStr for HealthStatusEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(HealthStatusEnum::EMPTY),
"none" => Ok(HealthStatusEnum::NONE),
"starting" => Ok(HealthStatusEnum::STARTING),
"healthy" => Ok(HealthStatusEnum::HEALTHY),
"unhealthy" => Ok(HealthStatusEnum::UNHEALTHY),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for HealthStatusEnum {
fn as_ref(&self) -> &str {
match self {
HealthStatusEnum::EMPTY => "",
HealthStatusEnum::NONE => "none",
HealthStatusEnum::STARTING => "starting",
HealthStatusEnum::HEALTHY => "healthy",
HealthStatusEnum::UNHEALTHY => "unhealthy",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct HealthConfig {
#[serde(rename = "Test")]
#[serde(skip_serializing_if = "Option::is_none")]
pub test: Option<Vec<String>>,
#[serde(rename = "Interval")]
#[serde(skip_serializing_if = "Option::is_none")]
pub interval: Option<i64>,
#[serde(rename = "Timeout")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timeout: Option<i64>,
#[serde(rename = "Retries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub retries: Option<i64>,
#[serde(rename = "StartPeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_period: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct HealthcheckResult {
#[serde(rename = "Start")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub start: Option<BollardDate>,
#[serde(rename = "End")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub end: Option<BollardDate>,
#[serde(rename = "ExitCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub exit_code: Option<i64>,
#[serde(rename = "Output")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct HistoryResponseItem {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "Created")]
pub created: i64,
#[serde(rename = "CreatedBy")]
pub created_by: String,
#[serde(rename = "Tags")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub tags: Vec<String>,
#[serde(rename = "Size")]
pub size: i64,
#[serde(rename = "Comment")]
pub comment: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct HostConfig {
#[serde(rename = "CpuShares")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_shares: Option<i64>,
#[serde(rename = "Memory")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory: Option<i64>,
#[serde(rename = "CgroupParent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cgroup_parent: Option<String>,
#[serde(rename = "BlkioWeight")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blkio_weight: Option<u16>,
#[serde(rename = "BlkioWeightDevice")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blkio_weight_device: Option<Vec<ResourcesBlkioWeightDevice>>,
#[serde(rename = "BlkioDeviceReadBps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blkio_device_read_bps: Option<Vec<ThrottleDevice>>,
#[serde(rename = "BlkioDeviceWriteBps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blkio_device_write_bps: Option<Vec<ThrottleDevice>>,
#[serde(rename = "BlkioDeviceReadIOps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blkio_device_read_iops: Option<Vec<ThrottleDevice>>,
#[serde(rename = "BlkioDeviceWriteIOps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blkio_device_write_iops: Option<Vec<ThrottleDevice>>,
#[serde(rename = "CpuPeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_period: Option<i64>,
#[serde(rename = "CpuQuota")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_quota: Option<i64>,
#[serde(rename = "CpuRealtimePeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_realtime_period: Option<i64>,
#[serde(rename = "CpuRealtimeRuntime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_realtime_runtime: Option<i64>,
#[serde(rename = "CpusetCpus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpuset_cpus: Option<String>,
#[serde(rename = "CpusetMems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpuset_mems: Option<String>,
#[serde(rename = "Devices")]
#[serde(skip_serializing_if = "Option::is_none")]
pub devices: Option<Vec<DeviceMapping>>,
#[serde(rename = "DeviceCgroupRules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_cgroup_rules: Option<Vec<String>>,
#[serde(rename = "DeviceRequests")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_requests: Option<Vec<DeviceRequest>>,
#[serde(rename = "KernelMemory")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kernel_memory: Option<i64>,
#[serde(rename = "KernelMemoryTCP")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kernel_memory_tcp: Option<i64>,
#[serde(rename = "MemoryReservation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory_reservation: Option<i64>,
#[serde(rename = "MemorySwap")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory_swap: Option<i64>,
#[serde(rename = "MemorySwappiness")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory_swappiness: Option<i64>,
#[serde(rename = "NanoCpus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub nano_cpus: Option<i64>,
#[serde(rename = "OomKillDisable")]
#[serde(skip_serializing_if = "Option::is_none")]
pub oom_kill_disable: Option<bool>,
#[serde(rename = "Init")]
#[serde(skip_serializing_if = "Option::is_none")]
pub init: Option<bool>,
#[serde(rename = "PidsLimit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pids_limit: Option<i64>,
#[serde(rename = "Ulimits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ulimits: Option<Vec<ResourcesUlimits>>,
#[serde(rename = "CpuCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_count: Option<i64>,
#[serde(rename = "CpuPercent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_percent: Option<i64>,
#[serde(rename = "IOMaximumIOps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub io_maximum_iops: Option<i64>,
#[serde(rename = "IOMaximumBandwidth")]
#[serde(skip_serializing_if = "Option::is_none")]
pub io_maximum_bandwidth: Option<i64>,
#[serde(rename = "Binds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub binds: Option<Vec<String>>,
#[serde(rename = "ContainerIDFile")]
#[serde(skip_serializing_if = "Option::is_none")]
pub container_id_file: Option<String>,
#[serde(rename = "LogConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_config: Option<HostConfigLogConfig>,
#[serde(rename = "NetworkMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_mode: Option<String>,
#[serde(rename = "PortBindings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub port_bindings: Option<PortMap>,
#[serde(rename = "RestartPolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub restart_policy: Option<RestartPolicy>,
#[serde(rename = "AutoRemove")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_remove: Option<bool>,
#[serde(rename = "VolumeDriver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_driver: Option<String>,
#[serde(rename = "VolumesFrom")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volumes_from: Option<Vec<String>>,
#[serde(rename = "Mounts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mounts: Option<Vec<Mount>>,
#[serde(rename = "CapAdd")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cap_add: Option<Vec<String>>,
#[serde(rename = "CapDrop")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cap_drop: Option<Vec<String>>,
#[serde(rename = "CgroupnsMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cgroupns_mode: Option<HostConfigCgroupnsModeEnum>,
#[serde(rename = "Dns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dns: Option<Vec<String>>,
#[serde(rename = "DnsOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dns_options: Option<Vec<String>>,
#[serde(rename = "DnsSearch")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dns_search: Option<Vec<String>>,
#[serde(rename = "ExtraHosts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub extra_hosts: Option<Vec<String>>,
#[serde(rename = "GroupAdd")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_add: Option<Vec<String>>,
#[serde(rename = "IpcMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipc_mode: Option<String>,
#[serde(rename = "Cgroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cgroup: Option<String>,
#[serde(rename = "Links")]
#[serde(skip_serializing_if = "Option::is_none")]
pub links: Option<Vec<String>>,
#[serde(rename = "OomScoreAdj")]
#[serde(skip_serializing_if = "Option::is_none")]
pub oom_score_adj: Option<i64>,
#[serde(rename = "PidMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pid_mode: Option<String>,
#[serde(rename = "Privileged")]
#[serde(skip_serializing_if = "Option::is_none")]
pub privileged: Option<bool>,
#[serde(rename = "PublishAllPorts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub publish_all_ports: Option<bool>,
#[serde(rename = "ReadonlyRootfs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub readonly_rootfs: Option<bool>,
#[serde(rename = "SecurityOpt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_opt: Option<Vec<String>>,
#[serde(rename = "StorageOpt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub storage_opt: Option<HashMap<String, String>>,
#[serde(rename = "Tmpfs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tmpfs: Option<HashMap<String, String>>,
#[serde(rename = "UTSMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uts_mode: Option<String>,
#[serde(rename = "UsernsMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub userns_mode: Option<String>,
#[serde(rename = "ShmSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub shm_size: Option<i64>,
#[serde(rename = "Sysctls")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sysctls: Option<HashMap<String, String>>,
#[serde(rename = "Runtime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub runtime: Option<String>,
#[serde(rename = "ConsoleSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub console_size: Option<Vec<i32>>,
#[serde(rename = "Isolation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub isolation: Option<HostConfigIsolationEnum>,
#[serde(rename = "MaskedPaths")]
#[serde(skip_serializing_if = "Option::is_none")]
pub masked_paths: Option<Vec<String>>,
#[serde(rename = "ReadonlyPaths")]
#[serde(skip_serializing_if = "Option::is_none")]
pub readonly_paths: Option<Vec<String>>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum HostConfigCgroupnsModeEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "private")]
PRIVATE,
#[serde(rename = "host")]
HOST,
}
impl ::std::fmt::Display for HostConfigCgroupnsModeEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
HostConfigCgroupnsModeEnum::EMPTY => write!(f, ""),
HostConfigCgroupnsModeEnum::PRIVATE => write!(f, "{}", "private"),
HostConfigCgroupnsModeEnum::HOST => write!(f, "{}", "host"),
}
}
}
impl ::std::str::FromStr for HostConfigCgroupnsModeEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(HostConfigCgroupnsModeEnum::EMPTY),
"private" => Ok(HostConfigCgroupnsModeEnum::PRIVATE),
"host" => Ok(HostConfigCgroupnsModeEnum::HOST),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for HostConfigCgroupnsModeEnum {
fn as_ref(&self) -> &str {
match self {
HostConfigCgroupnsModeEnum::EMPTY => "",
HostConfigCgroupnsModeEnum::PRIVATE => "private",
HostConfigCgroupnsModeEnum::HOST => "host",
}
}
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum HostConfigIsolationEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "default")]
DEFAULT,
#[serde(rename = "process")]
PROCESS,
#[serde(rename = "hyperv")]
HYPERV,
}
impl ::std::fmt::Display for HostConfigIsolationEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
HostConfigIsolationEnum::EMPTY => write!(f, ""),
HostConfigIsolationEnum::DEFAULT => write!(f, "{}", "default"),
HostConfigIsolationEnum::PROCESS => write!(f, "{}", "process"),
HostConfigIsolationEnum::HYPERV => write!(f, "{}", "hyperv"),
}
}
}
impl ::std::str::FromStr for HostConfigIsolationEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(HostConfigIsolationEnum::EMPTY),
"default" => Ok(HostConfigIsolationEnum::DEFAULT),
"process" => Ok(HostConfigIsolationEnum::PROCESS),
"hyperv" => Ok(HostConfigIsolationEnum::HYPERV),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for HostConfigIsolationEnum {
fn as_ref(&self) -> &str {
match self {
HostConfigIsolationEnum::EMPTY => "",
HostConfigIsolationEnum::DEFAULT => "default",
HostConfigIsolationEnum::PROCESS => "process",
HostConfigIsolationEnum::HYPERV => "hyperv",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct HostConfigLogConfig {
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub typ: Option<String>,
#[serde(rename = "Config")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config: Option<HashMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "UPPERCASE")]
pub struct IdResponse {
pub id: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ImageDeleteResponseItem {
#[serde(rename = "Untagged")]
#[serde(skip_serializing_if = "Option::is_none")]
pub untagged: Option<String>,
#[serde(rename = "Deleted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub deleted: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ImageId {
#[serde(rename = "ID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ImageInspect {
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "RepoTags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repo_tags: Option<Vec<String>>,
#[serde(rename = "RepoDigests")]
#[serde(skip_serializing_if = "Option::is_none")]
pub repo_digests: Option<Vec<String>>,
#[serde(rename = "Parent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parent: Option<String>,
#[serde(rename = "Comment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<String>,
#[serde(rename = "Created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<String>,
#[serde(rename = "Container")]
#[serde(skip_serializing_if = "Option::is_none")]
pub container: Option<String>,
#[serde(rename = "ContainerConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub container_config: Option<ContainerConfig>,
#[serde(rename = "DockerVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub docker_version: Option<String>,
#[serde(rename = "Author")]
#[serde(skip_serializing_if = "Option::is_none")]
pub author: Option<String>,
#[serde(rename = "Config")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config: Option<ContainerConfig>,
#[serde(rename = "Architecture")]
#[serde(skip_serializing_if = "Option::is_none")]
pub architecture: Option<String>,
#[serde(rename = "Variant")]
#[serde(skip_serializing_if = "Option::is_none")]
pub variant: Option<String>,
#[serde(rename = "Os")]
#[serde(skip_serializing_if = "Option::is_none")]
pub os: Option<String>,
#[serde(rename = "OsVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub os_version: Option<String>,
#[serde(rename = "Size")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<i64>,
#[serde(rename = "VirtualSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub virtual_size: Option<i64>,
#[serde(rename = "GraphDriver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub graph_driver: Option<GraphDriverData>,
#[serde(rename = "RootFS")]
#[serde(skip_serializing_if = "Option::is_none")]
pub root_fs: Option<ImageInspectRootFs>,
#[serde(rename = "Metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<ImageInspectMetadata>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ImageInspectMetadata {
#[serde(rename = "LastTagTime")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub last_tag_time: Option<BollardDate>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ImageInspectRootFs {
#[serde(rename = "Type")]
pub typ: String,
#[serde(rename = "Layers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layers: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ImagePruneResponse {
#[serde(rename = "ImagesDeleted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub images_deleted: Option<Vec<ImageDeleteResponseItem>>,
#[serde(rename = "SpaceReclaimed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub space_reclaimed: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ImageSearchResponseItem {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "is_official")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_official: Option<bool>,
#[serde(rename = "is_automated")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_automated: Option<bool>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "star_count")]
#[serde(skip_serializing_if = "Option::is_none")]
pub star_count: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ImageSummary {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "ParentId")]
pub parent_id: String,
#[serde(rename = "RepoTags")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub repo_tags: Vec<String>,
#[serde(rename = "RepoDigests")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub repo_digests: Vec<String>,
#[serde(rename = "Created")]
pub created: i64,
#[serde(rename = "Size")]
pub size: i64,
#[serde(rename = "SharedSize")]
pub shared_size: i64,
#[serde(rename = "VirtualSize")]
pub virtual_size: i64,
#[serde(rename = "Labels")]
#[serde(deserialize_with = "deserialize_nonoptional_map")]
pub labels: HashMap<String, String>,
#[serde(rename = "Containers")]
pub containers: i64,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct IndexInfo {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Mirrors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mirrors: Option<Vec<String>>,
#[serde(rename = "Secure")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secure: Option<bool>,
#[serde(rename = "Official")]
#[serde(skip_serializing_if = "Option::is_none")]
pub official: Option<bool>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Ipam {
#[serde(rename = "Driver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub driver: Option<String>,
#[serde(rename = "Config")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config: Option<Vec<IpamConfig>>,
#[serde(rename = "Options")]
#[serde(skip_serializing_if = "Option::is_none")]
pub options: Option<HashMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct IpamConfig {
#[serde(rename = "Subnet")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet: Option<String>,
#[serde(rename = "IPRange")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_range: Option<String>,
#[serde(rename = "Gateway")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway: Option<String>,
#[serde(rename = "AuxiliaryAddresses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auxiliary_addresses: Option<HashMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct JoinTokens {
#[serde(rename = "Worker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub worker: Option<String>,
#[serde(rename = "Manager")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manager: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Limit {
#[serde(rename = "NanoCPUs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub nano_cp_us: Option<i64>,
#[serde(rename = "MemoryBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory_bytes: Option<i64>,
#[serde(rename = "Pids")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pids: Option<i64>,
}
#[allow(non_camel_case_types)]
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum LocalNodeState {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "inactive")]
INACTIVE,
#[serde(rename = "pending")]
PENDING,
#[serde(rename = "active")]
ACTIVE,
#[serde(rename = "error")]
ERROR,
#[serde(rename = "locked")]
LOCKED,
}
impl ::std::fmt::Display for LocalNodeState {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
LocalNodeState::EMPTY => write!(f, "{}", ""),
LocalNodeState::INACTIVE => write!(f, "{}", "inactive"),
LocalNodeState::PENDING => write!(f, "{}", "pending"),
LocalNodeState::ACTIVE => write!(f, "{}", "active"),
LocalNodeState::ERROR => write!(f, "{}", "error"),
LocalNodeState::LOCKED => write!(f, "{}", "locked"),
}
}
}
impl ::std::str::FromStr for LocalNodeState {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(LocalNodeState::EMPTY),
"inactive" => Ok(LocalNodeState::INACTIVE),
"pending" => Ok(LocalNodeState::PENDING),
"active" => Ok(LocalNodeState::ACTIVE),
"error" => Ok(LocalNodeState::ERROR),
"locked" => Ok(LocalNodeState::LOCKED),
_ => Err(()),
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ManagerStatus {
#[serde(rename = "Leader")]
#[serde(skip_serializing_if = "Option::is_none")]
pub leader: Option<bool>,
#[serde(rename = "Reachability")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reachability: Option<Reachability>,
#[serde(rename = "Addr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub addr: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Mount {
#[serde(rename = "Target")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target: Option<String>,
#[serde(rename = "Source")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub typ: Option<MountTypeEnum>,
#[serde(rename = "ReadOnly")]
#[serde(skip_serializing_if = "Option::is_none")]
pub read_only: Option<bool>,
#[serde(rename = "Consistency")]
#[serde(skip_serializing_if = "Option::is_none")]
pub consistency: Option<String>,
#[serde(rename = "BindOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bind_options: Option<MountBindOptions>,
#[serde(rename = "VolumeOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_options: Option<MountVolumeOptions>,
#[serde(rename = "TmpfsOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tmpfs_options: Option<MountTmpfsOptions>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum MountTypeEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "bind")]
BIND,
#[serde(rename = "volume")]
VOLUME,
#[serde(rename = "tmpfs")]
TMPFS,
#[serde(rename = "npipe")]
NPIPE,
}
impl ::std::fmt::Display for MountTypeEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
MountTypeEnum::EMPTY => write!(f, ""),
MountTypeEnum::BIND => write!(f, "{}", "bind"),
MountTypeEnum::VOLUME => write!(f, "{}", "volume"),
MountTypeEnum::TMPFS => write!(f, "{}", "tmpfs"),
MountTypeEnum::NPIPE => write!(f, "{}", "npipe"),
}
}
}
impl ::std::str::FromStr for MountTypeEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(MountTypeEnum::EMPTY),
"bind" => Ok(MountTypeEnum::BIND),
"volume" => Ok(MountTypeEnum::VOLUME),
"tmpfs" => Ok(MountTypeEnum::TMPFS),
"npipe" => Ok(MountTypeEnum::NPIPE),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for MountTypeEnum {
fn as_ref(&self) -> &str {
match self {
MountTypeEnum::EMPTY => "",
MountTypeEnum::BIND => "bind",
MountTypeEnum::VOLUME => "volume",
MountTypeEnum::TMPFS => "tmpfs",
MountTypeEnum::NPIPE => "npipe",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct MountBindOptions {
#[serde(rename = "Propagation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub propagation: Option<MountBindOptionsPropagationEnum>,
#[serde(rename = "NonRecursive")]
#[serde(skip_serializing_if = "Option::is_none")]
pub non_recursive: Option<bool>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum MountBindOptionsPropagationEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "private")]
PRIVATE,
#[serde(rename = "rprivate")]
RPRIVATE,
#[serde(rename = "shared")]
SHARED,
#[serde(rename = "rshared")]
RSHARED,
#[serde(rename = "slave")]
SLAVE,
#[serde(rename = "rslave")]
RSLAVE,
}
impl ::std::fmt::Display for MountBindOptionsPropagationEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
MountBindOptionsPropagationEnum::EMPTY => write!(f, ""),
MountBindOptionsPropagationEnum::PRIVATE => write!(f, "{}", "private"),
MountBindOptionsPropagationEnum::RPRIVATE => write!(f, "{}", "rprivate"),
MountBindOptionsPropagationEnum::SHARED => write!(f, "{}", "shared"),
MountBindOptionsPropagationEnum::RSHARED => write!(f, "{}", "rshared"),
MountBindOptionsPropagationEnum::SLAVE => write!(f, "{}", "slave"),
MountBindOptionsPropagationEnum::RSLAVE => write!(f, "{}", "rslave"),
}
}
}
impl ::std::str::FromStr for MountBindOptionsPropagationEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(MountBindOptionsPropagationEnum::EMPTY),
"private" => Ok(MountBindOptionsPropagationEnum::PRIVATE),
"rprivate" => Ok(MountBindOptionsPropagationEnum::RPRIVATE),
"shared" => Ok(MountBindOptionsPropagationEnum::SHARED),
"rshared" => Ok(MountBindOptionsPropagationEnum::RSHARED),
"slave" => Ok(MountBindOptionsPropagationEnum::SLAVE),
"rslave" => Ok(MountBindOptionsPropagationEnum::RSLAVE),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for MountBindOptionsPropagationEnum {
fn as_ref(&self) -> &str {
match self {
MountBindOptionsPropagationEnum::EMPTY => "",
MountBindOptionsPropagationEnum::PRIVATE => "private",
MountBindOptionsPropagationEnum::RPRIVATE => "rprivate",
MountBindOptionsPropagationEnum::SHARED => "shared",
MountBindOptionsPropagationEnum::RSHARED => "rshared",
MountBindOptionsPropagationEnum::SLAVE => "slave",
MountBindOptionsPropagationEnum::RSLAVE => "rslave",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct MountPoint {
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub typ: Option<MountPointTypeEnum>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Source")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source: Option<String>,
#[serde(rename = "Destination")]
#[serde(skip_serializing_if = "Option::is_none")]
pub destination: Option<String>,
#[serde(rename = "Driver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub driver: Option<String>,
#[serde(rename = "Mode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mode: Option<String>,
#[serde(rename = "RW")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rw: Option<bool>,
#[serde(rename = "Propagation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub propagation: Option<String>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum MountPointTypeEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "bind")]
BIND,
#[serde(rename = "volume")]
VOLUME,
#[serde(rename = "tmpfs")]
TMPFS,
#[serde(rename = "npipe")]
NPIPE,
}
impl ::std::fmt::Display for MountPointTypeEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
MountPointTypeEnum::EMPTY => write!(f, ""),
MountPointTypeEnum::BIND => write!(f, "{}", "bind"),
MountPointTypeEnum::VOLUME => write!(f, "{}", "volume"),
MountPointTypeEnum::TMPFS => write!(f, "{}", "tmpfs"),
MountPointTypeEnum::NPIPE => write!(f, "{}", "npipe"),
}
}
}
impl ::std::str::FromStr for MountPointTypeEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(MountPointTypeEnum::EMPTY),
"bind" => Ok(MountPointTypeEnum::BIND),
"volume" => Ok(MountPointTypeEnum::VOLUME),
"tmpfs" => Ok(MountPointTypeEnum::TMPFS),
"npipe" => Ok(MountPointTypeEnum::NPIPE),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for MountPointTypeEnum {
fn as_ref(&self) -> &str {
match self {
MountPointTypeEnum::EMPTY => "",
MountPointTypeEnum::BIND => "bind",
MountPointTypeEnum::VOLUME => "volume",
MountPointTypeEnum::TMPFS => "tmpfs",
MountPointTypeEnum::NPIPE => "npipe",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct MountTmpfsOptions {
#[serde(rename = "SizeBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size_bytes: Option<i64>,
#[serde(rename = "Mode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mode: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct MountVolumeOptions {
#[serde(rename = "NoCopy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub no_copy: Option<bool>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
#[serde(rename = "DriverConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub driver_config: Option<MountVolumeOptionsDriverConfig>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct MountVolumeOptionsDriverConfig {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Options")]
#[serde(skip_serializing_if = "Option::is_none")]
pub options: Option<HashMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Network {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Created")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub created: Option<BollardDate>,
#[serde(rename = "Scope")]
#[serde(skip_serializing_if = "Option::is_none")]
pub scope: Option<String>,
#[serde(rename = "Driver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub driver: Option<String>,
#[serde(rename = "EnableIPv6")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_ipv6: Option<bool>,
#[serde(rename = "IPAM")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipam: Option<Ipam>,
#[serde(rename = "Internal")]
#[serde(skip_serializing_if = "Option::is_none")]
pub internal: Option<bool>,
#[serde(rename = "Attachable")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attachable: Option<bool>,
#[serde(rename = "Ingress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ingress: Option<bool>,
#[serde(rename = "Containers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub containers: Option<HashMap<String, NetworkContainer>>,
#[serde(rename = "Options")]
#[serde(skip_serializing_if = "Option::is_none")]
pub options: Option<HashMap<String, String>>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct NetworkAttachmentConfig {
#[serde(rename = "Target")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target: Option<String>,
#[serde(rename = "Aliases")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aliases: Option<Vec<String>>,
#[serde(rename = "DriverOpts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub driver_opts: Option<HashMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct NetworkConnectRequest {
#[serde(rename = "Container")]
#[serde(skip_serializing_if = "Option::is_none")]
pub container: Option<String>,
#[serde(rename = "Force")]
#[serde(skip_serializing_if = "Option::is_none")]
pub force: Option<bool>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct NetworkContainer {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "EndpointID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_id: Option<String>,
#[serde(rename = "MacAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mac_address: Option<String>,
#[serde(rename = "IPv4Address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipv4_address: Option<String>,
#[serde(rename = "IPv6Address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipv6_address: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct NetworkCreateRequest {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "CheckDuplicate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub check_duplicate: Option<bool>,
#[serde(rename = "Driver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub driver: Option<String>,
#[serde(rename = "Internal")]
#[serde(skip_serializing_if = "Option::is_none")]
pub internal: Option<bool>,
#[serde(rename = "Attachable")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attachable: Option<bool>,
#[serde(rename = "Ingress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ingress: Option<bool>,
#[serde(rename = "IPAM")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipam: Option<Ipam>,
#[serde(rename = "EnableIPv6")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_ipv6: Option<bool>,
#[serde(rename = "Options")]
#[serde(skip_serializing_if = "Option::is_none")]
pub options: Option<HashMap<String, String>>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct NetworkCreateResponse {
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Warning")]
#[serde(skip_serializing_if = "Option::is_none")]
pub warning: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct NetworkDisconnectRequest {
#[serde(rename = "Container")]
#[serde(skip_serializing_if = "Option::is_none")]
pub container: Option<String>,
#[serde(rename = "EndpointConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_config: Option<EndpointSettings>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct NetworkPruneResponse {
#[serde(rename = "NetworksDeleted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub networks_deleted: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct NetworkSettings {
#[serde(rename = "Bridge")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bridge: Option<String>,
#[serde(rename = "SandboxID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sandbox_id: Option<String>,
#[serde(rename = "HairpinMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hairpin_mode: Option<bool>,
#[serde(rename = "LinkLocalIPv6Address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub link_local_ipv6_address: Option<String>,
#[serde(rename = "LinkLocalIPv6PrefixLen")]
#[serde(skip_serializing_if = "Option::is_none")]
pub link_local_ipv6_prefix_len: Option<i64>,
#[serde(rename = "Ports")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ports: Option<PortMap>,
#[serde(rename = "SandboxKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sandbox_key: Option<String>,
#[serde(rename = "SecondaryIPAddresses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secondary_ip_addresses: Option<Vec<Address>>,
#[serde(rename = "SecondaryIPv6Addresses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secondary_ipv6_addresses: Option<Vec<Address>>,
#[serde(rename = "EndpointID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_id: Option<String>,
#[serde(rename = "Gateway")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gateway: Option<String>,
#[serde(rename = "GlobalIPv6Address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub global_ipv6_address: Option<String>,
#[serde(rename = "GlobalIPv6PrefixLen")]
#[serde(skip_serializing_if = "Option::is_none")]
pub global_ipv6_prefix_len: Option<i64>,
#[serde(rename = "IPAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_address: Option<String>,
#[serde(rename = "IPPrefixLen")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_prefix_len: Option<i64>,
#[serde(rename = "IPv6Gateway")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipv6_gateway: Option<String>,
#[serde(rename = "MacAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mac_address: Option<String>,
#[serde(rename = "Networks")]
#[serde(skip_serializing_if = "Option::is_none")]
pub networks: Option<HashMap<String, EndpointSettings>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct NetworkingConfig {
#[serde(rename = "EndpointsConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoints_config: Option<HashMap<String, EndpointSettings>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Node {
#[serde(rename = "ID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<ObjectVersion>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub created_at: Option<BollardDate>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub updated_at: Option<BollardDate>,
#[serde(rename = "Spec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spec: Option<NodeSpec>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<NodeDescription>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<NodeStatus>,
#[serde(rename = "ManagerStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub manager_status: Option<ManagerStatus>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct NodeDescription {
#[serde(rename = "Hostname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hostname: Option<String>,
#[serde(rename = "Platform")]
#[serde(skip_serializing_if = "Option::is_none")]
pub platform: Option<Platform>,
#[serde(rename = "Resources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resources: Option<ResourceObject>,
#[serde(rename = "Engine")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine: Option<EngineDescription>,
#[serde(rename = "TLSInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tls_info: Option<TlsInfo>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct NodeSpec {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
#[serde(rename = "Role")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role: Option<NodeSpecRoleEnum>,
#[serde(rename = "Availability")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability: Option<NodeSpecAvailabilityEnum>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum NodeSpecRoleEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "worker")]
WORKER,
#[serde(rename = "manager")]
MANAGER,
}
impl ::std::fmt::Display for NodeSpecRoleEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
NodeSpecRoleEnum::EMPTY => write!(f, ""),
NodeSpecRoleEnum::WORKER => write!(f, "{}", "worker"),
NodeSpecRoleEnum::MANAGER => write!(f, "{}", "manager"),
}
}
}
impl ::std::str::FromStr for NodeSpecRoleEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(NodeSpecRoleEnum::EMPTY),
"worker" => Ok(NodeSpecRoleEnum::WORKER),
"manager" => Ok(NodeSpecRoleEnum::MANAGER),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for NodeSpecRoleEnum {
fn as_ref(&self) -> &str {
match self {
NodeSpecRoleEnum::EMPTY => "",
NodeSpecRoleEnum::WORKER => "worker",
NodeSpecRoleEnum::MANAGER => "manager",
}
}
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum NodeSpecAvailabilityEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "active")]
ACTIVE,
#[serde(rename = "pause")]
PAUSE,
#[serde(rename = "drain")]
DRAIN,
}
impl ::std::fmt::Display for NodeSpecAvailabilityEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
NodeSpecAvailabilityEnum::EMPTY => write!(f, ""),
NodeSpecAvailabilityEnum::ACTIVE => write!(f, "{}", "active"),
NodeSpecAvailabilityEnum::PAUSE => write!(f, "{}", "pause"),
NodeSpecAvailabilityEnum::DRAIN => write!(f, "{}", "drain"),
}
}
}
impl ::std::str::FromStr for NodeSpecAvailabilityEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(NodeSpecAvailabilityEnum::EMPTY),
"active" => Ok(NodeSpecAvailabilityEnum::ACTIVE),
"pause" => Ok(NodeSpecAvailabilityEnum::PAUSE),
"drain" => Ok(NodeSpecAvailabilityEnum::DRAIN),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for NodeSpecAvailabilityEnum {
fn as_ref(&self) -> &str {
match self {
NodeSpecAvailabilityEnum::EMPTY => "",
NodeSpecAvailabilityEnum::ACTIVE => "active",
NodeSpecAvailabilityEnum::PAUSE => "pause",
NodeSpecAvailabilityEnum::DRAIN => "drain",
}
}
}
#[allow(non_camel_case_types)]
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum NodeState {
#[serde(rename = "unknown")]
UNKNOWN,
#[serde(rename = "down")]
DOWN,
#[serde(rename = "ready")]
READY,
#[serde(rename = "disconnected")]
DISCONNECTED,
}
impl ::std::fmt::Display for NodeState {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
NodeState::UNKNOWN => write!(f, "{}", "unknown"),
NodeState::DOWN => write!(f, "{}", "down"),
NodeState::READY => write!(f, "{}", "ready"),
NodeState::DISCONNECTED => write!(f, "{}", "disconnected"),
}
}
}
impl ::std::str::FromStr for NodeState {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"unknown" => Ok(NodeState::UNKNOWN),
"down" => Ok(NodeState::DOWN),
"ready" => Ok(NodeState::READY),
"disconnected" => Ok(NodeState::DISCONNECTED),
_ => Err(()),
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct NodeStatus {
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<NodeState>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "Addr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub addr: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ObjectVersion {
#[serde(rename = "Index")]
#[serde(skip_serializing_if = "Option::is_none")]
pub index: Option<u64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct OciDescriptor {
#[serde(rename = "mediaType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub media_type: Option<String>,
#[serde(rename = "digest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub digest: Option<String>,
#[serde(rename = "size")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct OciPlatform {
#[serde(rename = "architecture")]
#[serde(skip_serializing_if = "Option::is_none")]
pub architecture: Option<String>,
#[serde(rename = "os")]
#[serde(skip_serializing_if = "Option::is_none")]
pub os: Option<String>,
#[serde(rename = "os.version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub os_version: Option<String>,
#[serde(rename = "os.features")]
#[serde(skip_serializing_if = "Option::is_none")]
pub os_features: Option<Vec<String>>,
#[serde(rename = "variant")]
#[serde(skip_serializing_if = "Option::is_none")]
pub variant: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PeerNode {
#[serde(rename = "NodeID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_id: Option<String>,
#[serde(rename = "Addr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub addr: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Platform {
#[serde(rename = "Architecture")]
#[serde(skip_serializing_if = "Option::is_none")]
pub architecture: Option<String>,
#[serde(rename = "OS")]
#[serde(skip_serializing_if = "Option::is_none")]
pub os: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Plugin {
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Enabled")]
pub enabled: bool,
#[serde(rename = "Settings")]
pub settings: PluginSettings,
#[serde(rename = "PluginReference")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plugin_reference: Option<String>,
#[serde(rename = "Config")]
pub config: PluginConfig,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PluginConfig {
#[serde(rename = "DockerVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub docker_version: Option<String>,
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "Documentation")]
pub documentation: String,
#[serde(rename = "Interface")]
pub interface: PluginConfigInterface,
#[serde(rename = "Entrypoint")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub entrypoint: Vec<String>,
#[serde(rename = "WorkDir")]
pub work_dir: String,
#[serde(rename = "User")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user: Option<PluginConfigUser>,
#[serde(rename = "Network")]
pub network: PluginConfigNetwork,
#[serde(rename = "Linux")]
pub linux: PluginConfigLinux,
#[serde(rename = "PropagatedMount")]
pub propagated_mount: String,
#[serde(rename = "IpcHost")]
pub ipc_host: bool,
#[serde(rename = "PidHost")]
pub pid_host: bool,
#[serde(rename = "Mounts")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub mounts: Vec<PluginMount>,
#[serde(rename = "Env")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub env: Vec<PluginEnv>,
#[serde(rename = "Args")]
pub args: PluginConfigArgs,
#[serde(rename = "rootfs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rootfs: Option<PluginConfigRootfs>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PluginConfigArgs {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "Settable")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub settable: Vec<String>,
#[serde(rename = "Value")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub value: Vec<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PluginConfigInterface {
#[serde(rename = "Types")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub types: Vec<PluginInterfaceType>,
#[serde(rename = "Socket")]
pub socket: String,
#[serde(rename = "ProtocolScheme")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol_scheme: Option<PluginConfigInterfaceProtocolSchemeEnum>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum PluginConfigInterfaceProtocolSchemeEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "moby.plugins.http/v1")]
MOBY_PLUGINS_HTTP_V1,
}
impl ::std::fmt::Display for PluginConfigInterfaceProtocolSchemeEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
PluginConfigInterfaceProtocolSchemeEnum::EMPTY => write!(f, "{}", ""),
PluginConfigInterfaceProtocolSchemeEnum::MOBY_PLUGINS_HTTP_V1 => write!(f, "{}", "moby.plugins.http/v1"),
}
}
}
impl ::std::str::FromStr for PluginConfigInterfaceProtocolSchemeEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(PluginConfigInterfaceProtocolSchemeEnum::EMPTY),
"moby.plugins.http/v1" => Ok(PluginConfigInterfaceProtocolSchemeEnum::MOBY_PLUGINS_HTTP_V1),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for PluginConfigInterfaceProtocolSchemeEnum {
fn as_ref(&self) -> &str {
match self {
PluginConfigInterfaceProtocolSchemeEnum::EMPTY => "",
PluginConfigInterfaceProtocolSchemeEnum::MOBY_PLUGINS_HTTP_V1 => "moby.plugins.http/v1",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PluginConfigLinux {
#[serde(rename = "Capabilities")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub capabilities: Vec<String>,
#[serde(rename = "AllowAllDevices")]
pub allow_all_devices: bool,
#[serde(rename = "Devices")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub devices: Vec<PluginDevice>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PluginConfigNetwork {
#[serde(rename = "Type")]
pub typ: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PluginConfigRootfs {
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub typ: Option<String>,
#[serde(rename = "diff_ids")]
#[serde(skip_serializing_if = "Option::is_none")]
pub diff_ids: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PluginConfigUser {
#[serde(rename = "UID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uid: Option<u32>,
#[serde(rename = "GID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gid: Option<u32>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PluginDevice {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "Settable")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub settable: Vec<String>,
#[serde(rename = "Path")]
pub path: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PluginEnv {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "Settable")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub settable: Vec<String>,
#[serde(rename = "Value")]
pub value: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PluginInterfaceType {
#[serde(rename = "Prefix")]
pub prefix: String,
#[serde(rename = "Capability")]
pub capability: String,
#[serde(rename = "Version")]
pub version: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PluginMount {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "Settable")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub settable: Vec<String>,
#[serde(rename = "Source")]
pub source: String,
#[serde(rename = "Destination")]
pub destination: String,
#[serde(rename = "Type")]
pub typ: String,
#[serde(rename = "Options")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub options: Vec<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PluginPrivilege {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PluginSettings {
#[serde(rename = "Mounts")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub mounts: Vec<PluginMount>,
#[serde(rename = "Env")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub env: Vec<String>,
#[serde(rename = "Args")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub args: Vec<String>,
#[serde(rename = "Devices")]
#[serde(deserialize_with = "deserialize_nonoptional_vec")]
pub devices: Vec<PluginDevice>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PluginsInfo {
#[serde(rename = "Volume")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume: Option<Vec<String>>,
#[serde(rename = "Network")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network: Option<Vec<String>>,
#[serde(rename = "Authorization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authorization: Option<Vec<String>>,
#[serde(rename = "Log")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Port {
#[serde(rename = "IP")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip: Option<String>,
#[serde(rename = "PrivatePort")]
pub private_port: i64,
#[serde(rename = "PublicPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub public_port: Option<i64>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "::serde_with::As::<::serde_with::NoneAsEmptyString>")]
pub typ: Option<PortTypeEnum>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum PortTypeEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "tcp")]
TCP,
#[serde(rename = "udp")]
UDP,
#[serde(rename = "sctp")]
SCTP,
}
impl ::std::fmt::Display for PortTypeEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
PortTypeEnum::EMPTY => write!(f, ""),
PortTypeEnum::TCP => write!(f, "{}", "tcp"),
PortTypeEnum::UDP => write!(f, "{}", "udp"),
PortTypeEnum::SCTP => write!(f, "{}", "sctp"),
}
}
}
impl ::std::str::FromStr for PortTypeEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(PortTypeEnum::EMPTY),
"tcp" => Ok(PortTypeEnum::TCP),
"udp" => Ok(PortTypeEnum::UDP),
"sctp" => Ok(PortTypeEnum::SCTP),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for PortTypeEnum {
fn as_ref(&self) -> &str {
match self {
PortTypeEnum::EMPTY => "",
PortTypeEnum::TCP => "tcp",
PortTypeEnum::UDP => "udp",
PortTypeEnum::SCTP => "sctp",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PortBinding {
#[serde(rename = "HostIp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub host_ip: Option<String>,
#[serde(rename = "HostPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub host_port: Option<String>,
}
pub type PortMap = HashMap<String, Option<Vec<PortBinding>>>;
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ProcessConfig {
#[serde(rename = "privileged")]
#[serde(skip_serializing_if = "Option::is_none")]
pub privileged: Option<bool>,
#[serde(rename = "user")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user: Option<String>,
#[serde(rename = "tty")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tty: Option<bool>,
#[serde(rename = "entrypoint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entrypoint: Option<String>,
#[serde(rename = "arguments")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arguments: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ProgressDetail {
#[serde(rename = "current")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current: Option<i64>,
#[serde(rename = "total")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PushImageInfo {
#[serde(rename = "error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "progress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress: Option<String>,
#[serde(rename = "progressDetail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub progress_detail: Option<ProgressDetail>,
}
#[allow(non_camel_case_types)]
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum Reachability {
#[serde(rename = "unknown")]
UNKNOWN,
#[serde(rename = "unreachable")]
UNREACHABLE,
#[serde(rename = "reachable")]
REACHABLE,
}
impl ::std::fmt::Display for Reachability {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
Reachability::UNKNOWN => write!(f, "{}", "unknown"),
Reachability::UNREACHABLE => write!(f, "{}", "unreachable"),
Reachability::REACHABLE => write!(f, "{}", "reachable"),
}
}
}
impl ::std::str::FromStr for Reachability {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"unknown" => Ok(Reachability::UNKNOWN),
"unreachable" => Ok(Reachability::UNREACHABLE),
"reachable" => Ok(Reachability::REACHABLE),
_ => Err(()),
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct RegistryServiceConfig {
#[serde(rename = "AllowNondistributableArtifactsCIDRs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub allow_nondistributable_artifacts_cid_rs: Option<Vec<String>>,
#[serde(rename = "AllowNondistributableArtifactsHostnames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub allow_nondistributable_artifacts_hostnames: Option<Vec<String>>,
#[serde(rename = "InsecureRegistryCIDRs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub insecure_registry_cid_rs: Option<Vec<String>>,
#[serde(rename = "IndexConfigs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub index_configs: Option<HashMap<String, IndexInfo>>,
#[serde(rename = "Mirrors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mirrors: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ResourceObject {
#[serde(rename = "NanoCPUs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub nano_cp_us: Option<i64>,
#[serde(rename = "MemoryBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory_bytes: Option<i64>,
#[serde(rename = "GenericResources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub generic_resources: Option<GenericResources>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Resources {
#[serde(rename = "CpuShares")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_shares: Option<i64>,
#[serde(rename = "Memory")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory: Option<i64>,
#[serde(rename = "CgroupParent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cgroup_parent: Option<String>,
#[serde(rename = "BlkioWeight")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blkio_weight: Option<u16>,
#[serde(rename = "BlkioWeightDevice")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blkio_weight_device: Option<Vec<ResourcesBlkioWeightDevice>>,
#[serde(rename = "BlkioDeviceReadBps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blkio_device_read_bps: Option<Vec<ThrottleDevice>>,
#[serde(rename = "BlkioDeviceWriteBps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blkio_device_write_bps: Option<Vec<ThrottleDevice>>,
#[serde(rename = "BlkioDeviceReadIOps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blkio_device_read_iops: Option<Vec<ThrottleDevice>>,
#[serde(rename = "BlkioDeviceWriteIOps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blkio_device_write_iops: Option<Vec<ThrottleDevice>>,
#[serde(rename = "CpuPeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_period: Option<i64>,
#[serde(rename = "CpuQuota")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_quota: Option<i64>,
#[serde(rename = "CpuRealtimePeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_realtime_period: Option<i64>,
#[serde(rename = "CpuRealtimeRuntime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_realtime_runtime: Option<i64>,
#[serde(rename = "CpusetCpus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpuset_cpus: Option<String>,
#[serde(rename = "CpusetMems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpuset_mems: Option<String>,
#[serde(rename = "Devices")]
#[serde(skip_serializing_if = "Option::is_none")]
pub devices: Option<Vec<DeviceMapping>>,
#[serde(rename = "DeviceCgroupRules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_cgroup_rules: Option<Vec<String>>,
#[serde(rename = "DeviceRequests")]
#[serde(skip_serializing_if = "Option::is_none")]
pub device_requests: Option<Vec<DeviceRequest>>,
#[serde(rename = "KernelMemory")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kernel_memory: Option<i64>,
#[serde(rename = "KernelMemoryTCP")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kernel_memory_tcp: Option<i64>,
#[serde(rename = "MemoryReservation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory_reservation: Option<i64>,
#[serde(rename = "MemorySwap")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory_swap: Option<i64>,
#[serde(rename = "MemorySwappiness")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory_swappiness: Option<i64>,
#[serde(rename = "NanoCpus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub nano_cpus: Option<i64>,
#[serde(rename = "OomKillDisable")]
#[serde(skip_serializing_if = "Option::is_none")]
pub oom_kill_disable: Option<bool>,
#[serde(rename = "Init")]
#[serde(skip_serializing_if = "Option::is_none")]
pub init: Option<bool>,
#[serde(rename = "PidsLimit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pids_limit: Option<i64>,
#[serde(rename = "Ulimits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ulimits: Option<Vec<ResourcesUlimits>>,
#[serde(rename = "CpuCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_count: Option<i64>,
#[serde(rename = "CpuPercent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_percent: Option<i64>,
#[serde(rename = "IOMaximumIOps")]
#[serde(skip_serializing_if = "Option::is_none")]
pub io_maximum_iops: Option<i64>,
#[serde(rename = "IOMaximumBandwidth")]
#[serde(skip_serializing_if = "Option::is_none")]
pub io_maximum_bandwidth: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ResourcesBlkioWeightDevice {
#[serde(rename = "Path")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<String>,
#[serde(rename = "Weight")]
#[serde(skip_serializing_if = "Option::is_none")]
pub weight: Option<usize>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ResourcesUlimits {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Soft")]
#[serde(skip_serializing_if = "Option::is_none")]
pub soft: Option<i64>,
#[serde(rename = "Hard")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hard: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct RestartPolicy {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<RestartPolicyNameEnum>,
#[serde(rename = "MaximumRetryCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub maximum_retry_count: Option<i64>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum RestartPolicyNameEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "no")]
NO,
#[serde(rename = "always")]
ALWAYS,
#[serde(rename = "unless-stopped")]
UNLESS_STOPPED,
#[serde(rename = "on-failure")]
ON_FAILURE,
}
impl ::std::fmt::Display for RestartPolicyNameEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
RestartPolicyNameEnum::EMPTY => write!(f, "{}", ""),
RestartPolicyNameEnum::NO => write!(f, "{}", "no"),
RestartPolicyNameEnum::ALWAYS => write!(f, "{}", "always"),
RestartPolicyNameEnum::UNLESS_STOPPED => write!(f, "{}", "unless-stopped"),
RestartPolicyNameEnum::ON_FAILURE => write!(f, "{}", "on-failure"),
}
}
}
impl ::std::str::FromStr for RestartPolicyNameEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(RestartPolicyNameEnum::EMPTY),
"no" => Ok(RestartPolicyNameEnum::NO),
"always" => Ok(RestartPolicyNameEnum::ALWAYS),
"unless-stopped" => Ok(RestartPolicyNameEnum::UNLESS_STOPPED),
"on-failure" => Ok(RestartPolicyNameEnum::ON_FAILURE),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for RestartPolicyNameEnum {
fn as_ref(&self) -> &str {
match self {
RestartPolicyNameEnum::EMPTY => "",
RestartPolicyNameEnum::NO => "no",
RestartPolicyNameEnum::ALWAYS => "always",
RestartPolicyNameEnum::UNLESS_STOPPED => "unless-stopped",
RestartPolicyNameEnum::ON_FAILURE => "on-failure",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Runtime {
#[serde(rename = "path")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<String>,
#[serde(rename = "runtimeArgs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub runtime_args: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Secret {
#[serde(rename = "ID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<ObjectVersion>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub created_at: Option<BollardDate>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub updated_at: Option<BollardDate>,
#[serde(rename = "Spec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spec: Option<SecretSpec>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SecretSpec {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
#[serde(rename = "Data")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<String>,
#[serde(rename = "Driver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub driver: Option<Driver>,
#[serde(rename = "Templating")]
#[serde(skip_serializing_if = "Option::is_none")]
pub templating: Option<Driver>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Service {
#[serde(rename = "ID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<ObjectVersion>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub created_at: Option<BollardDate>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub updated_at: Option<BollardDate>,
#[serde(rename = "Spec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spec: Option<ServiceSpec>,
#[serde(rename = "Endpoint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint: Option<ServiceEndpoint>,
#[serde(rename = "UpdateStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub update_status: Option<ServiceUpdateStatus>,
#[serde(rename = "ServiceStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_status: Option<ServiceServiceStatus>,
#[serde(rename = "JobStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_status: Option<ServiceJobStatus>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ServiceCreateResponse {
#[serde(rename = "ID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Warning")]
#[serde(skip_serializing_if = "Option::is_none")]
pub warning: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ServiceEndpoint {
#[serde(rename = "Spec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spec: Option<EndpointSpec>,
#[serde(rename = "Ports")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ports: Option<Vec<EndpointPortConfig>>,
#[serde(rename = "VirtualIPs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub virtual_i_ps: Option<Vec<ServiceEndpointVirtualIPs>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ServiceEndpointVirtualIPs {
#[serde(rename = "NetworkID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_id: Option<String>,
#[serde(rename = "Addr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub addr: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ServiceJobStatus {
#[serde(rename = "JobIteration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_iteration: Option<ObjectVersion>,
#[serde(rename = "LastExecution")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub last_execution: Option<BollardDate>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ServiceServiceStatus {
#[serde(rename = "RunningTasks")]
#[serde(skip_serializing_if = "Option::is_none")]
pub running_tasks: Option<u64>,
#[serde(rename = "DesiredTasks")]
#[serde(skip_serializing_if = "Option::is_none")]
pub desired_tasks: Option<u64>,
#[serde(rename = "CompletedTasks")]
#[serde(skip_serializing_if = "Option::is_none")]
pub completed_tasks: Option<u64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ServiceSpec {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
#[serde(rename = "TaskTemplate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_template: Option<TaskSpec>,
#[serde(rename = "Mode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mode: Option<ServiceSpecMode>,
#[serde(rename = "UpdateConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub update_config: Option<ServiceSpecUpdateConfig>,
#[serde(rename = "RollbackConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rollback_config: Option<ServiceSpecRollbackConfig>,
#[serde(rename = "Networks")]
#[serde(skip_serializing_if = "Option::is_none")]
pub networks: Option<Vec<NetworkAttachmentConfig>>,
#[serde(rename = "EndpointSpec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_spec: Option<EndpointSpec>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ServiceSpecMode {
#[serde(rename = "Replicated")]
#[serde(skip_serializing_if = "Option::is_none")]
pub replicated: Option<ServiceSpecModeReplicated>,
#[serde(rename = "Global")]
#[serde(skip_serializing_if = "Option::is_none")]
pub global: Option<HashMap<(), ()>>,
#[serde(rename = "ReplicatedJob")]
#[serde(skip_serializing_if = "Option::is_none")]
pub replicated_job: Option<ServiceSpecModeReplicatedJob>,
#[serde(rename = "GlobalJob")]
#[serde(skip_serializing_if = "Option::is_none")]
pub global_job: Option<HashMap<(), ()>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ServiceSpecModeReplicated {
#[serde(rename = "Replicas")]
#[serde(skip_serializing_if = "Option::is_none")]
pub replicas: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ServiceSpecModeReplicatedJob {
#[serde(rename = "MaxConcurrent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_concurrent: Option<i64>,
#[serde(rename = "TotalCompletions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_completions: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ServiceSpecRollbackConfig {
#[serde(rename = "Parallelism")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parallelism: Option<i64>,
#[serde(rename = "Delay")]
#[serde(skip_serializing_if = "Option::is_none")]
pub delay: Option<i64>,
#[serde(rename = "FailureAction")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_action: Option<ServiceSpecRollbackConfigFailureActionEnum>,
#[serde(rename = "Monitor")]
#[serde(skip_serializing_if = "Option::is_none")]
pub monitor: Option<i64>,
#[serde(rename = "MaxFailureRatio")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_failure_ratio: Option<f64>,
#[serde(rename = "Order")]
#[serde(skip_serializing_if = "Option::is_none")]
pub order: Option<ServiceSpecRollbackConfigOrderEnum>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum ServiceSpecRollbackConfigFailureActionEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "continue")]
CONTINUE,
#[serde(rename = "pause")]
PAUSE,
}
impl ::std::fmt::Display for ServiceSpecRollbackConfigFailureActionEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
ServiceSpecRollbackConfigFailureActionEnum::EMPTY => write!(f, ""),
ServiceSpecRollbackConfigFailureActionEnum::CONTINUE => write!(f, "{}", "continue"),
ServiceSpecRollbackConfigFailureActionEnum::PAUSE => write!(f, "{}", "pause"),
}
}
}
impl ::std::str::FromStr for ServiceSpecRollbackConfigFailureActionEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(ServiceSpecRollbackConfigFailureActionEnum::EMPTY),
"continue" => Ok(ServiceSpecRollbackConfigFailureActionEnum::CONTINUE),
"pause" => Ok(ServiceSpecRollbackConfigFailureActionEnum::PAUSE),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for ServiceSpecRollbackConfigFailureActionEnum {
fn as_ref(&self) -> &str {
match self {
ServiceSpecRollbackConfigFailureActionEnum::EMPTY => "",
ServiceSpecRollbackConfigFailureActionEnum::CONTINUE => "continue",
ServiceSpecRollbackConfigFailureActionEnum::PAUSE => "pause",
}
}
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum ServiceSpecRollbackConfigOrderEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "stop-first")]
STOP_FIRST,
#[serde(rename = "start-first")]
START_FIRST,
}
impl ::std::fmt::Display for ServiceSpecRollbackConfigOrderEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
ServiceSpecRollbackConfigOrderEnum::EMPTY => write!(f, ""),
ServiceSpecRollbackConfigOrderEnum::STOP_FIRST => write!(f, "{}", "stop-first"),
ServiceSpecRollbackConfigOrderEnum::START_FIRST => write!(f, "{}", "start-first"),
}
}
}
impl ::std::str::FromStr for ServiceSpecRollbackConfigOrderEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(ServiceSpecRollbackConfigOrderEnum::EMPTY),
"stop-first" => Ok(ServiceSpecRollbackConfigOrderEnum::STOP_FIRST),
"start-first" => Ok(ServiceSpecRollbackConfigOrderEnum::START_FIRST),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for ServiceSpecRollbackConfigOrderEnum {
fn as_ref(&self) -> &str {
match self {
ServiceSpecRollbackConfigOrderEnum::EMPTY => "",
ServiceSpecRollbackConfigOrderEnum::STOP_FIRST => "stop-first",
ServiceSpecRollbackConfigOrderEnum::START_FIRST => "start-first",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ServiceSpecUpdateConfig {
#[serde(rename = "Parallelism")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parallelism: Option<i64>,
#[serde(rename = "Delay")]
#[serde(skip_serializing_if = "Option::is_none")]
pub delay: Option<i64>,
#[serde(rename = "FailureAction")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_action: Option<ServiceSpecUpdateConfigFailureActionEnum>,
#[serde(rename = "Monitor")]
#[serde(skip_serializing_if = "Option::is_none")]
pub monitor: Option<i64>,
#[serde(rename = "MaxFailureRatio")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_failure_ratio: Option<f64>,
#[serde(rename = "Order")]
#[serde(skip_serializing_if = "Option::is_none")]
pub order: Option<ServiceSpecUpdateConfigOrderEnum>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum ServiceSpecUpdateConfigFailureActionEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "continue")]
CONTINUE,
#[serde(rename = "pause")]
PAUSE,
#[serde(rename = "rollback")]
ROLLBACK,
}
impl ::std::fmt::Display for ServiceSpecUpdateConfigFailureActionEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
ServiceSpecUpdateConfigFailureActionEnum::EMPTY => write!(f, ""),
ServiceSpecUpdateConfigFailureActionEnum::CONTINUE => write!(f, "{}", "continue"),
ServiceSpecUpdateConfigFailureActionEnum::PAUSE => write!(f, "{}", "pause"),
ServiceSpecUpdateConfigFailureActionEnum::ROLLBACK => write!(f, "{}", "rollback"),
}
}
}
impl ::std::str::FromStr for ServiceSpecUpdateConfigFailureActionEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(ServiceSpecUpdateConfigFailureActionEnum::EMPTY),
"continue" => Ok(ServiceSpecUpdateConfigFailureActionEnum::CONTINUE),
"pause" => Ok(ServiceSpecUpdateConfigFailureActionEnum::PAUSE),
"rollback" => Ok(ServiceSpecUpdateConfigFailureActionEnum::ROLLBACK),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for ServiceSpecUpdateConfigFailureActionEnum {
fn as_ref(&self) -> &str {
match self {
ServiceSpecUpdateConfigFailureActionEnum::EMPTY => "",
ServiceSpecUpdateConfigFailureActionEnum::CONTINUE => "continue",
ServiceSpecUpdateConfigFailureActionEnum::PAUSE => "pause",
ServiceSpecUpdateConfigFailureActionEnum::ROLLBACK => "rollback",
}
}
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum ServiceSpecUpdateConfigOrderEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "stop-first")]
STOP_FIRST,
#[serde(rename = "start-first")]
START_FIRST,
}
impl ::std::fmt::Display for ServiceSpecUpdateConfigOrderEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
ServiceSpecUpdateConfigOrderEnum::EMPTY => write!(f, ""),
ServiceSpecUpdateConfigOrderEnum::STOP_FIRST => write!(f, "{}", "stop-first"),
ServiceSpecUpdateConfigOrderEnum::START_FIRST => write!(f, "{}", "start-first"),
}
}
}
impl ::std::str::FromStr for ServiceSpecUpdateConfigOrderEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(ServiceSpecUpdateConfigOrderEnum::EMPTY),
"stop-first" => Ok(ServiceSpecUpdateConfigOrderEnum::STOP_FIRST),
"start-first" => Ok(ServiceSpecUpdateConfigOrderEnum::START_FIRST),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for ServiceSpecUpdateConfigOrderEnum {
fn as_ref(&self) -> &str {
match self {
ServiceSpecUpdateConfigOrderEnum::EMPTY => "",
ServiceSpecUpdateConfigOrderEnum::STOP_FIRST => "stop-first",
ServiceSpecUpdateConfigOrderEnum::START_FIRST => "start-first",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ServiceUpdateResponse {
#[serde(rename = "Warnings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub warnings: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ServiceUpdateStatus {
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<ServiceUpdateStatusStateEnum>,
#[serde(rename = "StartedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub started_at: Option<BollardDate>,
#[serde(rename = "CompletedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub completed_at: Option<BollardDate>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum ServiceUpdateStatusStateEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "updating")]
UPDATING,
#[serde(rename = "paused")]
PAUSED,
#[serde(rename = "completed")]
COMPLETED,
#[serde(rename = "rollback_started")]
ROLLBACK_STARTED,
#[serde(rename = "rollback_paused")]
ROLLBACK_PAUSED,
#[serde(rename = "rollback_completed")]
ROLLBACK_COMPLETED,
}
impl ::std::fmt::Display for ServiceUpdateStatusStateEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
ServiceUpdateStatusStateEnum::EMPTY => write!(f, ""),
ServiceUpdateStatusStateEnum::UPDATING => write!(f, "{}", "updating"),
ServiceUpdateStatusStateEnum::PAUSED => write!(f, "{}", "paused"),
ServiceUpdateStatusStateEnum::COMPLETED => write!(f, "{}", "completed"),
ServiceUpdateStatusStateEnum::ROLLBACK_STARTED => write!(f, "{}", "rollback_started"),
ServiceUpdateStatusStateEnum::ROLLBACK_PAUSED => write!(f, "{}", "rollback_paused"),
ServiceUpdateStatusStateEnum::ROLLBACK_COMPLETED => write!(f, "{}", "rollback_completed"),
}
}
}
impl ::std::str::FromStr for ServiceUpdateStatusStateEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(ServiceUpdateStatusStateEnum::EMPTY),
"updating" => Ok(ServiceUpdateStatusStateEnum::UPDATING),
"paused" => Ok(ServiceUpdateStatusStateEnum::PAUSED),
"completed" => Ok(ServiceUpdateStatusStateEnum::COMPLETED),
"rollback_started" => Ok(ServiceUpdateStatusStateEnum::ROLLBACK_STARTED),
"rollback_paused" => Ok(ServiceUpdateStatusStateEnum::ROLLBACK_PAUSED),
"rollback_completed" => Ok(ServiceUpdateStatusStateEnum::ROLLBACK_COMPLETED),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for ServiceUpdateStatusStateEnum {
fn as_ref(&self) -> &str {
match self {
ServiceUpdateStatusStateEnum::EMPTY => "",
ServiceUpdateStatusStateEnum::UPDATING => "updating",
ServiceUpdateStatusStateEnum::PAUSED => "paused",
ServiceUpdateStatusStateEnum::COMPLETED => "completed",
ServiceUpdateStatusStateEnum::ROLLBACK_STARTED => "rollback_started",
ServiceUpdateStatusStateEnum::ROLLBACK_PAUSED => "rollback_paused",
ServiceUpdateStatusStateEnum::ROLLBACK_COMPLETED => "rollback_completed",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Swarm {
#[serde(rename = "ID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<ObjectVersion>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub created_at: Option<BollardDate>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub updated_at: Option<BollardDate>,
#[serde(rename = "Spec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spec: Option<SwarmSpec>,
#[serde(rename = "TLSInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tls_info: Option<TlsInfo>,
#[serde(rename = "RootRotationInProgress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub root_rotation_in_progress: Option<bool>,
#[serde(rename = "DataPathPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_path_port: Option<u32>,
#[serde(rename = "DefaultAddrPool")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_addr_pool: Option<Vec<String>>,
#[serde(rename = "SubnetSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_size: Option<u32>,
#[serde(rename = "JoinTokens")]
#[serde(skip_serializing_if = "Option::is_none")]
pub join_tokens: Option<JoinTokens>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SwarmInfo {
#[serde(rename = "NodeID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_id: Option<String>,
#[serde(rename = "NodeAddr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_addr: Option<String>,
#[serde(rename = "LocalNodeState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub local_node_state: Option<LocalNodeState>,
#[serde(rename = "ControlAvailable")]
#[serde(skip_serializing_if = "Option::is_none")]
pub control_available: Option<bool>,
#[serde(rename = "Error")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "RemoteManagers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_managers: Option<Vec<PeerNode>>,
#[serde(rename = "Nodes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub nodes: Option<i64>,
#[serde(rename = "Managers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub managers: Option<i64>,
#[serde(rename = "Cluster")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster: Option<ClusterInfo>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SwarmInitRequest {
#[serde(rename = "ListenAddr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub listen_addr: Option<String>,
#[serde(rename = "AdvertiseAddr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub advertise_addr: Option<String>,
#[serde(rename = "DataPathAddr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_path_addr: Option<String>,
#[serde(rename = "DataPathPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_path_port: Option<u32>,
#[serde(rename = "DefaultAddrPool")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_addr_pool: Option<Vec<String>>,
#[serde(rename = "ForceNewCluster")]
#[serde(skip_serializing_if = "Option::is_none")]
pub force_new_cluster: Option<bool>,
#[serde(rename = "SubnetSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_size: Option<u32>,
#[serde(rename = "Spec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spec: Option<SwarmSpec>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SwarmJoinRequest {
#[serde(rename = "ListenAddr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub listen_addr: Option<String>,
#[serde(rename = "AdvertiseAddr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub advertise_addr: Option<String>,
#[serde(rename = "DataPathAddr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_path_addr: Option<String>,
#[serde(rename = "RemoteAddrs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_addrs: Option<Vec<String>>,
#[serde(rename = "JoinToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub join_token: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SwarmSpec {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
#[serde(rename = "Orchestration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub orchestration: Option<SwarmSpecOrchestration>,
#[serde(rename = "Raft")]
#[serde(skip_serializing_if = "Option::is_none")]
pub raft: Option<SwarmSpecRaft>,
#[serde(rename = "Dispatcher")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dispatcher: Option<SwarmSpecDispatcher>,
#[serde(rename = "CAConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ca_config: Option<SwarmSpecCaConfig>,
#[serde(rename = "EncryptionConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption_config: Option<SwarmSpecEncryptionConfig>,
#[serde(rename = "TaskDefaults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_defaults: Option<SwarmSpecTaskDefaults>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SwarmSpecCaConfig {
#[serde(rename = "NodeCertExpiry")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_cert_expiry: Option<i64>,
#[serde(rename = "ExternalCAs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub external_cas: Option<Vec<SwarmSpecCaConfigExternalCAs>>,
#[serde(rename = "SigningCACert")]
#[serde(skip_serializing_if = "Option::is_none")]
pub signing_ca_cert: Option<String>,
#[serde(rename = "SigningCAKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub signing_ca_key: Option<String>,
#[serde(rename = "ForceRotate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub force_rotate: Option<u64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SwarmSpecCaConfigExternalCAs {
#[serde(rename = "Protocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol: Option<SwarmSpecCaConfigExternalCAsProtocolEnum>,
#[serde(rename = "URL")]
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[serde(rename = "Options")]
#[serde(skip_serializing_if = "Option::is_none")]
pub options: Option<HashMap<String, String>>,
#[serde(rename = "CACert")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ca_cert: Option<String>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum SwarmSpecCaConfigExternalCAsProtocolEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "cfssl")]
CFSSL,
}
impl ::std::fmt::Display for SwarmSpecCaConfigExternalCAsProtocolEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
SwarmSpecCaConfigExternalCAsProtocolEnum::EMPTY => write!(f, ""),
SwarmSpecCaConfigExternalCAsProtocolEnum::CFSSL => write!(f, "{}", "cfssl"),
}
}
}
impl ::std::str::FromStr for SwarmSpecCaConfigExternalCAsProtocolEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(SwarmSpecCaConfigExternalCAsProtocolEnum::EMPTY),
"cfssl" => Ok(SwarmSpecCaConfigExternalCAsProtocolEnum::CFSSL),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for SwarmSpecCaConfigExternalCAsProtocolEnum {
fn as_ref(&self) -> &str {
match self {
SwarmSpecCaConfigExternalCAsProtocolEnum::EMPTY => "",
SwarmSpecCaConfigExternalCAsProtocolEnum::CFSSL => "cfssl",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SwarmSpecDispatcher {
#[serde(rename = "HeartbeatPeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub heartbeat_period: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SwarmSpecEncryptionConfig {
#[serde(rename = "AutoLockManagers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_lock_managers: Option<bool>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SwarmSpecOrchestration {
#[serde(rename = "TaskHistoryRetentionLimit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_history_retention_limit: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SwarmSpecRaft {
#[serde(rename = "SnapshotInterval")]
#[serde(skip_serializing_if = "Option::is_none")]
pub snapshot_interval: Option<u64>,
#[serde(rename = "KeepOldSnapshots")]
#[serde(skip_serializing_if = "Option::is_none")]
pub keep_old_snapshots: Option<u64>,
#[serde(rename = "LogEntriesForSlowFollowers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_entries_for_slow_followers: Option<u64>,
#[serde(rename = "ElectionTick")]
#[serde(skip_serializing_if = "Option::is_none")]
pub election_tick: Option<i64>,
#[serde(rename = "HeartbeatTick")]
#[serde(skip_serializing_if = "Option::is_none")]
pub heartbeat_tick: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SwarmSpecTaskDefaults {
#[serde(rename = "LogDriver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_driver: Option<SwarmSpecTaskDefaultsLogDriver>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SwarmSpecTaskDefaultsLogDriver {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Options")]
#[serde(skip_serializing_if = "Option::is_none")]
pub options: Option<HashMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SwarmUnlockRequest {
#[serde(rename = "UnlockKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unlock_key: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SystemAuthResponse {
#[serde(rename = "Status")]
pub status: String,
#[serde(rename = "IdentityToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_token: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SystemDataUsageResponse {
#[serde(rename = "LayersSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub layers_size: Option<i64>,
#[serde(rename = "Images")]
#[serde(skip_serializing_if = "Option::is_none")]
pub images: Option<Vec<ImageSummary>>,
#[serde(rename = "Containers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub containers: Option<Vec<ContainerSummary>>,
#[serde(rename = "Volumes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volumes: Option<Vec<Volume>>,
#[serde(rename = "BuildCache")]
#[serde(skip_serializing_if = "Option::is_none")]
pub build_cache: Option<Vec<BuildCache>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SystemInfo {
#[serde(rename = "ID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Containers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub containers: Option<i64>,
#[serde(rename = "ContainersRunning")]
#[serde(skip_serializing_if = "Option::is_none")]
pub containers_running: Option<i64>,
#[serde(rename = "ContainersPaused")]
#[serde(skip_serializing_if = "Option::is_none")]
pub containers_paused: Option<i64>,
#[serde(rename = "ContainersStopped")]
#[serde(skip_serializing_if = "Option::is_none")]
pub containers_stopped: Option<i64>,
#[serde(rename = "Images")]
#[serde(skip_serializing_if = "Option::is_none")]
pub images: Option<i64>,
#[serde(rename = "Driver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub driver: Option<String>,
#[serde(rename = "DriverStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub driver_status: Option<Vec<Vec<String>>>,
#[serde(rename = "DockerRootDir")]
#[serde(skip_serializing_if = "Option::is_none")]
pub docker_root_dir: Option<String>,
#[serde(rename = "Plugins")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plugins: Option<PluginsInfo>,
#[serde(rename = "MemoryLimit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub memory_limit: Option<bool>,
#[serde(rename = "SwapLimit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swap_limit: Option<bool>,
#[serde(rename = "KernelMemory")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kernel_memory: Option<bool>,
#[serde(rename = "KernelMemoryTCP")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kernel_memory_tcp: Option<bool>,
#[serde(rename = "CpuCfsPeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_cfs_period: Option<bool>,
#[serde(rename = "CpuCfsQuota")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_cfs_quota: Option<bool>,
#[serde(rename = "CPUShares")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_shares: Option<bool>,
#[serde(rename = "CPUSet")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cpu_set: Option<bool>,
#[serde(rename = "PidsLimit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pids_limit: Option<bool>,
#[serde(rename = "OomKillDisable")]
#[serde(skip_serializing_if = "Option::is_none")]
pub oom_kill_disable: Option<bool>,
#[serde(rename = "IPv4Forwarding")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipv4_forwarding: Option<bool>,
#[serde(rename = "BridgeNfIptables")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bridge_nf_iptables: Option<bool>,
#[serde(rename = "BridgeNfIp6tables")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bridge_nf_ip6tables: Option<bool>,
#[serde(rename = "Debug")]
#[serde(skip_serializing_if = "Option::is_none")]
pub debug: Option<bool>,
#[serde(rename = "NFd")]
#[serde(skip_serializing_if = "Option::is_none")]
pub n_fd: Option<i64>,
#[serde(rename = "NGoroutines")]
#[serde(skip_serializing_if = "Option::is_none")]
pub n_goroutines: Option<i64>,
#[serde(rename = "SystemTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub system_time: Option<String>,
#[serde(rename = "LoggingDriver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub logging_driver: Option<String>,
#[serde(rename = "CgroupDriver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cgroup_driver: Option<SystemInfoCgroupDriverEnum>,
#[serde(rename = "CgroupVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cgroup_version: Option<SystemInfoCgroupVersionEnum>,
#[serde(rename = "NEventsListener")]
#[serde(skip_serializing_if = "Option::is_none")]
pub n_events_listener: Option<i64>,
#[serde(rename = "KernelVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kernel_version: Option<String>,
#[serde(rename = "OperatingSystem")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operating_system: Option<String>,
#[serde(rename = "OSVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub os_version: Option<String>,
#[serde(rename = "OSType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub os_type: Option<String>,
#[serde(rename = "Architecture")]
#[serde(skip_serializing_if = "Option::is_none")]
pub architecture: Option<String>,
#[serde(rename = "NCPU")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ncpu: Option<i64>,
#[serde(rename = "MemTotal")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mem_total: Option<i64>,
#[serde(rename = "IndexServerAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub index_server_address: Option<String>,
#[serde(rename = "RegistryConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry_config: Option<RegistryServiceConfig>,
#[serde(rename = "GenericResources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub generic_resources: Option<GenericResources>,
#[serde(rename = "HttpProxy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub http_proxy: Option<String>,
#[serde(rename = "HttpsProxy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub https_proxy: Option<String>,
#[serde(rename = "NoProxy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub no_proxy: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<String>>,
#[serde(rename = "ExperimentalBuild")]
#[serde(skip_serializing_if = "Option::is_none")]
pub experimental_build: Option<bool>,
#[serde(rename = "ServerVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub server_version: Option<String>,
#[serde(rename = "ClusterStore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_store: Option<String>,
#[serde(rename = "ClusterAdvertise")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_advertise: Option<String>,
#[serde(rename = "Runtimes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub runtimes: Option<HashMap<String, Runtime>>,
#[serde(rename = "DefaultRuntime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_runtime: Option<String>,
#[serde(rename = "Swarm")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm: Option<SwarmInfo>,
#[serde(rename = "LiveRestoreEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub live_restore_enabled: Option<bool>,
#[serde(rename = "Isolation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub isolation: Option<SystemInfoIsolationEnum>,
#[serde(rename = "InitBinary")]
#[serde(skip_serializing_if = "Option::is_none")]
pub init_binary: Option<String>,
#[serde(rename = "ContainerdCommit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub containerd_commit: Option<Commit>,
#[serde(rename = "RuncCommit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub runc_commit: Option<Commit>,
#[serde(rename = "InitCommit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub init_commit: Option<Commit>,
#[serde(rename = "SecurityOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_options: Option<Vec<String>>,
#[serde(rename = "ProductLicense")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_license: Option<String>,
#[serde(rename = "DefaultAddressPools")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_address_pools: Option<Vec<SystemInfoDefaultAddressPools>>,
#[serde(rename = "Warnings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub warnings: Option<Vec<String>>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum SystemInfoCgroupDriverEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "cgroupfs")]
CGROUPFS,
#[serde(rename = "systemd")]
SYSTEMD,
#[serde(rename = "none")]
NONE,
}
impl ::std::fmt::Display for SystemInfoCgroupDriverEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
SystemInfoCgroupDriverEnum::EMPTY => write!(f, ""),
SystemInfoCgroupDriverEnum::CGROUPFS => write!(f, "{}", "cgroupfs"),
SystemInfoCgroupDriverEnum::SYSTEMD => write!(f, "{}", "systemd"),
SystemInfoCgroupDriverEnum::NONE => write!(f, "{}", "none"),
}
}
}
impl ::std::str::FromStr for SystemInfoCgroupDriverEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(SystemInfoCgroupDriverEnum::EMPTY),
"cgroupfs" => Ok(SystemInfoCgroupDriverEnum::CGROUPFS),
"systemd" => Ok(SystemInfoCgroupDriverEnum::SYSTEMD),
"none" => Ok(SystemInfoCgroupDriverEnum::NONE),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for SystemInfoCgroupDriverEnum {
fn as_ref(&self) -> &str {
match self {
SystemInfoCgroupDriverEnum::EMPTY => "",
SystemInfoCgroupDriverEnum::CGROUPFS => "cgroupfs",
SystemInfoCgroupDriverEnum::SYSTEMD => "systemd",
SystemInfoCgroupDriverEnum::NONE => "none",
}
}
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum SystemInfoCgroupVersionEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "1")]
_1,
#[serde(rename = "2")]
_2,
}
impl ::std::fmt::Display for SystemInfoCgroupVersionEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
SystemInfoCgroupVersionEnum::EMPTY => write!(f, ""),
SystemInfoCgroupVersionEnum::_1 => write!(f, "{}", "1"),
SystemInfoCgroupVersionEnum::_2 => write!(f, "{}", "2"),
}
}
}
impl ::std::str::FromStr for SystemInfoCgroupVersionEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(SystemInfoCgroupVersionEnum::EMPTY),
"1" => Ok(SystemInfoCgroupVersionEnum::_1),
"2" => Ok(SystemInfoCgroupVersionEnum::_2),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for SystemInfoCgroupVersionEnum {
fn as_ref(&self) -> &str {
match self {
SystemInfoCgroupVersionEnum::EMPTY => "",
SystemInfoCgroupVersionEnum::_1 => "1",
SystemInfoCgroupVersionEnum::_2 => "2",
}
}
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum SystemInfoIsolationEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "default")]
DEFAULT,
#[serde(rename = "hyperv")]
HYPERV,
#[serde(rename = "process")]
PROCESS,
}
impl ::std::fmt::Display for SystemInfoIsolationEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
SystemInfoIsolationEnum::EMPTY => write!(f, ""),
SystemInfoIsolationEnum::DEFAULT => write!(f, "{}", "default"),
SystemInfoIsolationEnum::HYPERV => write!(f, "{}", "hyperv"),
SystemInfoIsolationEnum::PROCESS => write!(f, "{}", "process"),
}
}
}
impl ::std::str::FromStr for SystemInfoIsolationEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(SystemInfoIsolationEnum::EMPTY),
"default" => Ok(SystemInfoIsolationEnum::DEFAULT),
"hyperv" => Ok(SystemInfoIsolationEnum::HYPERV),
"process" => Ok(SystemInfoIsolationEnum::PROCESS),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for SystemInfoIsolationEnum {
fn as_ref(&self) -> &str {
match self {
SystemInfoIsolationEnum::EMPTY => "",
SystemInfoIsolationEnum::DEFAULT => "default",
SystemInfoIsolationEnum::HYPERV => "hyperv",
SystemInfoIsolationEnum::PROCESS => "process",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SystemInfoDefaultAddressPools {
#[serde(rename = "Base")]
#[serde(skip_serializing_if = "Option::is_none")]
pub base: Option<String>,
#[serde(rename = "Size")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SystemVersion {
#[serde(rename = "Platform")]
#[serde(skip_serializing_if = "Option::is_none")]
pub platform: Option<SystemVersionPlatform>,
#[serde(rename = "Components")]
#[serde(skip_serializing_if = "Option::is_none")]
pub components: Option<Vec<SystemVersionComponents>>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
#[serde(rename = "ApiVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub api_version: Option<String>,
#[serde(rename = "MinAPIVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub min_api_version: Option<String>,
#[serde(rename = "GitCommit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub git_commit: Option<String>,
#[serde(rename = "GoVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub go_version: Option<String>,
#[serde(rename = "Os")]
#[serde(skip_serializing_if = "Option::is_none")]
pub os: Option<String>,
#[serde(rename = "Arch")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arch: Option<String>,
#[serde(rename = "KernelVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kernel_version: Option<String>,
#[serde(rename = "Experimental")]
#[serde(skip_serializing_if = "Option::is_none")]
pub experimental: Option<bool>,
#[serde(rename = "BuildTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub build_time: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SystemVersionComponents {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Version")]
pub version: String,
#[serde(rename = "Details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub details: Option<HashMap<(), ()>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SystemVersionPlatform {
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Task {
#[serde(rename = "ID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<ObjectVersion>,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub created_at: Option<BollardDate>,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub updated_at: Option<BollardDate>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
#[serde(rename = "Spec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spec: Option<TaskSpec>,
#[serde(rename = "ServiceID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_id: Option<String>,
#[serde(rename = "Slot")]
#[serde(skip_serializing_if = "Option::is_none")]
pub slot: Option<i64>,
#[serde(rename = "NodeID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_id: Option<String>,
#[serde(rename = "AssignedGenericResources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assigned_generic_resources: Option<GenericResources>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<TaskStatus>,
#[serde(rename = "DesiredState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub desired_state: Option<TaskState>,
#[serde(rename = "JobIteration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub job_iteration: Option<ObjectVersion>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpec {
#[serde(rename = "PluginSpec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plugin_spec: Option<TaskSpecPluginSpec>,
#[serde(rename = "ContainerSpec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub container_spec: Option<TaskSpecContainerSpec>,
#[serde(rename = "NetworkAttachmentSpec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_attachment_spec: Option<TaskSpecNetworkAttachmentSpec>,
#[serde(rename = "Resources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resources: Option<TaskSpecResources>,
#[serde(rename = "RestartPolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub restart_policy: Option<TaskSpecRestartPolicy>,
#[serde(rename = "Placement")]
#[serde(skip_serializing_if = "Option::is_none")]
pub placement: Option<TaskSpecPlacement>,
#[serde(rename = "ForceUpdate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub force_update: Option<i64>,
#[serde(rename = "Runtime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub runtime: Option<String>,
#[serde(rename = "Networks")]
#[serde(skip_serializing_if = "Option::is_none")]
pub networks: Option<Vec<NetworkAttachmentConfig>>,
#[serde(rename = "LogDriver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_driver: Option<TaskSpecLogDriver>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecContainerSpec {
#[serde(rename = "Image")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
#[serde(rename = "Command")]
#[serde(skip_serializing_if = "Option::is_none")]
pub command: Option<Vec<String>>,
#[serde(rename = "Args")]
#[serde(skip_serializing_if = "Option::is_none")]
pub args: Option<Vec<String>>,
#[serde(rename = "Hostname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hostname: Option<String>,
#[serde(rename = "Env")]
#[serde(skip_serializing_if = "Option::is_none")]
pub env: Option<Vec<String>>,
#[serde(rename = "Dir")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dir: Option<String>,
#[serde(rename = "User")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user: Option<String>,
#[serde(rename = "Groups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub groups: Option<Vec<String>>,
#[serde(rename = "Privileges")]
#[serde(skip_serializing_if = "Option::is_none")]
pub privileges: Option<TaskSpecContainerSpecPrivileges>,
#[serde(rename = "TTY")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tty: Option<bool>,
#[serde(rename = "OpenStdin")]
#[serde(skip_serializing_if = "Option::is_none")]
pub open_stdin: Option<bool>,
#[serde(rename = "ReadOnly")]
#[serde(skip_serializing_if = "Option::is_none")]
pub read_only: Option<bool>,
#[serde(rename = "Mounts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mounts: Option<Vec<Mount>>,
#[serde(rename = "StopSignal")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stop_signal: Option<String>,
#[serde(rename = "StopGracePeriod")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stop_grace_period: Option<i64>,
#[serde(rename = "HealthCheck")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check: Option<HealthConfig>,
#[serde(rename = "Hosts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hosts: Option<Vec<String>>,
#[serde(rename = "DNSConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dns_config: Option<TaskSpecContainerSpecDnsConfig>,
#[serde(rename = "Secrets")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secrets: Option<Vec<TaskSpecContainerSpecSecrets>>,
#[serde(rename = "Configs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configs: Option<Vec<TaskSpecContainerSpecConfigs>>,
#[serde(rename = "Isolation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub isolation: Option<TaskSpecContainerSpecIsolationEnum>,
#[serde(rename = "Init")]
#[serde(skip_serializing_if = "Option::is_none")]
pub init: Option<bool>,
#[serde(rename = "Sysctls")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sysctls: Option<HashMap<String, String>>,
#[serde(rename = "CapabilityAdd")]
#[serde(skip_serializing_if = "Option::is_none")]
pub capability_add: Option<Vec<String>>,
#[serde(rename = "CapabilityDrop")]
#[serde(skip_serializing_if = "Option::is_none")]
pub capability_drop: Option<Vec<String>>,
#[serde(rename = "Ulimits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ulimits: Option<Vec<ResourcesUlimits>>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum TaskSpecContainerSpecIsolationEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "default")]
DEFAULT,
#[serde(rename = "process")]
PROCESS,
#[serde(rename = "hyperv")]
HYPERV,
}
impl ::std::fmt::Display for TaskSpecContainerSpecIsolationEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
TaskSpecContainerSpecIsolationEnum::EMPTY => write!(f, ""),
TaskSpecContainerSpecIsolationEnum::DEFAULT => write!(f, "{}", "default"),
TaskSpecContainerSpecIsolationEnum::PROCESS => write!(f, "{}", "process"),
TaskSpecContainerSpecIsolationEnum::HYPERV => write!(f, "{}", "hyperv"),
}
}
}
impl ::std::str::FromStr for TaskSpecContainerSpecIsolationEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(TaskSpecContainerSpecIsolationEnum::EMPTY),
"default" => Ok(TaskSpecContainerSpecIsolationEnum::DEFAULT),
"process" => Ok(TaskSpecContainerSpecIsolationEnum::PROCESS),
"hyperv" => Ok(TaskSpecContainerSpecIsolationEnum::HYPERV),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for TaskSpecContainerSpecIsolationEnum {
fn as_ref(&self) -> &str {
match self {
TaskSpecContainerSpecIsolationEnum::EMPTY => "",
TaskSpecContainerSpecIsolationEnum::DEFAULT => "default",
TaskSpecContainerSpecIsolationEnum::PROCESS => "process",
TaskSpecContainerSpecIsolationEnum::HYPERV => "hyperv",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecContainerSpecConfigs {
#[serde(rename = "File")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file: Option<TaskSpecContainerSpecFile1>,
#[serde(rename = "Runtime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub runtime: Option<HashMap<(), ()>>,
#[serde(rename = "ConfigID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_id: Option<String>,
#[serde(rename = "ConfigName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_name: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecContainerSpecDnsConfig {
#[serde(rename = "Nameservers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub nameservers: Option<Vec<String>>,
#[serde(rename = "Search")]
#[serde(skip_serializing_if = "Option::is_none")]
pub search: Option<Vec<String>>,
#[serde(rename = "Options")]
#[serde(skip_serializing_if = "Option::is_none")]
pub options: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecContainerSpecFile {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "UID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uid: Option<String>,
#[serde(rename = "GID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gid: Option<String>,
#[serde(rename = "Mode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mode: Option<u32>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecContainerSpecFile1 {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "UID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uid: Option<String>,
#[serde(rename = "GID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub gid: Option<String>,
#[serde(rename = "Mode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mode: Option<u32>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecContainerSpecPrivileges {
#[serde(rename = "CredentialSpec")]
#[serde(skip_serializing_if = "Option::is_none")]
pub credential_spec: Option<TaskSpecContainerSpecPrivilegesCredentialSpec>,
#[serde(rename = "SELinuxContext")]
#[serde(skip_serializing_if = "Option::is_none")]
pub se_linux_context: Option<TaskSpecContainerSpecPrivilegesSeLinuxContext>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecContainerSpecPrivilegesCredentialSpec {
#[serde(rename = "Config")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config: Option<String>,
#[serde(rename = "File")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file: Option<String>,
#[serde(rename = "Registry")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registry: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecContainerSpecPrivilegesSeLinuxContext {
#[serde(rename = "Disable")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disable: Option<bool>,
#[serde(rename = "User")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user: Option<String>,
#[serde(rename = "Role")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub typ: Option<String>,
#[serde(rename = "Level")]
#[serde(skip_serializing_if = "Option::is_none")]
pub level: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecContainerSpecSecrets {
#[serde(rename = "File")]
#[serde(skip_serializing_if = "Option::is_none")]
pub file: Option<TaskSpecContainerSpecFile>,
#[serde(rename = "SecretID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secret_id: Option<String>,
#[serde(rename = "SecretName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub secret_name: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecLogDriver {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Options")]
#[serde(skip_serializing_if = "Option::is_none")]
pub options: Option<HashMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecNetworkAttachmentSpec {
#[serde(rename = "ContainerID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub container_id: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecPlacement {
#[serde(rename = "Constraints")]
#[serde(skip_serializing_if = "Option::is_none")]
pub constraints: Option<Vec<String>>,
#[serde(rename = "Preferences")]
#[serde(skip_serializing_if = "Option::is_none")]
pub preferences: Option<Vec<TaskSpecPlacementPreferences>>,
#[serde(rename = "MaxReplicas")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_replicas: Option<i64>,
#[serde(rename = "Platforms")]
#[serde(skip_serializing_if = "Option::is_none")]
pub platforms: Option<Vec<Platform>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecPlacementPreferences {
#[serde(rename = "Spread")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spread: Option<TaskSpecPlacementSpread>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecPlacementSpread {
#[serde(rename = "SpreadDescriptor")]
#[serde(skip_serializing_if = "Option::is_none")]
pub spread_descriptor: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecPluginSpec {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Remote")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote: Option<String>,
#[serde(rename = "Disabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disabled: Option<bool>,
#[serde(rename = "PluginPrivilege")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plugin_privilege: Option<Vec<PluginPrivilege>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecResources {
#[serde(rename = "Limits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limits: Option<Limit>,
#[serde(rename = "Reservations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reservations: Option<ResourceObject>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskSpecRestartPolicy {
#[serde(rename = "Condition")]
#[serde(skip_serializing_if = "Option::is_none")]
pub condition: Option<TaskSpecRestartPolicyConditionEnum>,
#[serde(rename = "Delay")]
#[serde(skip_serializing_if = "Option::is_none")]
pub delay: Option<i64>,
#[serde(rename = "MaxAttempts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_attempts: Option<i64>,
#[serde(rename = "Window")]
#[serde(skip_serializing_if = "Option::is_none")]
pub window: Option<i64>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum TaskSpecRestartPolicyConditionEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "none")]
NONE,
#[serde(rename = "on-failure")]
ON_FAILURE,
#[serde(rename = "any")]
ANY,
}
impl ::std::fmt::Display for TaskSpecRestartPolicyConditionEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
TaskSpecRestartPolicyConditionEnum::EMPTY => write!(f, ""),
TaskSpecRestartPolicyConditionEnum::NONE => write!(f, "{}", "none"),
TaskSpecRestartPolicyConditionEnum::ON_FAILURE => write!(f, "{}", "on-failure"),
TaskSpecRestartPolicyConditionEnum::ANY => write!(f, "{}", "any"),
}
}
}
impl ::std::str::FromStr for TaskSpecRestartPolicyConditionEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(TaskSpecRestartPolicyConditionEnum::EMPTY),
"none" => Ok(TaskSpecRestartPolicyConditionEnum::NONE),
"on-failure" => Ok(TaskSpecRestartPolicyConditionEnum::ON_FAILURE),
"any" => Ok(TaskSpecRestartPolicyConditionEnum::ANY),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for TaskSpecRestartPolicyConditionEnum {
fn as_ref(&self) -> &str {
match self {
TaskSpecRestartPolicyConditionEnum::EMPTY => "",
TaskSpecRestartPolicyConditionEnum::NONE => "none",
TaskSpecRestartPolicyConditionEnum::ON_FAILURE => "on-failure",
TaskSpecRestartPolicyConditionEnum::ANY => "any",
}
}
}
#[allow(non_camel_case_types)]
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum TaskState {
#[serde(rename = "new")]
NEW,
#[serde(rename = "allocated")]
ALLOCATED,
#[serde(rename = "pending")]
PENDING,
#[serde(rename = "assigned")]
ASSIGNED,
#[serde(rename = "accepted")]
ACCEPTED,
#[serde(rename = "preparing")]
PREPARING,
#[serde(rename = "ready")]
READY,
#[serde(rename = "starting")]
STARTING,
#[serde(rename = "running")]
RUNNING,
#[serde(rename = "complete")]
COMPLETE,
#[serde(rename = "shutdown")]
SHUTDOWN,
#[serde(rename = "failed")]
FAILED,
#[serde(rename = "rejected")]
REJECTED,
#[serde(rename = "remove")]
REMOVE,
#[serde(rename = "orphaned")]
ORPHANED,
}
impl ::std::fmt::Display for TaskState {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
TaskState::NEW => write!(f, "{}", "new"),
TaskState::ALLOCATED => write!(f, "{}", "allocated"),
TaskState::PENDING => write!(f, "{}", "pending"),
TaskState::ASSIGNED => write!(f, "{}", "assigned"),
TaskState::ACCEPTED => write!(f, "{}", "accepted"),
TaskState::PREPARING => write!(f, "{}", "preparing"),
TaskState::READY => write!(f, "{}", "ready"),
TaskState::STARTING => write!(f, "{}", "starting"),
TaskState::RUNNING => write!(f, "{}", "running"),
TaskState::COMPLETE => write!(f, "{}", "complete"),
TaskState::SHUTDOWN => write!(f, "{}", "shutdown"),
TaskState::FAILED => write!(f, "{}", "failed"),
TaskState::REJECTED => write!(f, "{}", "rejected"),
TaskState::REMOVE => write!(f, "{}", "remove"),
TaskState::ORPHANED => write!(f, "{}", "orphaned"),
}
}
}
impl ::std::str::FromStr for TaskState {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"new" => Ok(TaskState::NEW),
"allocated" => Ok(TaskState::ALLOCATED),
"pending" => Ok(TaskState::PENDING),
"assigned" => Ok(TaskState::ASSIGNED),
"accepted" => Ok(TaskState::ACCEPTED),
"preparing" => Ok(TaskState::PREPARING),
"ready" => Ok(TaskState::READY),
"starting" => Ok(TaskState::STARTING),
"running" => Ok(TaskState::RUNNING),
"complete" => Ok(TaskState::COMPLETE),
"shutdown" => Ok(TaskState::SHUTDOWN),
"failed" => Ok(TaskState::FAILED),
"rejected" => Ok(TaskState::REJECTED),
"remove" => Ok(TaskState::REMOVE),
"orphaned" => Ok(TaskState::ORPHANED),
_ => Err(()),
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskStatus {
#[serde(rename = "Timestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub timestamp: Option<BollardDate>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<TaskState>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "Err")]
#[serde(skip_serializing_if = "Option::is_none")]
pub err: Option<String>,
#[serde(rename = "ContainerStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub container_status: Option<TaskStatusContainerStatus>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TaskStatusContainerStatus {
#[serde(rename = "ContainerID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub container_id: Option<String>,
#[serde(rename = "PID")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pid: Option<i64>,
#[serde(rename = "ExitCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub exit_code: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ThrottleDevice {
#[serde(rename = "Path")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<String>,
#[serde(rename = "Rate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rate: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TlsInfo {
#[serde(rename = "TrustRoot")]
#[serde(skip_serializing_if = "Option::is_none")]
pub trust_root: Option<String>,
#[serde(rename = "CertIssuerSubject")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cert_issuer_subject: Option<String>,
#[serde(rename = "CertIssuerPublicKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cert_issuer_public_key: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct UnlockKeyResponse {
#[serde(rename = "UnlockKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unlock_key: Option<String>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Volume {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Driver")]
pub driver: String,
#[serde(rename = "Mountpoint")]
pub mountpoint: String,
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(
default,
deserialize_with = "deserialize_timestamp",
serialize_with = "serialize_timestamp"
)]
pub created_at: Option<BollardDate>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<HashMap<String, HashMap<(), ()>>>,
#[serde(rename = "Labels")]
#[serde(deserialize_with = "deserialize_nonoptional_map")]
pub labels: HashMap<String, String>,
#[serde(rename = "Scope")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "::serde_with::As::<::serde_with::NoneAsEmptyString>")]
pub scope: Option<VolumeScopeEnum>,
#[serde(rename = "Options")]
#[serde(deserialize_with = "deserialize_nonoptional_map")]
pub options: HashMap<String, String>,
#[serde(rename = "UsageData")]
#[serde(skip_serializing_if = "Option::is_none")]
pub usage_data: Option<VolumeUsageData>,
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]
pub enum VolumeScopeEnum {
#[serde(rename = "")]
EMPTY,
#[serde(rename = "local")]
LOCAL,
#[serde(rename = "global")]
GLOBAL,
}
impl ::std::fmt::Display for VolumeScopeEnum {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match *self {
VolumeScopeEnum::EMPTY => write!(f, ""),
VolumeScopeEnum::LOCAL => write!(f, "{}", "local"),
VolumeScopeEnum::GLOBAL => write!(f, "{}", "global"),
}
}
}
impl ::std::str::FromStr for VolumeScopeEnum {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(VolumeScopeEnum::EMPTY),
"local" => Ok(VolumeScopeEnum::LOCAL),
"global" => Ok(VolumeScopeEnum::GLOBAL),
x => Err(format!("Invalid enum type: {}", x)),
}
}
}
impl ::std::convert::AsRef<str> for VolumeScopeEnum {
fn as_ref(&self) -> &str {
match self {
VolumeScopeEnum::EMPTY => "",
VolumeScopeEnum::LOCAL => "local",
VolumeScopeEnum::GLOBAL => "global",
}
}
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct VolumeCreateOptions {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Driver")]
#[serde(skip_serializing_if = "Option::is_none")]
pub driver: Option<String>,
#[serde(rename = "DriverOpts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub driver_opts: Option<HashMap<String, String>>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct VolumeListResponse {
#[serde(rename = "Volumes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volumes: Option<Vec<Volume>>,
#[serde(rename = "Warnings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub warnings: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct VolumePruneResponse {
#[serde(rename = "VolumesDeleted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volumes_deleted: Option<Vec<String>>,
#[serde(rename = "SpaceReclaimed")]
#[serde(skip_serializing_if = "Option::is_none")]
pub space_reclaimed: Option<i64>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct VolumeUsageData {
#[serde(rename = "Size")]
pub size: i64,
#[serde(rename = "RefCount")]
pub ref_count: i64,
}