From: Hannes Laimer <h.laimer@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 3/3] manager: add report cli command
Date: Tue, 3 Nov 2020 13:29:08 +0100 [thread overview]
Message-ID: <20201103122908.114524-4-h.laimer@proxmox.com> (raw)
In-Reply-To: <20201103122908.114524-1-h.laimer@proxmox.com>
Signed-off-by: Hannes Laimer <h.laimer@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
next prev parent reply other threads:[~2020-11-03 12:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 12:29 [pbs-devel] [PATCH proxmox-backup 0/3] add system report Hannes Laimer
2020-11-03 12:29 ` [pbs-devel] [PATCH proxmox-backup 1/3] report: add api endpoint and function to generate report Hannes Laimer
2020-11-03 12:29 ` [pbs-devel] [PATCH proxmox-backup 2/3] report: add webui button for system report Hannes Laimer
2020-11-03 12:29 ` Hannes Laimer [this message]
2020-11-04 7:49 ` [pbs-devel] applied-series: [PATCH proxmox-backup 0/3] add " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201103122908.114524-4-h.laimer@proxmox.com \
--to=h.laimer@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox