podman_autogen_api/models/list_container.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/// ListContainer : ListContainer describes a container suitable for listing
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ListContainer {
17 /// AutoRemove
18 #[serde(rename = "AutoRemove", skip_serializing_if = "Option::is_none")]
19 pub auto_remove: Option<bool>,
20 /// CIDFile specified at creation time.
21 #[serde(rename = "CIDFile", skip_serializing_if = "Option::is_none")]
22 pub cid_file: Option<String>,
23 /// Container command
24 #[serde(rename = "Command", skip_serializing_if = "Option::is_none")]
25 pub command: Option<Vec<String>>,
26 /// Container creation time
27 #[serde(rename = "Created", skip_serializing_if = "Option::is_none")]
28 pub created: Option<String>,
29 /// Human-readable container creation time.
30 #[serde(rename = "CreatedAt", skip_serializing_if = "Option::is_none")]
31 pub created_at: Option<String>,
32 /// If container has exited, the return code from the command
33 #[serde(rename = "ExitCode", skip_serializing_if = "Option::is_none")]
34 pub exit_code: Option<i32>,
35 /// If container has exited/stopped
36 #[serde(rename = "Exited", skip_serializing_if = "Option::is_none")]
37 pub exited: Option<bool>,
38 /// Time container exited
39 #[serde(rename = "ExitedAt", skip_serializing_if = "Option::is_none")]
40 pub exited_at: Option<i64>,
41 /// ExposedPorts contains the ports that are exposed but not forwarded, see Ports for forwarded ports. The key is the port number and the string slice contains the protocols, i.e. \"tcp\", \"udp\" and \"sctp\".
42 #[serde(rename = "ExposedPorts", skip_serializing_if = "Option::is_none")]
43 pub exposed_ports: Option<serde_json::Value>,
44 /// The unique identifier for the container
45 #[serde(rename = "Id", skip_serializing_if = "Option::is_none")]
46 pub id: Option<String>,
47 /// Container image
48 #[serde(rename = "Image", skip_serializing_if = "Option::is_none")]
49 pub image: Option<String>,
50 /// Container image ID
51 #[serde(rename = "ImageID", skip_serializing_if = "Option::is_none")]
52 pub image_id: Option<String>,
53 /// If this container is a Pod infra container
54 #[serde(rename = "IsInfra", skip_serializing_if = "Option::is_none")]
55 pub is_infra: Option<bool>,
56 /// Labels for container
57 #[serde(rename = "Labels", skip_serializing_if = "Option::is_none")]
58 pub labels: Option<std::collections::HashMap<String, String>>,
59 /// User volume mounts
60 #[serde(rename = "Mounts", skip_serializing_if = "Option::is_none")]
61 pub mounts: Option<Vec<String>>,
62 /// The names assigned to the container
63 #[serde(rename = "Names", skip_serializing_if = "Option::is_none")]
64 pub names: Option<Vec<String>>,
65 #[serde(rename = "Namespaces", skip_serializing_if = "Option::is_none")]
66 pub namespaces: Option<Box<models::ListContainerNamespaces>>,
67 /// The network names assigned to the container
68 #[serde(rename = "Networks", skip_serializing_if = "Option::is_none")]
69 pub networks: Option<Vec<String>>,
70 /// The process id of the container
71 #[serde(rename = "Pid", skip_serializing_if = "Option::is_none")]
72 pub pid: Option<i64>,
73 /// If the container is part of Pod, the Pod ID. Requires the pod boolean to be set
74 #[serde(rename = "Pod", skip_serializing_if = "Option::is_none")]
75 pub pod: Option<String>,
76 /// If the container is part of Pod, the Pod name. Requires the pod boolean to be set
77 #[serde(rename = "PodName", skip_serializing_if = "Option::is_none")]
78 pub pod_name: Option<String>,
79 /// Port mappings
80 #[serde(rename = "Ports", skip_serializing_if = "Option::is_none")]
81 pub ports: Option<Vec<models::PortMapping>>,
82 /// Restarts is how many times the container was restarted by its restart policy. This is NOT incremented by normal container restarts (only by restart policy).
83 #[serde(rename = "Restarts", skip_serializing_if = "Option::is_none")]
84 pub restarts: Option<i32>,
85 #[serde(rename = "Size", skip_serializing_if = "Option::is_none")]
86 pub size: Option<Box<models::ContainerSize>>,
87 /// Time when container started
88 #[serde(rename = "StartedAt", skip_serializing_if = "Option::is_none")]
89 pub started_at: Option<i64>,
90 /// State of container
91 #[serde(rename = "State", skip_serializing_if = "Option::is_none")]
92 pub state: Option<String>,
93 /// Status is a human-readable approximation of a duration for json output
94 #[serde(rename = "Status", skip_serializing_if = "Option::is_none")]
95 pub status: Option<String>,
96}
97
98impl ListContainer {
99 /// ListContainer describes a container suitable for listing
100 pub fn new() -> ListContainer {
101 ListContainer {
102 auto_remove: None,
103 cid_file: None,
104 command: None,
105 created: None,
106 created_at: None,
107 exit_code: None,
108 exited: None,
109 exited_at: None,
110 exposed_ports: None,
111 id: None,
112 image: None,
113 image_id: None,
114 is_infra: None,
115 labels: None,
116 mounts: None,
117 names: None,
118 namespaces: None,
119 networks: None,
120 pid: None,
121 pod: None,
122 pod_name: None,
123 ports: None,
124 restarts: None,
125 size: None,
126 started_at: None,
127 state: None,
128 status: None,
129 }
130 }
131}