catar api: cleanup parameter names

This commit is contained in:
Dietmar Maurer 2019-03-03 09:48:32 +01:00
parent 421c9ba1d9
commit e77a02ed87
2 changed files with 15 additions and 15 deletions

View File

@ -63,9 +63,9 @@ fn upload_catar(
archive_name.push_str(".didx");
let backup_type = tools::required_string_param(&param, "type")?;
let backup_id = tools::required_string_param(&param, "id")?;
let backup_time = tools::required_integer_param(&param, "time")?;
let backup_type = tools::required_string_param(&param, "backup-type")?;
let backup_id = tools::required_string_param(&param, "backup-id")?;
let backup_time = tools::required_integer_param(&param, "backup-time")?;
println!("Upload {}/{}/{}/{}/{}", store, backup_type, backup_id, backup_time, archive_name);
@ -109,10 +109,10 @@ pub fn api_method_upload_catar() -> ApiAsyncMethod {
ObjectSchema::new("Upload .catar backup file.")
.required("store", StringSchema::new("Datastore name."))
.required("archive-name", StringSchema::new("Backup archive name."))
.required("type", StringSchema::new("Backup type.")
.required("backup-type", StringSchema::new("Backup type.")
.format(Arc::new(ApiStringFormat::Enum(vec!["ct".into(), "host".into()]))))
.required("id", StringSchema::new("Backup ID."))
.required("time", IntegerSchema::new("Backup time (Unix epoch.)")
.required("backup-id", StringSchema::new("Backup ID."))
.required("backup-time", IntegerSchema::new("Backup time (Unix epoch.)")
.minimum(1547797308))
.optional(
"chunk-size",
@ -135,9 +135,9 @@ fn download_catar(
let store = tools::required_string_param(&param, "store")?;
let archive_name = tools::required_string_param(&param, "archive-name")?;
let backup_type = tools::required_string_param(&param, "type")?;
let backup_id = tools::required_string_param(&param, "id")?;
let backup_time = tools::required_integer_param(&param, "time")?;
let backup_type = tools::required_string_param(&param, "backup-type")?;
let backup_id = tools::required_string_param(&param, "backup-id")?;
let backup_time = tools::required_integer_param(&param, "backup-time")?;
let backup_time = Local.timestamp(backup_time, 0);
println!("Download {}.catar from {} ({}/{}/{}/{}.didx)", archive_name, store,
@ -178,10 +178,10 @@ pub fn api_method_download_catar() -> ApiAsyncMethod {
ObjectSchema::new("Download .catar backup file.")
.required("store", StringSchema::new("Datastore name."))
.required("archive-name", StringSchema::new("Backup archive name."))
.required("type", StringSchema::new("Backup type.")
.required("backup-type", StringSchema::new("Backup type.")
.format(Arc::new(ApiStringFormat::Enum(vec!["ct".into(), "host".into()]))))
.required("id", StringSchema::new("Backup ID."))
.required("time", IntegerSchema::new("Backup time (Unix epoch.)")
.required("backup-id", StringSchema::new("Backup ID."))
.required("backup-time", IntegerSchema::new("Backup time (Unix epoch.)")
.minimum(1547797308))
)

View File

@ -39,9 +39,9 @@ fn backup_directory<P: AsRef<Path>>(
let mut param = json!({
"archive-name": archive_name,
"type": "host",
"id": &tools::nodename(),
"time": backup_time.timestamp(),
"backup-type": "host",
"backup-id": &tools::nodename(),
"backup-time": backup_time.timestamp(),
});
if let Some(size) = chunk_size {