forked from proxmox-mirrors/proxmox
pbs-api-types: add mount_status field to DataStoreListItem
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
This commit is contained in:
parent
fd1f8413f7
commit
35fb5d4f7f
@ -178,6 +178,20 @@ pub enum ChunkOrder {
|
|||||||
Inode,
|
Inode,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[api]
|
||||||
|
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
#[serde(rename_all = "lowercase")]
|
||||||
|
/// Current mounting status of a datastore, useful for removable datastores.
|
||||||
|
pub enum DataStoreMountStatus {
|
||||||
|
/// Removable datastore is currently mounted correctly.
|
||||||
|
Mounted,
|
||||||
|
/// Removable datastore is currebtly not mounted.
|
||||||
|
NotMounted,
|
||||||
|
/// Datastore is not removable, so there is no mount status.
|
||||||
|
#[default]
|
||||||
|
NonRemovable,
|
||||||
|
}
|
||||||
|
|
||||||
#[api]
|
#[api]
|
||||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
@ -451,6 +465,7 @@ impl DataStoreConfig {
|
|||||||
pub struct DataStoreListItem {
|
pub struct DataStoreListItem {
|
||||||
pub store: String,
|
pub store: String,
|
||||||
pub comment: Option<String>,
|
pub comment: Option<String>,
|
||||||
|
pub mount_status: DataStoreMountStatus,
|
||||||
/// If the datastore is in maintenance mode, information about it
|
/// If the datastore is in maintenance mode, information about it
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub maintenance: Option<String>,
|
pub maintenance: Option<String>,
|
||||||
@ -1456,6 +1471,7 @@ pub struct DataStoreStatusListItem {
|
|||||||
/// The available bytes of the underlying storage. (-1 on error)
|
/// The available bytes of the underlying storage. (-1 on error)
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub avail: Option<u64>,
|
pub avail: Option<u64>,
|
||||||
|
pub mount_status: DataStoreMountStatus,
|
||||||
/// A list of usages of the past (last Month).
|
/// A list of usages of the past (last Month).
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub history: Option<Vec<Option<f64>>>,
|
pub history: Option<Vec<Option<f64>>>,
|
||||||
@ -1480,12 +1496,13 @@ pub struct DataStoreStatusListItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl DataStoreStatusListItem {
|
impl DataStoreStatusListItem {
|
||||||
pub fn empty(store: &str, err: Option<String>) -> Self {
|
pub fn empty(store: &str, err: Option<String>, mount_status: DataStoreMountStatus) -> Self {
|
||||||
DataStoreStatusListItem {
|
DataStoreStatusListItem {
|
||||||
store: store.to_owned(),
|
store: store.to_owned(),
|
||||||
total: None,
|
total: None,
|
||||||
used: None,
|
used: None,
|
||||||
avail: None,
|
avail: None,
|
||||||
|
mount_status,
|
||||||
history: None,
|
history: None,
|
||||||
history_start: None,
|
history_start: None,
|
||||||
history_delta: None,
|
history_delta: None,
|
||||||
|
Loading…
Reference in New Issue
Block a user