mirror of
https://git.proxmox.com/git/proxmox
synced 2025-06-01 23:33:31 +00:00

This shifts notification routing into the matcher-system. Every notification has associated metadata (key-value fields, severity - to be extended) that can be match with match directives in notification matchers. Right now, there are 2 matching directives, match-field and match-severity. The first one allows one to do a regex match/exact match on a metadata field, the other one allows one to match one or more severites. Every matcher also allows 'target' directives, these decide which target(s) will be notified if a matcher matches a notification. Since routing now happens in matchers, the API for sending is simplified, since we do not need to specify a target any more. The API routes for filters and groups have been removed completely. The parser for the configuration file will still accept filter/group entries, but will delete them once the config is saved again. This is needed to allow a smooth transition from the old system to the new system, since the old system was already available on pvetest. Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
24 lines
519 B
Rust
24 lines
519 B
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
use proxmox_schema::api;
|
|
|
|
use crate::schema::ENTITY_NAME_SCHEMA;
|
|
|
|
pub(crate) const GROUP_TYPENAME: &str = "group";
|
|
|
|
#[api(
|
|
properties: {
|
|
name: {
|
|
schema: ENTITY_NAME_SCHEMA,
|
|
},
|
|
},
|
|
additional_properties: true,
|
|
)]
|
|
#[derive(Debug, Serialize, Deserialize, Default)]
|
|
#[serde(rename_all = "kebab-case")]
|
|
/// Config for the old target groups - can be removed at some point.
|
|
pub struct GroupConfig {
|
|
/// Name of the group
|
|
pub name: String,
|
|
}
|