proxmox_api/generated/nodes/node/lxc/vmid/
status.rs1pub mod current;
2pub mod reboot;
3pub mod resume;
4pub mod shutdown;
5pub mod start;
6pub mod stop;
7pub mod suspend;
8#[derive(Debug, Clone)]
9pub struct StatusClient<T> {
10 client: T,
11 path: String,
12}
13impl<T> StatusClient<T>
14where
15 T: crate::client::Client,
16{
17 pub fn new(client: T, parent_path: &str) -> Self {
18 Self {
19 client,
20 path: format!("{}{}", parent_path, "/status"),
21 }
22 }
23}
24impl<T> StatusClient<T>
25where
26 T: crate::client::Client,
27{
28 #[doc = "Directory index"]
29 #[doc = ""]
30 pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
31 let path = self.path.to_string();
32 let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
33 Ok(optional_vec.unwrap_or_default())
34 }
35}
36impl GetOutputItems {
37 pub fn new(subdir: String) -> Self {
38 Self {
39 subdir,
40 additional_properties: ::std::default::Default::default(),
41 }
42 }
43}
44#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
45pub struct GetOutputItems {
46 pub subdir: String,
47 #[serde(
48 flatten,
49 default,
50 skip_serializing_if = "::std::collections::HashMap::is_empty"
51 )]
52 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
53}
54impl<T> StatusClient<T>
55where
56 T: crate::client::Client,
57{
58 pub fn current(&self) -> current::CurrentClient<T> {
59 current::CurrentClient::<T>::new(self.client.clone(), &self.path)
60 }
61}
62impl<T> StatusClient<T>
63where
64 T: crate::client::Client,
65{
66 pub fn start(&self) -> start::StartClient<T> {
67 start::StartClient::<T>::new(self.client.clone(), &self.path)
68 }
69}
70impl<T> StatusClient<T>
71where
72 T: crate::client::Client,
73{
74 pub fn stop(&self) -> stop::StopClient<T> {
75 stop::StopClient::<T>::new(self.client.clone(), &self.path)
76 }
77}
78impl<T> StatusClient<T>
79where
80 T: crate::client::Client,
81{
82 pub fn shutdown(&self) -> shutdown::ShutdownClient<T> {
83 shutdown::ShutdownClient::<T>::new(self.client.clone(), &self.path)
84 }
85}
86impl<T> StatusClient<T>
87where
88 T: crate::client::Client,
89{
90 pub fn suspend(&self) -> suspend::SuspendClient<T> {
91 suspend::SuspendClient::<T>::new(self.client.clone(), &self.path)
92 }
93}
94impl<T> StatusClient<T>
95where
96 T: crate::client::Client,
97{
98 pub fn resume(&self) -> resume::ResumeClient<T> {
99 resume::ResumeClient::<T>::new(self.client.clone(), &self.path)
100 }
101}
102impl<T> StatusClient<T>
103where
104 T: crate::client::Client,
105{
106 pub fn reboot(&self) -> reboot::RebootClient<T> {
107 reboot::RebootClient::<T>::new(self.client.clone(), &self.path)
108 }
109}