cli client: backup: better use of our api macro capabilities
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
a1b800c232
commit
667476f19d
@ -543,6 +543,7 @@ fn spawn_catalog_upload(
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
description: "Include all mounted subdirectories.",
|
description: "Include all mounted subdirectories.",
|
||||||
optional: true,
|
optional: true,
|
||||||
|
default: false,
|
||||||
},
|
},
|
||||||
keyfile: {
|
keyfile: {
|
||||||
schema: KEYFILE_SCHEMA,
|
schema: KEYFILE_SCHEMA,
|
||||||
@ -568,6 +569,7 @@ fn spawn_catalog_upload(
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
description: "Skip lost+found directory.",
|
description: "Skip lost+found directory.",
|
||||||
optional: true,
|
optional: true,
|
||||||
|
default: false,
|
||||||
},
|
},
|
||||||
"backup-type": {
|
"backup-type": {
|
||||||
schema: BACKUP_TYPE_SCHEMA,
|
schema: BACKUP_TYPE_SCHEMA,
|
||||||
@ -612,11 +614,13 @@ fn spawn_catalog_upload(
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
description: "Verbose output.",
|
description: "Verbose output.",
|
||||||
optional: true,
|
optional: true,
|
||||||
|
default: false,
|
||||||
},
|
},
|
||||||
"dry-run": {
|
"dry-run": {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
description: "Just show what backup would do, but do not upload anything.",
|
description: "Just show what backup would do, but do not upload anything.",
|
||||||
optional: true,
|
optional: true,
|
||||||
|
default: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -624,6 +628,10 @@ fn spawn_catalog_upload(
|
|||||||
/// Create (host) backup.
|
/// Create (host) backup.
|
||||||
async fn create_backup(
|
async fn create_backup(
|
||||||
param: Value,
|
param: Value,
|
||||||
|
all_file_systems: bool,
|
||||||
|
skip_lost_and_found: bool,
|
||||||
|
dry_run: bool,
|
||||||
|
verbose: bool,
|
||||||
_info: &ApiMethod,
|
_info: &ApiMethod,
|
||||||
_rpcenv: &mut dyn RpcEnvironment,
|
_rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Value, Error> {
|
) -> Result<Value, Error> {
|
||||||
@ -632,14 +640,6 @@ async fn create_backup(
|
|||||||
|
|
||||||
let backupspec_list = json::required_array_param(¶m, "backupspec")?;
|
let backupspec_list = json::required_array_param(¶m, "backupspec")?;
|
||||||
|
|
||||||
let all_file_systems = param["all-file-systems"].as_bool().unwrap_or(false);
|
|
||||||
|
|
||||||
let skip_lost_and_found = param["skip-lost-and-found"].as_bool().unwrap_or(false);
|
|
||||||
|
|
||||||
let verbose = param["verbose"].as_bool().unwrap_or(false);
|
|
||||||
|
|
||||||
let dry_run = param["dry-run"].as_bool().unwrap_or(false);
|
|
||||||
|
|
||||||
let backup_time_opt = param["backup-time"].as_i64();
|
let backup_time_opt = param["backup-time"].as_i64();
|
||||||
|
|
||||||
let chunk_size_opt = param["chunk-size"].as_u64().map(|v| (v*1024) as usize);
|
let chunk_size_opt = param["chunk-size"].as_u64().map(|v| (v*1024) as usize);
|
||||||
|
Loading…
Reference in New Issue
Block a user