[pbs-devel] [PATCH proxmox-backup 3/3] manager: add report cli command
Hannes Laimer
h.laimer at proxmox.com
Tue Nov 3 13:29:08 CET 2020
Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
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<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() {
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)
);
--
2.20.1
More information about the pbs-devel
mailing list