Skip to main content

proxmox_api/generated/nodes/node/qemu/vmid/agent/
exec_status.rs

1#[derive(Debug, Clone)]
2pub struct ExecStatusClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> ExecStatusClient<T>
7where
8    T: crate::client::Client,
9{
10    pub fn new(client: T, parent_path: &str) -> Self {
11        Self {
12            client,
13            path: format!("{}{}", parent_path, "/exec-status"),
14        }
15    }
16}
17impl<T> ExecStatusClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "Gets the status of the given pid started by the guest-agent"]
22    #[doc = ""]
23    #[doc = "Permission check: perm(\"/vms/{vmid}\", [\"VM.GuestAgent.Unrestricted\"])"]
24    pub async fn get(&self, params: GetParams) -> Result<GetOutput, T::Error> {
25        let path = self.path.to_string();
26        self.client.get(&path, &params).await
27    }
28}
29impl GetOutput {
30    pub fn new(exited: bool) -> Self {
31        Self {
32            exited,
33            err_data: ::std::default::Default::default(),
34            err_truncated: ::std::default::Default::default(),
35            exitcode: ::std::default::Default::default(),
36            out_data: ::std::default::Default::default(),
37            out_truncated: ::std::default::Default::default(),
38            signal: ::std::default::Default::default(),
39            additional_properties: ::std::default::Default::default(),
40        }
41    }
42}
43#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
44pub struct GetOutput {
45    #[serde(rename = "err-data")]
46    #[serde(skip_serializing_if = "Option::is_none", default)]
47    #[doc = "stderr of the process"]
48    #[doc = ""]
49    pub err_data: Option<String>,
50    #[serde(rename = "err-truncated")]
51    #[serde(
52        serialize_with = "crate::types::serialize_bool_optional",
53        deserialize_with = "crate::types::deserialize_bool_optional"
54    )]
55    #[serde(skip_serializing_if = "Option::is_none", default)]
56    #[doc = "true if stderr was not fully captured"]
57    #[doc = ""]
58    pub err_truncated: Option<bool>,
59    #[serde(
60        serialize_with = "crate::types::serialize_int_optional",
61        deserialize_with = "crate::types::deserialize_int_optional"
62    )]
63    #[serde(skip_serializing_if = "Option::is_none", default)]
64    #[doc = "process exit code if it was normally terminated."]
65    #[doc = ""]
66    pub exitcode: Option<i64>,
67    #[serde(
68        serialize_with = "crate::types::serialize_bool",
69        deserialize_with = "crate::types::deserialize_bool"
70    )]
71    #[doc = "Tells if the given command has exited yet."]
72    #[doc = ""]
73    pub exited: bool,
74    #[serde(rename = "out-data")]
75    #[serde(skip_serializing_if = "Option::is_none", default)]
76    #[doc = "stdout of the process"]
77    #[doc = ""]
78    pub out_data: Option<String>,
79    #[serde(rename = "out-truncated")]
80    #[serde(
81        serialize_with = "crate::types::serialize_bool_optional",
82        deserialize_with = "crate::types::deserialize_bool_optional"
83    )]
84    #[serde(skip_serializing_if = "Option::is_none", default)]
85    #[doc = "true if stdout was not fully captured"]
86    #[doc = ""]
87    pub out_truncated: Option<bool>,
88    #[serde(
89        serialize_with = "crate::types::serialize_int_optional",
90        deserialize_with = "crate::types::deserialize_int_optional"
91    )]
92    #[serde(skip_serializing_if = "Option::is_none", default)]
93    #[doc = "signal number or exception code if the process was abnormally terminated."]
94    #[doc = ""]
95    pub signal: Option<i64>,
96    #[serde(
97        flatten,
98        default,
99        skip_serializing_if = "::std::collections::HashMap::is_empty"
100    )]
101    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
102}
103impl GetParams {
104    pub fn new(pid: i64) -> Self {
105        Self {
106            pid,
107            additional_properties: ::std::default::Default::default(),
108        }
109    }
110}
111#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
112pub struct GetParams {
113    #[serde(
114        serialize_with = "crate::types::serialize_int",
115        deserialize_with = "crate::types::deserialize_int"
116    )]
117    #[doc = "The PID to query"]
118    #[doc = ""]
119    pub pid: i64,
120    #[serde(
121        flatten,
122        default,
123        skip_serializing_if = "::std::collections::HashMap::is_empty"
124    )]
125    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
126}