podman_autogen_api/models/
host_config.rs

1/*
2 * supports a RESTful API for the Libpod library
3 *
4 * 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
5 *
6 * The version of the OpenAPI document: 5.0.0
7 * Contact: podman@lists.podman.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// HostConfig : Here, \"non-portable\" means \"dependent of the host we are running on\". Portable information *should* appear in Config.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct HostConfig {
17    #[serde(rename = "Annotations", skip_serializing_if = "Option::is_none")]
18    pub annotations: Option<std::collections::HashMap<String, String>>,
19    #[serde(rename = "AutoRemove", skip_serializing_if = "Option::is_none")]
20    pub auto_remove: Option<bool>,
21    /// Applicable to all platforms
22    #[serde(rename = "Binds", skip_serializing_if = "Option::is_none")]
23    pub binds: Option<Vec<String>>,
24    #[serde(rename = "BlkioDeviceReadBps", skip_serializing_if = "Option::is_none")]
25    pub blkio_device_read_bps: Option<Vec<models::ThrottleDevice>>,
26    #[serde(
27        rename = "BlkioDeviceReadIOps",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub blkio_device_read_i_ops: Option<Vec<models::ThrottleDevice>>,
31    #[serde(
32        rename = "BlkioDeviceWriteBps",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub blkio_device_write_bps: Option<Vec<models::ThrottleDevice>>,
36    #[serde(
37        rename = "BlkioDeviceWriteIOps",
38        skip_serializing_if = "Option::is_none"
39    )]
40    pub blkio_device_write_i_ops: Option<Vec<models::ThrottleDevice>>,
41    #[serde(rename = "BlkioWeight", skip_serializing_if = "Option::is_none")]
42    pub blkio_weight: Option<i32>,
43    #[serde(rename = "BlkioWeightDevice", skip_serializing_if = "Option::is_none")]
44    pub blkio_weight_device: Option<Vec<models::WeightDevice>>,
45    /// We need to override the json decoder to accept both options.
46    #[serde(rename = "CapAdd", skip_serializing_if = "Option::is_none")]
47    pub cap_add: Option<Vec<String>>,
48    /// We need to override the json decoder to accept both options.
49    #[serde(rename = "CapDrop", skip_serializing_if = "Option::is_none")]
50    pub cap_drop: Option<Vec<String>>,
51    #[serde(rename = "Cgroup", skip_serializing_if = "Option::is_none")]
52    pub cgroup: Option<String>,
53    /// Applicable to UNIX platforms
54    #[serde(rename = "CgroupParent", skip_serializing_if = "Option::is_none")]
55    pub cgroup_parent: Option<String>,
56    /// CgroupnsMode represents the cgroup namespace mode of the container
57    #[serde(rename = "CgroupnsMode", skip_serializing_if = "Option::is_none")]
58    pub cgroupns_mode: Option<String>,
59    #[serde(rename = "ConsoleSize", skip_serializing_if = "Option::is_none")]
60    pub console_size: Option<Vec<i32>>,
61    #[serde(rename = "ContainerIDFile", skip_serializing_if = "Option::is_none")]
62    pub container_id_file: Option<String>,
63    /// Applicable to Windows
64    #[serde(rename = "CpuCount", skip_serializing_if = "Option::is_none")]
65    pub cpu_count: Option<i64>,
66    #[serde(rename = "CpuPercent", skip_serializing_if = "Option::is_none")]
67    pub cpu_percent: Option<i64>,
68    #[serde(rename = "CpuPeriod", skip_serializing_if = "Option::is_none")]
69    pub cpu_period: Option<i64>,
70    #[serde(rename = "CpuQuota", skip_serializing_if = "Option::is_none")]
71    pub cpu_quota: Option<i64>,
72    #[serde(rename = "CpuRealtimePeriod", skip_serializing_if = "Option::is_none")]
73    pub cpu_realtime_period: Option<i64>,
74    #[serde(rename = "CpuRealtimeRuntime", skip_serializing_if = "Option::is_none")]
75    pub cpu_realtime_runtime: Option<i64>,
76    /// Applicable to all platforms
77    #[serde(rename = "CpuShares", skip_serializing_if = "Option::is_none")]
78    pub cpu_shares: Option<i64>,
79    #[serde(rename = "CpusetCpus", skip_serializing_if = "Option::is_none")]
80    pub cpuset_cpus: Option<String>,
81    #[serde(rename = "CpusetMems", skip_serializing_if = "Option::is_none")]
82    pub cpuset_mems: Option<String>,
83    #[serde(rename = "DeviceCgroupRules", skip_serializing_if = "Option::is_none")]
84    pub device_cgroup_rules: Option<Vec<String>>,
85    #[serde(rename = "DeviceRequests", skip_serializing_if = "Option::is_none")]
86    pub device_requests: Option<Vec<models::DeviceRequest>>,
87    #[serde(rename = "Devices", skip_serializing_if = "Option::is_none")]
88    pub devices: Option<Vec<models::DeviceMapping>>,
89    #[serde(rename = "Dns", skip_serializing_if = "Option::is_none")]
90    pub dns: Option<Vec<String>>,
91    #[serde(rename = "DnsOptions", skip_serializing_if = "Option::is_none")]
92    pub dns_options: Option<Vec<String>>,
93    #[serde(rename = "DnsSearch", skip_serializing_if = "Option::is_none")]
94    pub dns_search: Option<Vec<String>>,
95    #[serde(rename = "ExtraHosts", skip_serializing_if = "Option::is_none")]
96    pub extra_hosts: Option<Vec<String>>,
97    #[serde(rename = "GroupAdd", skip_serializing_if = "Option::is_none")]
98    pub group_add: Option<Vec<String>>,
99    #[serde(rename = "IOMaximumBandwidth", skip_serializing_if = "Option::is_none")]
100    pub io_maximum_bandwidth: Option<i32>,
101    #[serde(rename = "IOMaximumIOps", skip_serializing_if = "Option::is_none")]
102    pub io_maximum_i_ops: Option<i32>,
103    /// Run a custom init inside the container, if null, use the daemon's configured settings
104    #[serde(rename = "Init", skip_serializing_if = "Option::is_none")]
105    pub init: Option<bool>,
106    #[serde(rename = "IpcMode", skip_serializing_if = "Option::is_none")]
107    pub ipc_mode: Option<String>,
108    /// Isolation represents the isolation technology of a container. The supported values are platform specific
109    #[serde(rename = "Isolation", skip_serializing_if = "Option::is_none")]
110    pub isolation: Option<String>,
111    /// KernelMemory specifies the kernel memory limit (in bytes) for the container. Deprecated: kernel 5.4 deprecated kmem.limit_in_bytes.
112    #[serde(rename = "KernelMemory", skip_serializing_if = "Option::is_none")]
113    pub kernel_memory: Option<i64>,
114    #[serde(rename = "KernelMemoryTCP", skip_serializing_if = "Option::is_none")]
115    pub kernel_memory_tcp: Option<i64>,
116    #[serde(rename = "Links", skip_serializing_if = "Option::is_none")]
117    pub links: Option<Vec<String>>,
118    #[serde(rename = "LogConfig", skip_serializing_if = "Option::is_none")]
119    pub log_config: Option<Box<models::LogConfig>>,
120    /// MaskedPaths is the list of paths to be masked inside the container (this overrides the default set of paths)
121    #[serde(rename = "MaskedPaths", skip_serializing_if = "Option::is_none")]
122    pub masked_paths: Option<Vec<String>>,
123    #[serde(rename = "Memory", skip_serializing_if = "Option::is_none")]
124    pub memory: Option<i64>,
125    #[serde(rename = "MemoryReservation", skip_serializing_if = "Option::is_none")]
126    pub memory_reservation: Option<i64>,
127    #[serde(rename = "MemorySwap", skip_serializing_if = "Option::is_none")]
128    pub memory_swap: Option<i64>,
129    #[serde(rename = "MemorySwappiness", skip_serializing_if = "Option::is_none")]
130    pub memory_swappiness: Option<i64>,
131    /// Mounts specs used by the container
132    #[serde(rename = "Mounts", skip_serializing_if = "Option::is_none")]
133    pub mounts: Option<Vec<models::Mount>>,
134    #[serde(rename = "NanoCpus", skip_serializing_if = "Option::is_none")]
135    pub nano_cpus: Option<i64>,
136    #[serde(rename = "NetworkMode", skip_serializing_if = "Option::is_none")]
137    pub network_mode: Option<String>,
138    #[serde(rename = "OomKillDisable", skip_serializing_if = "Option::is_none")]
139    pub oom_kill_disable: Option<bool>,
140    #[serde(rename = "OomScoreAdj", skip_serializing_if = "Option::is_none")]
141    pub oom_score_adj: Option<i64>,
142    #[serde(rename = "PidMode", skip_serializing_if = "Option::is_none")]
143    pub pid_mode: Option<String>,
144    #[serde(rename = "PidsLimit", skip_serializing_if = "Option::is_none")]
145    pub pids_limit: Option<i64>,
146    /// PortMap is a collection of PortBinding indexed by Port
147    #[serde(rename = "PortBindings", skip_serializing_if = "Option::is_none")]
148    pub port_bindings: Option<std::collections::HashMap<String, Vec<models::PortBinding>>>,
149    #[serde(rename = "Privileged", skip_serializing_if = "Option::is_none")]
150    pub privileged: Option<bool>,
151    #[serde(rename = "PublishAllPorts", skip_serializing_if = "Option::is_none")]
152    pub publish_all_ports: Option<bool>,
153    /// ReadonlyPaths is the list of paths to be set as read-only inside the container (this overrides the default set of paths)
154    #[serde(rename = "ReadonlyPaths", skip_serializing_if = "Option::is_none")]
155    pub readonly_paths: Option<Vec<String>>,
156    #[serde(rename = "ReadonlyRootfs", skip_serializing_if = "Option::is_none")]
157    pub readonly_rootfs: Option<bool>,
158    #[serde(rename = "RestartPolicy", skip_serializing_if = "Option::is_none")]
159    pub restart_policy: Option<Box<models::RestartPolicy>>,
160    #[serde(rename = "Runtime", skip_serializing_if = "Option::is_none")]
161    pub runtime: Option<String>,
162    #[serde(rename = "SecurityOpt", skip_serializing_if = "Option::is_none")]
163    pub security_opt: Option<Vec<String>>,
164    #[serde(rename = "ShmSize", skip_serializing_if = "Option::is_none")]
165    pub shm_size: Option<i64>,
166    #[serde(rename = "StorageOpt", skip_serializing_if = "Option::is_none")]
167    pub storage_opt: Option<std::collections::HashMap<String, String>>,
168    #[serde(rename = "Sysctls", skip_serializing_if = "Option::is_none")]
169    pub sysctls: Option<std::collections::HashMap<String, String>>,
170    #[serde(rename = "Tmpfs", skip_serializing_if = "Option::is_none")]
171    pub tmpfs: Option<std::collections::HashMap<String, String>>,
172    #[serde(rename = "UTSMode", skip_serializing_if = "Option::is_none")]
173    pub uts_mode: Option<String>,
174    #[serde(rename = "Ulimits", skip_serializing_if = "Option::is_none")]
175    pub ulimits: Option<Vec<models::Ulimit>>,
176    #[serde(rename = "UsernsMode", skip_serializing_if = "Option::is_none")]
177    pub userns_mode: Option<String>,
178    #[serde(rename = "VolumeDriver", skip_serializing_if = "Option::is_none")]
179    pub volume_driver: Option<String>,
180    #[serde(rename = "VolumesFrom", skip_serializing_if = "Option::is_none")]
181    pub volumes_from: Option<Vec<String>>,
182}
183
184impl HostConfig {
185    /// Here, \"non-portable\" means \"dependent of the host we are running on\". Portable information *should* appear in Config.
186    pub fn new() -> HostConfig {
187        HostConfig {
188            annotations: None,
189            auto_remove: None,
190            binds: None,
191            blkio_device_read_bps: None,
192            blkio_device_read_i_ops: None,
193            blkio_device_write_bps: None,
194            blkio_device_write_i_ops: None,
195            blkio_weight: None,
196            blkio_weight_device: None,
197            cap_add: None,
198            cap_drop: None,
199            cgroup: None,
200            cgroup_parent: None,
201            cgroupns_mode: None,
202            console_size: None,
203            container_id_file: None,
204            cpu_count: None,
205            cpu_percent: None,
206            cpu_period: None,
207            cpu_quota: None,
208            cpu_realtime_period: None,
209            cpu_realtime_runtime: None,
210            cpu_shares: None,
211            cpuset_cpus: None,
212            cpuset_mems: None,
213            device_cgroup_rules: None,
214            device_requests: None,
215            devices: None,
216            dns: None,
217            dns_options: None,
218            dns_search: None,
219            extra_hosts: None,
220            group_add: None,
221            io_maximum_bandwidth: None,
222            io_maximum_i_ops: None,
223            init: None,
224            ipc_mode: None,
225            isolation: None,
226            kernel_memory: None,
227            kernel_memory_tcp: None,
228            links: None,
229            log_config: None,
230            masked_paths: None,
231            memory: None,
232            memory_reservation: None,
233            memory_swap: None,
234            memory_swappiness: None,
235            mounts: None,
236            nano_cpus: None,
237            network_mode: None,
238            oom_kill_disable: None,
239            oom_score_adj: None,
240            pid_mode: None,
241            pids_limit: None,
242            port_bindings: None,
243            privileged: None,
244            publish_all_ports: None,
245            readonly_paths: None,
246            readonly_rootfs: None,
247            restart_policy: None,
248            runtime: None,
249            security_opt: None,
250            shm_size: None,
251            storage_opt: None,
252            sysctls: None,
253            tmpfs: None,
254            uts_mode: None,
255            ulimits: None,
256            userns_mode: None,
257            volume_driver: None,
258            volumes_from: None,
259        }
260    }
261}