// NewRouter initializes a new systemRouter func NewRouter(b Backend) router.Router { r := &podRouter{ backend: b, } r.routes = []router.Route{ // GET local.NewGetRoute("/pod/info", r.getPodInfo), local.NewGetRoute("/pod/stats", r.getPodStats), local.NewGetRoute("/list", r.getList), // POST local.NewPostRoute("/pod/create", r.postPodCreate), local.NewPostRoute("/pod/labels", r.postPodLabels), local.NewPostRoute("/pod/start", r.postPodStart), local.NewPostRoute("/pod/stop", r.postPodStop), local.NewPostRoute("/pod/kill", r.postPodKill), local.NewPostRoute("/pod/pause", r.postPodPause), local.NewPostRoute("/pod/unpause", r.postPodUnpause), // PUT // DELETE local.NewDeleteRoute("/pod", r.deletePod), } return r }
// NewRouter initializes a new systemRouter func NewRouter(b Backend) router.Router { r := &systemRouter{ backend: b, } r.routes = []router.Route{ local.NewGetRoute("/_ping", pingHandler), local.NewGetRoute("/info", r.getInfo), local.NewGetRoute("/version", r.getVersion), local.NewPostRoute("/auth", r.postAuth), } return r }
// initRoutes initializes the routes in container router func (r *containerRouter) initRoutes() { r.routes = []router.Route{ // GET local.NewGetRoute("/container/info", r.getContainerInfo), local.NewGetRoute("/container/logs", r.getContainerLogs), local.NewGetRoute("/exitcode", r.getExitCode), // POST local.NewPostRoute("/container/create", r.postContainerCreate), local.NewPostRoute("/container/rename", r.postContainerRename), local.NewPostRoute("/container/commit", r.postContainerCommit), local.NewPostRoute("/container/stop", r.postContainerStop), local.NewPostRoute("/container/kill", r.postContainerKill), local.NewPostRoute("/exec/create", r.postContainerExecCreate), local.NewPostRoute("/exec/start", r.postContainerExecStart), local.NewPostRoute("/attach", r.postContainerAttach), local.NewPostRoute("/tty/resize", r.postTtyResize), // PUT // DELETE } }
// NewRouter initializes a new systemRouter func NewRouter(b Backend) router.Router { r := &serviceRouter{ backend: b, } r.routes = []router.Route{ // GET local.NewGetRoute("/service/list", r.getServices), // POST local.NewPostRoute("/service/add", r.postServiceAdd), local.NewPostRoute("/service/update", r.postServiceUpdate), // PUT // DELETE local.NewDeleteRoute("/service", r.deleteService), } return r }