podman-autogen-api 0.9.0

Podman REST API client generated from the official swagger file using openapi-generator
Documentation
/*
 * supports a RESTful API for the Libpod library
 *
 * This documentation describes the Podman v2.x+ RESTful API. It consists of a Docker-compatible API and a Libpod API providing support for Podman’s unique features such as pods.  To start the service and keep it running for 5,000 seconds (-t 0 runs forever):  podman system service -t 5000 &  You can then use cURL on the socket using requests documented below.  NOTE: if you install the package podman-docker, it will create a symbolic link for /run/docker.sock to /run/podman/podman.sock  NOTE: Some fields in the API response JSON are encoded as omitempty, which means that if said field has a zero value, they will not be encoded in the API response. This is a feature to help reduce the size of the JSON responses returned via the API.  NOTE: Due to the limitations of [go-swagger](https://github.com/go-swagger/go-swagger), some field values that have a complex type show up as null in the docs as well as in the API responses. This is because the zero value for the field type is null. The field description in the docs will state what type the field is expected to be for such cases.  See podman-system-service(1) for more information.  Quick Examples:  'podman info'  curl --unix-socket /run/podman/podman.sock http://d/v5.0.0/libpod/info  'podman pull quay.io/containers/podman'  curl -XPOST --unix-socket /run/podman/podman.sock -v 'http://d/v5.0.0/images/create?fromImage=quay.io%2Fcontainers%2Fpodman'  'podman list images'  curl --unix-socket /run/podman/podman.sock -v 'http://d/v5.0.0/libpod/images/json' | jq
 *
 * The version of the OpenAPI document: 5.0.0
 * Contact: podman@lists.podman.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// HostConfig : Here, \"non-portable\" means \"dependent of the host we are running on\". Portable information *should* appear in Config.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct HostConfig {
    #[serde(rename = "Annotations", skip_serializing_if = "Option::is_none")]
    pub annotations: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "AutoRemove", skip_serializing_if = "Option::is_none")]
    pub auto_remove: Option<bool>,
    /// Applicable to all platforms
    #[serde(rename = "Binds", skip_serializing_if = "Option::is_none")]
    pub binds: Option<Vec<String>>,
    #[serde(rename = "BlkioDeviceReadBps", skip_serializing_if = "Option::is_none")]
    pub blkio_device_read_bps: Option<Vec<models::ThrottleDevice>>,
    #[serde(
        rename = "BlkioDeviceReadIOps",
        skip_serializing_if = "Option::is_none"
    )]
    pub blkio_device_read_i_ops: Option<Vec<models::ThrottleDevice>>,
    #[serde(
        rename = "BlkioDeviceWriteBps",
        skip_serializing_if = "Option::is_none"
    )]
    pub blkio_device_write_bps: Option<Vec<models::ThrottleDevice>>,
    #[serde(
        rename = "BlkioDeviceWriteIOps",
        skip_serializing_if = "Option::is_none"
    )]
    pub blkio_device_write_i_ops: Option<Vec<models::ThrottleDevice>>,
    #[serde(rename = "BlkioWeight", skip_serializing_if = "Option::is_none")]
    pub blkio_weight: Option<i32>,
    #[serde(rename = "BlkioWeightDevice", skip_serializing_if = "Option::is_none")]
    pub blkio_weight_device: Option<Vec<models::WeightDevice>>,
    /// We need to override the json decoder to accept both options.
    #[serde(rename = "CapAdd", skip_serializing_if = "Option::is_none")]
    pub cap_add: Option<Vec<String>>,
    /// We need to override the json decoder to accept both options.
    #[serde(rename = "CapDrop", skip_serializing_if = "Option::is_none")]
    pub cap_drop: Option<Vec<String>>,
    #[serde(rename = "Cgroup", skip_serializing_if = "Option::is_none")]
    pub cgroup: Option<String>,
    /// Applicable to UNIX platforms
    #[serde(rename = "CgroupParent", skip_serializing_if = "Option::is_none")]
    pub cgroup_parent: Option<String>,
    /// CgroupnsMode represents the cgroup namespace mode of the container
    #[serde(rename = "CgroupnsMode", skip_serializing_if = "Option::is_none")]
    pub cgroupns_mode: Option<String>,
    #[serde(rename = "ConsoleSize", skip_serializing_if = "Option::is_none")]
    pub console_size: Option<Vec<i32>>,
    #[serde(rename = "ContainerIDFile", skip_serializing_if = "Option::is_none")]
    pub container_id_file: Option<String>,
    /// Applicable to Windows
    #[serde(rename = "CpuCount", skip_serializing_if = "Option::is_none")]
    pub cpu_count: Option<i64>,
    #[serde(rename = "CpuPercent", skip_serializing_if = "Option::is_none")]
    pub cpu_percent: Option<i64>,
    #[serde(rename = "CpuPeriod", skip_serializing_if = "Option::is_none")]
    pub cpu_period: Option<i64>,
    #[serde(rename = "CpuQuota", skip_serializing_if = "Option::is_none")]
    pub cpu_quota: Option<i64>,
    #[serde(rename = "CpuRealtimePeriod", skip_serializing_if = "Option::is_none")]
    pub cpu_realtime_period: Option<i64>,
    #[serde(rename = "CpuRealtimeRuntime", skip_serializing_if = "Option::is_none")]
    pub cpu_realtime_runtime: Option<i64>,
    /// Applicable to all platforms
    #[serde(rename = "CpuShares", skip_serializing_if = "Option::is_none")]
    pub cpu_shares: Option<i64>,
    #[serde(rename = "CpusetCpus", skip_serializing_if = "Option::is_none")]
    pub cpuset_cpus: Option<String>,
    #[serde(rename = "CpusetMems", skip_serializing_if = "Option::is_none")]
    pub cpuset_mems: Option<String>,
    #[serde(rename = "DeviceCgroupRules", skip_serializing_if = "Option::is_none")]
    pub device_cgroup_rules: Option<Vec<String>>,
    #[serde(rename = "DeviceRequests", skip_serializing_if = "Option::is_none")]
    pub device_requests: Option<Vec<models::DeviceRequest>>,
    #[serde(rename = "Devices", skip_serializing_if = "Option::is_none")]
    pub devices: Option<Vec<models::DeviceMapping>>,
    #[serde(rename = "Dns", skip_serializing_if = "Option::is_none")]
    pub dns: Option<Vec<String>>,
    #[serde(rename = "DnsOptions", skip_serializing_if = "Option::is_none")]
    pub dns_options: Option<Vec<String>>,
    #[serde(rename = "DnsSearch", skip_serializing_if = "Option::is_none")]
    pub dns_search: Option<Vec<String>>,
    #[serde(rename = "ExtraHosts", skip_serializing_if = "Option::is_none")]
    pub extra_hosts: Option<Vec<String>>,
    #[serde(rename = "GroupAdd", skip_serializing_if = "Option::is_none")]
    pub group_add: Option<Vec<String>>,
    #[serde(rename = "IOMaximumBandwidth", skip_serializing_if = "Option::is_none")]
    pub io_maximum_bandwidth: Option<i32>,
    #[serde(rename = "IOMaximumIOps", skip_serializing_if = "Option::is_none")]
    pub io_maximum_i_ops: Option<i32>,
    /// Run a custom init inside the container, if null, use the daemon's configured settings
    #[serde(rename = "Init", skip_serializing_if = "Option::is_none")]
    pub init: Option<bool>,
    #[serde(rename = "IpcMode", skip_serializing_if = "Option::is_none")]
    pub ipc_mode: Option<String>,
    /// Isolation represents the isolation technology of a container. The supported values are platform specific
    #[serde(rename = "Isolation", skip_serializing_if = "Option::is_none")]
    pub isolation: Option<String>,
    /// KernelMemory specifies the kernel memory limit (in bytes) for the container. Deprecated: kernel 5.4 deprecated kmem.limit_in_bytes.
    #[serde(rename = "KernelMemory", skip_serializing_if = "Option::is_none")]
    pub kernel_memory: Option<i64>,
    #[serde(rename = "KernelMemoryTCP", skip_serializing_if = "Option::is_none")]
    pub kernel_memory_tcp: Option<i64>,
    #[serde(rename = "Links", skip_serializing_if = "Option::is_none")]
    pub links: Option<Vec<String>>,
    #[serde(rename = "LogConfig", skip_serializing_if = "Option::is_none")]
    pub log_config: Option<Box<models::LogConfig>>,
    /// MaskedPaths is the list of paths to be masked inside the container (this overrides the default set of paths)
    #[serde(rename = "MaskedPaths", skip_serializing_if = "Option::is_none")]
    pub masked_paths: Option<Vec<String>>,
    #[serde(rename = "Memory", skip_serializing_if = "Option::is_none")]
    pub memory: Option<i64>,
    #[serde(rename = "MemoryReservation", skip_serializing_if = "Option::is_none")]
    pub memory_reservation: Option<i64>,
    #[serde(rename = "MemorySwap", skip_serializing_if = "Option::is_none")]
    pub memory_swap: Option<i64>,
    #[serde(rename = "MemorySwappiness", skip_serializing_if = "Option::is_none")]
    pub memory_swappiness: Option<i64>,
    /// Mounts specs used by the container
    #[serde(rename = "Mounts", skip_serializing_if = "Option::is_none")]
    pub mounts: Option<Vec<models::Mount>>,
    #[serde(rename = "NanoCpus", skip_serializing_if = "Option::is_none")]
    pub nano_cpus: Option<i64>,
    #[serde(rename = "NetworkMode", skip_serializing_if = "Option::is_none")]
    pub network_mode: Option<String>,
    #[serde(rename = "OomKillDisable", skip_serializing_if = "Option::is_none")]
    pub oom_kill_disable: Option<bool>,
    #[serde(rename = "OomScoreAdj", skip_serializing_if = "Option::is_none")]
    pub oom_score_adj: Option<i64>,
    #[serde(rename = "PidMode", skip_serializing_if = "Option::is_none")]
    pub pid_mode: Option<String>,
    #[serde(rename = "PidsLimit", skip_serializing_if = "Option::is_none")]
    pub pids_limit: Option<i64>,
    /// PortMap is a collection of PortBinding indexed by Port
    #[serde(rename = "PortBindings", skip_serializing_if = "Option::is_none")]
    pub port_bindings: Option<std::collections::HashMap<String, Vec<models::PortBinding>>>,
    #[serde(rename = "Privileged", skip_serializing_if = "Option::is_none")]
    pub privileged: Option<bool>,
    #[serde(rename = "PublishAllPorts", skip_serializing_if = "Option::is_none")]
    pub publish_all_ports: Option<bool>,
    /// ReadonlyPaths is the list of paths to be set as read-only inside the container (this overrides the default set of paths)
    #[serde(rename = "ReadonlyPaths", skip_serializing_if = "Option::is_none")]
    pub readonly_paths: Option<Vec<String>>,
    #[serde(rename = "ReadonlyRootfs", skip_serializing_if = "Option::is_none")]
    pub readonly_rootfs: Option<bool>,
    #[serde(rename = "RestartPolicy", skip_serializing_if = "Option::is_none")]
    pub restart_policy: Option<Box<models::RestartPolicy>>,
    #[serde(rename = "Runtime", skip_serializing_if = "Option::is_none")]
    pub runtime: Option<String>,
    #[serde(rename = "SecurityOpt", skip_serializing_if = "Option::is_none")]
    pub security_opt: Option<Vec<String>>,
    #[serde(rename = "ShmSize", skip_serializing_if = "Option::is_none")]
    pub shm_size: Option<i64>,
    #[serde(rename = "StorageOpt", skip_serializing_if = "Option::is_none")]
    pub storage_opt: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "Sysctls", skip_serializing_if = "Option::is_none")]
    pub sysctls: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "Tmpfs", skip_serializing_if = "Option::is_none")]
    pub tmpfs: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "UTSMode", skip_serializing_if = "Option::is_none")]
    pub uts_mode: Option<String>,
    #[serde(rename = "Ulimits", skip_serializing_if = "Option::is_none")]
    pub ulimits: Option<Vec<models::Ulimit>>,
    #[serde(rename = "UsernsMode", skip_serializing_if = "Option::is_none")]
    pub userns_mode: Option<String>,
    #[serde(rename = "VolumeDriver", skip_serializing_if = "Option::is_none")]
    pub volume_driver: Option<String>,
    #[serde(rename = "VolumesFrom", skip_serializing_if = "Option::is_none")]
    pub volumes_from: Option<Vec<String>>,
}

impl HostConfig {
    /// Here, \"non-portable\" means \"dependent of the host we are running on\". Portable information *should* appear in Config.
    pub fn new() -> HostConfig {
        HostConfig {
            annotations: None,
            auto_remove: None,
            binds: None,
            blkio_device_read_bps: None,
            blkio_device_read_i_ops: None,
            blkio_device_write_bps: None,
            blkio_device_write_i_ops: None,
            blkio_weight: None,
            blkio_weight_device: None,
            cap_add: None,
            cap_drop: None,
            cgroup: None,
            cgroup_parent: None,
            cgroupns_mode: None,
            console_size: None,
            container_id_file: None,
            cpu_count: None,
            cpu_percent: None,
            cpu_period: None,
            cpu_quota: None,
            cpu_realtime_period: None,
            cpu_realtime_runtime: None,
            cpu_shares: None,
            cpuset_cpus: None,
            cpuset_mems: None,
            device_cgroup_rules: None,
            device_requests: None,
            devices: None,
            dns: None,
            dns_options: None,
            dns_search: None,
            extra_hosts: None,
            group_add: None,
            io_maximum_bandwidth: None,
            io_maximum_i_ops: None,
            init: None,
            ipc_mode: None,
            isolation: None,
            kernel_memory: None,
            kernel_memory_tcp: None,
            links: None,
            log_config: None,
            masked_paths: None,
            memory: None,
            memory_reservation: None,
            memory_swap: None,
            memory_swappiness: None,
            mounts: None,
            nano_cpus: None,
            network_mode: None,
            oom_kill_disable: None,
            oom_score_adj: None,
            pid_mode: None,
            pids_limit: None,
            port_bindings: None,
            privileged: None,
            publish_all_ports: None,
            readonly_paths: None,
            readonly_rootfs: None,
            restart_policy: None,
            runtime: None,
            security_opt: None,
            shm_size: None,
            storage_opt: None,
            sysctls: None,
            tmpfs: None,
            uts_mode: None,
            ulimits: None,
            userns_mode: None,
            volume_driver: None,
            volumes_from: None,
        }
    }
}