public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/5] tape backup jobs: add group filters to config/api
Date: Thu,  4 Nov 2021 10:56:19 +0100	[thread overview]
Message-ID: <20211104095622.2207427-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20211104095622.2207427-1-d.csapak@proxmox.com>

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 pbs-api-types/src/jobs.rs          | 6 ++++++
 src/api2/config/tape_backup_job.rs | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/pbs-api-types/src/jobs.rs b/pbs-api-types/src/jobs.rs
index 18c55dad..320c879e 100644
--- a/pbs-api-types/src/jobs.rs
+++ b/pbs-api-types/src/jobs.rs
@@ -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(
diff --git a/src/api2/config/tape_backup_job.rs b/src/api2/config/tape_backup_job.rs
index 6c5680d3..84dda075 100644
--- a/src/api2/config/tape_backup_job.rs
+++ b/src/api2/config/tape_backup_job.rs
@@ -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; }
-- 
2.30.2





  parent reply	other threads:[~2021-11-04  9:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04  9:56 [pbs-devel] [PATCH proxmox-backup 0/5] add group filters to tape backup (jobs) Dominik Csapak
2021-11-04  9:56 ` [pbs-devel] [PATCH proxmox-backup 1/5] proxmox-tape: add missing 'notify-user' option to backup command Dominik Csapak
2021-11-04  9:56 ` Dominik Csapak [this message]
2021-11-04  9:56 ` [pbs-devel] [PATCH proxmox-backup 3/5] fix #3533: tape backup: filter groups according to config Dominik Csapak
2021-11-04  9:56 ` [pbs-devel] [PATCH proxmox-backup 4/5] ui: tape: show configred group filters Dominik Csapak
2021-11-04  9:56 ` [pbs-devel] [PATCH proxmox-backup 5/5] proxmox-tape: add groups filter to backup command Dominik Csapak
2021-11-18 10:13 ` [pbs-devel] applied-series: [PATCH proxmox-backup 0/5] add group filters to tape backup (jobs) Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211104095622.2207427-3-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal