[pve-devel] [PATCH v3 pve-guest-common 37/66] vzdump: add config options for new notification backend

Lukas Wagner l.wagner at proxmox.com
Mon Jul 17 17:00:22 CEST 2023


- Add new option 'notification-target'
  Allows to select to which endpoint/group notifications shall be sent
- Add new option 'notification-policy'
  Replacement for the now deprecated 'mailnotification' option. Mostly
  just a rename for consistency, but also adds the 'never' option.
- Mark 'mailnotification' as deprecated in favor of 'notification-policy'
- Clarify that 'mailto' is ignored if 'notification-target' is set

Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 src/PVE/VZDump/Common.pm | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/PVE/VZDump/Common.pm b/src/PVE/VZDump/Common.pm
index a6fe483..31e9fdb 100644
--- a/src/PVE/VZDump/Common.pm
+++ b/src/PVE/VZDump/Common.pm
@@ -167,16 +167,33 @@ my $confdesc = {
 	type => 'string',
 	format => 'email-or-username-list',
 	description => "Comma-separated list of email addresses or users that should" .
-	    " receive email notifications.",
+	    " receive email notifications. Has no effect if the 'notification-target' option " .
+	    " is set at the same time.",
 	optional => 1,
     },
     mailnotification => {
 	type => 'string',
-	description => "Specify when to send an email",
+	description => "Deprecated: use 'notification-policy' instead.",
 	optional => 1,
 	enum => [ 'always', 'failure' ],
 	default => 'always',
     },
+    'notification-policy' => {
+	type => 'string',
+	description => "Specify when to send a notification",
+	optional => 1,
+	enum => [ 'always', 'failure', 'never'],
+	default => 'always',
+    },
+    'notification-target' => {
+	type => 'string',
+	format => 'pve-configid',
+	description => "Determine the target to which notifications should be sent." .
+	    " Can either be a notification endpoint or a notification group." .
+	    " This option takes precedence over 'mailto', meaning that if both are " .
+	    " set, the 'mailto' option will be ignored.",
+	optional => 1,
+    },
     tmpdir => {
 	type => 'string',
 	description => "Store temporary files to specified directory.",
-- 
2.39.2






More information about the pve-devel mailing list