[pdm-devel] [PATCH datacenter-manager 6/9] pdm-client: add cluster status method
Dominik Csapak
d.csapak at proxmox.com
Mon Jan 13 16:45:47 CET 2025
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
lib/pdm-client/src/lib.rs | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/lib/pdm-client/src/lib.rs b/lib/pdm-client/src/lib.rs
index 14e6fc8..4ef560e 100644
--- a/lib/pdm-client/src/lib.rs
+++ b/lib/pdm-client/src/lib.rs
@@ -52,6 +52,8 @@ pub mod types {
};
pub use pve_api_types::ListRealm;
+
+ pub use pve_api_types::ClusterNodeStatus;
}
pub struct PdmClient<T: HttpApiClient>(pub T);
@@ -347,6 +349,16 @@ impl<T: HttpApiClient> PdmClient<T> {
Ok(self.0.get(&query).await?.expect_json()?.data)
}
+ pub async fn pve_cluster_status(
+ &self,
+ remote: &str,
+ target_endpoint: Option<&str>,
+ ) -> Result<Vec<ClusterNodeStatus>, Error> {
+ let mut query = format!("/api2/extjs/pve/remotes/{remote}/cluster-status");
+ add_query_arg(&mut query, &mut '?', "target-endpoint", &target_endpoint);
+ Ok(self.0.get(&query).await?.expect_json()?.data)
+ }
+
pub async fn pve_list_qemu(
&self,
remote: &str,
--
2.39.5
More information about the pdm-devel
mailing list