Alerting: Add provisioning endpoint to fetch all rules (#59989)
* Domain layer api for fetching all rules * Add endpoint for getting all rules
This commit is contained in:
@@ -25,6 +25,7 @@ type ProvisioningApi interface {
|
||||
RouteDeleteTemplate(*models.ReqContext) response.Response
|
||||
RouteGetAlertRule(*models.ReqContext) response.Response
|
||||
RouteGetAlertRuleGroup(*models.ReqContext) response.Response
|
||||
RouteGetAlertRules(*models.ReqContext) response.Response
|
||||
RouteGetContactpoints(*models.ReqContext) response.Response
|
||||
RouteGetMuteTiming(*models.ReqContext) response.Response
|
||||
RouteGetMuteTimings(*models.ReqContext) response.Response
|
||||
@@ -74,6 +75,9 @@ func (f *ProvisioningApiHandler) RouteGetAlertRuleGroup(ctx *models.ReqContext)
|
||||
groupParam := web.Params(ctx.Req)[":Group"]
|
||||
return f.handleRouteGetAlertRuleGroup(ctx, folderUIDParam, groupParam)
|
||||
}
|
||||
func (f *ProvisioningApiHandler) RouteGetAlertRules(ctx *models.ReqContext) response.Response {
|
||||
return f.handleRouteGetAlertRules(ctx)
|
||||
}
|
||||
func (f *ProvisioningApiHandler) RouteGetContactpoints(ctx *models.ReqContext) response.Response {
|
||||
return f.handleRouteGetContactpoints(ctx)
|
||||
}
|
||||
@@ -245,6 +249,16 @@ func (api *API) RegisterProvisioningApiEndpoints(srv ProvisioningApi, m *metrics
|
||||
m,
|
||||
),
|
||||
)
|
||||
group.Get(
|
||||
toMacaronPath("/api/v1/provisioning/alert-rules"),
|
||||
api.authorize(http.MethodGet, "/api/v1/provisioning/alert-rules"),
|
||||
metrics.Instrument(
|
||||
http.MethodGet,
|
||||
"/api/v1/provisioning/alert-rules",
|
||||
srv.RouteGetAlertRules,
|
||||
m,
|
||||
),
|
||||
)
|
||||
group.Get(
|
||||
toMacaronPath("/api/v1/provisioning/contact-points"),
|
||||
api.authorize(http.MethodGet, "/api/v1/provisioning/contact-points"),
|
||||
|
||||
Reference in New Issue
Block a user