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

@ -13,7 +13,6 @@ use crate::{
DriveListEntry,
LinuxTapeDrive,
ScsiTapeChanger,
TapeDeviceInfo,
},
tape::{
linux_tape_device_list,
@ -224,31 +223,6 @@ pub fn delete_drive(name: String, _param: Value) -> Result<(), Error> {
Ok(())
}
#[api(
input: {
properties: {},
},
returns: {
description: "The list of autodetected tape drives.",
type: Array,
items: {
type: TapeDeviceInfo,
},
},
)]
/// Scan tape drives
pub fn scan_drives(_param: Value) -> Result<Vec<TapeDeviceInfo>, Error> {
let list = linux_tape_device_list();
Ok(list)
}
pub const SCAN_DRIVES: Router = Router::new()
.get(&API_METHOD_SCAN_DRIVES);
const ITEM_ROUTER: Router = Router::new()
.get(&API_METHOD_GET_CONFIG)
.put(&API_METHOD_UPDATE_DRIVE)