podman_autogen_api/models/
inspect_pod_data.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/// InspectPodData : InspectPodData contains detailed information on a pod's configuration and state. It is used as the output of Inspect on pods.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct InspectPodData {
17    /// CgroupParent is the parent of the pod's Cgroup.
18    #[serde(rename = "CgroupParent", skip_serializing_if = "Option::is_none")]
19    pub cgroup_parent: Option<String>,
20    /// CgroupPath is the path to the pod's Cgroup.
21    #[serde(rename = "CgroupPath", skip_serializing_if = "Option::is_none")]
22    pub cgroup_path: Option<String>,
23    /// Containers gives a brief summary of all containers in the pod and their current status.
24    #[serde(rename = "Containers", skip_serializing_if = "Option::is_none")]
25    pub containers: Option<Vec<models::InspectPodContainerInfo>>,
26    /// CreateCgroup is whether this pod will create its own Cgroup to group containers under.
27    #[serde(rename = "CreateCgroup", skip_serializing_if = "Option::is_none")]
28    pub create_cgroup: Option<bool>,
29    /// CreateCommand is the full command plus arguments of the process the container has been created with.
30    #[serde(rename = "CreateCommand", skip_serializing_if = "Option::is_none")]
31    pub create_command: Option<Vec<String>>,
32    /// CreateInfra is whether this pod will create an infra container to share namespaces.
33    #[serde(rename = "CreateInfra", skip_serializing_if = "Option::is_none")]
34    pub create_infra: Option<bool>,
35    /// Created is the time when the pod was created.
36    #[serde(rename = "Created", skip_serializing_if = "Option::is_none")]
37    pub created: Option<String>,
38    /// ExitPolicy of the pod.
39    #[serde(rename = "ExitPolicy", skip_serializing_if = "Option::is_none")]
40    pub exit_policy: Option<String>,
41    /// Hostname is the hostname that the pod will set.
42    #[serde(rename = "Hostname", skip_serializing_if = "Option::is_none")]
43    pub hostname: Option<String>,
44    /// ID is the ID of the pod.
45    #[serde(rename = "Id", skip_serializing_if = "Option::is_none")]
46    pub id: Option<String>,
47    #[serde(rename = "InfraConfig", skip_serializing_if = "Option::is_none")]
48    pub infra_config: Option<Box<models::InspectPodInfraConfig>>,
49    /// InfraContainerID is the ID of the pod's infra container, if one is present.
50    #[serde(rename = "InfraContainerID", skip_serializing_if = "Option::is_none")]
51    pub infra_container_id: Option<String>,
52    /// Labels is a set of key-value labels that have been applied to the pod.
53    #[serde(rename = "Labels", skip_serializing_if = "Option::is_none")]
54    pub labels: Option<std::collections::HashMap<String, String>>,
55    /// Number of the pod's Libpod lock.
56    #[serde(rename = "LockNumber", skip_serializing_if = "Option::is_none")]
57    pub lock_number: Option<i32>,
58    /// Name is the name of the pod.
59    #[serde(rename = "Name", skip_serializing_if = "Option::is_none")]
60    pub name: Option<String>,
61    /// Namespace is the Libpod namespace the pod is placed in.
62    #[serde(rename = "Namespace", skip_serializing_if = "Option::is_none")]
63    pub namespace: Option<String>,
64    /// NumContainers is the number of containers in the pod, including the infra container.
65    #[serde(rename = "NumContainers", skip_serializing_if = "Option::is_none")]
66    pub num_containers: Option<i32>,
67    /// RestartPolicy of the pod.
68    #[serde(rename = "RestartPolicy", skip_serializing_if = "Option::is_none")]
69    pub restart_policy: Option<String>,
70    /// SharedNamespaces contains a list of namespaces that will be shared by containers within the pod. Can only be set if CreateInfra is true.
71    #[serde(rename = "SharedNamespaces", skip_serializing_if = "Option::is_none")]
72    pub shared_namespaces: Option<Vec<String>>,
73    /// State represents the current state of the pod.
74    #[serde(rename = "State", skip_serializing_if = "Option::is_none")]
75    pub state: Option<String>,
76    /// BlkioWeight contains the blkio weight limit for the pod
77    #[serde(rename = "blkio_weight", skip_serializing_if = "Option::is_none")]
78    pub blkio_weight: Option<i32>,
79    /// BlkioWeightDevice contains the blkio weight device limits for the pod
80    #[serde(
81        rename = "blkio_weight_device",
82        skip_serializing_if = "Option::is_none"
83    )]
84    pub blkio_weight_device: Option<Vec<models::InspectBlkioWeightDevice>>,
85    /// CPUPeriod contains the CPU period of the pod
86    #[serde(rename = "cpu_period", skip_serializing_if = "Option::is_none")]
87    pub cpu_period: Option<i32>,
88    /// CPUQuota contains the CPU quota of the pod
89    #[serde(rename = "cpu_quota", skip_serializing_if = "Option::is_none")]
90    pub cpu_quota: Option<i64>,
91    /// CPUShares contains the cpu shares for the pod
92    #[serde(rename = "cpu_shares", skip_serializing_if = "Option::is_none")]
93    pub cpu_shares: Option<i32>,
94    /// CPUSetCPUs contains linux specific CPU data for the pod
95    #[serde(rename = "cpuset_cpus", skip_serializing_if = "Option::is_none")]
96    pub cpuset_cpus: Option<String>,
97    /// CPUSetMems contains linux specific CPU data for the pod
98    #[serde(rename = "cpuset_mems", skip_serializing_if = "Option::is_none")]
99    pub cpuset_mems: Option<String>,
100    /// BlkioDeviceReadBps contains the Read/Access limit for the pod's devices
101    #[serde(rename = "device_read_bps", skip_serializing_if = "Option::is_none")]
102    pub device_read_bps: Option<Vec<models::InspectBlkioThrottleDevice>>,
103    /// BlkioDeviceReadBps contains the Read/Access limit for the pod's devices
104    #[serde(rename = "device_write_bps", skip_serializing_if = "Option::is_none")]
105    pub device_write_bps: Option<Vec<models::InspectBlkioThrottleDevice>>,
106    /// Devices contains the specified host devices
107    #[serde(rename = "devices", skip_serializing_if = "Option::is_none")]
108    pub devices: Option<Vec<models::InspectDevice>>,
109    /// MemoryLimit contains the specified cgroup memory limit for the pod
110    #[serde(rename = "memory_limit", skip_serializing_if = "Option::is_none")]
111    pub memory_limit: Option<i32>,
112    /// MemorySwap contains the specified memory swap limit for the pod
113    #[serde(rename = "memory_swap", skip_serializing_if = "Option::is_none")]
114    pub memory_swap: Option<i32>,
115    /// Mounts contains volume related information for the pod
116    #[serde(rename = "mounts", skip_serializing_if = "Option::is_none")]
117    pub mounts: Option<Vec<models::InspectMount>>,
118    /// SecurityOpt contains the specified security labels and related SELinux information
119    #[serde(rename = "security_opt", skip_serializing_if = "Option::is_none")]
120    pub security_opt: Option<Vec<String>>,
121    /// VolumesFrom contains the containers that the pod inherits mounts from
122    #[serde(rename = "volumes_from", skip_serializing_if = "Option::is_none")]
123    pub volumes_from: Option<Vec<String>>,
124}
125
126impl InspectPodData {
127    /// InspectPodData contains detailed information on a pod's configuration and state. It is used as the output of Inspect on pods.
128    pub fn new() -> InspectPodData {
129        InspectPodData {
130            cgroup_parent: None,
131            cgroup_path: None,
132            containers: None,
133            create_cgroup: None,
134            create_command: None,
135            create_infra: None,
136            created: None,
137            exit_policy: None,
138            hostname: None,
139            id: None,
140            infra_config: None,
141            infra_container_id: None,
142            labels: None,
143            lock_number: None,
144            name: None,
145            namespace: None,
146            num_containers: None,
147            restart_policy: None,
148            shared_namespaces: None,
149            state: None,
150            blkio_weight: None,
151            blkio_weight_device: None,
152            cpu_period: None,
153            cpu_quota: None,
154            cpu_shares: None,
155            cpuset_cpus: None,
156            cpuset_mems: None,
157            device_read_bps: None,
158            device_write_bps: None,
159            devices: None,
160            memory_limit: None,
161            memory_swap: None,
162            mounts: None,
163            security_opt: None,
164            volumes_from: None,
165        }
166    }
167}