From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id D3E761FF142 for ; Mon, 16 Feb 2026 13:13:43 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9A4CF1088B; Mon, 16 Feb 2026 13:14:32 +0100 (CET) From: Christian Ebner To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup v2 05/12] bin: s3: expose request counter reset method as cli command Date: Mon, 16 Feb 2026 13:13:59 +0100 Message-ID: <20260216121406.99617-12-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260216121406.99617-1-c.ebner@proxmox.com> References: <20260216121406.99617-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1771244054901 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.048 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: IX5K2I37RZJISOHQ3ZCBBA6D67SY3B7W X-Message-ID-Hash: IX5K2I37RZJISOHQ3ZCBBA6D67SY3B7W X-MailFrom: c.ebner@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: Allows to reset the s3 request counters from the cli by calling the corresponding api method. Place it as a subcommand to `s3 endpoint` since the endpoint as this should only be allowed for existing endpoints. Signed-off-by: Christian Ebner --- changes since version 1: - no changes src/bin/proxmox_backup_manager/s3.rs | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/bin/proxmox_backup_manager/s3.rs b/src/bin/proxmox_backup_manager/s3.rs index a94371e09..64154466f 100644 --- a/src/bin/proxmox_backup_manager/s3.rs +++ b/src/bin/proxmox_backup_manager/s3.rs @@ -86,6 +86,33 @@ fn list_s3_clients(param: Value, rpcenv: &mut dyn RpcEnvironment) -> Result, + rpcenv: &mut dyn RpcEnvironment, +) -> Result<(), Error> { + api2::admin::s3::reset_counters(s3_endpoint_id, bucket, store_prefix, rpcenv).await +} + pub fn s3_commands() -> CommandLineInterface { let endpoint_cmd_def = CliCommandMap::new() .insert("list", CliCommand::new(&API_METHOD_LIST_S3_CLIENTS)) @@ -111,6 +138,12 @@ pub fn s3_commands() -> CommandLineInterface { CliCommand::new(&API_METHOD_LIST_BUCKETS) .arg_param(&["s3-endpoint-id"]) .completion_cb("s3-endpoint-id", pbs_config::s3::complete_s3_client_id), + ) + .insert( + "reset-counters", + CliCommand::new(&API_METHOD_RESET_COUNTERS) + .arg_param(&["s3-endpoint-id", "bucket"]) + .completion_cb("s3-endpoint-id", pbs_config::s3::complete_s3_client_id), ); let cmd_def = CliCommandMap::new() -- 2.47.3