mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-14 13:08:58 +00:00
api-types: api: tape: add notification-mode parameter
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>
This commit is contained in:
parent
7b668dbc2b
commit
89ef8b5035
@ -8,9 +8,9 @@ use serde::{Deserialize, Serialize};
|
|||||||
use proxmox_schema::*;
|
use proxmox_schema::*;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
Authid, BackupNamespace, BackupType, RateLimitConfig, Userid, BACKUP_GROUP_SCHEMA,
|
Authid, BackupNamespace, BackupType, NotificationMode, RateLimitConfig, Userid,
|
||||||
BACKUP_NAMESPACE_SCHEMA, BACKUP_NS_RE, DATASTORE_SCHEMA, DRIVE_NAME_SCHEMA,
|
BACKUP_GROUP_SCHEMA, BACKUP_NAMESPACE_SCHEMA, BACKUP_NS_RE, DATASTORE_SCHEMA,
|
||||||
MEDIA_POOL_NAME_SCHEMA, NS_MAX_DEPTH_REDUCED_SCHEMA, PROXMOX_SAFE_ID_FORMAT,
|
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,
|
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")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub notify_user: Option<Userid>,
|
pub notify_user: Option<Userid>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[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>>,
|
pub group_filter: Option<Vec<GroupFilter>>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none", default)]
|
#[serde(skip_serializing_if = "Option::is_none", default)]
|
||||||
pub ns: Option<BackupNamespace>,
|
pub ns: Option<BackupNamespace>,
|
||||||
|
@ -132,6 +132,8 @@ pub enum DeletableProperty {
|
|||||||
LatestOnly,
|
LatestOnly,
|
||||||
/// Delete the 'notify-user' property
|
/// Delete the 'notify-user' property
|
||||||
NotifyUser,
|
NotifyUser,
|
||||||
|
/// Delete the 'notification-mode' property
|
||||||
|
NotificationMode,
|
||||||
/// Delete the 'group_filter' property
|
/// Delete the 'group_filter' property
|
||||||
GroupFilter,
|
GroupFilter,
|
||||||
/// Delete the 'max-depth' property
|
/// Delete the 'max-depth' property
|
||||||
@ -202,6 +204,9 @@ pub fn update_tape_backup_job(
|
|||||||
DeletableProperty::NotifyUser => {
|
DeletableProperty::NotifyUser => {
|
||||||
data.setup.notify_user = None;
|
data.setup.notify_user = None;
|
||||||
}
|
}
|
||||||
|
DeletableProperty::NotificationMode => {
|
||||||
|
data.setup.notification_mode = None;
|
||||||
|
}
|
||||||
DeletableProperty::Schedule => {
|
DeletableProperty::Schedule => {
|
||||||
data.schedule = None;
|
data.schedule = None;
|
||||||
}
|
}
|
||||||
@ -243,6 +248,9 @@ pub fn update_tape_backup_job(
|
|||||||
if update.setup.notify_user.is_some() {
|
if update.setup.notify_user.is_some() {
|
||||||
data.setup.notify_user = update.setup.notify_user;
|
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() {
|
if update.setup.group_filter.is_some() {
|
||||||
data.setup.group_filter = update.setup.group_filter;
|
data.setup.group_filter = update.setup.group_filter;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user