public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Datacenter Manager development discussion
	<pdm-devel@lists.proxmox.com>,
	Dominik Csapak <d.csapak@proxmox.com>
Subject: Re: [pdm-devel] [PATCH datacenter-manager v2 1/3] lib/server: pve: add api call to get the cached version info from remotes
Date: Tue, 2 Dec 2025 12:46:58 +0100	[thread overview]
Message-ID: <a76b57b5-ab8c-4ceb-b5bc-ab7c1b31334f@proxmox.com> (raw)
In-Reply-To: <20251202111533.2068448-4-d.csapak@proxmox.com>

Am 02.12.25 um 12:15 schrieb Dominik Csapak:
> this is useful when we e.g. want to feature gate some things in the ui.
> This way we don't have to get the whole update information for all
> remotes, and we don't have to query all nodes of the remotes for their
> versions.
> 
> Should we need it in the future, we can do the analagous api call for
> pbs too.
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  lib/pdm-client/src/lib.rs    |  6 ++++++
>  server/src/api/pve/mod.rs    | 21 +++++++++++++++++++++
>  server/src/remote_updates.rs | 22 +++++++++++++++++++++-
>  3 files changed, 48 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/pdm-client/src/lib.rs b/lib/pdm-client/src/lib.rs
> index 11bedb64..f8d6062a 100644
> --- a/lib/pdm-client/src/lib.rs
> +++ b/lib/pdm-client/src/lib.rs
> @@ -3,6 +3,7 @@
>  use std::collections::HashMap;
>  use std::time::Duration;
>  
> +use pdm_api_types::remote_updates::RemoteUpdateSummary;
>  use pdm_api_types::remotes::{RemoteType, TlsProbeOutcome};
>  use pdm_api_types::resource::{PveResource, RemoteResources, ResourceType, TopEntities};
>  use pdm_api_types::rrddata::{
> @@ -554,6 +555,11 @@ impl<T: HttpApiClient> PdmClient<T> {
>          Ok(self.0.get(&query).await?.expect_json()?.data)
>      }
>  
> +    pub async fn pve_cluster_updates(&self, remote: &str) -> Result<RemoteUpdateSummary, Error> {
> +        let url = format!("/api2/extjs/pve/remotes/{remote}/updates");

Hmm, wondering if we should expose the top-level /version API endpoint [0]
for such things, as that uses only "compiled"-in constants when returning,
so would be a bit cheaper.

I mean, this can be switched at any time, so it probably just doesn't really
matter for now..

OTOH, your approach actually might be superior, as one gets the node-specific
info for the whole remote, not just the version for the node one connects too.

[0]: https://pve.proxmox.com/pve-docs/api-viewer/index.html#/version




_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


  reply	other threads:[~2025-12-02 11:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02 11:13 [pdm-devel] [PATCH datacenter-manager/yew-comp v2 0/5] add basic version guarding for pve guests config Dominik Csapak
2025-12-02 11:13 ` [pdm-devel] [PATCH yew-comp v2 1/2] pve: qemu: options/hardware: prepare and use version feature gating Dominik Csapak
2025-12-02 12:16   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-02 11:13 ` [pdm-devel] [PATCH yew-comp v2 2/2] pve: lxc panels: prepare/add " Dominik Csapak
2025-12-02 12:17   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-02 11:13 ` [pdm-devel] [PATCH datacenter-manager v2 1/3] lib/server: pve: add api call to get the cached version info from remotes Dominik Csapak
2025-12-02 11:46   ` Thomas Lamprecht [this message]
2025-12-02 12:17   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-02 11:13 ` [pdm-devel] [PATCH datacenter-manager v2 2/3] ui: pve: qemu: load and pass the pve-manager version to panels Dominik Csapak
2025-12-02 12:17   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-02 11:13 ` [pdm-devel] [PATCH datacenter-manager v2 3/3] ui: pve: lxc: " Dominik Csapak
2025-12-02 12:17   ` [pdm-devel] applied: " 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=a76b57b5-ab8c-4ceb-b5bc-ab7c1b31334f@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=d.csapak@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal