]> git.proxmox.com Git - proxmox-backup.git/commitdiff
api-types: api: tape: add notification-mode parameter
authorLukas Wagner <l.wagner@proxmox.com>
Tue, 23 Apr 2024 11:52:05 +0000 (13:52 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 23 Apr 2024 21:14:46 +0000 (23:14 +0200)
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 <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
pbs-api-types/src/jobs.rs
src/api2/config/tape_backup_job.rs

index 6fb9b187de57c1a7d2ad41d0562b5f153401e829..868702bc059ed3477fa695c80ff314babdc70a81 100644 (file)
@@ -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<Userid>,
     #[serde(skip_serializing_if = "Option::is_none")]
+    pub notification_mode: Option<NotificationMode>,
+    #[serde(skip_serializing_if = "Option::is_none")]
     pub group_filter: Option<Vec<GroupFilter>>,
     #[serde(skip_serializing_if = "Option::is_none", default)]
     pub ns: Option<BackupNamespace>,
index 386ff5300dadbdeda96bf80d2c096dabea9a3907..e425cbb53cee93fdc02be523ee70b04c8606fd13 100644 (file)
@@ -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;
     }