grafana/apps/alerting/notifications/routingtree.cue
Yuri Tseretyan 2deced7d40
Alerting: Notifications Routes API (#91550)
* Introduce new models RoutingTree, RouteDefaults and Route and api-server to serve them that is backed by provisioning notification policy service.

* update method UpdatePolicyTree of notification policy service to return route and new version

* declare new actions alert.notifications.routes:read and alert.notifications.routes:write and two corresponding fixed roles.

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
2024-10-24 13:53:03 -04:00

49 lines
924 B
CUE

package core
route: {
kind: "RoutingTree"
group: "notifications"
apiResource: {
groupOverride: "notifications.alerting.grafana.app"
}
codegen: {
frontend: false
backend: true
}
pluralName: "RoutingTrees"
current: "v0alpha1"
versions: {
"v0alpha1": {
schema: {
#RouteDefaults: {
receiver: string
group_by?: [...string]
group_wait?: string
group_interval?: string
repeat_interval?: string
}
#Matcher: {
type: "=" |"!="|"=~"|"!~" @cuetsy(kind="enum")
label: string
value: string
}
#Route: {
receiver?: string
matchers?: [...#Matcher]
continue: bool
group_by?: [...string]
mute_time_intervals?: [...string]
routes?: [...#Route]
group_wait?: string
group_interval?: string
repeat_interval?: string
}
spec: {
defaults: #RouteDefaults
routes: [...#Route]
}
}
}
}
}