proxmox_api/generated/nodes/node/lxc/vmid/
remote_migrate.rs1pub 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 the container to another 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, ¶ms)
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 restart: Default::default(),
36 target_vmid: Default::default(),
37 timeout: Default::default(),
38 additional_properties: Default::default(),
39 }
40 }
41}
42#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
43pub struct PostParams {
44 #[serde(skip_serializing_if = "Option::is_none", default)]
45 #[doc = "Override I/O bandwidth limit (in KiB/s)."]
46 pub bwlimit: Option<()>,
47 #[serde(
48 serialize_with = "crate::types::serialize_bool_optional",
49 deserialize_with = "crate::types::deserialize_bool_optional"
50 )]
51 #[serde(skip_serializing_if = "Option::is_none", default)]
52 #[doc = "Delete the original CT and related data after successful migration. By default the original CT is kept on the source cluster in a stopped state."]
53 pub delete: Option<bool>,
54 #[serde(
55 serialize_with = "crate::types::serialize_bool_optional",
56 deserialize_with = "crate::types::deserialize_bool_optional"
57 )]
58 #[serde(skip_serializing_if = "Option::is_none", default)]
59 #[doc = "Use online/live migration."]
60 pub online: Option<bool>,
61 #[serde(
62 serialize_with = "crate::types::serialize_bool_optional",
63 deserialize_with = "crate::types::deserialize_bool_optional"
64 )]
65 #[serde(skip_serializing_if = "Option::is_none", default)]
66 #[doc = "Use restart migration"]
67 pub restart: Option<bool>,
68 #[serde(rename = "target-bridge")]
69 #[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."]
70 pub target_bridge: String,
71 #[serde(rename = "target-endpoint")]
72 #[doc = "Remote target endpoint"]
73 pub target_endpoint: String,
74 #[serde(rename = "target-storage")]
75 #[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."]
76 pub target_storage: String,
77 #[serde(rename = "target-vmid")]
78 #[serde(skip_serializing_if = "Option::is_none", default)]
79 #[doc = "The (unique) ID of the VM."]
80 pub target_vmid: Option<crate::types::VmId>,
81 #[serde(
82 serialize_with = "crate::types::serialize_int_optional",
83 deserialize_with = "crate::types::deserialize_int_optional"
84 )]
85 #[serde(skip_serializing_if = "Option::is_none", default)]
86 #[doc = "Timeout in seconds for shutdown for restart migration"]
87 pub timeout: Option<u64>,
88 #[serde(
89 flatten,
90 default,
91 skip_serializing_if = "::std::collections::HashMap::is_empty"
92 )]
93 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
94}