tape backup jobs: add group filters to config/api

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-11-04 10:56:19 +01:00 committed by Thomas Lamprecht
parent 097ccfe1d5
commit 91357c2034
2 changed files with 10 additions and 0 deletions

View File

@ -247,6 +247,10 @@ pub struct VerificationJobStatus {
optional: true,
type: Userid,
},
groups: {
schema: GROUP_FILTER_LIST_SCHEMA,
optional: true,
},
}
)]
#[derive(Serialize,Deserialize,Clone,Updater)]
@ -265,6 +269,8 @@ pub struct TapeBackupJobSetup {
/// Send job email notification to this user
#[serde(skip_serializing_if="Option::is_none")]
pub notify_user: Option<Userid>,
#[serde(skip_serializing_if="Option::is_none")]
pub groups: Option<Vec<GroupFilter>>,
}
#[api(

View File

@ -133,6 +133,8 @@ pub enum DeletableProperty {
LatestOnly,
/// Delete the 'notify-user' property
NotifyUser,
/// Delete the 'groups' property
Groups,
}
#[api(
@ -191,6 +193,7 @@ pub fn update_tape_backup_job(
DeletableProperty::NotifyUser => { data.setup.notify_user = None; },
DeletableProperty::Schedule => { data.schedule = None; },
DeletableProperty::Comment => { data.comment = None; },
DeletableProperty::Groups => { data.setup.groups = None; },
}
}
}
@ -203,6 +206,7 @@ pub fn update_tape_backup_job(
if update.setup.export_media_set.is_some() { data.setup.export_media_set = update.setup.export_media_set; }
if update.setup.latest_only.is_some() { data.setup.latest_only = update.setup.latest_only; }
if update.setup.notify_user.is_some() { data.setup.notify_user = update.setup.notify_user; }
if update.setup.groups.is_some() { data.setup.groups = update.setup.groups; }
let schedule_changed = data.schedule != update.schedule;
if update.schedule.is_some() { data.schedule = update.schedule; }