podman_autogen_api/models/inspect_container_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/// InspectContainerHostConfig : nolint:revive,stylecheck // Field names are fixed for compatibility and cannot be changed.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct InspectContainerHostConfig {
17 /// Annotations are provided to the runtime when the container is started.
18 #[serde(rename = "Annotations", skip_serializing_if = "Option::is_none")]
19 pub annotations: Option<std::collections::HashMap<String, String>>,
20 /// AutoRemove is whether the container will be automatically removed on exiting. It is not handled directly within libpod and is stored in an annotation.
21 #[serde(rename = "AutoRemove", skip_serializing_if = "Option::is_none")]
22 pub auto_remove: Option<bool>,
23 /// Binds contains an array of user-added mounts. Both volume mounts and named volumes are included. Tmpfs mounts are NOT included. In 'docker inspect' this is separated into 'Binds' and 'Mounts' based on how a mount was added. We do not make this distinction and do not include a Mounts field in inspect. Format: <src>:<destination>[:<comma-separated options>]
24 #[serde(rename = "Binds", skip_serializing_if = "Option::is_none")]
25 pub binds: Option<Vec<String>>,
26 /// BlkioDeviceReadBps is an array of I/O throttle parameters for individual device nodes. This specifically sets read rate cap in bytes per second for device nodes. As with BlkioWeightDevice, we pull the path from /sys/dev, and we don't guarantee the path will be identical to the original (though the node will be).
27 #[serde(rename = "BlkioDeviceReadBps", skip_serializing_if = "Option::is_none")]
28 pub blkio_device_read_bps: Option<Vec<models::InspectBlkioThrottleDevice>>,
29 /// BlkioDeviceReadIOps is an array of I/O throttle parameters for individual device nodes. This specifically sets the read rate cap in iops per second for device nodes. As with BlkioWeightDevice, we pull the path from /sys/dev, and we don't guarantee the path will be identical to the original (though the node will be).
30 #[serde(
31 rename = "BlkioDeviceReadIOps",
32 skip_serializing_if = "Option::is_none"
33 )]
34 pub blkio_device_read_i_ops: Option<Vec<models::InspectBlkioThrottleDevice>>,
35 /// BlkioDeviceWriteBps is an array of I/O throttle parameters for individual device nodes. this specifically sets write rate cap in bytes per second for device nodes. as with BlkioWeightDevice, we pull the path from /sys/dev, and we don't guarantee the path will be identical to the original (though the node will be).
36 #[serde(
37 rename = "BlkioDeviceWriteBps",
38 skip_serializing_if = "Option::is_none"
39 )]
40 pub blkio_device_write_bps: Option<Vec<models::InspectBlkioThrottleDevice>>,
41 /// BlkioDeviceWriteIOps is an array of I/O throttle parameters for individual device nodes. This specifically sets the write rate cap in iops per second for device nodes. As with BlkioWeightDevice, we pull the path from /sys/dev, and we don't guarantee the path will be identical to the original (though the node will be).
42 #[serde(
43 rename = "BlkioDeviceWriteIOps",
44 skip_serializing_if = "Option::is_none"
45 )]
46 pub blkio_device_write_i_ops: Option<Vec<models::InspectBlkioThrottleDevice>>,
47 /// BlkioWeight indicates the I/O resources allocated to the container. It is a relative weight in the scheduler for assigning I/O time versus other Cgroups.
48 #[serde(rename = "BlkioWeight", skip_serializing_if = "Option::is_none")]
49 pub blkio_weight: Option<i32>,
50 /// BlkioWeightDevice is an array of I/O resource priorities for individual device nodes. Unfortunately, the spec only stores the device's Major/Minor numbers and not the path, which is used here. Fortunately, the kernel provides an interface for retrieving the path of a given node by major:minor at /sys/dev/. However, the exact path in use may not be what was used in the original CLI invocation - though it is guaranteed that the device node will be the same, and using the given path will be functionally identical.
51 #[serde(rename = "BlkioWeightDevice", skip_serializing_if = "Option::is_none")]
52 pub blkio_weight_device: Option<Vec<models::InspectBlkioWeightDevice>>,
53 /// CapAdd is a list of capabilities added to the container. It is not directly stored by Libpod, and instead computed from the capabilities listed in the container's spec, compared against a set of default capabilities.
54 #[serde(rename = "CapAdd", skip_serializing_if = "Option::is_none")]
55 pub cap_add: Option<Vec<String>>,
56 /// CapDrop is a list of capabilities removed from the container. It is not directly stored by libpod, and instead computed from the capabilities listed in the container's spec, compared against a set of default capabilities.
57 #[serde(rename = "CapDrop", skip_serializing_if = "Option::is_none")]
58 pub cap_drop: Option<Vec<String>>,
59 /// Cgroup contains the container's cgroup. It is presently not populated. TODO.
60 #[serde(rename = "Cgroup", skip_serializing_if = "Option::is_none")]
61 pub cgroup: Option<String>,
62 /// CgroupConf is the configuration for cgroup v2.
63 #[serde(rename = "CgroupConf", skip_serializing_if = "Option::is_none")]
64 pub cgroup_conf: Option<std::collections::HashMap<String, String>>,
65 /// CgroupManager is the cgroup manager used by the container. At present, allowed values are either \"cgroupfs\" or \"systemd\".
66 #[serde(rename = "CgroupManager", skip_serializing_if = "Option::is_none")]
67 pub cgroup_manager: Option<String>,
68 /// CgroupMode is the configuration of the container's cgroup namespace. Populated as follows: private - a cgroup namespace has been created host - No cgroup namespace created container:<id> - Using another container's cgroup namespace ns:<path> - A path to a cgroup namespace has been specified
69 #[serde(rename = "CgroupMode", skip_serializing_if = "Option::is_none")]
70 pub cgroup_mode: Option<String>,
71 /// CgroupParent is the Cgroup parent of the container. Only set if not default.
72 #[serde(rename = "CgroupParent", skip_serializing_if = "Option::is_none")]
73 pub cgroup_parent: Option<String>,
74 /// Cgroups contains the container's Cgroup mode. Allowed values are \"default\" (container is creating Cgroups) and \"disabled\" (container is not creating Cgroups). This is Libpod-specific and not included in `docker inspect`.
75 #[serde(rename = "Cgroups", skip_serializing_if = "Option::is_none")]
76 pub cgroups: Option<String>,
77 /// ConsoleSize is an array of 2 integers showing the size of the container's console. It is only set if the container is creating a terminal. TODO.
78 #[serde(rename = "ConsoleSize", skip_serializing_if = "Option::is_none")]
79 pub console_size: Option<Vec<i32>>,
80 /// ContainerIDFile is a file created during container creation to hold the ID of the created container. This is not handled within libpod and is stored in an annotation.
81 #[serde(rename = "ContainerIDFile", skip_serializing_if = "Option::is_none")]
82 pub container_id_file: Option<String>,
83 /// CpuCount is Windows-only and not presently implemented.
84 #[serde(rename = "CpuCount", skip_serializing_if = "Option::is_none")]
85 pub cpu_count: Option<i32>,
86 /// CpuPercent is Windows-only and not presently implemented.
87 #[serde(rename = "CpuPercent", skip_serializing_if = "Option::is_none")]
88 pub cpu_percent: Option<i32>,
89 /// CpuPeriod is the length of a CPU period in microseconds. It relates directly to CpuQuota.
90 #[serde(rename = "CpuPeriod", skip_serializing_if = "Option::is_none")]
91 pub cpu_period: Option<i32>,
92 /// CpuPeriod is the amount of time (in microseconds) that a container can use the CPU in every CpuPeriod.
93 #[serde(rename = "CpuQuota", skip_serializing_if = "Option::is_none")]
94 pub cpu_quota: Option<i64>,
95 /// CpuRealtimePeriod is the length of time (in microseconds) of the CPU realtime period. If set to 0, no time will be allocated to realtime tasks.
96 #[serde(rename = "CpuRealtimePeriod", skip_serializing_if = "Option::is_none")]
97 pub cpu_realtime_period: Option<i32>,
98 /// CpuRealtimeRuntime is the length of time (in microseconds) allocated for realtime tasks within every CpuRealtimePeriod.
99 #[serde(rename = "CpuRealtimeRuntime", skip_serializing_if = "Option::is_none")]
100 pub cpu_realtime_runtime: Option<i64>,
101 /// CpuShares indicates the CPU resources allocated to the container. It is a relative weight in the scheduler for assigning CPU time versus other Cgroups.
102 #[serde(rename = "CpuShares", skip_serializing_if = "Option::is_none")]
103 pub cpu_shares: Option<i32>,
104 /// CpusetCpus is the set of CPUs that the container will execute on. Formatted as `0-3` or `0,2`. Default (if unset) is all CPUs.
105 #[serde(rename = "CpusetCpus", skip_serializing_if = "Option::is_none")]
106 pub cpuset_cpus: Option<String>,
107 /// CpusetMems is the set of memory nodes the container will use. Formatted as `0-3` or `0,2`. Default (if unset) is all memory nodes.
108 #[serde(rename = "CpusetMems", skip_serializing_if = "Option::is_none")]
109 pub cpuset_mems: Option<String>,
110 /// Devices is a list of device nodes that will be added to the container. These are stored in the OCI spec only as type, major, minor while we display the host path. We convert this with /sys/dev, but we cannot guarantee that the host path will be identical - only that the actual device will be.
111 #[serde(rename = "Devices", skip_serializing_if = "Option::is_none")]
112 pub devices: Option<Vec<models::InspectDevice>>,
113 /// DiskQuota is the maximum amount of disk space the container may use (in bytes). Presently not populated. TODO.
114 #[serde(rename = "DiskQuota", skip_serializing_if = "Option::is_none")]
115 pub disk_quota: Option<i32>,
116 /// Dns is a list of DNS nameservers that will be added to the container's resolv.conf
117 #[serde(rename = "Dns", skip_serializing_if = "Option::is_none")]
118 pub dns: Option<Vec<String>>,
119 /// DnsOptions is a list of DNS options that will be set in the container's resolv.conf
120 #[serde(rename = "DnsOptions", skip_serializing_if = "Option::is_none")]
121 pub dns_options: Option<Vec<String>>,
122 /// DnsSearch is a list of DNS search domains that will be set in the container's resolv.conf
123 #[serde(rename = "DnsSearch", skip_serializing_if = "Option::is_none")]
124 pub dns_search: Option<Vec<String>>,
125 /// ExtraHosts contains hosts that will be added to the container's etc/hosts.
126 #[serde(rename = "ExtraHosts", skip_serializing_if = "Option::is_none")]
127 pub extra_hosts: Option<Vec<String>>,
128 /// GroupAdd contains groups that the user inside the container will be added to.
129 #[serde(rename = "GroupAdd", skip_serializing_if = "Option::is_none")]
130 pub group_add: Option<Vec<String>>,
131 #[serde(rename = "IDMappings", skip_serializing_if = "Option::is_none")]
132 pub id_mappings: Option<Box<models::InspectIdMappings>>,
133 /// IOMaximumBandwidth is Windows-only and not presently implemented.
134 #[serde(rename = "IOMaximumBandwidth", skip_serializing_if = "Option::is_none")]
135 pub io_maximum_bandwidth: Option<i32>,
136 /// IOMaximumIOps is Windows-only and not presently implemented.
137 #[serde(rename = "IOMaximumIOps", skip_serializing_if = "Option::is_none")]
138 pub io_maximum_i_ops: Option<i32>,
139 /// Init indicates whether the container has an init mounted into it.
140 #[serde(rename = "Init", skip_serializing_if = "Option::is_none")]
141 pub init: Option<bool>,
142 /// IntelRdtClosID defines the Intel RDT CAT Class Of Service (COS) that all processes of the container should run in.
143 #[serde(rename = "IntelRdtClosID", skip_serializing_if = "Option::is_none")]
144 pub intel_rdt_clos_id: Option<String>,
145 /// IpcMode represents the configuration of the container's IPC namespace. Populated as follows: \"\" (empty string) - Default, an IPC namespace will be created host - No IPC namespace created container:<id> - Using another container's IPC namespace ns:<path> - A path to an IPC namespace has been specified
146 #[serde(rename = "IpcMode", skip_serializing_if = "Option::is_none")]
147 pub ipc_mode: Option<String>,
148 /// Isolation is presently unused and provided solely for Docker compatibility.
149 #[serde(rename = "Isolation", skip_serializing_if = "Option::is_none")]
150 pub isolation: Option<String>,
151 /// KernelMemory is the maximum amount of memory the kernel will devote to the container.
152 #[serde(rename = "KernelMemory", skip_serializing_if = "Option::is_none")]
153 pub kernel_memory: Option<i64>,
154 /// Links is unused, and provided purely for Docker compatibility.
155 #[serde(rename = "Links", skip_serializing_if = "Option::is_none")]
156 pub links: Option<Vec<String>>,
157 #[serde(rename = "LogConfig", skip_serializing_if = "Option::is_none")]
158 pub log_config: Option<Box<models::InspectLogConfig>>,
159 /// Memory indicates the memory resources allocated to the container. This is the limit (in bytes) of RAM the container may use.
160 #[serde(rename = "Memory", skip_serializing_if = "Option::is_none")]
161 pub memory: Option<i64>,
162 /// MemoryReservation is the reservation (soft limit) of memory available to the container. Soft limits are warnings only and can be exceeded.
163 #[serde(rename = "MemoryReservation", skip_serializing_if = "Option::is_none")]
164 pub memory_reservation: Option<i64>,
165 /// MemorySwap is the total limit for all memory available to the container, including swap. 0 indicates that there is no limit to the amount of memory available.
166 #[serde(rename = "MemorySwap", skip_serializing_if = "Option::is_none")]
167 pub memory_swap: Option<i64>,
168 /// MemorySwappiness is the willingness of the kernel to page container memory to swap. It is an integer from 0 to 100, with low numbers being more likely to be put into swap. 1, the default, will not set swappiness and use the system defaults.
169 #[serde(rename = "MemorySwappiness", skip_serializing_if = "Option::is_none")]
170 pub memory_swappiness: Option<i64>,
171 /// NanoCpus indicates number of CPUs allocated to the container. It is an integer where one full CPU is indicated by 1000000000 (one billion). Thus, 2.5 CPUs (fractional portions of CPUs are allowed) would be 2500000000 (2.5 billion). In 'docker inspect' this is set exclusively of two further options in the output (CpuPeriod and CpuQuota) which are both used to implement this functionality. We can't distinguish here, so if CpuQuota is set to the default of 100000, we will set both CpuQuota, CpuPeriod, and NanoCpus. If CpuQuota is not the default, we will not set NanoCpus.
172 #[serde(rename = "NanoCpus", skip_serializing_if = "Option::is_none")]
173 pub nano_cpus: Option<i64>,
174 /// NetworkMode is the configuration of the container's network namespace. Populated as follows: default - A network namespace is being created and configured via CNI none - A network namespace is being created, not configured via CNI host - No network namespace created container:<id> - Using another container's network namespace ns:<path> - A path to a network namespace has been specified
175 #[serde(rename = "NetworkMode", skip_serializing_if = "Option::is_none")]
176 pub network_mode: Option<String>,
177 /// OomKillDisable indicates whether the kernel OOM killer is disabled for the container.
178 #[serde(rename = "OomKillDisable", skip_serializing_if = "Option::is_none")]
179 pub oom_kill_disable: Option<bool>,
180 /// OOMScoreAdj is an adjustment that will be made to the container's OOM score.
181 #[serde(rename = "OomScoreAdj", skip_serializing_if = "Option::is_none")]
182 pub oom_score_adj: Option<i64>,
183 /// PidMode represents the configuration of the container's PID namespace. Populated as follows: \"\" (empty string) - Default, a PID namespace will be created host - No PID namespace created container:<id> - Using another container's PID namespace ns:<path> - A path to a PID namespace has been specified
184 #[serde(rename = "PidMode", skip_serializing_if = "Option::is_none")]
185 pub pid_mode: Option<String>,
186 /// PidsLimit is the maximum number of PIDs that may be created within the container. 0, the default, indicates no limit.
187 #[serde(rename = "PidsLimit", skip_serializing_if = "Option::is_none")]
188 pub pids_limit: Option<i64>,
189 /// PortBindings contains the container's port bindings. It is formatted as map[string][]InspectHostPort. The string key here is formatted as <integer port number>/<protocol> and represents the container port. A single container port may be bound to multiple host ports (on different IPs).
190 #[serde(rename = "PortBindings", skip_serializing_if = "Option::is_none")]
191 pub port_bindings: Option<std::collections::HashMap<String, Vec<models::InspectHostPort>>>,
192 /// Privileged indicates whether the container is running with elevated privileges. This has a very specific meaning in the Docker sense, so it's very difficult to decode from the spec and config, and so is stored as an annotation.
193 #[serde(rename = "Privileged", skip_serializing_if = "Option::is_none")]
194 pub privileged: Option<bool>,
195 /// PublishAllPorts indicates whether image ports are being published. This is not directly stored in libpod and is saved as an annotation.
196 #[serde(rename = "PublishAllPorts", skip_serializing_if = "Option::is_none")]
197 pub publish_all_ports: Option<bool>,
198 /// ReadonlyRootfs is whether the container will be mounted read-only.
199 #[serde(rename = "ReadonlyRootfs", skip_serializing_if = "Option::is_none")]
200 pub readonly_rootfs: Option<bool>,
201 #[serde(rename = "RestartPolicy", skip_serializing_if = "Option::is_none")]
202 pub restart_policy: Option<Box<models::InspectRestartPolicy>>,
203 /// Runtime is provided purely for Docker compatibility. It is set unconditionally to \"oci\" as Podman does not presently support non-OCI runtimes.
204 #[serde(rename = "Runtime", skip_serializing_if = "Option::is_none")]
205 pub runtime: Option<String>,
206 /// SecurityOpt is a list of security-related options that are set in the container.
207 #[serde(rename = "SecurityOpt", skip_serializing_if = "Option::is_none")]
208 pub security_opt: Option<Vec<String>>,
209 #[serde(rename = "ShmSize", skip_serializing_if = "Option::is_none")]
210 pub shm_size: Option<i64>,
211 /// Tmpfs is a list of tmpfs filesystems that will be mounted into the container. It is a map of destination path to options for the mount.
212 #[serde(rename = "Tmpfs", skip_serializing_if = "Option::is_none")]
213 pub tmpfs: Option<std::collections::HashMap<String, String>>,
214 /// UTSMode represents the configuration of the container's UID namespace. Populated as follows: \"\" (empty string) - Default, a UTS namespace will be created host - no UTS namespace created container:<id> - Using another container's UTS namespace ns:<path> - A path to a UTS namespace has been specified
215 #[serde(rename = "UTSMode", skip_serializing_if = "Option::is_none")]
216 pub uts_mode: Option<String>,
217 /// Ulimits is a set of ulimits that will be set within the container.
218 #[serde(rename = "Ulimits", skip_serializing_if = "Option::is_none")]
219 pub ulimits: Option<Vec<models::InspectUlimit>>,
220 /// UsernsMode represents the configuration of the container's user namespace. When running rootless, a user namespace is created outside of libpod to allow some privileged operations. This will not be reflected here. Populated as follows: \"\" (empty string) - No user namespace will be created private - The container will be run in a user namespace container:<id> - Using another container's user namespace ns:<path> - A path to a user namespace has been specified TODO Rootless has an additional 'keep-id' option, presently not reflected here.
221 #[serde(rename = "UsernsMode", skip_serializing_if = "Option::is_none")]
222 pub userns_mode: Option<String>,
223 /// VolumeDriver is presently unused and is retained for Docker compatibility.
224 #[serde(rename = "VolumeDriver", skip_serializing_if = "Option::is_none")]
225 pub volume_driver: Option<String>,
226 /// VolumesFrom is a list of containers which this container uses volumes from. This is not handled directly within libpod and is stored in an annotation. It is formatted as an array of container names and IDs.
227 #[serde(rename = "VolumesFrom", skip_serializing_if = "Option::is_none")]
228 pub volumes_from: Option<Vec<String>>,
229}
230
231impl InspectContainerHostConfig {
232 /// nolint:revive,stylecheck // Field names are fixed for compatibility and cannot be changed.
233 pub fn new() -> InspectContainerHostConfig {
234 InspectContainerHostConfig {
235 annotations: None,
236 auto_remove: None,
237 binds: None,
238 blkio_device_read_bps: None,
239 blkio_device_read_i_ops: None,
240 blkio_device_write_bps: None,
241 blkio_device_write_i_ops: None,
242 blkio_weight: None,
243 blkio_weight_device: None,
244 cap_add: None,
245 cap_drop: None,
246 cgroup: None,
247 cgroup_conf: None,
248 cgroup_manager: None,
249 cgroup_mode: None,
250 cgroup_parent: None,
251 cgroups: None,
252 console_size: None,
253 container_id_file: None,
254 cpu_count: None,
255 cpu_percent: None,
256 cpu_period: None,
257 cpu_quota: None,
258 cpu_realtime_period: None,
259 cpu_realtime_runtime: None,
260 cpu_shares: None,
261 cpuset_cpus: None,
262 cpuset_mems: None,
263 devices: None,
264 disk_quota: None,
265 dns: None,
266 dns_options: None,
267 dns_search: None,
268 extra_hosts: None,
269 group_add: None,
270 id_mappings: None,
271 io_maximum_bandwidth: None,
272 io_maximum_i_ops: None,
273 init: None,
274 intel_rdt_clos_id: None,
275 ipc_mode: None,
276 isolation: None,
277 kernel_memory: None,
278 links: None,
279 log_config: None,
280 memory: None,
281 memory_reservation: None,
282 memory_swap: None,
283 memory_swappiness: None,
284 nano_cpus: None,
285 network_mode: None,
286 oom_kill_disable: None,
287 oom_score_adj: None,
288 pid_mode: None,
289 pids_limit: None,
290 port_bindings: None,
291 privileged: None,
292 publish_all_ports: None,
293 readonly_rootfs: None,
294 restart_policy: None,
295 runtime: None,
296 security_opt: None,
297 shm_size: None,
298 tmpfs: None,
299 uts_mode: None,
300 ulimits: None,
301 userns_mode: None,
302 volume_driver: None,
303 volumes_from: None,
304 }
305 }
306}