grafana/pkg/services/ngalert/api/ruler_history.go
Alexander Weaver 6ad1cfef38
Alerting: Add endpoint for querying state history (#62166)
* Define endpoint and generate

* Wire up and register endpoint

* Cleanup, define authorization

* Forgot the leading slash

* Wire up query and SignedInUser

* Wire up timerange query params

* Add todo for label queries

* Drop comment

* Update path to rules subtree
2023-02-02 11:34:00 -06:00

21 lines
458 B
Go

package api
import (
"github.com/grafana/grafana/pkg/api/response"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
)
type HistoryApiHandler struct {
svc *HistorySrv
}
func NewStateHistoryApi(svc *HistorySrv) *HistoryApiHandler {
return &HistoryApiHandler{
svc: svc,
}
}
func (f *HistoryApiHandler) handleRouteGetStateHistory(ctx *contextmodel.ReqContext) response.Response {
return f.svc.RouteQueryStateHistory(ctx)
}