[pbs-devel] [PATCH proxmox-backup 12/26] api-types: add "removable" to DataStoreListItem

Hannes Laimer h.laimer at proxmox.com
Tue Jul 5 15:08:20 CEST 2022


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

diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index ce77f47d..60c51c8d 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -337,6 +337,11 @@ impl DataStoreConfig {
             optional: true,
             format: &ApiStringFormat::PropertyString(&MaintenanceMode::API_SCHEMA),
             type: String,
+        },
+        removable: {
+            optional: true,
+            default: false,
+            type: bool,
         }
     },
 )]
@@ -349,6 +354,8 @@ pub struct DataStoreListItem {
     /// If the datastore is in maintenance mode, information about it
     #[serde(skip_serializing_if = "Option::is_none")]
     pub maintenance: Option<String>,
+    /// This datastore is marked as removable
+    pub removable: bool,
 }
 
 #[api(
diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
index 2be95f92..cbdadce2 100644
--- a/src/api2/admin/datastore.rs
+++ b/src/api2/admin/datastore.rs
@@ -1280,6 +1280,7 @@ pub fn get_datastore_list(
                     data["comment"].as_str().map(String::from)
                 },
                 maintenance: data["maintenance-mode"].as_str().map(String::from),
+                removable: data["removable"].as_bool().unwrap_or(false),
             });
         }
     }
-- 
2.30.2






More information about the pbs-devel mailing list