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

1pub struct ShutdownClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> ShutdownClient<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, "/shutdown"),
13        }
14    }
15}
16impl<T> ShutdownClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Shutdown virtual machine. This is similar to pressing the power button on a physical machine.This will send an ACPI event for the guest OS, which should then proceed to a clean shutdown."]
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 = "forceStop")]
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 = "Make sure the VM stops."]
35    pub forcestop: Option<bool>,
36    #[serde(rename = "keepActive")]
37    #[serde(
38        serialize_with = "crate::types::serialize_bool_optional",
39        deserialize_with = "crate::types::deserialize_bool_optional"
40    )]
41    #[serde(skip_serializing_if = "Option::is_none", default)]
42    #[doc = "Do not deactivate storage volumes."]
43    pub keepactive: Option<bool>,
44    #[serde(
45        serialize_with = "crate::types::serialize_bool_optional",
46        deserialize_with = "crate::types::deserialize_bool_optional"
47    )]
48    #[serde(skip_serializing_if = "Option::is_none", default)]
49    #[doc = "Ignore locks - only root is allowed to use this option."]
50    pub skiplock: Option<bool>,
51    #[serde(
52        serialize_with = "crate::types::serialize_int_optional",
53        deserialize_with = "crate::types::deserialize_int_optional"
54    )]
55    #[serde(skip_serializing_if = "Option::is_none", default)]
56    #[doc = "Wait maximal timeout seconds."]
57    pub timeout: Option<u64>,
58    #[serde(
59        flatten,
60        default,
61        skip_serializing_if = "::std::collections::HashMap::is_empty"
62    )]
63    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
64}