manager: add report cli command

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
This commit is contained in:
Hannes Laimer 2020-11-03 13:29:08 +01:00 committed by Thomas Lamprecht
parent 46dce62be6
commit 9a556c8a30
1 changed files with 18 additions and 0 deletions

View File

@ -354,6 +354,21 @@ async fn verify(
Ok(Value::Null) Ok(Value::Null)
} }
#[api()]
/// System report
async fn report() -> Result<Value, Error> {
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() { fn main() {
proxmox_backup::tools::setup_safe_path_env(); proxmox_backup::tools::setup_safe_path_env();
@ -384,6 +399,9 @@ fn main() {
CliCommand::new(&API_METHOD_VERIFY) CliCommand::new(&API_METHOD_VERIFY)
.arg_param(&["store"]) .arg_param(&["store"])
.completion_cb("store", config::datastore::complete_datastore_name) .completion_cb("store", config::datastore::complete_datastore_name)
)
.insert("report",
CliCommand::new(&API_METHOD_REPORT)
); );