public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager v2 2/4] pdm-client: add target-endpoint parameter to remote migration methods
Date: Tue, 14 Jan 2025 12:21:38 +0100	[thread overview]
Message-ID: <20250114112140.1898658-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250114112140.1898658-1-d.csapak@proxmox.com>

and set it to None for all users for now

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
changes from v1:
* fix cli code to set that parameter to None
* also fix UI code in one go so the repo state is compileable

 cli/client/src/pve.rs           | 4 ++--
 lib/pdm-client/src/lib.rs       | 8 ++++++++
 ui/src/widget/migrate_window.rs | 2 ++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/cli/client/src/pve.rs b/cli/client/src/pve.rs
index c355293..1b12403 100644
--- a/cli/client/src/pve.rs
+++ b/cli/client/src/pve.rs
@@ -618,7 +618,7 @@ async fn remote_migrate_qemu(
 
     let client = client()?;
     let upid = client
-        .pve_qemu_remote_migrate(&remote, node.as_deref(), vmid, target, params)
+        .pve_qemu_remote_migrate(&remote, node.as_deref(), vmid, target, None, params)
         .await?;
     println!("upid: {upid}");
     let status = client.pve_wait_for_task(&upid).await?;
@@ -996,7 +996,7 @@ async fn remote_migrate_lxc(
 
     let client = client()?;
     let upid = client
-        .pve_lxc_remote_migrate(&remote, node.as_deref(), vmid, target, params)
+        .pve_lxc_remote_migrate(&remote, node.as_deref(), vmid, target, None, params)
         .await?;
     println!("upid: {upid}");
     let status = client.pve_wait_for_task(&upid).await?;
diff --git a/lib/pdm-client/src/lib.rs b/lib/pdm-client/src/lib.rs
index 4ef560e..1253ded 100644
--- a/lib/pdm-client/src/lib.rs
+++ b/lib/pdm-client/src/lib.rs
@@ -488,6 +488,7 @@ impl<T: HttpApiClient> PdmClient<T> {
         node: Option<&str>,
         vmid: u32,
         target: String,
+        target_endpoint: Option<&str>,
         params: RemoteMigrateQemu,
     ) -> Result<RemoteUpid, Error> {
         let path = format!("/api2/extjs/pve/remotes/{remote}/qemu/{vmid}/remote-migrate");
@@ -496,6 +497,9 @@ impl<T: HttpApiClient> PdmClient<T> {
         if let Some(node) = node {
             request["node"] = node.into();
         }
+        if let Some(target_endpoint) = target_endpoint {
+            request["target-endpoint"] = target_endpoint.into();
+        }
         Ok(self.0.post(&path, &request).await?.expect_json()?.data)
     }
 
@@ -581,6 +585,7 @@ impl<T: HttpApiClient> PdmClient<T> {
         node: Option<&str>,
         vmid: u32,
         target: String,
+        target_endpoint: Option<&str>,
         params: RemoteMigrateLxc,
     ) -> Result<RemoteUpid, Error> {
         let path = format!("/api2/extjs/pve/remotes/{remote}/lxc/{vmid}/remote-migrate");
@@ -589,6 +594,9 @@ impl<T: HttpApiClient> PdmClient<T> {
         if let Some(node) = node {
             request["node"] = node.into();
         }
+        if let Some(target_endpoint) = target_endpoint {
+            request["target-endpoint"] = target_endpoint.into();
+        }
         Ok(self.0.post(&path, &request).await?.expect_json()?.data)
     }
 
diff --git a/ui/src/widget/migrate_window.rs b/ui/src/widget/migrate_window.rs
index c87cf9a..42b4e95 100644
--- a/ui/src/widget/migrate_window.rs
+++ b/ui/src/widget/migrate_window.rs
@@ -174,6 +174,7 @@ impl PdmMigrateWindow {
                             None,
                             guest_info.vmid,
                             target_remote.to_string(),
+                            None,
                             migrate_opts,
                         )
                         .await?
@@ -218,6 +219,7 @@ impl PdmMigrateWindow {
                             None,
                             guest_info.vmid,
                             target_remote.to_string(),
+                            None,
                             migrate_opts,
                         )
                         .await?
-- 
2.39.5



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


  parent reply	other threads:[~2025-01-14 11:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-14 11:21 [pdm-devel] [PATCH datacenter-manager v2 0/4] remote migration: make target endpoint selectable Dominik Csapak
2025-01-14 11:21 ` [pdm-devel] [PATCH datacenter-manager v2 1/4] pdm-client: add cluster status method Dominik Csapak
2025-01-14 11:21 ` Dominik Csapak [this message]
2025-01-14 11:21 ` [pdm-devel] [PATCH datacenter-manager v2 3/4] ui: widget: add remote endpoint selector Dominik Csapak
2025-01-14 11:21 ` [pdm-devel] [PATCH datacenter-manager v2 4/4] ui: migrate: make target endpoint selectable for remote migration Dominik Csapak
2025-01-14 13:25 ` [pdm-devel] applied: [PATCH datacenter-manager v2 0/4] remote migration: make target endpoint selectable Dietmar Maurer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250114112140.1898658-3-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal