mirror of
https://github.com/spaytac/orbiter.git
synced 2026-01-21 21:54:50 +00:00
Add new API call to get all the autoscalers currently managed by orbiter: ``` curl http://localhost:8000/autoscaler ``` Add command into the CLI to get this list ``` export ORBITER_HOST=http://localhost:8000 orbiter autoscler ls ``` Add command into the CLI to print all the events fired by the daemon: ``` export ORBITER_HOST=http://localhost:8000 orbiter system events ```
17 lines
518 B
Go
17 lines
518 B
Go
package api
|
|
|
|
import (
|
|
"github.com/Sirupsen/logrus"
|
|
"github.com/gianarb/orbiter/core"
|
|
"github.com/gorilla/mux"
|
|
)
|
|
|
|
func GetRouter(core core.Core, eventChannel chan *logrus.Entry) *mux.Router {
|
|
r := mux.NewRouter()
|
|
r.HandleFunc("/handle/{autoscaler_name}/{service_name}", Handle(core.Autoscalers)).Methods("POST")
|
|
r.HandleFunc("/autoscaler", AutoscalerList(core.Autoscalers)).Methods("GET")
|
|
r.HandleFunc("/health", Health()).Methods("GET")
|
|
r.HandleFunc("/events", Events(eventChannel)).Methods("GET")
|
|
return r
|
|
}
|