[pve-devel] [PATCH proxmox 07/19] notify: api: add get_targets
Fiona Ebner
f.ebner at proxmox.com
Fri Apr 19 10:34:33 CEST 2024
Am 09.04.24 um 15:25 schrieb Lukas Wagner:
> +/// Get a list of all notification targets.
> +pub fn get_targets(config: &Config) -> Result<Vec<Target>, HttpError> {
> + let mut targets = Vec::new();
> +
> + #[cfg(feature = "gotify")]
> + for endpoint in gotify::get_endpoints(config)? {
> + targets.push(Target {
> + name: endpoint.name,
> + origin: endpoint.origin.unwrap_or(Origin::UserCreated),
> + endpoint_type: EndpointType::Gotify,
> + disable: endpoint.disable,
> + comment: endpoint.comment,
> + })
Would it make sense to have into() functions for
{Gotify,Sendmail,Smtp}Config -> Target ?
More information about the pve-devel
mailing list