Alerting: Refactor API handlers to use web.Bind (#42600)
* Alerting: Refactor API handlers to use web.Bind * lint
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/grafana/grafana/pkg/api/response"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
|
||||
)
|
||||
|
||||
// ForkedTestingApi always forwards requests to grafana backend
|
||||
type ForkedTestingApi struct {
|
||||
grafana TestingApiService
|
||||
}
|
||||
|
||||
// NewForkedTestingApi creates a new ForkedTestingApi instance
|
||||
func NewForkedTestingApi(grafana TestingApiService) *ForkedTestingApi {
|
||||
return &ForkedTestingApi{
|
||||
grafana: grafana,
|
||||
}
|
||||
}
|
||||
|
||||
func (f *ForkedTestingApi) forkRouteTestRuleConfig(c *models.ReqContext, body apimodels.TestRulePayload) response.Response {
|
||||
return f.grafana.RouteTestRuleConfig(c, body)
|
||||
}
|
||||
|
||||
func (f *ForkedTestingApi) forkRouteEvalQueries(c *models.ReqContext, body apimodels.EvalQueriesPayload) response.Response {
|
||||
return f.grafana.RouteEvalQueries(c, body)
|
||||
}
|
||||
Reference in New Issue
Block a user