mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 18:30:41 -06:00
2ab7d3c725
* Add single receiver method * Add receiver permissions * Add single/multi GET endpoints for receivers * Remove stable tag from time intervals See end of PR description here: https://github.com/grafana/grafana/pull/81672
33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package api
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/api/response"
|
|
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
|
|
)
|
|
|
|
type NotificationsApiHandler struct {
|
|
notificationSrv *NotificationSrv
|
|
}
|
|
|
|
func NewNotificationsApi(notificationSrv *NotificationSrv) *NotificationsApiHandler {
|
|
return &NotificationsApiHandler{
|
|
notificationSrv: notificationSrv,
|
|
}
|
|
}
|
|
|
|
func (f *NotificationsApiHandler) handleRouteNotificationsGetTimeInterval(ctx *contextmodel.ReqContext, name string) response.Response {
|
|
return f.notificationSrv.RouteGetTimeInterval(ctx, name)
|
|
}
|
|
|
|
func (f *NotificationsApiHandler) handleRouteNotificationsGetTimeIntervals(ctx *contextmodel.ReqContext) response.Response {
|
|
return f.notificationSrv.RouteGetTimeIntervals(ctx)
|
|
}
|
|
|
|
func (f *NotificationsApiHandler) handleRouteGetReceiver(ctx *contextmodel.ReqContext, name string) response.Response {
|
|
return f.notificationSrv.RouteGetReceiver(ctx, name)
|
|
}
|
|
|
|
func (f *NotificationsApiHandler) handleRouteGetReceivers(ctx *contextmodel.ReqContext) response.Response {
|
|
return f.notificationSrv.RouteGetReceivers(ctx)
|
|
}
|