From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 0266A95606 for ; Fri, 12 Apr 2024 12:07:18 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1E7067A5C for ; Fri, 12 Apr 2024 12:06:47 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 12 Apr 2024 12:06:43 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id E7FF84515C for ; Fri, 12 Apr 2024 12:06:40 +0200 (CEST) From: Lukas Wagner To: pbs-devel@lists.proxmox.com Date: Fri, 12 Apr 2024 12:06:11 +0200 Message-Id: <20240412100631.94218-14-l.wagner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240412100631.94218-1-l.wagner@proxmox.com> References: <20240412100631.94218-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.006 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 Subject: [pbs-devel] [PATCH proxmox-backup 13/33] api-types: api: tape: add notification-mode parameter X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Apr 2024 10:07:18 -0000 Same as with datastores, this option determines whether we send notifications the old way (send email via sendmail to a user's email address) or the new way (emit matchable notification events to the notification stack). Signed-off-by: Lukas Wagner --- pbs-api-types/src/jobs.rs | 8 +++++--- src/api2/config/tape_backup_job.rs | 8 ++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pbs-api-types/src/jobs.rs b/pbs-api-types/src/jobs.rs index 6fb9b187..868702bc 100644 --- a/pbs-api-types/src/jobs.rs +++ b/pbs-api-types/src/jobs.rs @@ -8,9 +8,9 @@ use serde::{Deserialize, Serialize}; use proxmox_schema::*; use crate::{ - Authid, BackupNamespace, BackupType, RateLimitConfig, Userid, BACKUP_GROUP_SCHEMA, - BACKUP_NAMESPACE_SCHEMA, BACKUP_NS_RE, DATASTORE_SCHEMA, DRIVE_NAME_SCHEMA, - MEDIA_POOL_NAME_SCHEMA, NS_MAX_DEPTH_REDUCED_SCHEMA, PROXMOX_SAFE_ID_FORMAT, + Authid, BackupNamespace, BackupType, NotificationMode, RateLimitConfig, Userid, + BACKUP_GROUP_SCHEMA, BACKUP_NAMESPACE_SCHEMA, BACKUP_NS_RE, DATASTORE_SCHEMA, + DRIVE_NAME_SCHEMA, MEDIA_POOL_NAME_SCHEMA, NS_MAX_DEPTH_REDUCED_SCHEMA, PROXMOX_SAFE_ID_FORMAT, PROXMOX_SAFE_ID_REGEX_STR, REMOTE_ID_SCHEMA, SINGLE_LINE_COMMENT_SCHEMA, }; @@ -325,6 +325,8 @@ pub struct TapeBackupJobSetup { #[serde(skip_serializing_if = "Option::is_none")] pub notify_user: Option, #[serde(skip_serializing_if = "Option::is_none")] + pub notification_mode: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub group_filter: Option>, #[serde(skip_serializing_if = "Option::is_none", default)] pub ns: Option, diff --git a/src/api2/config/tape_backup_job.rs b/src/api2/config/tape_backup_job.rs index 386ff530..e425cbb5 100644 --- a/src/api2/config/tape_backup_job.rs +++ b/src/api2/config/tape_backup_job.rs @@ -132,6 +132,8 @@ pub enum DeletableProperty { LatestOnly, /// Delete the 'notify-user' property NotifyUser, + /// Delete the 'notification-mode' property + NotificationMode, /// Delete the 'group_filter' property GroupFilter, /// Delete the 'max-depth' property @@ -202,6 +204,9 @@ pub fn update_tape_backup_job( DeletableProperty::NotifyUser => { data.setup.notify_user = None; } + DeletableProperty::NotificationMode => { + data.setup.notification_mode = None; + } DeletableProperty::Schedule => { data.schedule = None; } @@ -243,6 +248,9 @@ pub fn update_tape_backup_job( if update.setup.notify_user.is_some() { data.setup.notify_user = update.setup.notify_user; } + if update.setup.notification_mode.is_some() { + data.setup.notification_mode = update.setup.notification_mode; + } if update.setup.group_filter.is_some() { data.setup.group_filter = update.setup.group_filter; } -- 2.39.2