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 6924C1FF56B for ; Mon, 22 Apr 2024 14:39:20 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7ED98111ED; Mon, 22 Apr 2024 14:39:23 +0200 (CEST) From: Lukas Wagner To: pbs-devel@lists.proxmox.com Date: Mon, 22 Apr 2024 14:38:17 +0200 Message-Id: <20240422123841.280675-20-l.wagner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240422123841.280675-1-l.wagner@proxmox.com> References: <20240422123841.280675-1-l.wagner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.001 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 v4 19/43] 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: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" 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 Tested-by: Gabriel Goller Reviewed-by: Gabriel Goller --- 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 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel