tape: cleanup TapeJob implementation - uses AllOf Schema with SectionConfig

This commit is contained in:
Dietmar Maurer
2021-02-24 18:12:11 +01:00
parent 46d53e3e90
commit 5830e5620d
5 changed files with 67 additions and 105 deletions

View File

@ -38,6 +38,7 @@ use proxmox_backup::{
datastore::complete_datastore_name,
drive::complete_drive_name,
media_pool::complete_pool_name,
tape_job::TapeBackupJobSetup,
},
tape::{
drive::{
@ -790,27 +791,11 @@ async fn clean_drive(mut param: Value) -> Result<(), Error> {
}
#[api(
input: {
input: {
properties: {
store: {
schema: DATASTORE_SCHEMA,
},
pool: {
schema: MEDIA_POOL_NAME_SCHEMA,
},
drive: {
schema: DRIVE_NAME_SCHEMA,
optional: true,
},
"eject-media": {
description: "Eject media upon job completion.",
type: bool,
optional: true,
},
"export-media-set": {
description: "Export media set upon job completion.",
type: bool,
optional: true,
setup: {
type: TapeBackupJobSetup,
flatten: true,
},
"output-format": {
schema: OUTPUT_FORMAT,
@ -926,6 +911,7 @@ fn main() {
"backup",
CliCommand::new(&API_METHOD_BACKUP)
.arg_param(&["store", "pool"])
.completion_cb("drive", complete_drive_name)
.completion_cb("store", complete_datastore_name)
.completion_cb("pool", complete_pool_name)
)