mirror of
https://github.com/spaytac/orbiter.git
synced 2026-01-21 23:44:41 +00:00
Merge pull request #32 from gianarb/feature/better-api-root-path
Change API root path to `/v1/orbiter`
This commit is contained in:
commit
f680b4907d
@ -8,11 +8,20 @@ import (
|
|||||||
|
|
||||||
func GetRouter(core *core.Core, eventChannel chan *logrus.Entry) *mux.Router {
|
func GetRouter(core *core.Core, eventChannel chan *logrus.Entry) *mux.Router {
|
||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
|
|
||||||
|
r.HandleFunc("/v1/orbiter/handle/{autoscaler_name}/{service_name}", Handle(&core.Autoscalers)).Methods("POST")
|
||||||
|
r.HandleFunc("/v1/orbiter/handle/{autoscaler_name}/{service_name}/{direction}", Handle(&core.Autoscalers)).Methods("POST")
|
||||||
|
r.HandleFunc("/v1/orbiter/autoscaler", AutoscalerList(core.Autoscalers)).Methods("GET")
|
||||||
|
r.HandleFunc("/v1/orbiter/health", Health()).Methods("GET")
|
||||||
|
r.HandleFunc("/v1/orbiter/events", Events(eventChannel)).Methods("GET")
|
||||||
|
|
||||||
|
// This lines will be removed October 2017. They are here to offer a soft migation path.
|
||||||
r.HandleFunc("/handle/{autoscaler_name}/{service_name}", Handle(&core.Autoscalers)).Methods("POST")
|
r.HandleFunc("/handle/{autoscaler_name}/{service_name}", Handle(&core.Autoscalers)).Methods("POST")
|
||||||
r.HandleFunc("/handle/{autoscaler_name}/{service_name}/{direction}", Handle(&core.Autoscalers)).Methods("POST")
|
r.HandleFunc("/handle/{autoscaler_name}/{service_name}/{direction}", Handle(&core.Autoscalers)).Methods("POST")
|
||||||
r.HandleFunc("/autoscaler", AutoscalerList(core.Autoscalers)).Methods("GET")
|
r.HandleFunc("/autoscaler", AutoscalerList(core.Autoscalers)).Methods("GET")
|
||||||
r.HandleFunc("/health", Health()).Methods("GET")
|
r.HandleFunc("/health", Health()).Methods("GET")
|
||||||
r.HandleFunc("/events", Events(eventChannel)).Methods("GET")
|
r.HandleFunc("/events", Events(eventChannel)).Methods("GET")
|
||||||
|
|
||||||
r.NotFoundHandler = NotFound{}
|
r.NotFoundHandler = NotFound{}
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user