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

1pub mod agent;
2pub mod clone;
3pub mod cloudinit;
4pub mod config;
5pub mod feature;
6pub mod firewall;
7pub mod migrate;
8pub mod monitor;
9pub mod move_disk;
10pub mod mtunnel;
11pub mod mtunnelwebsocket;
12pub mod pending;
13pub mod remote_migrate;
14pub mod resize;
15pub mod rrd;
16pub mod rrddata;
17pub mod sendkey;
18pub mod snapshot;
19pub mod spiceproxy;
20pub mod status;
21pub mod template;
22pub mod termproxy;
23pub mod unlink;
24pub mod vncproxy;
25pub mod vncwebsocket;
26pub struct VmidClient<T> {
27    client: T,
28    path: String,
29}
30impl<T> VmidClient<T>
31where
32    T: crate::client::Client,
33{
34    pub fn new(client: T, parent_path: &str, vmid: crate::types::VmId) -> Self {
35        Self {
36            client,
37            path: format!("{}/{}", parent_path, vmid),
38        }
39    }
40}
41impl<T> VmidClient<T>
42where
43    T: crate::client::Client,
44{
45    #[doc = "Destroy the VM and  all used/owned volumes. Removes any VM specific permissions and firewall rules"]
46    pub fn delete(&self, params: DeleteParams) -> Result<String, T::Error> {
47        let path = self.path.to_string();
48        self.client.delete(&path, &params)
49    }
50}
51impl<T> VmidClient<T>
52where
53    T: crate::client::Client,
54{
55    #[doc = "Directory index"]
56    pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
57        let path = self.path.to_string();
58        self.client.get(&path, &())
59    }
60}
61#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
62pub struct DeleteParams {
63    #[serde(rename = "destroy-unreferenced-disks")]
64    #[serde(
65        serialize_with = "crate::types::serialize_bool_optional",
66        deserialize_with = "crate::types::deserialize_bool_optional"
67    )]
68    #[serde(skip_serializing_if = "Option::is_none", default)]
69    #[doc = "If set, destroy additionally all disks not referenced in the config but with a matching VMID from all enabled storages."]
70    pub destroy_unreferenced_disks: Option<bool>,
71    #[serde(
72        serialize_with = "crate::types::serialize_bool_optional",
73        deserialize_with = "crate::types::deserialize_bool_optional"
74    )]
75    #[serde(skip_serializing_if = "Option::is_none", default)]
76    #[doc = "Remove VMID from configurations, like backup & replication jobs and HA."]
77    pub purge: Option<bool>,
78    #[serde(
79        serialize_with = "crate::types::serialize_bool_optional",
80        deserialize_with = "crate::types::deserialize_bool_optional"
81    )]
82    #[serde(skip_serializing_if = "Option::is_none", default)]
83    #[doc = "Ignore locks - only root is allowed to use this option."]
84    pub skiplock: Option<bool>,
85    #[serde(
86        flatten,
87        default,
88        skip_serializing_if = "::std::collections::HashMap::is_empty"
89    )]
90    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
91}
92impl GetOutputItems {
93    pub fn new(subdir: String) -> Self {
94        Self {
95            subdir,
96            additional_properties: Default::default(),
97        }
98    }
99}
100#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
101pub struct GetOutputItems {
102    pub subdir: String,
103    #[serde(
104        flatten,
105        default,
106        skip_serializing_if = "::std::collections::HashMap::is_empty"
107    )]
108    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
109}
110impl<T> VmidClient<T>
111where
112    T: crate::client::Client,
113{
114    pub fn firewall(&self) -> firewall::FirewallClient<T> {
115        firewall::FirewallClient::<T>::new(self.client.clone(), &self.path)
116    }
117}
118impl<T> VmidClient<T>
119where
120    T: crate::client::Client,
121{
122    pub fn agent(&self) -> agent::AgentClient<T> {
123        agent::AgentClient::<T>::new(self.client.clone(), &self.path)
124    }
125}
126impl<T> VmidClient<T>
127where
128    T: crate::client::Client,
129{
130    pub fn rrd(&self) -> rrd::RrdClient<T> {
131        rrd::RrdClient::<T>::new(self.client.clone(), &self.path)
132    }
133}
134impl<T> VmidClient<T>
135where
136    T: crate::client::Client,
137{
138    pub fn rrddata(&self) -> rrddata::RrddataClient<T> {
139        rrddata::RrddataClient::<T>::new(self.client.clone(), &self.path)
140    }
141}
142impl<T> VmidClient<T>
143where
144    T: crate::client::Client,
145{
146    pub fn config(&self) -> config::ConfigClient<T> {
147        config::ConfigClient::<T>::new(self.client.clone(), &self.path)
148    }
149}
150impl<T> VmidClient<T>
151where
152    T: crate::client::Client,
153{
154    pub fn pending(&self) -> pending::PendingClient<T> {
155        pending::PendingClient::<T>::new(self.client.clone(), &self.path)
156    }
157}
158impl<T> VmidClient<T>
159where
160    T: crate::client::Client,
161{
162    pub fn cloudinit(&self) -> cloudinit::CloudinitClient<T> {
163        cloudinit::CloudinitClient::<T>::new(self.client.clone(), &self.path)
164    }
165}
166impl<T> VmidClient<T>
167where
168    T: crate::client::Client,
169{
170    pub fn unlink(&self) -> unlink::UnlinkClient<T> {
171        unlink::UnlinkClient::<T>::new(self.client.clone(), &self.path)
172    }
173}
174impl<T> VmidClient<T>
175where
176    T: crate::client::Client,
177{
178    pub fn vncproxy(&self) -> vncproxy::VncproxyClient<T> {
179        vncproxy::VncproxyClient::<T>::new(self.client.clone(), &self.path)
180    }
181}
182impl<T> VmidClient<T>
183where
184    T: crate::client::Client,
185{
186    pub fn termproxy(&self) -> termproxy::TermproxyClient<T> {
187        termproxy::TermproxyClient::<T>::new(self.client.clone(), &self.path)
188    }
189}
190impl<T> VmidClient<T>
191where
192    T: crate::client::Client,
193{
194    pub fn vncwebsocket(&self) -> vncwebsocket::VncwebsocketClient<T> {
195        vncwebsocket::VncwebsocketClient::<T>::new(self.client.clone(), &self.path)
196    }
197}
198impl<T> VmidClient<T>
199where
200    T: crate::client::Client,
201{
202    pub fn spiceproxy(&self) -> spiceproxy::SpiceproxyClient<T> {
203        spiceproxy::SpiceproxyClient::<T>::new(self.client.clone(), &self.path)
204    }
205}
206impl<T> VmidClient<T>
207where
208    T: crate::client::Client,
209{
210    pub fn status(&self) -> status::StatusClient<T> {
211        status::StatusClient::<T>::new(self.client.clone(), &self.path)
212    }
213}
214impl<T> VmidClient<T>
215where
216    T: crate::client::Client,
217{
218    pub fn sendkey(&self) -> sendkey::SendkeyClient<T> {
219        sendkey::SendkeyClient::<T>::new(self.client.clone(), &self.path)
220    }
221}
222impl<T> VmidClient<T>
223where
224    T: crate::client::Client,
225{
226    pub fn feature(&self) -> feature::FeatureClient<T> {
227        feature::FeatureClient::<T>::new(self.client.clone(), &self.path)
228    }
229}
230impl<T> VmidClient<T>
231where
232    T: crate::client::Client,
233{
234    pub fn clone(&self) -> clone::CloneClient<T> {
235        clone::CloneClient::<T>::new(self.client.clone(), &self.path)
236    }
237}
238impl<T> VmidClient<T>
239where
240    T: crate::client::Client,
241{
242    pub fn move_disk(&self) -> move_disk::MoveDiskClient<T> {
243        move_disk::MoveDiskClient::<T>::new(self.client.clone(), &self.path)
244    }
245}
246impl<T> VmidClient<T>
247where
248    T: crate::client::Client,
249{
250    pub fn migrate(&self) -> migrate::MigrateClient<T> {
251        migrate::MigrateClient::<T>::new(self.client.clone(), &self.path)
252    }
253}
254impl<T> VmidClient<T>
255where
256    T: crate::client::Client,
257{
258    pub fn remote_migrate(&self) -> remote_migrate::RemoteMigrateClient<T> {
259        remote_migrate::RemoteMigrateClient::<T>::new(self.client.clone(), &self.path)
260    }
261}
262impl<T> VmidClient<T>
263where
264    T: crate::client::Client,
265{
266    pub fn monitor(&self) -> monitor::MonitorClient<T> {
267        monitor::MonitorClient::<T>::new(self.client.clone(), &self.path)
268    }
269}
270impl<T> VmidClient<T>
271where
272    T: crate::client::Client,
273{
274    pub fn resize(&self) -> resize::ResizeClient<T> {
275        resize::ResizeClient::<T>::new(self.client.clone(), &self.path)
276    }
277}
278impl<T> VmidClient<T>
279where
280    T: crate::client::Client,
281{
282    pub fn snapshot(&self) -> snapshot::SnapshotClient<T> {
283        snapshot::SnapshotClient::<T>::new(self.client.clone(), &self.path)
284    }
285}
286impl<T> VmidClient<T>
287where
288    T: crate::client::Client,
289{
290    pub fn template(&self) -> template::TemplateClient<T> {
291        template::TemplateClient::<T>::new(self.client.clone(), &self.path)
292    }
293}
294impl<T> VmidClient<T>
295where
296    T: crate::client::Client,
297{
298    pub fn mtunnel(&self) -> mtunnel::MtunnelClient<T> {
299        mtunnel::MtunnelClient::<T>::new(self.client.clone(), &self.path)
300    }
301}
302impl<T> VmidClient<T>
303where
304    T: crate::client::Client,
305{
306    pub fn mtunnelwebsocket(&self) -> mtunnelwebsocket::MtunnelwebsocketClient<T> {
307        mtunnelwebsocket::MtunnelwebsocketClient::<T>::new(self.client.clone(), &self.path)
308    }
309}