[pbs-devel] [PATCH v2 proxmox-backup 06/15] api2: add 'removable' to DataStoreListItem
Hannes Laimer
h.laimer at proxmox.com
Mon Aug 30 13:14:56 CEST 2021
---
pbs-api-types/src/lib.rs | 7 +++++++
src/api2/admin/datastore.rs | 1 +
2 files changed, 8 insertions(+)
diff --git a/pbs-api-types/src/lib.rs b/pbs-api-types/src/lib.rs
index 576099eb..2965a11a 100644
--- a/pbs-api-types/src/lib.rs
+++ b/pbs-api-types/src/lib.rs
@@ -437,6 +437,12 @@ pub struct GroupListItem {
optional: true,
schema: SINGLE_LINE_COMMENT_SCHEMA,
},
+ removable: {
+ description: "The datastore is marked as removable.",
+ type: bool,
+ optional: true,
+ default: false,
+ },
},
)]
#[derive(Serialize, Deserialize)]
@@ -445,6 +451,7 @@ pub struct GroupListItem {
pub struct DataStoreListItem {
pub store: String,
pub comment: Option<String>,
+ pub removable: bool,
}
#[api(
diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
index 16559678..b236dfab 100644
--- a/src/api2/admin/datastore.rs
+++ b/src/api2/admin/datastore.rs
@@ -1089,6 +1089,7 @@ pub fn get_datastore_list(
DataStoreListItem {
store: store.clone(),
comment: data["comment"].as_str().map(String::from),
+ removable: data["backing-device"] != Value::Null,
}
);
}
--
2.30.2
More information about the pbs-devel
mailing list