podman_rest_client/v5/models/
pod_basic_config.rs

1use serde::{Deserialize, Serialize};
2#[derive(Default, Debug, Serialize, Deserialize)]
3/// PodBasicConfig contains basic configuration options for pods.
4pub struct PodBasicConfig {
5    /// ExitPolicy determines the pod's exit and stop behaviour.
6    pub exit_policy: Option<String>,
7    /// Hostname is the pod's hostname. If not set, the name of the pod will
8    /// be used (if a name was not provided here, the name auto-generated for
9    /// the pod will be used). This will be used by the infra container and
10    /// all containers in the pod as long as the UTS namespace is shared.
11    /// Optional.
12    pub hostname: Option<String>,
13    /// InfraCommand sets the command that will be used to start the infra
14    /// container.
15    /// If not set, the default set in the Libpod configuration file will be
16    /// used.
17    /// Conflicts with NoInfra=true.
18    /// Optional.
19    pub infra_command: Option<Vec<String>>,
20    /// InfraConmonPidFile is a custom path to store the infra container's
21    /// conmon PID.
22    pub infra_conmon_pid_file: Option<String>,
23    /// InfraImage is the image that will be used for the infra container.
24    /// If not set, the default set in the Libpod configuration file will be
25    /// used.
26    /// Conflicts with NoInfra=true.
27    /// Optional.
28    pub infra_image: Option<String>,
29    /// InfraName is the name that will be used for the infra container.
30    /// If not set, the default set in the Libpod configuration file will be
31    /// used.
32    /// Conflicts with NoInfra=true.
33    /// Optional.
34    pub infra_name: Option<String>,
35    pub ipcns: Option<crate::v5::models::Namespace>,
36    /// Labels are key-value pairs that are used to add metadata to pods.
37    /// Optional.
38    pub labels: Option<std::collections::HashMap<String, String>>,
39    /// Name is the name of the pod.
40    /// If not provided, a name will be generated when the pod is created.
41    /// Optional.
42    pub name: Option<String>,
43    /// NoInfra tells the pod not to create an infra container. If this is
44    /// done, many networking-related options will become unavailable.
45    /// Conflicts with setting any options in PodNetworkConfig, and the
46    /// InfraCommand and InfraImages in this struct.
47    /// Optional.
48    pub no_infra: Option<bool>,
49    pub pidns: Option<crate::v5::models::Namespace>,
50    pub pod_create_command: Option<Vec<String>>,
51    /// Devices contains user specified Devices to be added to the Pod
52    pub pod_devices: Option<Vec<String>>,
53    /// RestartPolicy is the pod's restart policy - an action which
54    /// will be taken when one or all the containers in the pod exits.
55    /// If not given, the default policy will be set to Always, which
56    /// restarts the containers in the pod when they exit indefinitely.
57    /// Optional.
58    pub restart_policy: Option<String>,
59    /// RestartRetries is the number of attempts that will be made to restart
60    /// the container.
61    /// Only available when RestartPolicy is set to "on-failure".
62    /// Optional.
63    pub restart_tries: Option<u64>,
64    /// PodCreateCommand is the command used to create this pod.
65    /// This will be shown in the output of Inspect() on the pod, and may
66    /// also be used by some tools that wish to recreate the pod
67    /// (e.g. `podman generate systemd --new`).
68    /// Optional.
69    /// ShareParent determines if all containers in the pod will share the pod's cgroup as the cgroup parent
70    pub share_parent: Option<bool>,
71    /// SharedNamespaces instructs the pod to share a set of namespaces.
72    /// Shared namespaces will be joined (by default) by every container
73    /// which joins the pod.
74    /// If not set and NoInfra is false, the pod will set a default set of
75    /// namespaces to share.
76    /// Conflicts with NoInfra=true.
77    /// Optional.
78    pub shared_namespaces: Option<Vec<String>>,
79    /// Sysctl sets kernel parameters for the pod
80    pub sysctl: Option<std::collections::HashMap<String, String>>,
81    pub userns: Option<crate::v5::models::Namespace>,
82    pub utsns: Option<crate::v5::models::Namespace>,
83}