From 9a556c8a302b9a96efcf52ccaa2aa0254d72bab6 Mon Sep 17 00:00:00 2001 From: Hannes Laimer Date: Tue, 3 Nov 2020 13:29:08 +0100 Subject: [PATCH] manager: add report cli command Signed-off-by: Hannes Laimer --- src/bin/proxmox-backup-manager.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/bin/proxmox-backup-manager.rs b/src/bin/proxmox-backup-manager.rs index bbb3ed2f..d950d6f6 100644 --- a/src/bin/proxmox-backup-manager.rs +++ b/src/bin/proxmox-backup-manager.rs @@ -354,6 +354,21 @@ async fn verify( Ok(Value::Null) } +#[api()] +/// System report +async fn report() -> Result { + let client = connect()?; + + let path = format!("api2/json/nodes/localhost/report"); + + let result = client.get(&path, None).await?; + + let data = &result["data"]; + println!("{}",data.to_string().replace("\\n", "\n")); + + Ok(Value::Null) +} + fn main() { proxmox_backup::tools::setup_safe_path_env(); @@ -384,6 +399,9 @@ fn main() { CliCommand::new(&API_METHOD_VERIFY) .arg_param(&["store"]) .completion_cb("store", config::datastore::complete_datastore_name) + ) + .insert("report", + CliCommand::new(&API_METHOD_REPORT) );