[pdm-devel] [RFC datacenter-manager 2/3] api types: add new SubscriptionStatistics
Fabian Grünbichler
f.gruenbichler at proxmox.com
Mon Dec 1 12:39:07 CET 2025
this is a different view for the global subscription status - instead of
looking at the lowest level per remote, count all nodes.
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
this clashes with dominik's patches which return these counts in the
remote subscription endpoints.. since we only need them for the global
PDM-level status decision I think this is cleaner, but this could of
course also be re-based on top of the other patches..
lib/pdm-api-types/src/subscription.rs | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/lib/pdm-api-types/src/subscription.rs b/lib/pdm-api-types/src/subscription.rs
index 64167cb..d38611e 100644
--- a/lib/pdm-api-types/src/subscription.rs
+++ b/lib/pdm-api-types/src/subscription.rs
@@ -143,3 +143,16 @@ pub struct RemoteSubscriptions {
pub state: RemoteSubscriptionState,
}
+
+#[api]
+#[derive(Default, Serialize, Deserialize, Clone, PartialEq)]
+#[serde(rename_all = "kebab-case")]
+/// Lists the subscription level per node for the remote
+pub struct SubscriptionStatistics {
+ /// Total number of nodes across all remotes
+ pub total_nodes: usize,
+ /// Total number of active subscriptions across all remotes
+ pub active_subscriptions: usize,
+ /// Total number of community level subscriptions across all remotes
+ pub community: usize,
+}
--
2.47.3
More information about the pdm-devel
mailing list