From 21886bb2acf99436d3c1159af345079d980d3a6a Mon Sep 17 00:00:00 2001 From: Lukas Wagner Date: Fri, 8 Nov 2024 15:41:15 +0100 Subject: [PATCH] common: notify: add bindings for get_targets This allows us to drop the impl of that function on the perl side. Signed-off-by: Lukas Wagner Tested-By: Stefan Hanreich --- common/src/notify.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/src/notify.rs b/common/src/notify.rs index fe192d5..0f8a35d 100644 --- a/common/src/notify.rs +++ b/common/src/notify.rs @@ -27,6 +27,7 @@ mod export { MatcherConfigUpdater, SeverityMatcher, }; use proxmox_notify::{api, Config, Notification, Severity}; + use proxmox_notify::api::Target; pub struct NotificationConfig { config: Mutex, @@ -112,6 +113,14 @@ mod export { api::common::send(&config, ¬ification) } + #[export(serialize_error)] + fn get_targets( + #[try_from_ref] this: &NotificationConfig, + ) -> Result, HttpError> { + let config = this.config.lock().unwrap(); + api::get_targets(&config) + } + #[export(serialize_error)] fn test_target( #[try_from_ref] this: &NotificationConfig,