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] [RFC PATCH datacenter-manager 2/3] pdm-client: add bulk_start method
Date: Wed, 29 Jan 2025 11:51:41 +0100	[thread overview]
Message-ID: <20250129105142.1291843-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250129105142.1291843-1-d.csapak@proxmox.com>

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 lib/pdm-client/src/lib.rs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/pdm-client/src/lib.rs b/lib/pdm-client/src/lib.rs
index a41b82c..962c76e 100644
--- a/lib/pdm-client/src/lib.rs
+++ b/lib/pdm-client/src/lib.rs
@@ -7,7 +7,7 @@ use pdm_api_types::resource::{PveResource, RemoteResources, TopEntities};
 use pdm_api_types::rrddata::{
     LxcDataPoint, NodeDataPoint, PbsDatastoreDataPoint, PbsNodeDataPoint, QemuDataPoint,
 };
-use pdm_api_types::BasicRealmInfo;
+use pdm_api_types::{BasicRealmInfo, UPID};
 use pve_api_types::StartQemuMigrationType;
 use serde::{Deserialize, Serialize};
 use serde_json::{json, Value};
@@ -447,6 +447,13 @@ impl<T: HttpApiClient> PdmClient<T> {
             .await
     }
 
+    pub async fn pve_bulk_start(&self, remote: &str, vmid_list: Vec<u32>) -> Result<UPID, Error> {
+        let path = format!("/api2/extjs/pve/remotes/{remote}/bulk-start");
+        let mut request = json!({});
+        request["vmid-list"] = vmid_list.into();
+        Ok(self.0.post(&path, &request).await?.expect_json()?.data)
+    }
+
     pub async fn pve_qemu_shutdown(
         &self,
         remote: &str,
-- 
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-29 10:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-29 10:51 [pdm-devel] [RFC PATCH datacenter-manager 0/3] implement bulk start Dominik Csapak
2025-01-29 10:51 ` [pdm-devel] [RFC PATCH datacenter-manager 1/3] server: pve api: add new bulkstart api call Dominik Csapak
2025-01-29 10:51 ` Dominik Csapak [this message]
2025-01-29 10:51 ` [pdm-devel] [RFC PATCH datacenter-manager 3/3] ui: pve tree: add bulk start action Dominik Csapak
2025-01-29 18:48 ` [pdm-devel] [RFC PATCH datacenter-manager 0/3] implement bulk start Thomas Lamprecht
2025-01-30  8:14   ` Dominik Csapak
2025-01-30 16:15     ` Thomas Lamprecht

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=20250129105142.1291843-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