proxmox_api/generated/nodes/node/
suspendall.rs1#[derive(Debug, Clone)]
2pub struct SuspendallClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> SuspendallClient<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, "/suspendall"),
14 }
15 }
16}
17impl<T> SuspendallClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Suspend all VMs."]
22 #[doc = ""]
23 #[doc = "The 'VM.PowerMgmt' permission is required on '/' or on '/vms/\\<ID\\>' for each ID passed via the 'vms' parameter. Additionally, you need 'VM.Config.Disk' on the '/vms/{vmid}' path and 'Datastore.AllocateSpace' for the configured state-storage(s)"]
24 pub async fn post(&self, params: PostParams) -> Result<String, T::Error> {
25 let path = self.path.to_string();
26 self.client.post(&path, ¶ms).await
27 }
28}
29#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
30pub struct PostParams {
31 #[serde(skip_serializing_if = "Option::is_none", default)]
32 #[doc = "Only consider Guests with these IDs."]
33 #[doc = ""]
34 pub vms: Option<String>,
35 #[serde(
36 flatten,
37 default,
38 skip_serializing_if = "::std::collections::HashMap::is_empty"
39 )]
40 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
41}