[pdm-devel] [PATCH datacenter-manager v3 13/19] pdm-api-types/resources: extend datastore resources by config properties

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


Add currently configured datastore properties to the PBS datastore
resource definition. This will allow to identify datastores being
currently maintained, as well as their backing device and backend
type.

Derives the `Default` trait for easier object creation in case of
missing config information.

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 | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/lib/pdm-api-types/src/resource.rs b/lib/pdm-api-types/src/resource.rs
index 6c0125c..b779825 100644
--- a/lib/pdm-api-types/src/resource.rs
+++ b/lib/pdm-api-types/src/resource.rs
@@ -460,7 +460,7 @@ pub struct PbsNodeResource {
 }
 
 #[api]
-#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)]
 #[serde(rename_all = "kebab-case")]
 /// PBS datastore resource
 pub struct PbsDatastoreResource {
@@ -472,6 +472,17 @@ pub struct PbsDatastoreResource {
     pub disk: u64,
     /// Datastore name
     pub name: String,
+    /// Datastore contents disk usage
+    pub usage: f64,
+    /// Datastore maintenance mode
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub maintenance: Option<String>,
+    /// Datastore backing device
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub backing_device: Option<String>,
+    /// Datastore backend type
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub backend_type: Option<String>,
 }
 
 #[api(
-- 
2.47.3





More information about the pdm-devel mailing list