From 49dc074007c8d75d93be256be0048775c0df1ecf Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sat, 2 Mar 2019 16:34:10 +0100 Subject: [PATCH] parameter name cleanups (use '-' instead of '_') --- src/api2/admin/datastore.rs | 6 +++--- src/api2/admin/datastore/catar.rs | 8 ++++---- src/bin/proxmox-backup-client.rs | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs index 8e614e6e..0c07451a 100644 --- a/src/api2/admin/datastore.rs +++ b/src/api2/admin/datastore.rs @@ -308,9 +308,9 @@ fn get_backup_list( for info in datastore.list_backups()? { list.push(json!({ - "backup_type": info.backup_dir.group.backup_type, - "backup_id": info.backup_dir.group.backup_id, - "backup_time": info.backup_dir.backup_time.timestamp(), + "backup-type": info.backup_dir.group.backup_type, + "backup-id": info.backup_dir.group.backup_id, + "backup-time": info.backup_dir.backup_time.timestamp(), "files": info.files, })); } diff --git a/src/api2/admin/datastore/catar.rs b/src/api2/admin/datastore/catar.rs index c0bcbeab..c377174e 100644 --- a/src/api2/admin/datastore/catar.rs +++ b/src/api2/admin/datastore/catar.rs @@ -55,7 +55,7 @@ fn upload_catar( ) -> Result { let store = tools::required_string_param(¶m, "store")?; - let mut archive_name = String::from(tools::required_string_param(¶m, "archive_name")?); + let mut archive_name = String::from(tools::required_string_param(¶m, "archive-name")?); if !archive_name.ends_with(".catar") { bail!("got wront file extension (expected '.catar')"); @@ -108,7 +108,7 @@ pub fn api_method_upload_catar() -> ApiAsyncMethod { upload_catar, ObjectSchema::new("Upload .catar backup file.") .required("store", StringSchema::new("Datastore name.")) - .required("archive_name", StringSchema::new("Backup archive name.")) + .required("archive-name", StringSchema::new("Backup archive name.")) .required("type", StringSchema::new("Backup type.") .format(Arc::new(ApiStringFormat::Enum(vec!["ct".into(), "host".into()])))) .required("id", StringSchema::new("Backup ID.")) @@ -133,7 +133,7 @@ fn download_catar( ) -> Result { let store = tools::required_string_param(¶m, "store")?; - let archive_name = tools::required_string_param(¶m, "archive_name")?; + let archive_name = tools::required_string_param(¶m, "archive-name")?; let backup_type = tools::required_string_param(¶m, "type")?; let backup_id = tools::required_string_param(¶m, "id")?; @@ -177,7 +177,7 @@ pub fn api_method_download_catar() -> ApiAsyncMethod { download_catar, ObjectSchema::new("Download .catar backup file.") .required("store", StringSchema::new("Datastore name.")) - .required("archive_name", StringSchema::new("Backup archive name.")) + .required("archive-name", StringSchema::new("Backup archive name.")) .required("type", StringSchema::new("Backup type.") .format(Arc::new(ApiStringFormat::Enum(vec!["ct".into(), "host".into()])))) .required("id", StringSchema::new("Backup ID.")) diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs index f4e7759f..2ab1d78d 100644 --- a/src/bin/proxmox-backup-client.rs +++ b/src/bin/proxmox-backup-client.rs @@ -40,7 +40,7 @@ fn backup_directory>( let mut query = url::form_urlencoded::Serializer::new(String::new()); query - .append_pair("archive_name", archive_name) + .append_pair("archive-name", archive_name) .append_pair("type", "host") .append_pair("id", &tools::nodename()) .append_pair("time", &backup_time.timestamp().to_string()); @@ -108,9 +108,9 @@ fn list_backups( for item in list { - let id = item["backup_id"].as_str().unwrap(); - let btype = item["backup_type"].as_str().unwrap(); - let epoch = item["backup_time"].as_i64().unwrap(); + let id = item["backup-id"].as_str().unwrap(); + let btype = item["backup-type"].as_str().unwrap(); + let epoch = item["backup-time"].as_i64().unwrap(); let backup_time = Local.timestamp(epoch, 0); let backup_dir = BackupDir {