Alerting: Use correct response body for silence post API (#57114)

This commit is contained in:
Yuriy Tseretyan
2022-10-17 15:43:37 -04:00
committed by GitHub
parent 46fb4081ba
commit 888bdfd4ad
7 changed files with 88 additions and 28 deletions
+4 -1
View File
@@ -10,6 +10,7 @@ import (
"time"
"github.com/go-openapi/strfmt"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
@@ -85,7 +86,9 @@ func (srv AlertmanagerSrv) RouteCreateSilence(c *models.ReqContext, postableSile
return ErrResp(http.StatusInternalServerError, err, "failed to create silence")
}
return response.JSON(http.StatusAccepted, util.DynMap{"message": "silence created", "id": silenceID})
return response.JSON(http.StatusAccepted, apimodels.PostSilencesOKBody{
SilenceID: silenceID,
})
}
func (srv AlertmanagerSrv) RouteDeleteAlertingConfig(c *models.ReqContext) response.Response {