proxmox_api/generated/nodes/node/qemu/vmid/
remote_migrate.rs

1pub struct RemoteMigrateClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> RemoteMigrateClient<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, "/remote_migrate"),
13        }
14    }
15}
16impl<T> RemoteMigrateClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Migrate virtual machine to a remote cluster. Creates a new migration task. EXPERIMENTAL feature!"]
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_bridge: String, target_endpoint: String, target_storage: String) -> Self {
28        Self {
29            target_bridge,
30            target_endpoint,
31            target_storage,
32            bwlimit: Default::default(),
33            delete: Default::default(),
34            online: Default::default(),
35            target_vmid: Default::default(),
36            additional_properties: Default::default(),
37        }
38    }
39}
40#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
41pub struct PostParams {
42    #[serde(skip_serializing_if = "Option::is_none", default)]
43    #[doc = "Override I/O bandwidth limit (in KiB/s)."]
44    pub bwlimit: Option<()>,
45    #[serde(
46        serialize_with = "crate::types::serialize_bool_optional",
47        deserialize_with = "crate::types::deserialize_bool_optional"
48    )]
49    #[serde(skip_serializing_if = "Option::is_none", default)]
50    #[doc = "Delete the original VM and related data after successful migration. By default the original VM is kept on the source cluster in a stopped state."]
51    pub delete: Option<bool>,
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 = "Use online/live migration if VM is running. Ignored if VM is stopped."]
58    pub online: Option<bool>,
59    #[serde(rename = "target-bridge")]
60    #[doc = "Mapping from source to target bridges. Providing only a single bridge ID maps all source bridges to that bridge. Providing the special value '1' will map each source bridge to itself."]
61    pub target_bridge: String,
62    #[serde(rename = "target-endpoint")]
63    #[doc = "Remote target endpoint"]
64    pub target_endpoint: String,
65    #[serde(rename = "target-storage")]
66    #[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."]
67    pub target_storage: String,
68    #[serde(rename = "target-vmid")]
69    #[serde(skip_serializing_if = "Option::is_none", default)]
70    #[doc = "The (unique) ID of the VM."]
71    pub target_vmid: Option<crate::types::VmId>,
72    #[serde(
73        flatten,
74        default,
75        skip_serializing_if = "::std::collections::HashMap::is_empty"
76    )]
77    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
78}