From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 2BC3B1FF146 for ; Tue, 12 May 2026 14:56:41 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 486C212977; Tue, 12 May 2026 14:56:40 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 12 May 2026 14:56:02 +0200 Message-Id: Subject: Re: [PATCH datacenter-manager v2 6/8] cli: add subscription key pool management subcommands From: "Lukas Wagner" To: "Thomas Lamprecht" , X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20260507082943.2749725-1-t.lamprecht@proxmox.com> <20260507082943.2749725-7-t.lamprecht@proxmox.com> In-Reply-To: <20260507082943.2749725-7-t.lamprecht@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778590450690 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.054 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [lib.rs,subscriptions.rs] Message-ID-Hash: TEAP4K4WUHSSGKQZXU3GWCGD5GDTGOWG X-Message-ID-Hash: TEAP4K4WUHSSGKQZXU3GWCGD5GDTGOWG X-MailFrom: l.wagner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu May 7, 2026 at 10:26 AM CEST, Thomas Lamprecht wrote: > Expose the new key-pool API to the CLI so that the subscriptions > command group gains the following sub commands: > > list-keys > add-keys (variadic) > assign-key > clear-key > remove-key > auto-assign > apply-pending > clear-pending > > The pre-existing `status` subcommand becomes a sibling under this > `subscriptions` group. Looks good to me in general. Maybe I've missed it, but it does not seem that I can see which keys/nodes are pending in the CLI? One further note inline. Otherwise: Reviewed-by: Lukas Wagner > > Signed-off-by: Thomas Lamprecht > --- > cli/client/src/subscriptions.rs | 195 +++++++++++++++++++++++++++++++- > lib/pdm-client/src/lib.rs | 126 ++++++++++++++++++++- > 2 files changed, 316 insertions(+), 5 deletions(-) > [...] > + > +#[api] > +/// Push all pending key assignments to remotes as a worker task. > +async fn apply_pending() -> Result<(), Error> { > + match client()?.subscription_apply_pending().await? { > + None =3D> println!("No pending assignments to apply."), > + Some(upid) =3D> println!("Task started: {upid}"), > + } > + Ok(()) > +} I guess this should at least wait for the task to finish? At least that's what we usually do, see for example `remote_migrate_qemu` in pve.rs Streaming the task logs to the CLI would be even nicer, not sure if we do this anywhere yet though. > + > +#[api] > +/// Clear every pending assignment in one bulk transaction. > +async fn clear_pending() -> Result<(), Error> { > + let cleared =3D client()?.subscription_clear_pending().await?; > + if cleared =3D=3D 0 { > + println!("No pending assignments to clear."); > + } else { > + println!("Cleared {cleared} pending assignment(s)."); > + } > + Ok(()) > +}