]> git.proxmox.com Git - proxmox-backup.git/blame - src/api2/config/notifications/mod.rs
api: add endpoints for smtp targets
[proxmox-backup.git] / src / api2 / config / notifications / mod.rs
CommitLineData
c37f9dff
LW
1use proxmox_router::list_subdirs_api_method;
2use proxmox_router::{Router, SubdirMap};
3use proxmox_sortable_macro::sortable;
4
bc5b8588 5mod matchers;
fa797df0 6mod sendmail;
c3faee2f 7mod smtp;
c37f9dff
LW
8mod targets;
9
10#[sortable]
bc5b8588 11const SUBDIRS: SubdirMap = &sorted!([
fa797df0 12 ("endpoints", &ENDPOINT_ROUTER),
bc5b8588
LW
13 ("targets", &targets::ROUTER),
14 ("matchers", &matchers::ROUTER),
15]);
c37f9dff
LW
16
17pub const ROUTER: Router = Router::new()
18 .get(&list_subdirs_api_method!(SUBDIRS))
19 .subdirs(SUBDIRS);
fa797df0
LW
20
21#[sortable]
c3faee2f
LW
22const ENDPOINT_SUBDIRS: SubdirMap =
23 &sorted!([("sendmail", &sendmail::ROUTER), ("smtp", &smtp::ROUTER),]);
fa797df0
LW
24
25const ENDPOINT_ROUTER: Router = Router::new()
26 .get(&list_subdirs_api_method!(ENDPOINT_SUBDIRS))
27 .subdirs(ENDPOINT_SUBDIRS);