[pdm-devel] [PATCH datacenter-manager v3 12/19] pdm-api-types: introduce PBS datastore specific counters

Christian Ebner c.ebner at proxmox.com
Tue Oct 21 13:11:22 CEST 2025


Instead of using the storage counters, which are to limited to cover
counts of e.g. high usage stores, datastores which are in maintenance
mode ecc., introduce a dedicated type and add extended fields.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
Changes since version 2:
- not present in previous version

 lib/pdm-api-types/src/resource.rs | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/lib/pdm-api-types/src/resource.rs b/lib/pdm-api-types/src/resource.rs
index 400f2af..6c0125c 100644
--- a/lib/pdm-api-types/src/resource.rs
+++ b/lib/pdm-api-types/src/resource.rs
@@ -538,6 +538,28 @@ pub struct StorageStatusCount {
     pub unknown: u64,
 }
 
+#[api]
+#[derive(Default, Serialize, Deserialize, Clone, PartialEq)]
+/// Amount of Proxmox Backup Server datastores with certain state
+pub struct PbsDatastoreStatusCount {
+    /// Amount of online datastores
+    pub online: u64,
+    /// Amount of datastores which are in a maintenance mode
+    pub in_maintenance: Option<u64>,
+    /// Amount of datastores which have high datastore usage
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub high_usage: Option<u64>,
+    /// Amount of datastores in unknown state
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub unknown: Option<u64>,
+    /// Amount of removable datastores
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub removable: Option<u64>,
+    /// Amount of datastores with S3 backend
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub s3_backend: Option<u64>,
+}
+
 #[api]
 #[derive(Default, Serialize, Deserialize, Clone, PartialEq)]
 /// Amount of SDN zones in certain states
@@ -580,7 +602,7 @@ pub struct ResourcesStatus {
     /// Status of PBS Nodes
     pub pbs_nodes: NodeStatusCount,
     /// Status of PBS Datastores
-    pub pbs_datastores: StorageStatusCount,
+    pub pbs_datastores: PbsDatastoreStatusCount,
     /// List of the failed remotes including type and error
     #[serde(default, skip_serializing_if = "Vec::is_empty")]
     pub failed_remotes_list: Vec<FailedRemote>,
-- 
2.47.3





More information about the pdm-devel mailing list