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 9A2971FF197 for ; Wed, 03 Jun 2026 20:05:07 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 68A34156ED; Wed, 3 Jun 2026 20:05:07 +0200 (CEST) From: Stoiko Ivanov To: pmg-devel@lists.proxmox.com Subject: [PATCH pmg-api 07/15] pmgbackup: add encypted and verification state to output Date: Wed, 3 Jun 2026 20:03:09 +0200 Message-ID: <20260603180445.98770-8-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260603180445.98770-1-s.ivanov@proxmox.com> References: <20260603180445.98770-1-s.ivanov@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1780509859692 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.087 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: SYR2QNA43UBPUKNNKADOPVGCK3DBIYZ4 X-Message-ID-Hash: SYR2QNA43UBPUKNNKADOPVGCK3DBIYZ4 X-MailFrom: s.ivanov@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 Mail Gateway development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: print only the state of the verification result, and yes/no for encryption instead of the fingerprint. the rework of the output sub is inspired by pve-ha-manager/src/PVE/CLI/ha_manager.pm Signed-off-by: Stoiko Ivanov --- src/PMG/CLI/pmgbackup.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PMG/CLI/pmgbackup.pm b/src/PMG/CLI/pmgbackup.pm index 11dd5672..9ef0c3c7 100644 --- a/src/PMG/CLI/pmgbackup.pm +++ b/src/PMG/CLI/pmgbackup.pm @@ -114,8 +114,15 @@ our $cmddef = { { node => $nodename }, sub { my ($data, $schema, $options) = @_; + my $props_to_print = + ['backup-id', 'backup-time', 'size', 'encrypted', 'verify-state']; + for my $snapshot (@$data) { + $snapshot->{encrypted} = $snapshot->{encrypted} ? "yes" : "no"; + $snapshot->{'verify-state'} = $snapshot->{verification}->{state}; + } + PVE::CLIFormatter::print_api_result( - $data, $schema, ['backup-id', 'backup-time', 'size'], $options, + $data, $schema, $props_to_print, $options, ); }, $PVE::RESTHandler::standard_output_options, -- 2.47.3