tape: cleanup TapeJob implementation - uses AllOf Schema with SectionConfig
This commit is contained in:
@ -6,7 +6,6 @@ use proxmox::{
|
||||
schema::{
|
||||
Schema,
|
||||
ObjectSchemaType,
|
||||
SchemaPropertyEntry,
|
||||
ApiStringFormat,
|
||||
},
|
||||
router::{
|
||||
|
@ -586,7 +586,7 @@ async fn schedule_tape_backup_jobs() {
|
||||
Ok(job) => job,
|
||||
Err(_) => continue, // could not get lock
|
||||
};
|
||||
if let Err(err) = do_tape_backup_job(job, job_config, &auth_id, Some(event_str)) {
|
||||
if let Err(err) = do_tape_backup_job(job, job_config.setup, &auth_id, Some(event_str)) {
|
||||
eprintln!("unable to start tape bvackup job {} - {}", &job_id, err);
|
||||
}
|
||||
};
|
||||
|
@ -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)
|
||||
)
|
||||
|
Reference in New Issue
Block a user