tape: remove drive from pool config

This commit is contained in:
Dietmar Maurer
2021-02-01 09:14:28 +01:00
parent 83b8949a98
commit 9883b54cba
6 changed files with 38 additions and 44 deletions

View File

@ -765,6 +765,10 @@ async fn clean_drive(param: Value) -> Result<(), Error> {
pool: {
schema: MEDIA_POOL_NAME_SCHEMA,
},
drive: {
schema: DRIVE_NAME_SCHEMA,
optional: true,
},
"eject-media": {
description: "Eject media upon job completion.",
type: bool,
@ -783,10 +787,14 @@ async fn clean_drive(param: Value) -> Result<(), Error> {
},
)]
/// Backup datastore to tape media pool
async fn backup(param: Value) -> Result<(), Error> {
async fn backup(mut param: Value) -> Result<(), Error> {
let output_format = get_output_format(&param);
let (config, _digest) = config::drive::config()?;
param["drive"] = lookup_drive_name(&param, &config)?.into();
let mut client = connect_to_localhost()?;
let result = client.post("api2/json/tape/backup", Some(param)).await?;
@ -802,6 +810,10 @@ async fn backup(param: Value) -> Result<(), Error> {
store: {
schema: DATASTORE_SCHEMA,
},
drive: {
schema: DRIVE_NAME_SCHEMA,
optional: true,
},
"media-set": {
description: "Media set UUID.",
type: String,
@ -814,10 +826,14 @@ async fn backup(param: Value) -> Result<(), Error> {
},
)]
/// Restore data from media-set
async fn restore(param: Value) -> Result<(), Error> {
async fn restore(mut param: Value) -> Result<(), Error> {
let output_format = get_output_format(&param);
let (config, _digest) = config::drive::config()?;
param["drive"] = lookup_drive_name(&param, &config)?.into();
let mut client = connect_to_localhost()?;
let result = client.post("api2/json/tape/restore", Some(param)).await?;

View File

@ -18,9 +18,6 @@ use proxmox_backup::{
},
},
config::{
drive::{
complete_drive_name,
},
media_pool::{
complete_pool_name,
},
@ -50,7 +47,6 @@ pub fn pool_commands() -> CommandLineInterface {
CliCommand::new(&api2::config::media_pool::API_METHOD_CREATE_POOL)
.arg_param(&["name"])
.completion_cb("name", complete_pool_name)
.completion_cb("drive", complete_drive_name)
.completion_cb("encrypt", complete_key_fingerprint)
)
.insert(
@ -58,7 +54,6 @@ pub fn pool_commands() -> CommandLineInterface {
CliCommand::new(&api2::config::media_pool::API_METHOD_UPDATE_POOL)
.arg_param(&["name"])
.completion_cb("name", complete_pool_name)
.completion_cb("drive", complete_drive_name)
.completion_cb("encrypt", complete_key_fingerprint)
)
;
@ -99,7 +94,6 @@ fn list_pools(
let options = default_table_format_options()
.column(ColumnConfig::new("name"))
.column(ColumnConfig::new("drive"))
.column(ColumnConfig::new("allocation"))
.column(ColumnConfig::new("retention"))
.column(ColumnConfig::new("template"))