1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
 * supports a RESTful API for the Libpod library
 *
 * 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
 *
 * The version of the OpenAPI document: 5.0.0
 * Contact: podman@lists.podman.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// InspectContainerConfig : InspectContainerConfig holds further data about how a container was initially configured.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct InspectContainerConfig {
    /// Container annotations
    #[serde(rename = "Annotations", skip_serializing_if = "Option::is_none")]
    pub annotations: Option<std::collections::HashMap<String, String>>,
    /// Unused, at present
    #[serde(rename = "AttachStderr", skip_serializing_if = "Option::is_none")]
    pub attach_stderr: Option<bool>,
    /// Unused, at present
    #[serde(rename = "AttachStdin", skip_serializing_if = "Option::is_none")]
    pub attach_stdin: Option<bool>,
    /// Unused, at present
    #[serde(rename = "AttachStdout", skip_serializing_if = "Option::is_none")]
    pub attach_stdout: Option<bool>,
    /// ChrootDirs is an additional set of directories that need to be treated as root directories. Standard bind mounts will be mounted into paths relative to these directories.
    #[serde(rename = "ChrootDirs", skip_serializing_if = "Option::is_none")]
    pub chroot_dirs: Option<Vec<String>>,
    /// Container command
    #[serde(rename = "Cmd", skip_serializing_if = "Option::is_none")]
    pub cmd: Option<Vec<String>>,
    /// CreateCommand is the full command plus arguments of the process the container has been created with.
    #[serde(rename = "CreateCommand", skip_serializing_if = "Option::is_none")]
    pub create_command: Option<Vec<String>>,
    /// Container domain name - unused at present
    #[serde(rename = "Domainname", skip_serializing_if = "Option::is_none")]
    pub domainname: Option<String>,
    /// Container entrypoint
    #[serde(rename = "Entrypoint", skip_serializing_if = "Option::is_none")]
    pub entrypoint: Option<Vec<String>>,
    /// Container environment variables
    #[serde(rename = "Env", skip_serializing_if = "Option::is_none")]
    pub env: Option<Vec<String>>,
    #[serde(rename = "Healthcheck", skip_serializing_if = "Option::is_none")]
    pub healthcheck: Option<Box<models::Schema2HealthConfig>>,
    /// HealthcheckOnFailureAction defines an action to take once the container turns unhealthy.
    #[serde(
        rename = "HealthcheckOnFailureAction",
        skip_serializing_if = "Option::is_none"
    )]
    pub healthcheck_on_failure_action: Option<String>,
    /// Container hostname
    #[serde(rename = "Hostname", skip_serializing_if = "Option::is_none")]
    pub hostname: Option<String>,
    /// Container image
    #[serde(rename = "Image", skip_serializing_if = "Option::is_none")]
    pub image: Option<String>,
    /// Container labels
    #[serde(rename = "Labels", skip_serializing_if = "Option::is_none")]
    pub labels: Option<std::collections::HashMap<String, String>>,
    /// On-build arguments - presently unused. More of Buildah's domain.
    #[serde(rename = "OnBuild", skip_serializing_if = "Option::is_none")]
    pub on_build: Option<String>,
    /// Whether the container leaves STDIN open
    #[serde(rename = "OpenStdin", skip_serializing_if = "Option::is_none")]
    pub open_stdin: Option<bool>,
    /// Passwd determines whether or not podman can add entries to /etc/passwd and /etc/group
    #[serde(rename = "Passwd", skip_serializing_if = "Option::is_none")]
    pub passwd: Option<bool>,
    /// Secrets are the secrets mounted in the container
    #[serde(rename = "Secrets", skip_serializing_if = "Option::is_none")]
    pub secrets: Option<Vec<models::InspectSecret>>,
    /// Whether STDIN is only left open once. Presently not supported by Podman, unused.
    #[serde(rename = "StdinOnce", skip_serializing_if = "Option::is_none")]
    pub stdin_once: Option<bool>,
    /// Container stop signal
    #[serde(rename = "StopSignal", skip_serializing_if = "Option::is_none")]
    pub stop_signal: Option<String>,
    /// StopTimeout is time before container is stopped when calling stop
    #[serde(rename = "StopTimeout", skip_serializing_if = "Option::is_none")]
    pub stop_timeout: Option<i32>,
    /// SystemdMode is whether the container is running in systemd mode. In systemd mode, the container configuration is customized to optimize running systemd in the container.
    #[serde(rename = "SystemdMode", skip_serializing_if = "Option::is_none")]
    pub systemd_mode: Option<bool>,
    /// Timeout is time before container is killed by conmon
    #[serde(rename = "Timeout", skip_serializing_if = "Option::is_none")]
    pub timeout: Option<i32>,
    /// Timezone is the timezone inside the container. Local means it has the same timezone as the host machine
    #[serde(rename = "Timezone", skip_serializing_if = "Option::is_none")]
    pub timezone: Option<String>,
    /// Whether the container creates a TTY
    #[serde(rename = "Tty", skip_serializing_if = "Option::is_none")]
    pub tty: Option<bool>,
    /// Umask is the umask inside the container.
    #[serde(rename = "Umask", skip_serializing_if = "Option::is_none")]
    pub umask: Option<String>,
    /// User the container was launched with
    #[serde(rename = "User", skip_serializing_if = "Option::is_none")]
    pub user: Option<String>,
    /// Unused, at present. I've never seen this field populated.
    #[serde(rename = "Volumes", skip_serializing_if = "Option::is_none")]
    pub volumes: Option<std::collections::HashMap<String, serde_json::Value>>,
    /// Container working directory
    #[serde(rename = "WorkingDir", skip_serializing_if = "Option::is_none")]
    pub working_dir: Option<String>,
    /// SdNotifyMode is the sd-notify mode of the container.
    #[serde(rename = "sdNotifyMode", skip_serializing_if = "Option::is_none")]
    pub sd_notify_mode: Option<String>,
    /// SdNotifySocket is the NOTIFY_SOCKET in use by/configured for the container.
    #[serde(rename = "sdNotifySocket", skip_serializing_if = "Option::is_none")]
    pub sd_notify_socket: Option<String>,
}

impl InspectContainerConfig {
    /// InspectContainerConfig holds further data about how a container was initially configured.
    pub fn new() -> InspectContainerConfig {
        InspectContainerConfig {
            annotations: None,
            attach_stderr: None,
            attach_stdin: None,
            attach_stdout: None,
            chroot_dirs: None,
            cmd: None,
            create_command: None,
            domainname: None,
            entrypoint: None,
            env: None,
            healthcheck: None,
            healthcheck_on_failure_action: None,
            hostname: None,
            image: None,
            labels: None,
            on_build: None,
            open_stdin: None,
            passwd: None,
            secrets: None,
            stdin_once: None,
            stop_signal: None,
            stop_timeout: None,
            systemd_mode: None,
            timeout: None,
            timezone: None,
            tty: None,
            umask: None,
            user: None,
            volumes: None,
            working_dir: None,
            sd_notify_mode: None,
            sd_notify_socket: None,
        }
    }
}