Alerting: Split grafana and lotex routes (#44742)

* split Lotex and Grafana routes
* update template to use authorize function for every route
This commit is contained in:
Yuriy Tseretyan
2022-02-04 12:42:04 -05:00
committed by GitHub
parent 126ed461b1
commit ddfe2dce74
21 changed files with 2257 additions and 214 deletions
@@ -7,14 +7,28 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/services/ngalert/models"
"github.com/prometheus/alertmanager/config"
"github.com/prometheus/prometheus/promql"
"github.com/grafana/grafana/pkg/services/ngalert/models"
)
// swagger:route Post /api/v1/rule/test/grafana testing RouteTestRuleGrafanaConfig
//
// Test a rule against Grafana ruler
//
// Consumes:
// - application/json
//
// Produces:
// - application/json
//
// Responses:
// 200: TestRuleResponse
// swagger:route Post /api/v1/rule/test/{Recipient} testing RouteTestRuleConfig
//
// Test rule
// Test a rule against external data source ruler
//
// Consumes:
// - application/json
@@ -44,7 +58,7 @@ type TestReceiverRequest struct {
Body ExtendedReceiver
}
// swagger:parameters RouteTestRuleConfig
// swagger:parameters RouteTestRuleConfig RouteTestRuleGrafanaConfig
type TestRuleRequest struct {
// in:body
Body TestRulePayload