proxmox_api/generated/nodes/node/
migrateall.rs

1pub struct MigrateallClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> MigrateallClient<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, "/migrateall"),
13        }
14    }
15}
16impl<T> MigrateallClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Migrate 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}
26impl PostParams {
27    pub fn new(target: String) -> Self {
28        Self {
29            target,
30            maxworkers: Default::default(),
31            vms: Default::default(),
32            with_local_disks: Default::default(),
33            additional_properties: Default::default(),
34        }
35    }
36}
37#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
38pub struct PostParams {
39    #[serde(
40        serialize_with = "crate::types::serialize_int_optional",
41        deserialize_with = "crate::types::deserialize_int_optional"
42    )]
43    #[serde(skip_serializing_if = "Option::is_none", default)]
44    #[doc = "Maximal number of parallel migration job. If not set, uses'max_workers' from datacenter.cfg. One of both must be set!"]
45    pub maxworkers: Option<u64>,
46    #[doc = "Target node."]
47    pub target: String,
48    #[serde(skip_serializing_if = "Option::is_none", default)]
49    #[doc = "Only consider Guests with these IDs."]
50    pub vms: Option<String>,
51    #[serde(rename = "with-local-disks")]
52    #[serde(
53        serialize_with = "crate::types::serialize_bool_optional",
54        deserialize_with = "crate::types::deserialize_bool_optional"
55    )]
56    #[serde(skip_serializing_if = "Option::is_none", default)]
57    #[doc = "Enable live storage migration for local disk"]
58    pub with_local_disks: Option<bool>,
59    #[serde(
60        flatten,
61        default,
62        skip_serializing_if = "::std::collections::HashMap::is_empty"
63    )]
64    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
65}