proxmox_api/generated/nodes/node/lxc/vmid/
migrate.rs

1pub struct MigrateClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> MigrateClient<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, "/migrate"),
13        }
14    }
15}
16impl<T> MigrateClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Migrate the container to another node. Creates a new migration task."]
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            bwlimit: Default::default(),
31            online: Default::default(),
32            restart: Default::default(),
33            target_storage: Default::default(),
34            timeout: Default::default(),
35            additional_properties: Default::default(),
36        }
37    }
38}
39#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
40pub struct PostParams {
41    #[serde(skip_serializing_if = "Option::is_none", default)]
42    #[doc = "Override I/O bandwidth limit (in KiB/s)."]
43    pub bwlimit: Option<()>,
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 = "Use online/live migration."]
50    pub online: Option<bool>,
51    #[serde(
52        serialize_with = "crate::types::serialize_bool_optional",
53        deserialize_with = "crate::types::deserialize_bool_optional"
54    )]
55    #[serde(skip_serializing_if = "Option::is_none", default)]
56    #[doc = "Use restart migration"]
57    pub restart: Option<bool>,
58    #[doc = "Target node."]
59    pub target: String,
60    #[serde(rename = "target-storage")]
61    #[serde(skip_serializing_if = "Option::is_none", default)]
62    #[doc = "Mapping from source to target storages. Providing only a single storage ID maps all source storages to that storage. Providing the special value '1' will map each source storage to itself."]
63    pub target_storage: Option<String>,
64    #[serde(
65        serialize_with = "crate::types::serialize_int_optional",
66        deserialize_with = "crate::types::deserialize_int_optional"
67    )]
68    #[serde(skip_serializing_if = "Option::is_none", default)]
69    #[doc = "Timeout in seconds for shutdown for restart migration"]
70    pub timeout: Option<u64>,
71    #[serde(
72        flatten,
73        default,
74        skip_serializing_if = "::std::collections::HashMap::is_empty"
75    )]
76    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
77}