From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id B095A1FF0E0 for ; Thu, 09 Jul 2026 14:02:19 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id AD83521965; Thu, 09 Jul 2026 13:58:30 +0200 (CEST) From: Lukas Wagner To: pbs-devel@lists.proxmox.com, pve-devel@lists.proxmox.com Subject: [PATCH manager 27/29] api: notification: get_matcher: add 'migrate-to-expression' parameter Date: Thu, 9 Jul 2026 13:57:14 +0200 Message-ID: <20260709115716.299836-28-l.wagner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260709115716.299836-1-l.wagner@proxmox.com> References: <20260709115716.299836-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1783598240915 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.000 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) 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: W6NK3CWLQWUJKBODVX2IJXOURXIWZPDS X-Message-ID-Hash: W6NK3CWLQWUJKBODVX2IJXOURXIWZPDS 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 VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: If set, any existing matchers will be transformed so that any 'match-*', 'invert-match' or 'mode' parameter is translated into an equivalent 'expression'. Signed-off-by: Lukas Wagner --- PVE/API2/Cluster/Notifications.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Cluster/Notifications.pm b/PVE/API2/Cluster/Notifications.pm index 3f99de08..80884af1 100644 --- a/PVE/API2/Cluster/Notifications.pm +++ b/PVE/API2/Cluster/Notifications.pm @@ -1603,6 +1603,14 @@ __PACKAGE__->register_method({ type => 'string', format => 'pve-configid', }, + 'migrate-to-expression' => { + type => 'boolean', + default => 0, + description => + "Automatically translate existing 'match-*', 'invert-match' and 'mode' to" + . " an equivalent matching 'expression'.", + optional => 1, + }, }, }, returns => { @@ -1614,10 +1622,11 @@ __PACKAGE__->register_method({ code => sub { my ($param) = @_; my $name = extract_param($param, 'name'); + my $migrate_to_expression = extract_param($param, 'migrate-to-expression') // 0; my $config = PVE::Notify::read_config(); - my $matcher = eval { $config->get_matcher($name) }; + my $matcher = eval { $config->get_matcher($name, $migrate_to_expression) }; raise_api_error($@) if $@; $matcher->{digest} = $config->digest(); -- 2.47.3