From: Shannon Sterz <s.sterz@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager 3/4] api: pve: make to `get_storage_rrd_data` return PveStorageDataPoint
Date: Fri, 28 Nov 2025 16:38:54 +0100 [thread overview]
Message-ID: <20251128153855.543210-4-s.sterz@proxmox.com> (raw)
In-Reply-To: <20251128153855.543210-1-s.sterz@proxmox.com>
this worked so far by accident as `NodeDataPoint` has the field that
are also specified in `PveStorageDataPoint`, but marks all additional
fields as optional. fix this by using the proper return type.
pdm-client already uses the correct return type anyway.
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
server/src/api/pve/rrddata.rs | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/server/src/api/pve/rrddata.rs b/server/src/api/pve/rrddata.rs
index 226b675..08db107 100644
--- a/server/src/api/pve/rrddata.rs
+++ b/server/src/api/pve/rrddata.rs
@@ -289,8 +289,15 @@ async fn get_node_rrd_data(
access: {
permission: &Permission::Privilege(&["resource", "{remote}", "storage", "{storage}"], PRIV_RESOURCE_AUDIT, false),
},
+ returns: {
+ type: Array,
+ description:"A list of RRD data points on a PVE remote's storage.",
+ items: {
+ type: PveStorageDataPoint,
+ }
+ }
)]
-/// Read node stats
+/// Read storage stats
async fn get_storage_rrd_data(
remote: String,
node: String,
@@ -298,7 +305,7 @@ async fn get_storage_rrd_data(
timeframe: RrdTimeframe,
cf: RrdMode,
_param: Value,
-) -> Result<Vec<NodeDataPoint>, Error> {
+) -> Result<Vec<PveStorageDataPoint>, Error> {
let base = format!("pve/{remote}/storage/{node}/{storage}");
rrd_common::get_rrd_datapoints(remote, base, timeframe, cf).await
}
--
2.47.3
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next prev parent reply other threads:[~2025-11-28 15:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-28 15:38 [pdm-devel] [PATCH datacenter-manager 0/4] clean up return statements tree wide Shannon Sterz
2025-11-28 15:38 ` [pdm-devel] [PATCH datacenter-manager 1/4] tree-wide: add missing `returns` definitions to api macro Shannon Sterz
2025-11-28 15:38 ` [pdm-devel] [PATCH datacenter-manager 2/4] tree-wide: make `returns` defintion match the return type of api methods Shannon Sterz
2025-11-28 15:38 ` Shannon Sterz [this message]
2025-11-28 15:38 ` [pdm-devel] [PATCH datacenter-manager 4/4] api: pbs: fix description of list namespace endpoint Shannon Sterz
2025-11-28 18:53 ` [pdm-devel] applied: [PATCH datacenter-manager 0/4] clean up return statements tree wide 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=20251128153855.543210-4-s.sterz@proxmox.com \
--to=s.sterz@proxmox.com \
--cc=pdm-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.