podman_autogen_api/models/
inspect_container_state.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/// InspectContainerState : InspectContainerState provides a detailed record of a container's current state. It is returned as part of InspectContainerData. As with InspectContainerData, many portions of this struct are matched to Docker, but here we see more fields that are unused (nonsensical in the context of Libpod).
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct InspectContainerState {
17    #[serde(rename = "CgroupPath", skip_serializing_if = "Option::is_none")]
18    pub cgroup_path: Option<String>,
19    #[serde(rename = "CheckpointLog", skip_serializing_if = "Option::is_none")]
20    pub checkpoint_log: Option<String>,
21    #[serde(rename = "CheckpointPath", skip_serializing_if = "Option::is_none")]
22    pub checkpoint_path: Option<String>,
23    #[serde(rename = "Checkpointed", skip_serializing_if = "Option::is_none")]
24    pub checkpointed: Option<bool>,
25    #[serde(rename = "CheckpointedAt", skip_serializing_if = "Option::is_none")]
26    pub checkpointed_at: Option<String>,
27    #[serde(rename = "ConmonPid", skip_serializing_if = "Option::is_none")]
28    pub conmon_pid: Option<i64>,
29    #[serde(rename = "Dead", skip_serializing_if = "Option::is_none")]
30    pub dead: Option<bool>,
31    #[serde(rename = "Error", skip_serializing_if = "Option::is_none")]
32    pub error: Option<String>,
33    #[serde(rename = "ExitCode", skip_serializing_if = "Option::is_none")]
34    pub exit_code: Option<i32>,
35    #[serde(rename = "FinishedAt", skip_serializing_if = "Option::is_none")]
36    pub finished_at: Option<String>,
37    #[serde(rename = "Health", skip_serializing_if = "Option::is_none")]
38    pub health: Option<Box<models::HealthCheckResults>>,
39    #[serde(rename = "OOMKilled", skip_serializing_if = "Option::is_none")]
40    pub oom_killed: Option<bool>,
41    #[serde(rename = "OciVersion", skip_serializing_if = "Option::is_none")]
42    pub oci_version: Option<String>,
43    #[serde(rename = "Paused", skip_serializing_if = "Option::is_none")]
44    pub paused: Option<bool>,
45    #[serde(rename = "Pid", skip_serializing_if = "Option::is_none")]
46    pub pid: Option<i64>,
47    #[serde(rename = "Restarting", skip_serializing_if = "Option::is_none")]
48    pub restarting: Option<bool>,
49    #[serde(rename = "RestoreLog", skip_serializing_if = "Option::is_none")]
50    pub restore_log: Option<String>,
51    #[serde(rename = "Restored", skip_serializing_if = "Option::is_none")]
52    pub restored: Option<bool>,
53    #[serde(rename = "RestoredAt", skip_serializing_if = "Option::is_none")]
54    pub restored_at: Option<String>,
55    #[serde(rename = "Running", skip_serializing_if = "Option::is_none")]
56    pub running: Option<bool>,
57    #[serde(rename = "StartedAt", skip_serializing_if = "Option::is_none")]
58    pub started_at: Option<String>,
59    #[serde(rename = "Status", skip_serializing_if = "Option::is_none")]
60    pub status: Option<String>,
61    #[serde(rename = "StoppedByUser", skip_serializing_if = "Option::is_none")]
62    pub stopped_by_user: Option<bool>,
63}
64
65impl InspectContainerState {
66    /// InspectContainerState provides a detailed record of a container's current state. It is returned as part of InspectContainerData. As with InspectContainerData, many portions of this struct are matched to Docker, but here we see more fields that are unused (nonsensical in the context of Libpod).
67    pub fn new() -> InspectContainerState {
68        InspectContainerState {
69            cgroup_path: None,
70            checkpoint_log: None,
71            checkpoint_path: None,
72            checkpointed: None,
73            checkpointed_at: None,
74            conmon_pid: None,
75            dead: None,
76            error: None,
77            exit_code: None,
78            finished_at: None,
79            health: None,
80            oom_killed: None,
81            oci_version: None,
82            paused: None,
83            pid: None,
84            restarting: None,
85            restore_log: None,
86            restored: None,
87            restored_at: None,
88            running: None,
89            started_at: None,
90            status: None,
91            stopped_by_user: None,
92        }
93    }
94}