mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-29 12:12:39 +00:00
datastore status: impl empty-status constructor for item type
we can now use it for the error case and will further use it for the can access namespace but not datastore case in a future patch Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
f6a37f40f6
commit
79cf434a79
@ -1361,6 +1361,23 @@ pub struct DataStoreStatusListItem {
|
|||||||
pub gc_status: Option<GarbageCollectionStatus>,
|
pub gc_status: Option<GarbageCollectionStatus>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl DataStoreStatusListItem {
|
||||||
|
pub fn empty(store: &str, err: Option<String>) -> Self {
|
||||||
|
DataStoreStatusListItem {
|
||||||
|
store: store.to_owned(),
|
||||||
|
total: -1,
|
||||||
|
used: -1,
|
||||||
|
avail: -1,
|
||||||
|
history: None,
|
||||||
|
history_start: None,
|
||||||
|
history_delta: None,
|
||||||
|
estimated_full_date: None,
|
||||||
|
error: err,
|
||||||
|
gc_status: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub const ADMIN_DATASTORE_LIST_SNAPSHOTS_RETURN_TYPE: ReturnType = ReturnType {
|
pub const ADMIN_DATASTORE_LIST_SNAPSHOTS_RETURN_TYPE: ReturnType = ReturnType {
|
||||||
optional: false,
|
optional: false,
|
||||||
schema: &ArraySchema::new(
|
schema: &ArraySchema::new(
|
||||||
|
Loading…
Reference in New Issue
Block a user