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
co-authored by Tom Ratcliffe Matthew Jacobson
parent fb0221d561
commit 2deced7d40
41 changed files with 2809 additions and 54 deletions
@@ -31,7 +31,7 @@ func (c *defaultNotificationPolicyProvisioner) Provision(ctx context.Context,
files []*AlertingFile) error {
for _, file := range files {
for _, np := range file.Policies {
err := c.notificationPolicyService.UpdatePolicyTree(ctx, np.OrgID,
_, _, err := c.notificationPolicyService.UpdatePolicyTree(ctx, np.OrgID,
np.Policy, models.ProvenanceFile, "")
if err != nil {
return fmt.Errorf("%s: %w", file.Filename, err)