From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/6] api2/types: add necessary types for node status
Date: Mon, 19 Apr 2021 13:02:01 +0200 [thread overview]
Message-ID: <20210419110206.28498-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20210419110206.28498-1-d.csapak@proxmox.com>
we want to use concrete types instead of value
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/api2/types/mod.rs | 49 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 47 insertions(+), 2 deletions(-)
diff --git a/src/api2/types/mod.rs b/src/api2/types/mod.rs
index 19186ea2..ac4957ac 100644
--- a/src/api2/types/mod.rs
+++ b/src/api2/types/mod.rs
@@ -751,9 +751,8 @@ impl Default for GarbageCollectionStatus {
}
}
-
#[api()]
-#[derive(Serialize, Deserialize)]
+#[derive(Default, Serialize, Deserialize)]
/// Storage space usage information.
pub struct StorageStatus {
/// Total space (bytes).
@@ -1504,3 +1503,49 @@ pub struct JobScheduleStatus {
#[serde(skip_serializing_if="Option::is_none")]
pub last_run_endtime: Option<i64>,
}
+
+#[api]
+#[derive(Serialize, Deserialize, Default)]
+#[serde(rename_all = "kebab-case")]
+/// Node memory usage counters
+pub struct NodeMemoryCounters {
+ /// Total memory
+ pub total: u64,
+ /// Used memory
+ pub used: u64,
+ /// Free memory
+ pub free: u64,
+}
+
+#[api]
+#[derive(Serialize,Deserialize,Default)]
+#[serde(rename_all = "kebab-case")]
+/// Contains general node information such as the fingerprint`
+pub struct NodeInformation {
+ /// The SSL Fingerprint
+ pub fingerprint: String,
+}
+
+#[api(
+ properties: {
+ memory: {
+ type: NodeMemoryCounters,
+ },
+ root: {
+ type: StorageStatus,
+ },
+ info: {
+ type: NodeInformation,
+ }
+ },
+)]
+#[derive(Serialize, Deserialize, Default)]
+#[serde(rename_all = "kebab-case")]
+/// The Node status
+pub struct NodeStatus {
+ pub memory: NodeMemoryCounters,
+ pub root: StorageStatus,
+ /// Total CPU usage since last query.
+ pub cpu: f64,
+ pub info: NodeInformation,
+}
--
2.20.1
next prev parent reply other threads:[~2021-04-19 11:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-19 11:02 [pbs-devel] [PATCH proxmox-backup 0/6] make node info panel similar to pve Dominik Csapak
2021-04-19 11:02 ` Dominik Csapak [this message]
2021-04-23 9:36 ` [pbs-devel] applied: [PATCH proxmox-backup 1/6] api2/types: add necessary types for node status Thomas Lamprecht
2021-04-19 11:02 ` [pbs-devel] [PATCH proxmox-backup 2/6] api2/nodes/status: use NodeStatus struct Dominik Csapak
2021-04-23 9:36 ` [pbs-devel] applied: " Thomas Lamprecht
2021-04-19 11:02 ` [pbs-devel] [PATCH proxmox-backup 3/6] api2/node/status: extend node status Dominik Csapak
2021-04-23 9:36 ` [pbs-devel] applied: " Thomas Lamprecht
2021-04-19 11:02 ` [pbs-devel] [PATCH proxmox-backup 4/6] ui: factor out NodeInfoPanel Dominik Csapak
2021-04-19 11:02 ` [pbs-devel] [PATCH proxmox-backup 5/6] ui: panel/NodeInfo: make it like in pve Dominik Csapak
2021-04-19 11:02 ` [pbs-devel] [PATCH proxmox-backup 6/6] ui: window/Settings: add summarycolumns settings Dominik Csapak
2021-04-23 9:39 ` [pbs-devel] [PATCH proxmox-backup 0/6] make node info panel similar to pve 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=20210419110206.28498-2-d.csapak@proxmox.com \
--to=d.csapak@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