proxmox_api/generated/nodes/node/
stopall.rs

1pub struct StopallClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> StopallClient<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, "/stopall"),
13        }
14    }
15}
16impl<T> StopallClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Stop all VMs and Containers."]
21    pub fn post(&self, params: PostParams) -> Result<String, T::Error> {
22        let path = self.path.to_string();
23        self.client.post(&path, &params)
24    }
25}
26#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
27pub struct PostParams {
28    #[serde(rename = "force-stop")]
29    #[serde(
30        serialize_with = "crate::types::serialize_bool_optional",
31        deserialize_with = "crate::types::deserialize_bool_optional"
32    )]
33    #[serde(skip_serializing_if = "Option::is_none", default)]
34    #[doc = "Force a hard-stop after the timeout."]
35    pub force_stop: Option<bool>,
36    #[serde(
37        serialize_with = "crate::types::serialize_int_optional",
38        deserialize_with = "crate::types::deserialize_int_optional"
39    )]
40    #[serde(skip_serializing_if = "Option::is_none", default)]
41    #[doc = "Timeout for each guest shutdown task. Depending on `force-stop`, the shutdown gets then simply aborted or a hard-stop is forced."]
42    pub timeout: Option<u64>,
43    #[serde(skip_serializing_if = "Option::is_none", default)]
44    #[doc = "Only consider Guests with these IDs."]
45    pub vms: Option<String>,
46    #[serde(
47        flatten,
48        default,
49        skip_serializing_if = "::std::collections::HashMap::is_empty"
50    )]
51    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
52}