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>
This commit is contained in:
Yuri Tseretyan
2024-10-24 13:53:03 -04:00
committed by GitHub
parent fb0221d561
commit 2deced7d40
41 changed files with 2809 additions and 54 deletions

View File

@ -24,10 +24,20 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &alertingnotificationsv0alpha1.IntegrationApplyConfiguration{}
case v0alpha1.SchemeGroupVersion.WithKind("Interval"):
return &alertingnotificationsv0alpha1.IntervalApplyConfiguration{}
case v0alpha1.SchemeGroupVersion.WithKind("Matcher"):
return &alertingnotificationsv0alpha1.MatcherApplyConfiguration{}
case v0alpha1.SchemeGroupVersion.WithKind("Receiver"):
return &alertingnotificationsv0alpha1.ReceiverApplyConfiguration{}
case v0alpha1.SchemeGroupVersion.WithKind("ReceiverSpec"):
return &alertingnotificationsv0alpha1.ReceiverSpecApplyConfiguration{}
case v0alpha1.SchemeGroupVersion.WithKind("Route"):
return &alertingnotificationsv0alpha1.RouteApplyConfiguration{}
case v0alpha1.SchemeGroupVersion.WithKind("RouteDefaults"):
return &alertingnotificationsv0alpha1.RouteDefaultsApplyConfiguration{}
case v0alpha1.SchemeGroupVersion.WithKind("RoutingTree"):
return &alertingnotificationsv0alpha1.RoutingTreeApplyConfiguration{}
case v0alpha1.SchemeGroupVersion.WithKind("RoutingTreeSpec"):
return &alertingnotificationsv0alpha1.RoutingTreeSpecApplyConfiguration{}
case v0alpha1.SchemeGroupVersion.WithKind("TemplateGroup"):
return &alertingnotificationsv0alpha1.TemplateGroupApplyConfiguration{}
case v0alpha1.SchemeGroupVersion.WithKind("TemplateGroupSpec"):