pve/nodes/node/lxc/vmid/status/
current.rs1#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2pub struct GetResponseItem {
3 #[doc = "Maximum usable CPUs."]
4 #[serde(skip_serializing_if = "Option::is_none", default)]
5 pub cpus: Option<f64>,
6 #[doc = "HA manager service status."]
7 pub ha: Ha,
8 #[doc = "The current config lock, if any."]
9 #[serde(skip_serializing_if = "Option::is_none", default)]
10 pub lock: Option<String>,
11 #[doc = "Root disk size in bytes."]
12 #[serde(skip_serializing_if = "Option::is_none", default)]
13 pub maxdisk: Option<u64>,
14 #[doc = "Maximum memory in bytes."]
15 #[serde(skip_serializing_if = "Option::is_none", default)]
16 pub maxmem: Option<u64>,
17 #[doc = "Maximum SWAP memory in bytes."]
18 #[serde(skip_serializing_if = "Option::is_none", default)]
19 pub maxswap: Option<u64>,
20 #[doc = "Container name."]
21 #[serde(skip_serializing_if = "Option::is_none", default)]
22 pub name: Option<String>,
23 #[doc = "LXC Container status."]
24 pub status: String,
25 #[doc = "The current configured tags, if any."]
26 #[serde(skip_serializing_if = "Option::is_none", default)]
27 pub tags: Option<String>,
28 #[doc = "Uptime."]
29 #[serde(skip_serializing_if = "Option::is_none", default)]
30 pub uptime: Option<u64>,
31 #[doc = "The (unique) ID of the VM."]
32 pub vmid: u64,
33}
34
35#[doc = "HA manager service status."]
36#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, Default)]
37pub struct Ha {}
38
39#[derive(Debug, Clone)]
40pub struct CurrentClient<T> {
41 client: T,
42 path: String,
43}
44
45impl<T> CurrentClient<T>
46where
47 T: Clone,
48{
49 pub fn new(client: T, parent_path: &str) -> Self {
50 Self {
51 client,
52 path: format!("{}/{}", parent_path, "current"),
53 }
54 }
55}
56impl<T> CurrentClient<T>
57where
58 T: crate::client::HttpClient,
59{
60 #[doc = "Get virtual machine status."]
61 pub fn get(&self) -> Result<GetResponseItem, T::Error> {
62 self.client.get(&self.path, &())
63 }
64}
65#[derive(Debug, Clone)]
66pub struct AsyncCurrentClient<T> {
67 client: T,
68 path: String,
69}
70
71impl<T> AsyncCurrentClient<T>
72where
73 T: Clone,
74{
75 pub fn new(client: T, parent_path: &str) -> Self {
76 Self {
77 client,
78 path: format!("{}/{}", parent_path, "current"),
79 }
80 }
81}
82impl<T> AsyncCurrentClient<T>
83where
84 T: crate::client::AsyncHttpClient,
85{
86 #[doc = "Get virtual machine status."]
87 pub async fn get(&self) -> Result<GetResponseItem, T::Error> {
88 self.client.get(&self.path, &()).await
89 }
90}