Skip to main content

proxmox_api/generated/nodes/node/
migrateall.rs

1#[derive(Debug, Clone)]
2pub struct MigrateallClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> MigrateallClient<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, "/migrateall"),
14        }
15    }
16}
17impl<T> MigrateallClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "Migrate all VMs and Containers."]
22    #[doc = ""]
23    #[doc = "The 'VM.Migrate' permission is required on '/' or on '/vms/\\<ID\\>' for each ID passed via the 'vms' parameter."]
24    pub async fn post(&self, params: PostParams) -> Result<String, T::Error> {
25        let path = self.path.to_string();
26        self.client.post(&path, &params).await
27    }
28}
29impl PostParams {
30    pub fn new(target: String) -> Self {
31        Self {
32            target,
33            maxworkers: ::std::default::Default::default(),
34            vms: ::std::default::Default::default(),
35            with_local_disks: ::std::default::Default::default(),
36            additional_properties: ::std::default::Default::default(),
37        }
38    }
39}
40#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
41pub struct PostParams {
42    #[serde(
43        serialize_with = "crate::types::serialize_non_zero_pos_int_optional",
44        deserialize_with = "crate::types::deserialize_non_zero_pos_int_optional"
45    )]
46    #[serde(skip_serializing_if = "Option::is_none", default)]
47    #[doc = "Maximal number of parallel migration job. If not set, uses'max_workers' from datacenter.cfg. One of both must be set!"]
48    #[doc = ""]
49    pub maxworkers: Option<std::num::NonZeroU64>,
50    #[doc = "Target node."]
51    #[doc = ""]
52    pub target: String,
53    #[serde(skip_serializing_if = "Option::is_none", default)]
54    #[doc = "Only consider Guests with these IDs."]
55    #[doc = ""]
56    pub vms: Option<String>,
57    #[serde(rename = "with-local-disks")]
58    #[serde(
59        serialize_with = "crate::types::serialize_bool_optional",
60        deserialize_with = "crate::types::deserialize_bool_optional"
61    )]
62    #[serde(skip_serializing_if = "Option::is_none", default)]
63    #[doc = "Enable live storage migration for local disk"]
64    #[doc = ""]
65    pub with_local_disks: Option<bool>,
66    #[serde(
67        flatten,
68        default,
69        skip_serializing_if = "::std::collections::HashMap::is_empty"
70    )]
71    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
72}