[pdm-devel] [RFC datacenter-manager 2/3] api types: add new SubscriptionStatistics
Dominik Csapak
d.csapak at proxmox.com
Mon Dec 1 13:36:15 CET 2025
AFAICS this type is only ever used internally and never returned from
the api, so IMHO there is no need to use the api macro here
(or derive (de)serialize)
On 12/1/25 12:38 PM, Fabian Grünbichler wrote:
> 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,
> +}
More information about the pdm-devel
mailing list