public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: POYEN Alexis <alexis.poyen@groupe-cyllene.com>
To: pve-devel@lists.proxmox.com
Cc: POYEN Alexis <alexis.poyen@groupe-cyllene.com>
Subject: [RFC PATCH manager 2/3] close #4186: api: backup: support tag based guest selection in jobs
Date: Thu,  3 Dec 2026 10:27:09 +0100	[thread overview]
Message-ID: <20261203092717.1863218-4-alexis.poyen@groupe-cyllene.com> (raw)
In-Reply-To: <20261203092717.1863218-1-alexis.poyen@groupe-cyllene.com>

Allow creating and updating vzdump backup jobs with the new 'tags'
option. Keep the selection options mutually exclusive: setting 'vmid',
'all' or 'pool' removes 'tags' and vice versa.

When switching a job to the 'tags' mode, the previously configured
selection (e.g. a pool) is dropped, so the new mode takes effect.

Signed-off-by: POYEN Alexis <alexis.poyen@groupe-cyllene.com>
---
 PVE/API2/Backup.pm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/PVE/API2/Backup.pm b/PVE/API2/Backup.pm
index 7e1173bf..1b3208c9 100644
--- a/PVE/API2/Backup.pm
+++ b/PVE/API2/Backup.pm
@@ -622,13 +622,21 @@ __PACKAGE__->register_method({
                 delete $job->{all};
                 delete $job->{exclude};
                 delete $job->{pool};
+                delete $job->{tags};
             } elsif ($param->{all}) {
                 delete $job->{vmid};
                 delete $job->{pool};
+                delete $job->{tags};
+            } elsif ($param->{tags}) {
+                delete $job->{vmid};
+                delete $job->{all};
+                delete $job->{exclude};
+                delete $job->{pool};
             } elsif ($job->{pool}) {
                 delete $job->{vmid};
                 delete $job->{all};
                 delete $job->{exclude};
+                delete $job->{tags};
             }
 
             PVE::VZDump::verify_vzdump_parameters($job, 1);
-- 
2.53.0




  parent reply	other threads:[~2026-12-03  9:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  9:27 [RFC PATCH guest-common/manager 0/4] vzdump: support tag based guest selection in backup jobs POYEN Alexis
2026-12-03  9:27 ` [RFC PATCH guest-common 1/1] close #4186: vzdump: add 'tags' option to select guests by tag POYEN Alexis
2026-12-03  9:27 ` [RFC PATCH manager 1/3] close #4186: vzdump: " POYEN Alexis
2026-12-03  9:27 ` POYEN Alexis [this message]
2026-12-03  9:27 ` [RFC PATCH manager 3/3] close #4186: ui: backup: add tag based selection mode POYEN Alexis

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=20261203092717.1863218-4-alexis.poyen@groupe-cyllene.com \
    --to=alexis.poyen@groupe-cyllene.com \
    --cc=pve-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