podman_autogen_api/models/
container_basic_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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ContainerBasicConfig {
16    /// Annotations are key-value options passed into the container runtime that can be used to trigger special behavior. Optional.
17    #[serde(rename = "annotations", skip_serializing_if = "Option::is_none")]
18    pub annotations: Option<std::collections::HashMap<String, String>>,
19    /// Command is the container's command. If not given and Image is specified, this will be populated by the image's configuration. Optional.
20    #[serde(rename = "command", skip_serializing_if = "Option::is_none")]
21    pub command: Option<Vec<String>>,
22    /// ConmonPidFile is a path at which a PID file for Conmon will be placed. If not given, a default location will be used. Optional.
23    #[serde(rename = "conmon_pid_file", skip_serializing_if = "Option::is_none")]
24    pub conmon_pid_file: Option<String>,
25    /// 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.
26    #[serde(
27        rename = "containerCreateCommand",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub container_create_command: Option<Vec<String>>,
31    /// 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.
32    #[serde(
33        rename = "dependencyContainers",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub dependency_containers: Option<Vec<String>>,
37    /// Entrypoint is the container's entrypoint. If not given and Image is specified, this will be populated by the image's configuration. Optional.
38    #[serde(rename = "entrypoint", skip_serializing_if = "Option::is_none")]
39    pub entrypoint: Option<Vec<String>>,
40    /// Env is a set of environment variables that will be set in the container. Optional.
41    #[serde(rename = "env", skip_serializing_if = "Option::is_none")]
42    pub env: Option<std::collections::HashMap<String, String>>,
43    /// EnvHost indicates that the host environment should be added to container Optional.
44    #[serde(rename = "env_host", skip_serializing_if = "Option::is_none")]
45    pub env_host: Option<bool>,
46    /// EnvMerge takes the specified environment variables from image and preprocess them before injecting them into the container. Optional.
47    #[serde(rename = "envmerge", skip_serializing_if = "Option::is_none")]
48    pub envmerge: Option<Vec<String>>,
49    /// GroupEntry specifies an arbitrary string to append to the container's /etc/group file. Optional.
50    #[serde(rename = "group_entry", skip_serializing_if = "Option::is_none")]
51    pub group_entry: Option<String>,
52    /// 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.
53    #[serde(rename = "hostname", skip_serializing_if = "Option::is_none")]
54    pub hostname: Option<String>,
55    /// HostUsers is a list of host usernames or UIDs to add to the container etc/passwd file
56    #[serde(rename = "hostusers", skip_serializing_if = "Option::is_none")]
57    pub hostusers: Option<Vec<String>>,
58    /// EnvHTTPProxy indicates that the http host proxy environment variables should be added to container Optional.
59    #[serde(rename = "httpproxy", skip_serializing_if = "Option::is_none")]
60    pub httpproxy: Option<bool>,
61    /// InitContainerType describes if this container is an init container and if so, what type: always or once. Optional.
62    #[serde(
63        rename = "init_container_type",
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub init_container_type: Option<String>,
67    /// Labels are key-value pairs that are used to add metadata to containers. Optional.
68    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
69    pub labels: Option<std::collections::HashMap<String, String>>,
70    #[serde(rename = "log_configuration", skip_serializing_if = "Option::is_none")]
71    pub log_configuration: Option<Box<models::LogConfigLibpod>>,
72    /// Passwd is a container run option that determines if we are validating users/groups before running the container
73    #[serde(rename = "manage_password", skip_serializing_if = "Option::is_none")]
74    pub manage_password: Option<bool>,
75    /// Name is the name the container will be given. If no name is provided, one will be randomly generated. Optional.
76    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
77    pub name: Option<String>,
78    /// 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.
79    #[serde(rename = "oci_runtime", skip_serializing_if = "Option::is_none")]
80    pub oci_runtime: Option<String>,
81    /// PasswdEntry specifies an arbitrary string to append to the container's /etc/passwd file. Optional.
82    #[serde(rename = "passwd_entry", skip_serializing_if = "Option::is_none")]
83    pub passwd_entry: Option<String>,
84    #[serde(rename = "personality", skip_serializing_if = "Option::is_none")]
85    pub personality: Option<Box<models::LinuxPersonality>>,
86    #[serde(rename = "pidns", skip_serializing_if = "Option::is_none")]
87    pub pidns: Option<Box<models::Namespace>>,
88    /// Pod is the ID of the pod the container will join. Optional.
89    #[serde(rename = "pod", skip_serializing_if = "Option::is_none")]
90    pub pod: Option<String>,
91    /// Remove indicates if the container should be removed once it has been started and exits. Optional.
92    #[serde(rename = "remove", skip_serializing_if = "Option::is_none")]
93    pub remove: Option<bool>,
94    /// 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.
95    #[serde(rename = "restart_policy", skip_serializing_if = "Option::is_none")]
96    pub restart_policy: Option<String>,
97    /// RestartRetries is the number of attempts that will be made to restart the container. Only available when RestartPolicy is set to \"on-failure\". Optional.
98    #[serde(rename = "restart_tries", skip_serializing_if = "Option::is_none")]
99    pub restart_tries: Option<i32>,
100    /// 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.
101    #[serde(rename = "sdnotifyMode", skip_serializing_if = "Option::is_none")]
102    pub sdnotify_mode: Option<String>,
103    /// EnvSecrets are secrets that will be set as environment variables Optional.
104    #[serde(rename = "secret_env", skip_serializing_if = "Option::is_none")]
105    pub secret_env: Option<std::collections::HashMap<String, String>>,
106    /// Stdin is whether the container will keep its STDIN open. Optional.
107    #[serde(rename = "stdin", skip_serializing_if = "Option::is_none")]
108    pub stdin: Option<bool>,
109    /// It implements the os.Signal interface.
110    #[serde(rename = "stop_signal", skip_serializing_if = "Option::is_none")]
111    pub stop_signal: Option<i64>,
112    /// 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.
113    #[serde(rename = "stop_timeout", skip_serializing_if = "Option::is_none")]
114    pub stop_timeout: Option<i32>,
115    /// Sysctl sets kernel parameters for the container
116    #[serde(rename = "sysctl", skip_serializing_if = "Option::is_none")]
117    pub sysctl: Option<std::collections::HashMap<String, String>>,
118    /// 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.
119    #[serde(rename = "systemd", skip_serializing_if = "Option::is_none")]
120    pub systemd: Option<String>,
121    /// Terminal is whether the container will create a PTY. Optional.
122    #[serde(rename = "terminal", skip_serializing_if = "Option::is_none")]
123    pub terminal: Option<bool>,
124    /// 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.
125    #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")]
126    pub timeout: Option<i32>,
127    /// Timezone is the timezone inside the container. Local means it has the same timezone as the host machine Optional.
128    #[serde(rename = "timezone", skip_serializing_if = "Option::is_none")]
129    pub timezone: Option<String>,
130    /// UnsetEnv unsets the specified default environment variables from the image or from buildin or containers.conf Optional.
131    #[serde(rename = "unsetenv", skip_serializing_if = "Option::is_none")]
132    pub unsetenv: Option<Vec<String>>,
133    /// 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.
134    #[serde(rename = "unsetenvall", skip_serializing_if = "Option::is_none")]
135    pub unsetenvall: Option<bool>,
136    #[serde(rename = "utsns", skip_serializing_if = "Option::is_none")]
137    pub utsns: Option<Box<models::Namespace>>,
138}
139
140impl ContainerBasicConfig {
141    pub fn new() -> ContainerBasicConfig {
142        ContainerBasicConfig {
143            annotations: None,
144            command: None,
145            conmon_pid_file: None,
146            container_create_command: None,
147            dependency_containers: None,
148            entrypoint: None,
149            env: None,
150            env_host: None,
151            envmerge: None,
152            group_entry: None,
153            hostname: None,
154            hostusers: None,
155            httpproxy: None,
156            init_container_type: None,
157            labels: None,
158            log_configuration: None,
159            manage_password: None,
160            name: None,
161            oci_runtime: None,
162            passwd_entry: None,
163            personality: None,
164            pidns: None,
165            pod: None,
166            remove: None,
167            restart_policy: None,
168            restart_tries: None,
169            sdnotify_mode: None,
170            secret_env: None,
171            stdin: None,
172            stop_signal: None,
173            stop_timeout: None,
174            sysctl: None,
175            systemd: None,
176            terminal: None,
177            timeout: None,
178            timezone: None,
179            unsetenv: None,
180            unsetenvall: None,
181            utsns: None,
182        }
183    }
184}