[Alerting]: Implement test rule API route (#32837)

* [Alerting]: Implement test rule API route

* Apply suggestions from code review

* Call /query instead of /query_range
This commit is contained in:
Sofia Papagiannaki
2021-04-13 20:58:34 +03:00
committed by GitHub
parent 15978900a9
commit e7ff04a167
12 changed files with 293 additions and 112 deletions
@@ -23,7 +23,7 @@ type TestingApiService interface {
func (api *API) RegisterTestingApiEndpoints(srv TestingApiService) {
api.RouteRegister.Group("", func(group routing.RouteRegister) {
group.Post(toMacaronPath("/api/v1/receiver/test"), binding.Bind(apimodels.ExtendedReceiver{}), routing.Wrap(srv.RouteTestReceiverConfig))
group.Post(toMacaronPath("/api/v1/rule/test"), binding.Bind(apimodels.TestRulePayload{}), routing.Wrap(srv.RouteTestRuleConfig))
group.Post(toMacaronPath("/api/v1/receiver/test/{Recipient}"), binding.Bind(apimodels.ExtendedReceiver{}), routing.Wrap(srv.RouteTestReceiverConfig))
group.Post(toMacaronPath("/api/v1/rule/test/{Recipient}"), binding.Bind(apimodels.TestRulePayload{}), routing.Wrap(srv.RouteTestRuleConfig))
}, middleware.ReqSignedIn)
}