Alerting: Implement /status for the notification system (#33227)
* Alerting: Implement /status for the notification system Implements the necessary plumbing to have a /status endpoint on the notification system. * Add API examples * Update API specs * Update prometheus/common dependency Co-authored-by: Sofia Papagiannaki <sofia@grafana.com>
This commit is contained in:
@@ -21,6 +21,10 @@ type AlertmanagerSrv struct {
|
||||
log log.Logger
|
||||
}
|
||||
|
||||
func (srv AlertmanagerSrv) RouteGetAMStatus(c *models.ReqContext) response.Response {
|
||||
return response.JSON(http.StatusOK, srv.am.GetStatus())
|
||||
}
|
||||
|
||||
func (srv AlertmanagerSrv) RouteCreateSilence(c *models.ReqContext, postableSilence apimodels.PostableSilence) response.Response {
|
||||
if !c.HasUserRole(models.ROLE_EDITOR) {
|
||||
return ErrResp(http.StatusForbidden, errors.New("permission denied"), "")
|
||||
|
||||
Reference in New Issue
Block a user