podman_rest_client/v5/models/
pod_spec_generator.rs

1use serde::{Deserialize, Serialize};
2#[derive(Default, Debug, Serialize, Deserialize)]
3/// PodSpecGenerator describes options to create a pod
4pub struct PodSpecGenerator {
5    /// Map of networks names to ids the container should join to.
6    /// You can request additional settings for each network, you can
7    /// set network aliases, static ips, static mac address  and the
8    /// network interface name for this container on the specific network.
9    /// If the map is empty and the bridge network mode is set the container
10    /// will be joined to the default network.
11    #[serde(rename = "Networks")]
12    pub networks: Option<std::collections::HashMap<String, crate::v5::models::PerNetworkOptions>>,
13    /// CgroupParent is the parent for the Cgroup that the pod will create.
14    /// This pod cgroup will, in turn, be the default cgroup parent for all
15    /// containers in the pod.
16    /// Optional.
17    pub cgroup_parent: Option<String>,
18    /// CNINetworks is a list of CNI networks to join the container to.
19    /// If this list is empty, the default CNI network will be joined
20    /// instead. If at least one entry is present, we will not join the
21    /// default network (unless it is part of this list).
22    /// Only available if NetNS is set to bridge.
23    /// Optional.
24    /// Deprecated: as of podman 4.0 use "Networks" instead.
25    pub cni_networks: Option<Vec<String>>,
26    /// CPU period of the cpuset, determined by --cpus
27    pub cpu_period: Option<u64>,
28    /// CPU quota of the cpuset, determined by --cpus
29    pub cpu_quota: Option<i64>,
30    /// DNSOption is a set of DNS options that will be used in the infra
31    /// container's resolv.conf, which will, by default, be shared with all
32    /// containers in the pod.
33    /// Conflicts with NoInfra=true.
34    /// Optional.
35    pub dns_option: Option<Vec<String>>,
36    /// DNSSearch is a set of DNS search domains that will be used in the
37    /// infra container's resolv.conf, which will, by default, be shared with
38    /// all containers in the pod.
39    /// If not provided, DNS search domains from the host's resolv.conf will
40    /// be used.
41    /// Conflicts with NoInfra=true.
42    /// Optional.
43    pub dns_search: Option<Vec<String>>,
44    /// DNSServer is a set of DNS servers that will be used in the infra
45    /// container's resolv.conf, which will, by default, be shared with all
46    /// containers in the pod.
47    /// If not provided, the host's DNS servers will be used, unless the only
48    /// server set is a localhost address. As the container cannot connect to
49    /// the host's localhost, a default server will instead be set.
50    /// Conflicts with NoInfra=true.
51    /// Optional.
52    pub dns_server: Option<Vec<String>>,
53    /// ExitPolicy determines the pod's exit and stop behaviour.
54    pub exit_policy: Option<String>,
55    /// HostAdd is a set of hosts that will be added to the infra container's
56    /// etc/hosts that will, by default, be shared with all containers in
57    /// the pod.
58    /// Conflicts with NoInfra=true and NoManageHosts.
59    /// Optional.
60    pub hostadd: Option<Vec<String>>,
61    /// Hostname is the pod's hostname. If not set, the name of the pod will
62    /// be used (if a name was not provided here, the name auto-generated for
63    /// the pod will be used). This will be used by the infra container and
64    /// all containers in the pod as long as the UTS namespace is shared.
65    /// Optional.
66    pub hostname: Option<String>,
67    pub idmappings: Option<crate::v5::models::IdMappingOptions>,
68    /// Image volumes bind-mount a container-image mount into the pod's infra container.
69    /// Optional.
70    pub image_volumes: Option<Vec<crate::v5::models::ImageVolume>>,
71    /// InfraCommand sets the command that will be used to start the infra
72    /// container.
73    /// If not set, the default set in the Libpod configuration file will be
74    /// used.
75    /// Conflicts with NoInfra=true.
76    /// Optional.
77    pub infra_command: Option<Vec<String>>,
78    /// InfraConmonPidFile is a custom path to store the infra container's
79    /// conmon PID.
80    pub infra_conmon_pid_file: Option<String>,
81    /// InfraImage is the image that will be used for the infra container.
82    /// If not set, the default set in the Libpod configuration file will be
83    /// used.
84    /// Conflicts with NoInfra=true.
85    /// Optional.
86    pub infra_image: Option<String>,
87    /// InfraName is the name that will be used for the infra container.
88    /// If not set, the default set in the Libpod configuration file will be
89    /// used.
90    /// Conflicts with NoInfra=true.
91    /// Optional.
92    pub infra_name: Option<String>,
93    pub ipcns: Option<crate::v5::models::Namespace>,
94    /// Labels are key-value pairs that are used to add metadata to pods.
95    /// Optional.
96    pub labels: Option<std::collections::HashMap<String, String>>,
97    /// Mounts are mounts that will be added to the pod.
98    /// These will supersede Image Volumes and VolumesFrom volumes where
99    /// there are conflicts.
100    /// Optional.
101    pub mounts: Option<Vec<crate::v5::models::Mount>>,
102    /// Name is the name of the pod.
103    /// If not provided, a name will be generated when the pod is created.
104    /// Optional.
105    pub name: Option<String>,
106    pub netns: Option<crate::v5::models::Namespace>,
107    /// NetworkOptions are additional options for each network
108    /// Optional.
109    pub network_options: Option<std::collections::HashMap<String, Vec<String>>>,
110    /// NoInfra tells the pod not to create an infra container. If this is
111    /// done, many networking-related options will become unavailable.
112    /// Conflicts with setting any options in PodNetworkConfig, and the
113    /// InfraCommand and InfraImages in this struct.
114    /// Optional.
115    pub no_infra: Option<bool>,
116    /// NoManageHosts indicates that /etc/hosts should not be managed by the
117    /// pod. Instead, each container will create a separate /etc/hosts as
118    /// they would if not in a pod.
119    /// Conflicts with HostAdd.
120    pub no_manage_hosts: Option<bool>,
121    /// NoManageResolvConf indicates that /etc/resolv.conf should not be
122    /// managed by the pod. Instead, each container will create and manage a
123    /// separate resolv.conf as if they had not joined a pod.
124    /// Conflicts with NoInfra=true and DNSServer, DNSSearch, DNSOption.
125    /// Optional.
126    pub no_manage_resolv_conf: Option<bool>,
127    /// Overlay volumes are named volumes that will be added to the pod.
128    /// Optional.
129    pub overlay_volumes: Option<Vec<crate::v5::models::OverlayVolume>>,
130    pub pidns: Option<crate::v5::models::Namespace>,
131    pub pod_create_command: Option<Vec<String>>,
132    /// Devices contains user specified Devices to be added to the Pod
133    pub pod_devices: Option<Vec<String>>,
134    /// PortMappings is a set of ports to map into the infra container.
135    /// As, by default, containers share their network with the infra
136    /// container, this will forward the ports to the entire pod.
137    /// Only available if NetNS is set to Bridge, Slirp, or Pasta.
138    /// Optional.
139    pub portmappings: Option<Vec<crate::v5::models::PortMapping>>,
140    pub resource_limits: Option<crate::v5::models::LinuxResources>,
141    /// RestartPolicy is the pod's restart policy - an action which
142    /// will be taken when one or all the containers in the pod exits.
143    /// If not given, the default policy will be set to Always, which
144    /// restarts the containers in the pod when they exit indefinitely.
145    /// Optional.
146    pub restart_policy: Option<String>,
147    /// RestartRetries is the number of attempts that will be made to restart
148    /// the container.
149    /// Only available when RestartPolicy is set to "on-failure".
150    /// Optional.
151    pub restart_tries: Option<u64>,
152    pub security_opt: Option<Vec<String>>,
153    /// The ID of the pod's service container.
154    #[serde(rename = "serviceContainerID")]
155    pub service_container_id: Option<String>,
156    /// PodCreateCommand is the command used to create this pod.
157    /// This will be shown in the output of Inspect() on the pod, and may
158    /// also be used by some tools that wish to recreate the pod
159    /// (e.g. `podman generate systemd --new`).
160    /// Optional.
161    /// ShareParent determines if all containers in the pod will share the pod's cgroup as the cgroup parent
162    pub share_parent: Option<bool>,
163    /// SharedNamespaces instructs the pod to share a set of namespaces.
164    /// Shared namespaces will be joined (by default) by every container
165    /// which joins the pod.
166    /// If not set and NoInfra is false, the pod will set a default set of
167    /// namespaces to share.
168    /// Conflicts with NoInfra=true.
169    /// Optional.
170    pub shared_namespaces: Option<Vec<String>>,
171    /// ShmSize is the size of the tmpfs to mount in at /dev/shm, in bytes.
172    /// Conflicts with ShmSize if IpcNS is not private.
173    /// Optional.
174    pub shm_size: Option<i64>,
175    /// ShmSizeSystemd is the size of systemd-specific tmpfs mounts
176    /// specifically /run, /run/lock, /var/log/journal and /tmp.
177    /// Optional
178    pub shm_size_systemd: Option<i64>,
179    /// Sysctl sets kernel parameters for the pod
180    pub sysctl: Option<std::collections::HashMap<String, String>>,
181    /// ThrottleReadBpsDevice contains the rate at which the devices in the pod can be read from/accessed
182    #[serde(rename = "throttleReadBpsDevice")]
183    pub throttle_read_bps_device:
184        Option<std::collections::HashMap<String, crate::v5::models::LinuxThrottleDevice>>,
185    pub userns: Option<crate::v5::models::Namespace>,
186    pub utsns: Option<crate::v5::models::Namespace>,
187    /// Volumes are named volumes that will be added to the pod.
188    /// These will supersede Image Volumes and VolumesFrom  volumes where
189    /// there are conflicts.
190    /// Optional.
191    pub volumes: Option<Vec<crate::v5::models::NamedVolume>>,
192    /// VolumesFrom is a set of containers whose volumes will be added to
193    /// this pod. The name or ID of the container must be provided, and
194    /// may optionally be followed by a : and then one or more
195    /// comma-separated options. Valid options are 'ro', 'rw', and 'z'.
196    /// Options will be used for all volumes sourced from the container.
197    pub volumes_from: Option<Vec<String>>,
198}