]> git.proxmox.com Git - proxmox-backup.git/blobdiff - src/bin/proxmox_backup_client/benchmark.rs
adaptions for proxmox 0.9 and proxmox-api-macro 0.3
[proxmox-backup.git] / src / bin / proxmox_backup_client / benchmark.rs
index b0d769e8dca8b64abb0eb267d0ccc5b03ebe0f7d..2ecb3dc9b6449efc5f61a4b0759481cf7b20f347 100644 (file)
@@ -15,6 +15,7 @@ use proxmox::api::{
         format_and_print_result_full,
         default_table_format_options,
     },
+    router::ReturnType,
 };
 
 use proxmox_backup::backup::{
@@ -151,7 +152,7 @@ pub async fn benchmark(
     let crypt_config = match keyfile {
         None => None,
         Some(path) => {
-            let (key, _) = load_and_decrypt_key(&path, &crate::key::get_encryption_key_password)?;
+            let (key, _, _) = load_and_decrypt_key(&path, &crate::key::get_encryption_key_password)?;
             let crypt_config = CryptConfig::new(key)?;
             Some(Arc::new(crypt_config))
         }
@@ -178,7 +179,7 @@ fn render_result(
 ) -> Result<(), Error> {
 
     let mut data = serde_json::to_value(benchmark_result)?;
-    let schema = &BenchmarkResult::API_SCHEMA;
+    let return_type = ReturnType::new(false, &BenchmarkResult::API_SCHEMA);
 
     let render_speed = |value: &Value, _record: &Value| -> Result<String, Error> {
         match value["speed"].as_f64() {
@@ -211,7 +212,7 @@ fn render_result(
                 .right_align(false).renderer(render_speed));
 
 
-    format_and_print_result_full(&mut data, schema, output_format, &options);
+    format_and_print_result_full(&mut data, &return_type, output_format, &options);
 
     Ok(())
 }