Merge pull request #1362 from mxinden/deprecate-v0-alerts
api: Deprecate `api/alerts` endpoint
This commit is contained in:
commit
05fb09aebd
|
@ -133,16 +133,10 @@ func (api *API) Register(r *route.Router) {
|
||||||
|
|
||||||
r.Options("/*path", wrap(func(w http.ResponseWriter, r *http.Request) {}))
|
r.Options("/*path", wrap(func(w http.ResponseWriter, r *http.Request) {}))
|
||||||
|
|
||||||
// Register legacy forwarder for alert pushing.
|
|
||||||
r.Post("/alerts", wrap(api.legacyAddAlerts))
|
|
||||||
|
|
||||||
// Register actual API.
|
|
||||||
r = r.WithPrefix("/v1")
|
|
||||||
|
|
||||||
r.Get("/status", wrap(api.status))
|
r.Get("/status", wrap(api.status))
|
||||||
r.Get("/receivers", wrap(api.receivers))
|
r.Get("/receivers", wrap(api.receivers))
|
||||||
r.Get("/alerts/groups", wrap(api.alertGroups))
|
|
||||||
|
|
||||||
|
r.Get("/alerts/groups", wrap(api.alertGroups))
|
||||||
r.Get("/alerts", wrap(api.listAlerts))
|
r.Get("/alerts", wrap(api.listAlerts))
|
||||||
r.Post("/alerts", wrap(api.addAlerts))
|
r.Post("/alerts", wrap(api.addAlerts))
|
||||||
|
|
||||||
|
|
|
@ -370,7 +370,7 @@ func main() {
|
||||||
|
|
||||||
ui.Register(router, webReload, logger)
|
ui.Register(router, webReload, logger)
|
||||||
|
|
||||||
apiv.Register(router.WithPrefix("/api"))
|
apiv.Register(router.WithPrefix("/api/v1"))
|
||||||
|
|
||||||
level.Info(logger).Log("msg", "Listening", "address", *listenAddress)
|
level.Info(logger).Log("msg", "Listening", "address", *listenAddress)
|
||||||
go listen(*listenAddress, router, logger)
|
go listen(*listenAddress, router, logger)
|
||||||
|
|
Loading…
Reference in New Issue