tape: API type cleanup, use serde flatten to derive types

This commit is contained in:
Dietmar Maurer
2021-01-30 09:36:54 +01:00
parent 9586ce2f46
commit b5b99a52cd
8 changed files with 97 additions and 81 deletions

View File

@ -12,7 +12,6 @@ use crate::{
CHANGER_NAME_SCHEMA,
CHANGER_DRIVENUM_SCHEMA,
LINUX_DRIVE_PATH_SCHEMA,
DriveListEntry,
LinuxTapeDrive,
ScsiTapeChanger,
},
@ -110,7 +109,7 @@ pub fn get_config(
description: "The list of configured drives (with config digest).",
type: Array,
items: {
type: DriveListEntry,
type: LinuxTapeDrive,
},
},
)]
@ -125,6 +124,7 @@ pub fn list_drives(
let drive_list: Vec<LinuxTapeDrive> = config.convert_to_typed_array("linux")?;
rpcenv["digest"] = proxmox::tools::digest_to_hex(&digest).into();
Ok(drive_list)
}