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