api2: DataStoreListItem add maintenance info
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
This commit is contained in:
parent
dd09432a90
commit
e022d13cf3
|
@ -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(
|
||||
|
|
|
@ -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),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue