tape: remove drive from pool config
This commit is contained in:
@ -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(¶m);
|
||||
|
||||
let (config, _digest) = config::drive::config()?;
|
||||
|
||||
param["drive"] = lookup_drive_name(¶m, &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(¶m);
|
||||
|
||||
let (config, _digest) = config::drive::config()?;
|
||||
|
||||
param["drive"] = lookup_drive_name(¶m, &config)?.into();
|
||||
|
||||
let mut client = connect_to_localhost()?;
|
||||
|
||||
let result = client.post("api2/json/tape/restore", Some(param)).await?;
|
||||
|
Reference in New Issue
Block a user