tape: expose basic tape/changer functionality at api2/tape/

This commit is contained in:
Dietmar Maurer
2020-12-08 15:42:50 +01:00
parent 5ba83ed099
commit 5d90860688
9 changed files with 359 additions and 53 deletions

View File

@ -111,3 +111,36 @@ pub struct DriveListEntry {
#[serde(skip_serializing_if="Option::is_none")]
pub serial: Option<String>,
}
#[api()]
#[derive(Serialize,Deserialize)]
#[serde(rename_all = "lowercase")]
/// Mtx Entry Kind
pub enum MtxEntryKind {
/// Drive
Drive,
/// Slot
Slot,
}
#[api(
properties: {
"entry-kind": {
type: MtxEntryKind,
},
},
)]
#[derive(Serialize,Deserialize)]
#[serde(rename_all = "kebab-case")]
/// Mtx Status Entry
pub struct MtxStatusEntry {
pub entry_kind: MtxEntryKind,
/// The ID of the slot or drive
pub entry_id: u64,
/// The media label (volume tag) if the slot/drive is full
#[serde(skip_serializing_if="Option::is_none")]
pub changer_id: Option<String>,
/// The slot the drive was loaded from
#[serde(skip_serializing_if="Option::is_none")]
pub loaded_slot: Option<u64>,
}