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 C8FDD1FF141 for ; Mon, 13 Apr 2026 15:38:05 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id EBDE9274AA; Mon, 13 Apr 2026 15:38:53 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 13 Apr 2026 15:38:51 +0200 Message-Id: Subject: Re: [PATCH proxmox-backup 5/7] manager: add instance-id subcommand From: "Lukas Wagner" To: "Shannon Sterz" , "Lukas Wagner" , , X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20260413121057.371772-1-l.wagner@proxmox.com> <20260413121057.371772-6-l.wagner@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1776087457429 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.055 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 Message-ID-Hash: LDV7VAPRK3MIECG6ANIUK4NISIFC6NQ4 X-Message-ID-Hash: LDV7VAPRK3MIECG6ANIUK4NISIFC6NQ4 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 Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon Apr 13, 2026 at 3:26 PM CEST, Shannon Sterz wrote: > On Mon Apr 13, 2026 at 2:10 PM CEST, Lukas Wagner wrote: >> For the sake of completeness also allow to query the instance ID from >> the proxmox-backup-manager admin tool. >> >> Signed-off-by: Lukas Wagner >> --- >> src/bin/proxmox_backup_manager/node.rs | 27 ++++++++++++++++++++++++++ >> 1 file changed, 27 insertions(+) >> >> diff --git a/src/bin/proxmox_backup_manager/node.rs b/src/bin/proxmox_ba= ckup_manager/node.rs >> index 4da61690f..34c481587 100644 >> --- a/src/bin/proxmox_backup_manager/node.rs >> +++ b/src/bin/proxmox_backup_manager/node.rs >> @@ -32,9 +32,36 @@ fn get_node_config(param: Value, rpcenv: &mut dyn Rpc= Environment) -> Result> Ok(Value::Null) >> } >> >> +#[api( >> + input: { >> + properties: { >> + "output-format": { >> + schema: OUTPUT_FORMAT, >> + optional: true, >> + }, >> + } >> + } >> +)] >> +/// Show node configuration > > nit: this description should probably also be something like "Get the > instance ID of the current PBS instance." or similar. > Ack! sorry for the copy-paste mistake, I somewhat rushed this so that we can potentially get this in for the PBS release >> +fn get_instance_id(param: Value, rpcenv: &mut dyn RpcEnvironment) -> Re= sult { >> + let output_format =3D get_output_format(¶m); >> + >> + let info =3D &api2::node::API_METHOD_GET_INSTANCE_ID; >> + let mut data =3D match info.handler { >> + ApiHandler::Sync(handler) =3D> (handler)(param, info, rpcenv)?, >> + _ =3D> unreachable!(), >> + }; >> + >> + let options =3D default_table_format_options(); >> + format_and_print_result_full(&mut data, &info.returns, &output_form= at, &options); >> + >> + Ok(Value::Null) >> +} >> + >> pub fn node_commands() -> CommandLineInterface { >> let cmd_def =3D CliCommandMap::new() >> .insert("show", CliCommand::new(&API_METHOD_GET_NODE_CONFIG)) >> + .insert("instance-id", CliCommand::new(&API_METHOD_GET_INSTANCE= _ID)) >> .insert( >> "update", >> CliCommand::new(&api2::node::config::API_METHOD_UPDATE_NODE= _CONFIG)