[pbs-devel] [PATCH proxmox-backup v2 2/6] api2: DataStoreListItem add maintenance info

Hannes Laimer h.laimer at proxmox.com
Tue Apr 26 08:23:31 CEST 2022


Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
 pbs-api-types/src/datastore.rs | 8 ++++++++
 src/api2/admin/datastore.rs    | 1 +
 2 files changed, 9 insertions(+)

diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index 2bff64b5..fec0c3ad 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -354,6 +354,11 @@ impl DataStoreConfig {
             optional: true,
             schema: SINGLE_LINE_COMMENT_SCHEMA,
         },
+        maintenance: {
+            optional: true,
+            format: &ApiStringFormat::PropertyString(&MaintenanceMode::API_SCHEMA),
+            type: String,
+        }
     },
 )]
 #[derive(Serialize, Deserialize)]
@@ -362,6 +367,9 @@ impl DataStoreConfig {
 pub struct DataStoreListItem {
     pub store: String,
     pub comment: Option<String>,
+    /// If the datastore is in maintenance mode, information about it
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub maintenance: Option<String>,
 }
 
 #[api(
diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
index 9f7acd0d..dcc4e1c1 100644
--- a/src/api2/admin/datastore.rs
+++ b/src/api2/admin/datastore.rs
@@ -1030,6 +1030,7 @@ pub fn get_datastore_list(
             list.push(DataStoreListItem {
                 store: store.clone(),
                 comment: data["comment"].as_str().map(String::from),
+                maintenance: data["maintenance-mode"].as_str().map(String::from),
             });
         }
     }
-- 
2.30.2






More information about the pbs-devel mailing list