podman_autogen_api/models/
spec_generator.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/// SpecGenerator : SpecGenerator creates an OCI spec and Libpod configuration options to create a container based on the given configuration.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct SpecGenerator {
17    /// Map of networks names or ids that the container should join. You can request additional settings for each network, you can set network aliases, static ips, static mac address  and the network interface name for this container on the specific network. If the map is empty and the bridge network mode is set the container will be joined to the default network. Optional.
18    #[serde(rename = "Networks", skip_serializing_if = "Option::is_none")]
19    pub networks: Option<std::collections::HashMap<String, models::PerNetworkOptions>>,
20    /// Annotations are key-value options passed into the container runtime that can be used to trigger special behavior. Optional.
21    #[serde(rename = "annotations", skip_serializing_if = "Option::is_none")]
22    pub annotations: Option<std::collections::HashMap<String, String>>,
23    /// ApparmorProfile is the name of the Apparmor profile the container will use. Optional.
24    #[serde(rename = "apparmor_profile", skip_serializing_if = "Option::is_none")]
25    pub apparmor_profile: Option<String>,
26    /// BaseHostsFile is the path to a hosts file, the entries from this file are added to the containers hosts file. As special value \"image\" is allowed which uses the /etc/hosts file from within the image and \"none\" which uses no base file at all. If it is empty we should default to the base_hosts_file configuration in containers.conf. Optional.
27    #[serde(rename = "base_hosts_file", skip_serializing_if = "Option::is_none")]
28    pub base_hosts_file: Option<String>,
29    /// CapAdd are capabilities which will be added to the container. Conflicts with Privileged. Optional.
30    #[serde(rename = "cap_add", skip_serializing_if = "Option::is_none")]
31    pub cap_add: Option<Vec<String>>,
32    /// CapDrop are capabilities which will be removed from the container. Conflicts with Privileged. Optional.
33    #[serde(rename = "cap_drop", skip_serializing_if = "Option::is_none")]
34    pub cap_drop: Option<Vec<String>>,
35    /// CgroupParent is the container's Cgroup parent. If not set, the default for the current cgroup driver will be used. Optional.
36    #[serde(rename = "cgroup_parent", skip_serializing_if = "Option::is_none")]
37    pub cgroup_parent: Option<String>,
38    #[serde(rename = "cgroupns", skip_serializing_if = "Option::is_none")]
39    pub cgroupns: Option<Box<models::Namespace>>,
40    /// CgroupsMode sets a policy for how cgroups will be created for the container, including the ability to disable creation entirely. Optional.
41    #[serde(rename = "cgroups_mode", skip_serializing_if = "Option::is_none")]
42    pub cgroups_mode: Option<String>,
43    /// ChrootDirs is an additional set of directories that need to be treated as root directories. Standard bind mounts will be mounted into paths relative to these directories. Optional.
44    #[serde(rename = "chroot_directories", skip_serializing_if = "Option::is_none")]
45    pub chroot_directories: Option<Vec<String>>,
46    /// CNINetworks is a list of CNI networks to join the container to. If this list is empty, the default CNI network will be joined instead. If at least one entry is present, we will not join the default network (unless it is part of this list). Only available if NetNS is set to bridge. Optional. Deprecated: as of podman 4.0 use \"Networks\" instead.
47    #[serde(rename = "cni_networks", skip_serializing_if = "Option::is_none")]
48    pub cni_networks: Option<Vec<String>>,
49    /// Command is the container's command. If not given and Image is specified, this will be populated by the image's configuration. Optional.
50    #[serde(rename = "command", skip_serializing_if = "Option::is_none")]
51    pub command: Option<Vec<String>>,
52    /// ConmonPidFile is a path at which a PID file for Conmon will be placed. If not given, a default location will be used. Optional.
53    #[serde(rename = "conmon_pid_file", skip_serializing_if = "Option::is_none")]
54    pub conmon_pid_file: Option<String>,
55    /// ContainerCreateCommand is the command that was used to create this container. This will be shown in the output of Inspect() on the container, and may also be used by some tools that wish to recreate the container (e.g. `podman generate systemd --new`). Optional.
56    #[serde(
57        rename = "containerCreateCommand",
58        skip_serializing_if = "Option::is_none"
59    )]
60    pub container_create_command: Option<Vec<String>>,
61    /// Create the working directory if it doesn't exist. If unset, it doesn't create it. Optional.
62    #[serde(rename = "create_working_dir", skip_serializing_if = "Option::is_none")]
63    pub create_working_dir: Option<bool>,
64    /// DependencyContainers is an array of containers this container depends on. Dependency containers must be started before this container. Dependencies can be specified by name or full/partial ID. Optional.
65    #[serde(
66        rename = "dependencyContainers",
67        skip_serializing_if = "Option::is_none"
68    )]
69    pub dependency_containers: Option<Vec<String>>,
70    /// DeviceCgroupRule are device cgroup rules that allow containers to use additional types of devices.
71    #[serde(rename = "device_cgroup_rule", skip_serializing_if = "Option::is_none")]
72    pub device_cgroup_rule: Option<Vec<models::LinuxDeviceCgroup>>,
73    /// Devices are devices that will be added to the container. Optional.
74    #[serde(rename = "devices", skip_serializing_if = "Option::is_none")]
75    pub devices: Option<Vec<models::LinuxDevice>>,
76    /// DevicesFrom specifies that this container will mount the device(s) from other container(s). Optional.
77    #[serde(rename = "devices_from", skip_serializing_if = "Option::is_none")]
78    pub devices_from: Option<Vec<String>>,
79    /// DNSOptions is a set of DNS options that will be used in the container's resolv.conf, replacing the host's DNS options which are used by default. Conflicts with UseImageResolvConf. Optional.
80    #[serde(rename = "dns_option", skip_serializing_if = "Option::is_none")]
81    pub dns_option: Option<Vec<String>>,
82    /// DNSSearch is a set of DNS search domains that will be used in the container's resolv.conf, replacing the host's DNS search domains which are used by default. Conflicts with UseImageResolvConf. Optional.
83    #[serde(rename = "dns_search", skip_serializing_if = "Option::is_none")]
84    pub dns_search: Option<Vec<String>>,
85    /// DNSServers is a set of DNS servers that will be used in the container's resolv.conf, replacing the host's DNS Servers which are used by default. Conflicts with UseImageResolvConf. Optional.
86    #[serde(rename = "dns_server", skip_serializing_if = "Option::is_none")]
87    pub dns_server: Option<Vec<String>>,
88    /// Entrypoint is the container's entrypoint. If not given and Image is specified, this will be populated by the image's configuration. Optional.
89    #[serde(rename = "entrypoint", skip_serializing_if = "Option::is_none")]
90    pub entrypoint: Option<Vec<String>>,
91    /// Env is a set of environment variables that will be set in the container. Optional.
92    #[serde(rename = "env", skip_serializing_if = "Option::is_none")]
93    pub env: Option<std::collections::HashMap<String, String>>,
94    /// EnvHost indicates that the host environment should be added to container Optional.
95    #[serde(rename = "env_host", skip_serializing_if = "Option::is_none")]
96    pub env_host: Option<bool>,
97    /// EnvMerge takes the specified environment variables from image and preprocess them before injecting them into the container. Optional.
98    #[serde(rename = "envmerge", skip_serializing_if = "Option::is_none")]
99    pub envmerge: Option<Vec<String>>,
100    /// Expose is a number of ports that will be forwarded to the container if PublishExposedPorts is set. Expose is a map of uint16 (port number) to a string representing protocol i.e map[uint16]string. Allowed protocols are \"tcp\", \"udp\", and \"sctp\", or some combination of the three separated by commas. If protocol is set to \"\" we will assume TCP. Only available if NetNS is set to Bridge or Slirp, and PublishExposedPorts is set. Optional.
101    #[serde(rename = "expose", skip_serializing_if = "Option::is_none")]
102    pub expose: Option<serde_json::Value>,
103    /// GroupEntry specifies an arbitrary string to append to the container's /etc/group file. Optional.
104    #[serde(rename = "group_entry", skip_serializing_if = "Option::is_none")]
105    pub group_entry: Option<String>,
106    /// Groups are a list of supplemental groups the container's user will be granted access to. Optional.
107    #[serde(rename = "groups", skip_serializing_if = "Option::is_none")]
108    pub groups: Option<Vec<String>>,
109    /// HealthCheckOnFailureAction defines how Podman reacts when a container's health status turns unhealthy.
110    #[serde(
111        rename = "health_check_on_failure_action",
112        skip_serializing_if = "Option::is_none"
113    )]
114    pub health_check_on_failure_action: Option<i64>,
115    #[serde(rename = "healthconfig", skip_serializing_if = "Option::is_none")]
116    pub healthconfig: Option<Box<models::Schema2HealthConfig>>,
117    /// HostDeviceList is used to recreate the mounted device on inherited containers
118    #[serde(rename = "host_device_list", skip_serializing_if = "Option::is_none")]
119    pub host_device_list: Option<Vec<models::LinuxDevice>>,
120    /// HostAdd is a set of hosts which will be added to the container's etc/hosts file. Conflicts with UseImageHosts. Optional.
121    #[serde(rename = "hostadd", skip_serializing_if = "Option::is_none")]
122    pub hostadd: Option<Vec<String>>,
123    /// Hostname is the container's hostname. If not set, the hostname will not be modified (if UtsNS is not private) or will be set to the container ID (if UtsNS is private). Conflicts with UtsNS if UtsNS is not set to private. Optional.
124    #[serde(rename = "hostname", skip_serializing_if = "Option::is_none")]
125    pub hostname: Option<String>,
126    /// HostUsers is a list of host usernames or UIDs to add to the container etc/passwd file
127    #[serde(rename = "hostusers", skip_serializing_if = "Option::is_none")]
128    pub hostusers: Option<Vec<String>>,
129    /// EnvHTTPProxy indicates that the http host proxy environment variables should be added to container Optional.
130    #[serde(rename = "httpproxy", skip_serializing_if = "Option::is_none")]
131    pub httpproxy: Option<bool>,
132    #[serde(rename = "idmappings", skip_serializing_if = "Option::is_none")]
133    pub idmappings: Option<Box<models::IdMappingOptions>>,
134    /// Image is the image the container will be based on. The image will be used as the container's root filesystem, and its environment vars, volumes, and other configuration will be applied to the container. Conflicts with Rootfs. At least one of Image or Rootfs must be specified.
135    #[serde(rename = "image", skip_serializing_if = "Option::is_none")]
136    pub image: Option<String>,
137    /// ImageArch is the user-specified image architecture. Used to select a different variant from a manifest list. Optional.
138    #[serde(rename = "image_arch", skip_serializing_if = "Option::is_none")]
139    pub image_arch: Option<String>,
140    /// ImageOS is the user-specified OS of the image. Used to select a different variant from a manifest list. Optional.
141    #[serde(rename = "image_os", skip_serializing_if = "Option::is_none")]
142    pub image_os: Option<String>,
143    /// ImageVariant is the user-specified image variant. Used to select a different variant from a manifest list. Optional.
144    #[serde(rename = "image_variant", skip_serializing_if = "Option::is_none")]
145    pub image_variant: Option<String>,
146    /// ImageVolumeMode indicates how image volumes will be created. Supported modes are \"ignore\" (do not create), \"tmpfs\" (create as tmpfs), and \"anonymous\" (create as anonymous volumes). The default if unset is anonymous. Optional.
147    #[serde(rename = "image_volume_mode", skip_serializing_if = "Option::is_none")]
148    pub image_volume_mode: Option<String>,
149    /// Image volumes bind-mount a container-image mount into the container. Optional.
150    #[serde(rename = "image_volumes", skip_serializing_if = "Option::is_none")]
151    pub image_volumes: Option<Vec<models::ImageVolume>>,
152    /// Init specifies that an init binary will be mounted into the container, and will be used as PID1. Optional.
153    #[serde(rename = "init", skip_serializing_if = "Option::is_none")]
154    pub init: Option<bool>,
155    /// InitContainerType describes if this container is an init container and if so, what type: always or once. Optional.
156    #[serde(
157        rename = "init_container_type",
158        skip_serializing_if = "Option::is_none"
159    )]
160    pub init_container_type: Option<String>,
161    /// InitPath specifies the path to the init binary that will be added if Init is specified above. If not specified, the default set in the Libpod config will be used. Ignored if Init above is not set. Optional.
162    #[serde(rename = "init_path", skip_serializing_if = "Option::is_none")]
163    pub init_path: Option<String>,
164    #[serde(rename = "intelRdt", skip_serializing_if = "Option::is_none")]
165    pub intel_rdt: Option<Box<models::LinuxIntelRdt>>,
166    #[serde(rename = "ipcns", skip_serializing_if = "Option::is_none")]
167    pub ipcns: Option<Box<models::Namespace>>,
168    /// LabelNested indicates whether or not the container is allowed to run fully nested containers including SELinux labelling. Optional.
169    #[serde(rename = "label_nested", skip_serializing_if = "Option::is_none")]
170    pub label_nested: Option<bool>,
171    /// Labels are key-value pairs that are used to add metadata to containers. Optional.
172    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
173    pub labels: Option<std::collections::HashMap<String, String>>,
174    #[serde(rename = "log_configuration", skip_serializing_if = "Option::is_none")]
175    pub log_configuration: Option<Box<models::LogConfigLibpod>>,
176    /// Passwd is a container run option that determines if we are validating users/groups before running the container
177    #[serde(rename = "manage_password", skip_serializing_if = "Option::is_none")]
178    pub manage_password: Option<bool>,
179    /// Mask is the path we want to mask in the container. This masks the paths given in addition to the default list. Optional
180    #[serde(rename = "mask", skip_serializing_if = "Option::is_none")]
181    pub mask: Option<Vec<String>>,
182    /// Mounts are mounts that will be added to the container. These will supersede Image Volumes and VolumesFrom volumes where there are conflicts. Optional.
183    #[serde(rename = "mounts", skip_serializing_if = "Option::is_none")]
184    pub mounts: Option<Vec<models::Mount>>,
185    /// Name is the name the container will be given. If no name is provided, one will be randomly generated. Optional.
186    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
187    pub name: Option<String>,
188    #[serde(rename = "netns", skip_serializing_if = "Option::is_none")]
189    pub netns: Option<Box<models::Namespace>>,
190    /// NetworkOptions are additional options for each network Optional.
191    #[serde(rename = "network_options", skip_serializing_if = "Option::is_none")]
192    pub network_options: Option<std::collections::HashMap<String, Vec<String>>>,
193    /// NoNewPrivileges is whether the container will set the no new privileges flag on create, which disables gaining additional privileges (e.g. via setuid) in the container. Optional.
194    #[serde(rename = "no_new_privileges", skip_serializing_if = "Option::is_none")]
195    pub no_new_privileges: Option<bool>,
196    /// OCIRuntime is the name of the OCI runtime that will be used to create the container. If not specified, the default will be used. Optional.
197    #[serde(rename = "oci_runtime", skip_serializing_if = "Option::is_none")]
198    pub oci_runtime: Option<String>,
199    /// OOMScoreAdj adjusts the score used by the OOM killer to determine processes to kill for the container's process. Optional.
200    #[serde(rename = "oom_score_adj", skip_serializing_if = "Option::is_none")]
201    pub oom_score_adj: Option<i64>,
202    /// Overlay volumes are named volumes that will be added to the container. Optional.
203    #[serde(rename = "overlay_volumes", skip_serializing_if = "Option::is_none")]
204    pub overlay_volumes: Option<Vec<models::OverlayVolume>>,
205    /// PasswdEntry specifies an arbitrary string to append to the container's /etc/passwd file. Optional.
206    #[serde(rename = "passwd_entry", skip_serializing_if = "Option::is_none")]
207    pub passwd_entry: Option<String>,
208    #[serde(rename = "personality", skip_serializing_if = "Option::is_none")]
209    pub personality: Option<Box<models::LinuxPersonality>>,
210    #[serde(rename = "pidns", skip_serializing_if = "Option::is_none")]
211    pub pidns: Option<Box<models::Namespace>>,
212    /// Pod is the ID of the pod the container will join. Optional.
213    #[serde(rename = "pod", skip_serializing_if = "Option::is_none")]
214    pub pod: Option<String>,
215    /// PortBindings is a set of ports to map into the container. Only available if NetNS is set to bridge, slirp, or pasta. Optional.
216    #[serde(rename = "portmappings", skip_serializing_if = "Option::is_none")]
217    pub portmappings: Option<Vec<models::PortMapping>>,
218    /// Privileged is whether the container is privileged. Privileged does the following: Adds all devices on the system to the container. Adds all capabilities to the container. Disables Seccomp, SELinux, and Apparmor confinement. (Though SELinux can be manually re-enabled). TODO: this conflicts with things. TODO: this does more. Optional.
219    #[serde(rename = "privileged", skip_serializing_if = "Option::is_none")]
220    pub privileged: Option<bool>,
221    /// ProcOpts are the options used for the proc mount.
222    #[serde(rename = "procfs_opts", skip_serializing_if = "Option::is_none")]
223    pub procfs_opts: Option<Vec<String>>,
224    /// PublishExposedPorts will publish ports specified in the image to random unused ports (guaranteed to be above 1024) on the host. This is based on ports set in Expose below, and any ports specified by the Image (if one is given). Only available if NetNS is set to Bridge or Slirp. Optional.
225    #[serde(
226        rename = "publish_image_ports",
227        skip_serializing_if = "Option::is_none"
228    )]
229    pub publish_image_ports: Option<bool>,
230    /// Rlimits are POSIX rlimits to apply to the container. Optional.
231    #[serde(rename = "r_limits", skip_serializing_if = "Option::is_none")]
232    pub r_limits: Option<Vec<models::PosixRlimit>>,
233    /// RawImageName is the user-specified and unprocessed input referring to a local or a remote image. Optional, but strongly encouraged to be set if Image is set.
234    #[serde(rename = "raw_image_name", skip_serializing_if = "Option::is_none")]
235    pub raw_image_name: Option<String>,
236    /// ReadOnlyFilesystem indicates that everything will be mounted as read-only. Optional.
237    #[serde(
238        rename = "read_only_filesystem",
239        skip_serializing_if = "Option::is_none"
240    )]
241    pub read_only_filesystem: Option<bool>,
242    /// ReadWriteTmpfs indicates that when running with a ReadOnlyFilesystem mount temporary file systems. Optional.
243    #[serde(rename = "read_write_tmpfs", skip_serializing_if = "Option::is_none")]
244    pub read_write_tmpfs: Option<bool>,
245    /// Remove indicates if the container should be removed once it has been started and exits. Optional.
246    #[serde(rename = "remove", skip_serializing_if = "Option::is_none")]
247    pub remove: Option<bool>,
248    #[serde(rename = "resource_limits", skip_serializing_if = "Option::is_none")]
249    pub resource_limits: Option<Box<models::LinuxResources>>,
250    /// RestartPolicy is the container's restart policy - an action which will be taken when the container exits. If not given, the default policy, which does nothing, will be used. Optional.
251    #[serde(rename = "restart_policy", skip_serializing_if = "Option::is_none")]
252    pub restart_policy: Option<String>,
253    /// RestartRetries is the number of attempts that will be made to restart the container. Only available when RestartPolicy is set to \"on-failure\". Optional.
254    #[serde(rename = "restart_tries", skip_serializing_if = "Option::is_none")]
255    pub restart_tries: Option<i32>,
256    /// Rootfs is the path to a directory that will be used as the container's root filesystem. No modification will be made to the directory, it will be directly mounted into the container as root. Conflicts with Image. At least one of Image or Rootfs must be specified.
257    #[serde(rename = "rootfs", skip_serializing_if = "Option::is_none")]
258    pub rootfs: Option<String>,
259    /// RootfsMapping specifies if there are UID/GID mappings to apply to the rootfs. Optional.
260    #[serde(rename = "rootfs_mapping", skip_serializing_if = "Option::is_none")]
261    pub rootfs_mapping: Option<String>,
262    /// RootfsOverlay tells if rootfs is actually an overlay on top of base path. Optional.
263    #[serde(rename = "rootfs_overlay", skip_serializing_if = "Option::is_none")]
264    pub rootfs_overlay: Option<bool>,
265    /// RootfsPropagation is the rootfs propagation mode for the container. If not set, the default of rslave will be used. Optional.
266    #[serde(rename = "rootfs_propagation", skip_serializing_if = "Option::is_none")]
267    pub rootfs_propagation: Option<String>,
268    /// Determine how to handle the NOTIFY_SOCKET - do we participate or pass it through \"container\" - let the OCI runtime deal with it, advertise conmon's MAINPID \"conmon-only\" - advertise conmon's MAINPID, send READY when started, don't pass to OCI \"ignore\" - unset NOTIFY_SOCKET Optional.
269    #[serde(rename = "sdnotifyMode", skip_serializing_if = "Option::is_none")]
270    pub sdnotify_mode: Option<String>,
271    /// SeccompPolicy determines which seccomp profile gets applied the container. valid values: empty,default,image
272    #[serde(rename = "seccomp_policy", skip_serializing_if = "Option::is_none")]
273    pub seccomp_policy: Option<String>,
274    /// SeccompProfilePath is the path to a JSON file containing the container's Seccomp profile. If not specified, no Seccomp profile will be used. Optional.
275    #[serde(
276        rename = "seccomp_profile_path",
277        skip_serializing_if = "Option::is_none"
278    )]
279    pub seccomp_profile_path: Option<String>,
280    /// EnvSecrets are secrets that will be set as environment variables Optional.
281    #[serde(rename = "secret_env", skip_serializing_if = "Option::is_none")]
282    pub secret_env: Option<std::collections::HashMap<String, String>>,
283    /// Secrets are the secrets that will be added to the container Optional.
284    #[serde(rename = "secrets", skip_serializing_if = "Option::is_none")]
285    pub secrets: Option<Vec<models::Secret>>,
286    /// SelinuxProcessLabel is the process label the container will use. If SELinux is enabled and this is not specified, a label will be automatically generated if not specified. Optional.
287    #[serde(rename = "selinux_opts", skip_serializing_if = "Option::is_none")]
288    pub selinux_opts: Option<Vec<String>>,
289    /// ShmSize is the size of the tmpfs to mount in at /dev/shm, in bytes. Conflicts with ShmSize if IpcNS is not private. Optional.
290    #[serde(rename = "shm_size", skip_serializing_if = "Option::is_none")]
291    pub shm_size: Option<i64>,
292    /// ShmSizeSystemd is the size of systemd-specific tmpfs mounts specifically /run, /run/lock, /var/log/journal and /tmp. Optional
293    #[serde(rename = "shm_size_systemd", skip_serializing_if = "Option::is_none")]
294    pub shm_size_systemd: Option<i64>,
295    #[serde(
296        rename = "startupHealthConfig",
297        skip_serializing_if = "Option::is_none"
298    )]
299    pub startup_health_config: Option<Box<models::StartupHealthCheck>>,
300    /// Stdin is whether the container will keep its STDIN open. Optional.
301    #[serde(rename = "stdin", skip_serializing_if = "Option::is_none")]
302    pub stdin: Option<bool>,
303    /// It implements the os.Signal interface.
304    #[serde(rename = "stop_signal", skip_serializing_if = "Option::is_none")]
305    pub stop_signal: Option<i64>,
306    /// StopTimeout is a timeout between the container's stop signal being sent and SIGKILL being sent. If not provided, the default will be used. If 0 is used, stop signal will not be sent, and SIGKILL will be sent instead. Optional.
307    #[serde(rename = "stop_timeout", skip_serializing_if = "Option::is_none")]
308    pub stop_timeout: Option<i32>,
309    /// StorageOpts is the container's storage options Optional.
310    #[serde(rename = "storage_opts", skip_serializing_if = "Option::is_none")]
311    pub storage_opts: Option<std::collections::HashMap<String, String>>,
312    /// Sysctl sets kernel parameters for the container
313    #[serde(rename = "sysctl", skip_serializing_if = "Option::is_none")]
314    pub sysctl: Option<std::collections::HashMap<String, String>>,
315    /// Systemd is whether the container will be started in systemd mode. Valid options are \"true\", \"false\", and \"always\". \"true\" enables this mode only if the binary run in the container is sbin/init or systemd. \"always\" unconditionally enables systemd mode. \"false\" unconditionally disables systemd mode. If enabled, mounts and stop signal will be modified. If set to \"always\" or set to \"true\" and conditionally triggered, conflicts with StopSignal. If not specified, \"false\" will be assumed. Optional.
316    #[serde(rename = "systemd", skip_serializing_if = "Option::is_none")]
317    pub systemd: Option<String>,
318    /// Terminal is whether the container will create a PTY. Optional.
319    #[serde(rename = "terminal", skip_serializing_if = "Option::is_none")]
320    pub terminal: Option<bool>,
321    /// IO read rate limit per cgroup per device, bytes per second
322    #[serde(
323        rename = "throttleReadBpsDevice",
324        skip_serializing_if = "Option::is_none"
325    )]
326    pub throttle_read_bps_device:
327        Option<std::collections::HashMap<String, models::LinuxThrottleDevice>>,
328    /// IO read rate limit per cgroup per device, IO per second
329    #[serde(
330        rename = "throttleReadIOPSDevice",
331        skip_serializing_if = "Option::is_none"
332    )]
333    pub throttle_read_iops_device:
334        Option<std::collections::HashMap<String, models::LinuxThrottleDevice>>,
335    /// IO write rate limit per cgroup per device, bytes per second
336    #[serde(
337        rename = "throttleWriteBpsDevice",
338        skip_serializing_if = "Option::is_none"
339    )]
340    pub throttle_write_bps_device:
341        Option<std::collections::HashMap<String, models::LinuxThrottleDevice>>,
342    /// IO write rate limit per cgroup per device, IO per second
343    #[serde(
344        rename = "throttleWriteIOPSDevice",
345        skip_serializing_if = "Option::is_none"
346    )]
347    pub throttle_write_iops_device:
348        Option<std::collections::HashMap<String, models::LinuxThrottleDevice>>,
349    /// Timeout is a maximum time in seconds the container will run before main process is sent SIGKILL. If 0 is used, signal will not be sent. Container can run indefinitely if they do not stop after the default termination signal. Optional.
350    #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")]
351    pub timeout: Option<i32>,
352    /// Timezone is the timezone inside the container. Local means it has the same timezone as the host machine Optional.
353    #[serde(rename = "timezone", skip_serializing_if = "Option::is_none")]
354    pub timezone: Option<String>,
355    /// Umask is the umask the init process of the container will be run with.
356    #[serde(rename = "umask", skip_serializing_if = "Option::is_none")]
357    pub umask: Option<String>,
358    /// CgroupConf are key-value options passed into the container runtime that are used to configure cgroup v2. Optional.
359    #[serde(rename = "unified", skip_serializing_if = "Option::is_none")]
360    pub unified: Option<std::collections::HashMap<String, String>>,
361    /// Unmask a path in the container. Some paths are masked by default, preventing them from being accessed within the container; this undoes that masking. If ALL is passed, all paths will be unmasked. Optional.
362    #[serde(rename = "unmask", skip_serializing_if = "Option::is_none")]
363    pub unmask: Option<Vec<String>>,
364    /// UnsetEnv unsets the specified default environment variables from the image or from buildin or containers.conf Optional.
365    #[serde(rename = "unsetenv", skip_serializing_if = "Option::is_none")]
366    pub unsetenv: Option<Vec<String>>,
367    /// UnsetEnvAll unsetall default environment variables from the image or from buildin or containers.conf UnsetEnvAll unsets all default environment variables from the image or from buildin Optional.
368    #[serde(rename = "unsetenvall", skip_serializing_if = "Option::is_none")]
369    pub unsetenvall: Option<bool>,
370    /// UseImageHosts indicates that /etc/hosts should not be managed by Podman, and instead sourced from the image. Conflicts with HostAdd. Optional.
371    #[serde(rename = "use_image_hosts", skip_serializing_if = "Option::is_none")]
372    pub use_image_hosts: Option<bool>,
373    /// UseImageResolvConf indicates that resolv.conf should not be managed by Podman, but instead sourced from the image. Conflicts with DNSServer, DNSSearch, DNSOption. Optional.
374    #[serde(
375        rename = "use_image_resolve_conf",
376        skip_serializing_if = "Option::is_none"
377    )]
378    pub use_image_resolve_conf: Option<bool>,
379    /// User is the user the container will be run as. Can be given as a UID or a username; if a username, it will be resolved within the container, using the container's /etc/passwd. If unset, the container will be run as root. Optional.
380    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
381    pub user: Option<String>,
382    #[serde(rename = "userns", skip_serializing_if = "Option::is_none")]
383    pub userns: Option<Box<models::Namespace>>,
384    #[serde(rename = "utsns", skip_serializing_if = "Option::is_none")]
385    pub utsns: Option<Box<models::Namespace>>,
386    /// Volatile specifies whether the container storage can be optimized at the cost of not syncing all the dirty files in memory. Optional.
387    #[serde(rename = "volatile", skip_serializing_if = "Option::is_none")]
388    pub volatile: Option<bool>,
389    /// Volumes are named volumes that will be added to the container. These will supersede Image Volumes and VolumesFrom volumes where there are conflicts. Optional.
390    #[serde(rename = "volumes", skip_serializing_if = "Option::is_none")]
391    pub volumes: Option<Vec<models::NamedVolume>>,
392    /// VolumesFrom is a set of containers whose volumes will be added to this container. The name or ID of the container must be provided, and may optionally be followed by a : and then one or more comma-separated options. Valid options are 'ro', 'rw', and 'z'. Options will be used for all volumes sourced from the container. Optional.
393    #[serde(rename = "volumes_from", skip_serializing_if = "Option::is_none")]
394    pub volumes_from: Option<Vec<String>>,
395    /// Weight per cgroup per device, can override BlkioWeight
396    #[serde(rename = "weightDevice", skip_serializing_if = "Option::is_none")]
397    pub weight_device: Option<std::collections::HashMap<String, models::LinuxWeightDevice>>,
398    /// WorkDir is the container's working directory. If unset, the default, /, will be used. Optional.
399    #[serde(rename = "work_dir", skip_serializing_if = "Option::is_none")]
400    pub work_dir: Option<String>,
401}
402
403impl SpecGenerator {
404    /// SpecGenerator creates an OCI spec and Libpod configuration options to create a container based on the given configuration.
405    pub fn new() -> SpecGenerator {
406        SpecGenerator {
407            networks: None,
408            annotations: None,
409            apparmor_profile: None,
410            base_hosts_file: None,
411            cap_add: None,
412            cap_drop: None,
413            cgroup_parent: None,
414            cgroupns: None,
415            cgroups_mode: None,
416            chroot_directories: None,
417            cni_networks: None,
418            command: None,
419            conmon_pid_file: None,
420            container_create_command: None,
421            create_working_dir: None,
422            dependency_containers: None,
423            device_cgroup_rule: None,
424            devices: None,
425            devices_from: None,
426            dns_option: None,
427            dns_search: None,
428            dns_server: None,
429            entrypoint: None,
430            env: None,
431            env_host: None,
432            envmerge: None,
433            expose: None,
434            group_entry: None,
435            groups: None,
436            health_check_on_failure_action: None,
437            healthconfig: None,
438            host_device_list: None,
439            hostadd: None,
440            hostname: None,
441            hostusers: None,
442            httpproxy: None,
443            idmappings: None,
444            image: None,
445            image_arch: None,
446            image_os: None,
447            image_variant: None,
448            image_volume_mode: None,
449            image_volumes: None,
450            init: None,
451            init_container_type: None,
452            init_path: None,
453            intel_rdt: None,
454            ipcns: None,
455            label_nested: None,
456            labels: None,
457            log_configuration: None,
458            manage_password: None,
459            mask: None,
460            mounts: None,
461            name: None,
462            netns: None,
463            network_options: None,
464            no_new_privileges: None,
465            oci_runtime: None,
466            oom_score_adj: None,
467            overlay_volumes: None,
468            passwd_entry: None,
469            personality: None,
470            pidns: None,
471            pod: None,
472            portmappings: None,
473            privileged: None,
474            procfs_opts: None,
475            publish_image_ports: None,
476            r_limits: None,
477            raw_image_name: None,
478            read_only_filesystem: None,
479            read_write_tmpfs: None,
480            remove: None,
481            resource_limits: None,
482            restart_policy: None,
483            restart_tries: None,
484            rootfs: None,
485            rootfs_mapping: None,
486            rootfs_overlay: None,
487            rootfs_propagation: None,
488            sdnotify_mode: None,
489            seccomp_policy: None,
490            seccomp_profile_path: None,
491            secret_env: None,
492            secrets: None,
493            selinux_opts: None,
494            shm_size: None,
495            shm_size_systemd: None,
496            startup_health_config: None,
497            stdin: None,
498            stop_signal: None,
499            stop_timeout: None,
500            storage_opts: None,
501            sysctl: None,
502            systemd: None,
503            terminal: None,
504            throttle_read_bps_device: None,
505            throttle_read_iops_device: None,
506            throttle_write_bps_device: None,
507            throttle_write_iops_device: None,
508            timeout: None,
509            timezone: None,
510            umask: None,
511            unified: None,
512            unmask: None,
513            unsetenv: None,
514            unsetenvall: None,
515            use_image_hosts: None,
516            use_image_resolve_conf: None,
517            user: None,
518            userns: None,
519            utsns: None,
520            volatile: None,
521            volumes: None,
522            volumes_from: None,
523            weight_device: None,
524            work_dir: None,
525        }
526    }
527}