Chore: Move ReqContext to contexthandler service (#62102)
* Chore: Move ReqContext to contexthandler service * Rename package to contextmodel * Generate ngalert files * Remove unused imports
This commit is contained in:
@@ -12,33 +12,33 @@ import (
|
||||
"github.com/grafana/grafana/pkg/api/response"
|
||||
"github.com/grafana/grafana/pkg/api/routing"
|
||||
"github.com/grafana/grafana/pkg/middleware"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
|
||||
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/metrics"
|
||||
"github.com/grafana/grafana/pkg/web"
|
||||
)
|
||||
|
||||
type ConfigurationApi interface {
|
||||
RouteDeleteNGalertConfig(*models.ReqContext) response.Response
|
||||
RouteGetAlertmanagers(*models.ReqContext) response.Response
|
||||
RouteGetNGalertConfig(*models.ReqContext) response.Response
|
||||
RouteGetStatus(*models.ReqContext) response.Response
|
||||
RoutePostNGalertConfig(*models.ReqContext) response.Response
|
||||
RouteDeleteNGalertConfig(*contextmodel.ReqContext) response.Response
|
||||
RouteGetAlertmanagers(*contextmodel.ReqContext) response.Response
|
||||
RouteGetNGalertConfig(*contextmodel.ReqContext) response.Response
|
||||
RouteGetStatus(*contextmodel.ReqContext) response.Response
|
||||
RoutePostNGalertConfig(*contextmodel.ReqContext) response.Response
|
||||
}
|
||||
|
||||
func (f *ConfigurationApiHandler) RouteDeleteNGalertConfig(ctx *models.ReqContext) response.Response {
|
||||
func (f *ConfigurationApiHandler) RouteDeleteNGalertConfig(ctx *contextmodel.ReqContext) response.Response {
|
||||
return f.handleRouteDeleteNGalertConfig(ctx)
|
||||
}
|
||||
func (f *ConfigurationApiHandler) RouteGetAlertmanagers(ctx *models.ReqContext) response.Response {
|
||||
func (f *ConfigurationApiHandler) RouteGetAlertmanagers(ctx *contextmodel.ReqContext) response.Response {
|
||||
return f.handleRouteGetAlertmanagers(ctx)
|
||||
}
|
||||
func (f *ConfigurationApiHandler) RouteGetNGalertConfig(ctx *models.ReqContext) response.Response {
|
||||
func (f *ConfigurationApiHandler) RouteGetNGalertConfig(ctx *contextmodel.ReqContext) response.Response {
|
||||
return f.handleRouteGetNGalertConfig(ctx)
|
||||
}
|
||||
func (f *ConfigurationApiHandler) RouteGetStatus(ctx *models.ReqContext) response.Response {
|
||||
func (f *ConfigurationApiHandler) RouteGetStatus(ctx *contextmodel.ReqContext) response.Response {
|
||||
return f.handleRouteGetStatus(ctx)
|
||||
}
|
||||
func (f *ConfigurationApiHandler) RoutePostNGalertConfig(ctx *models.ReqContext) response.Response {
|
||||
func (f *ConfigurationApiHandler) RoutePostNGalertConfig(ctx *contextmodel.ReqContext) response.Response {
|
||||
// Parse Request Body
|
||||
conf := apimodels.PostableNGalertConfig{}
|
||||
if err := web.Bind(ctx.Req, &conf); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user