From d99b5f6eb99fa1c52f7af05448ca0665df827d67 Mon Sep 17 00:00:00 2001 From: Lukas Wagner Date: Fri, 8 Nov 2024 15:41:18 +0100 Subject: [PATCH] api: notifications: use get_targets impl from proxmox-notify The get_targets API endpoint is now implemented in Rust. Signed-off-by: Lukas Wagner Tested-By: Stefan Hanreich --- PVE/API2/Cluster/Notifications.pm | 34 +------------------------------ 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/PVE/API2/Cluster/Notifications.pm b/PVE/API2/Cluster/Notifications.pm index 2b202c28..8c9be1ed 100644 --- a/PVE/API2/Cluster/Notifications.pm +++ b/PVE/API2/Cluster/Notifications.pm @@ -309,39 +309,7 @@ __PACKAGE__->register_method ({ my $config = PVE::Notify::read_config(); my $targets = eval { - my $result = []; - - for my $target (@{$config->get_sendmail_endpoints()}) { - push @$result, { - name => $target->{name}, - comment => $target->{comment}, - type => 'sendmail', - disable => $target->{disable}, - origin => $target->{origin}, - }; - } - - for my $target (@{$config->get_gotify_endpoints()}) { - push @$result, { - name => $target->{name}, - comment => $target->{comment}, - type => 'gotify', - disable => $target->{disable}, - origin => $target->{origin}, - }; - } - - for my $target (@{$config->get_smtp_endpoints()}) { - push @$result, { - name => $target->{name}, - comment => $target->{comment}, - type => 'smtp', - disable => $target->{disable}, - origin => $target->{origin}, - }; - } - - $result + $config->get_targets(); }; raise_api_error($@) if $@;