podman_rest_client/v5/models/
container_basic_config.rs

1use serde::{Deserialize, Serialize};
2#[derive(Default, Debug, Serialize, Deserialize)]
3/// ContainerBasicConfig contains the basic parts of a container.
4pub struct ContainerBasicConfig {
5    /// Annotations are key-value options passed into the container runtime
6    /// that can be used to trigger special behavior.
7    /// Optional.
8    pub annotations: Option<std::collections::HashMap<String, String>>,
9    /// Command is the container's command.
10    /// If not given and Image is specified, this will be populated by the
11    /// image's configuration.
12    /// Optional.
13    pub command: Option<Vec<String>>,
14    /// ConmonPidFile is a path at which a PID file for Conmon will be
15    /// placed.
16    /// If not given, a default location will be used.
17    /// Optional.
18    pub conmon_pid_file: Option<String>,
19    /// ContainerCreateCommand is the command that was used to create this
20    /// container.
21    /// This will be shown in the output of Inspect() on the container, and
22    /// may also be used by some tools that wish to recreate the container
23    /// (e.g. `podman generate systemd --new`).
24    /// Optional.
25    #[serde(rename = "containerCreateCommand")]
26    pub container_create_command: Option<Vec<String>>,
27    /// DependencyContainers is an array of containers this container
28    /// depends on. Dependency containers must be started before this
29    /// container. Dependencies can be specified by name or full/partial ID.
30    /// Optional.
31    #[serde(rename = "dependencyContainers")]
32    pub dependency_containers: Option<Vec<String>>,
33    /// Entrypoint is the container's entrypoint.
34    /// If not given and Image is specified, this will be populated by the
35    /// image's configuration.
36    /// Optional.
37    pub entrypoint: Option<Vec<String>>,
38    /// Env is a set of environment variables that will be set in the
39    /// container.
40    /// Optional.
41    pub env: Option<std::collections::HashMap<String, String>>,
42    /// EnvHost indicates that the host environment should be added to container
43    /// Optional.
44    pub env_host: Option<bool>,
45    /// EnvMerge takes the specified environment variables from image and preprocess them before injecting them into the
46    /// container.
47    /// Optional.
48    pub envmerge: Option<Vec<String>>,
49    /// GroupEntry specifies an arbitrary string to append to the container's /etc/group file.
50    /// Optional.
51    pub group_entry: Option<String>,
52    /// Hostname is the container's hostname. If not set, the hostname will
53    /// not be modified (if UtsNS is not private) or will be set to the
54    /// container ID (if UtsNS is private).
55    /// Conflicts with UtsNS if UtsNS is not set to private.
56    /// Optional.
57    pub hostname: Option<String>,
58    /// HostUsers is a list of host usernames or UIDs to add to the container
59    /// etc/passwd file
60    pub hostusers: Option<Vec<String>>,
61    /// EnvHTTPProxy indicates that the http host proxy environment variables
62    /// should be added to container
63    /// Optional.
64    pub httpproxy: Option<bool>,
65    /// InitContainerType describes if this container is an init container
66    /// and if so, what type: always or once.
67    /// Optional.
68    pub init_container_type: Option<String>,
69    /// Labels are key-value pairs that are used to add metadata to
70    /// containers.
71    /// Optional.
72    pub labels: Option<std::collections::HashMap<String, String>>,
73    pub log_configuration: Option<crate::v5::models::LogConfigLibpod>,
74    /// Passwd is a container run option that determines if we are validating users/groups before running the container
75    pub manage_password: Option<bool>,
76    /// Name is the name the container will be given.
77    /// If no name is provided, one will be randomly generated.
78    /// Optional.
79    pub name: Option<String>,
80    /// OCIRuntime is the name of the OCI runtime that will be used to create
81    /// the container.
82    /// If not specified, the default will be used.
83    /// Optional.
84    pub oci_runtime: Option<String>,
85    /// PasswdEntry specifies an arbitrary string to append to the container's /etc/passwd file.
86    /// Optional.
87    pub passwd_entry: Option<String>,
88    pub personality: Option<crate::v5::models::LinuxPersonality>,
89    pub pidns: Option<crate::v5::models::Namespace>,
90    /// Pod is the ID of the pod the container will join.
91    /// Optional.
92    pub pod: Option<String>,
93    /// Remove indicates if the container should be removed once it has been started
94    /// and exits.
95    /// Optional.
96    pub remove: Option<bool>,
97    /// RestartPolicy is the container's restart policy - an action which
98    /// will be taken when the container exits.
99    /// If not given, the default policy, which does nothing, will be used.
100    /// Optional.
101    pub restart_policy: Option<String>,
102    /// RestartRetries is the number of attempts that will be made to restart
103    /// the container.
104    /// Only available when RestartPolicy is set to "on-failure".
105    /// Optional.
106    pub restart_tries: Option<u64>,
107    /// Determine how to handle the NOTIFY_SOCKET - do we participate or pass it through
108    /// "container" - let the OCI runtime deal with it, advertise conmon's MAINPID
109    /// "conmon-only" - advertise conmon's MAINPID, send READY when started, don't pass to OCI
110    /// "ignore" - unset NOTIFY_SOCKET
111    /// Optional.
112    #[serde(rename = "sdnotifyMode")]
113    pub sdnotify_mode: Option<String>,
114    /// EnvSecrets are secrets that will be set as environment variables
115    /// Optional.
116    pub secret_env: Option<std::collections::HashMap<String, String>>,
117    /// Stdin is whether the container will keep its STDIN open.
118    /// Optional.
119    pub stdin: Option<bool>,
120    pub stop_signal: Option<i64>,
121    /// StopTimeout is a timeout between the container's stop signal being
122    /// sent and SIGKILL being sent.
123    /// If not provided, the default will be used.
124    /// If 0 is used, stop signal will not be sent, and SIGKILL will be sent
125    /// instead.
126    /// Optional.
127    pub stop_timeout: Option<u64>,
128    /// Sysctl sets kernel parameters for the container
129    pub sysctl: Option<std::collections::HashMap<String, String>>,
130    /// Systemd is whether the container will be started in systemd mode.
131    /// Valid options are "true", "false", and "always".
132    /// "true" enables this mode only if the binary run in the container is
133    /// sbin/init or systemd. "always" unconditionally enables systemd mode.
134    /// "false" unconditionally disables systemd mode.
135    /// If enabled, mounts and stop signal will be modified.
136    /// If set to "always" or set to "true" and conditionally triggered,
137    /// conflicts with StopSignal.
138    /// If not specified, "false" will be assumed.
139    /// Optional.
140    pub systemd: Option<String>,
141    /// Terminal is whether the container will create a PTY.
142    /// Optional.
143    pub terminal: Option<bool>,
144    /// Timeout is a maximum time in seconds the container will run before
145    /// main process is sent SIGKILL.
146    /// If 0 is used, signal will not be sent. Container can run indefinitely
147    /// if they do not stop after the default termination signal.
148    /// Optional.
149    pub timeout: Option<u64>,
150    /// Timezone is the timezone inside the container.
151    /// Local means it has the same timezone as the host machine
152    /// Optional.
153    pub timezone: Option<String>,
154    /// UnsetEnv unsets the specified default environment variables from the image or from buildin or containers.conf
155    /// Optional.
156    pub unsetenv: Option<Vec<String>>,
157    /// UnsetEnvAll unsetall default environment variables from the image or from buildin or containers.conf
158    /// UnsetEnvAll unsets all default environment variables from the image or from buildin
159    /// Optional.
160    pub unsetenvall: Option<bool>,
161    pub utsns: Option<crate::v5::models::Namespace>,
162}