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:
gotjosh
2021-06-15 17:14:02 +01:00
committed by GitHub
parent 283572fcbc
commit f7ed35336d
14 changed files with 606 additions and 376 deletions
@@ -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"), "")