|
@@ -1,9 +1,6 @@
|
|
package container
|
|
package container
|
|
|
|
|
|
-import (
|
|
|
|
- "github.com/docker/docker/api/server/router"
|
|
|
|
- "github.com/docker/docker/api/server/router/local"
|
|
|
|
-)
|
|
|
|
|
|
+import "github.com/docker/docker/api/server/router"
|
|
|
|
|
|
// containerRouter is a router to talk with the container controller
|
|
// containerRouter is a router to talk with the container controller
|
|
type containerRouter struct {
|
|
type containerRouter struct {
|
|
@@ -20,7 +17,7 @@ func NewRouter(b Backend) router.Router {
|
|
return r
|
|
return r
|
|
}
|
|
}
|
|
|
|
|
|
-// Routes returns the available routers to the container controller
|
|
|
|
|
|
+// Routes returns the available routes to the container controller
|
|
func (r *containerRouter) Routes() []router.Route {
|
|
func (r *containerRouter) Routes() []router.Route {
|
|
return r.routes
|
|
return r.routes
|
|
}
|
|
}
|
|
@@ -29,38 +26,38 @@ func (r *containerRouter) Routes() []router.Route {
|
|
func (r *containerRouter) initRoutes() {
|
|
func (r *containerRouter) initRoutes() {
|
|
r.routes = []router.Route{
|
|
r.routes = []router.Route{
|
|
// HEAD
|
|
// HEAD
|
|
- local.NewHeadRoute("/containers/{name:.*}/archive", r.headContainersArchive),
|
|
|
|
|
|
+ router.NewHeadRoute("/containers/{name:.*}/archive", r.headContainersArchive),
|
|
// GET
|
|
// GET
|
|
- local.NewGetRoute("/containers/json", r.getContainersJSON),
|
|
|
|
- local.NewGetRoute("/containers/{name:.*}/export", r.getContainersExport),
|
|
|
|
- local.NewGetRoute("/containers/{name:.*}/changes", r.getContainersChanges),
|
|
|
|
- local.NewGetRoute("/containers/{name:.*}/json", r.getContainersByName),
|
|
|
|
- local.NewGetRoute("/containers/{name:.*}/top", r.getContainersTop),
|
|
|
|
- local.NewGetRoute("/containers/{name:.*}/logs", r.getContainersLogs),
|
|
|
|
- local.NewGetRoute("/containers/{name:.*}/stats", r.getContainersStats),
|
|
|
|
- local.NewGetRoute("/containers/{name:.*}/attach/ws", r.wsContainersAttach),
|
|
|
|
- local.NewGetRoute("/exec/{id:.*}/json", r.getExecByID),
|
|
|
|
- local.NewGetRoute("/containers/{name:.*}/archive", r.getContainersArchive),
|
|
|
|
|
|
+ router.NewGetRoute("/containers/json", r.getContainersJSON),
|
|
|
|
+ router.NewGetRoute("/containers/{name:.*}/export", r.getContainersExport),
|
|
|
|
+ router.NewGetRoute("/containers/{name:.*}/changes", r.getContainersChanges),
|
|
|
|
+ router.NewGetRoute("/containers/{name:.*}/json", r.getContainersByName),
|
|
|
|
+ router.NewGetRoute("/containers/{name:.*}/top", r.getContainersTop),
|
|
|
|
+ router.NewGetRoute("/containers/{name:.*}/logs", r.getContainersLogs),
|
|
|
|
+ router.NewGetRoute("/containers/{name:.*}/stats", r.getContainersStats),
|
|
|
|
+ router.NewGetRoute("/containers/{name:.*}/attach/ws", r.wsContainersAttach),
|
|
|
|
+ router.NewGetRoute("/exec/{id:.*}/json", r.getExecByID),
|
|
|
|
+ router.NewGetRoute("/containers/{name:.*}/archive", r.getContainersArchive),
|
|
// POST
|
|
// POST
|
|
- local.NewPostRoute("/containers/create", r.postContainersCreate),
|
|
|
|
- local.NewPostRoute("/containers/{name:.*}/kill", r.postContainersKill),
|
|
|
|
- local.NewPostRoute("/containers/{name:.*}/pause", r.postContainersPause),
|
|
|
|
- local.NewPostRoute("/containers/{name:.*}/unpause", r.postContainersUnpause),
|
|
|
|
- local.NewPostRoute("/containers/{name:.*}/restart", r.postContainersRestart),
|
|
|
|
- local.NewPostRoute("/containers/{name:.*}/start", r.postContainersStart),
|
|
|
|
- local.NewPostRoute("/containers/{name:.*}/stop", r.postContainersStop),
|
|
|
|
- local.NewPostRoute("/containers/{name:.*}/wait", r.postContainersWait),
|
|
|
|
- local.NewPostRoute("/containers/{name:.*}/resize", r.postContainersResize),
|
|
|
|
- local.NewPostRoute("/containers/{name:.*}/attach", r.postContainersAttach),
|
|
|
|
- local.NewPostRoute("/containers/{name:.*}/copy", r.postContainersCopy),
|
|
|
|
- local.NewPostRoute("/containers/{name:.*}/exec", r.postContainerExecCreate),
|
|
|
|
- local.NewPostRoute("/exec/{name:.*}/start", r.postContainerExecStart),
|
|
|
|
- local.NewPostRoute("/exec/{name:.*}/resize", r.postContainerExecResize),
|
|
|
|
- local.NewPostRoute("/containers/{name:.*}/rename", r.postContainerRename),
|
|
|
|
- local.NewPostRoute("/containers/{name:.*}/update", r.postContainerUpdate),
|
|
|
|
|
|
+ router.NewPostRoute("/containers/create", r.postContainersCreate),
|
|
|
|
+ router.NewPostRoute("/containers/{name:.*}/kill", r.postContainersKill),
|
|
|
|
+ router.NewPostRoute("/containers/{name:.*}/pause", r.postContainersPause),
|
|
|
|
+ router.NewPostRoute("/containers/{name:.*}/unpause", r.postContainersUnpause),
|
|
|
|
+ router.NewPostRoute("/containers/{name:.*}/restart", r.postContainersRestart),
|
|
|
|
+ router.NewPostRoute("/containers/{name:.*}/start", r.postContainersStart),
|
|
|
|
+ router.NewPostRoute("/containers/{name:.*}/stop", r.postContainersStop),
|
|
|
|
+ router.NewPostRoute("/containers/{name:.*}/wait", r.postContainersWait),
|
|
|
|
+ router.NewPostRoute("/containers/{name:.*}/resize", r.postContainersResize),
|
|
|
|
+ router.NewPostRoute("/containers/{name:.*}/attach", r.postContainersAttach),
|
|
|
|
+ router.NewPostRoute("/containers/{name:.*}/copy", r.postContainersCopy),
|
|
|
|
+ router.NewPostRoute("/containers/{name:.*}/exec", r.postContainerExecCreate),
|
|
|
|
+ router.NewPostRoute("/exec/{name:.*}/start", r.postContainerExecStart),
|
|
|
|
+ router.NewPostRoute("/exec/{name:.*}/resize", r.postContainerExecResize),
|
|
|
|
+ router.NewPostRoute("/containers/{name:.*}/rename", r.postContainerRename),
|
|
|
|
+ router.NewPostRoute("/containers/{name:.*}/update", r.postContainerUpdate),
|
|
// PUT
|
|
// PUT
|
|
- local.NewPutRoute("/containers/{name:.*}/archive", r.putContainersArchive),
|
|
|
|
|
|
+ router.NewPutRoute("/containers/{name:.*}/archive", r.putContainersArchive),
|
|
// DELETE
|
|
// DELETE
|
|
- local.NewDeleteRoute("/containers/{name:.*}", r.deleteContainers),
|
|
|
|
|
|
+ router.NewDeleteRoute("/containers/{name:.*}", r.deleteContainers),
|
|
}
|
|
}
|
|
}
|
|
}
|