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

Hannes Laimer h.laimer at proxmox.com
Fri Apr 15 09:28:15 CEST 2022


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

diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index 01e2319a..0fc5622e 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -330,6 +330,9 @@ impl DataStoreConfig {
             optional: true,
             schema: SINGLE_LINE_COMMENT_SCHEMA,
         },
+        maintenance: {
+            type: bool,
+        }
     },
 )]
 #[derive(Serialize, Deserialize)]
@@ -338,6 +341,8 @@ impl DataStoreConfig {
 pub struct DataStoreListItem {
     pub store: String,
     pub comment: Option<String>,
+    /// The datastore is in maintenance mode
+    pub maintenance: bool,
 }
 
 #[api(
diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
index ce5bd244..22bce40d 100644
--- a/src/api2/admin/datastore.rs
+++ b/src/api2/admin/datastore.rs
@@ -1084,6 +1084,7 @@ pub fn get_datastore_list(
                 DataStoreListItem {
                     store: store.clone(),
                     comment: data["comment"].as_str().map(String::from),
+                    maintenance: data.get("maintenance-mode").is_some(),
                 }
             );
         }
-- 
2.30.2






More information about the pbs-devel mailing list