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