Add Swarm management CLI commands

As described in our ROADMAP.md, introduce new Swarm management commands
to call to the corresponding API endpoints.

This PR is fully backward compatible (joining a Swarm is an optional
feature of the Engine, and existing commands are not impacted).

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Daniel Nephin 2016-06-13 19:56:23 -07:00 committed by Tonis Tiigi
parent 92e6b85fa0
commit 408531dafa
2 changed files with 7 additions and 1 deletions

View File

@ -5,7 +5,10 @@ import (
"github.com/docker/docker/api/client/container" "github.com/docker/docker/api/client/container"
"github.com/docker/docker/api/client/image" "github.com/docker/docker/api/client/image"
"github.com/docker/docker/api/client/network" "github.com/docker/docker/api/client/network"
"github.com/docker/docker/api/client/node"
"github.com/docker/docker/api/client/registry" "github.com/docker/docker/api/client/registry"
"github.com/docker/docker/api/client/service"
"github.com/docker/docker/api/client/swarm"
"github.com/docker/docker/api/client/system" "github.com/docker/docker/api/client/system"
"github.com/docker/docker/api/client/volume" "github.com/docker/docker/api/client/volume"
"github.com/docker/docker/cli" "github.com/docker/docker/cli"
@ -36,6 +39,9 @@ func NewCobraAdaptor(clientFlags *cliflags.ClientFlags) CobraAdaptor {
rootCmd.SetFlagErrorFunc(cli.FlagErrorFunc) rootCmd.SetFlagErrorFunc(cli.FlagErrorFunc)
rootCmd.SetOutput(stdout) rootCmd.SetOutput(stdout)
rootCmd.AddCommand( rootCmd.AddCommand(
node.NewNodeCommand(dockerCli),
service.NewServiceCommand(dockerCli),
swarm.NewSwarmCommand(dockerCli),
container.NewAttachCommand(dockerCli), container.NewAttachCommand(dockerCli),
container.NewCommitCommand(dockerCli), container.NewCommitCommand(dockerCli),
container.NewCreateCommand(dockerCli), container.NewCreateCommand(dockerCli),

View File

@ -11,7 +11,7 @@ var DockerCommandUsage = []Command{
{"cp", "Copy files/folders between a container and the local filesystem"}, {"cp", "Copy files/folders between a container and the local filesystem"},
{"exec", "Run a command in a running container"}, {"exec", "Run a command in a running container"},
{"info", "Display system-wide information"}, {"info", "Display system-wide information"},
{"inspect", "Return low-level information on a container or image"}, {"inspect", "Return low-level information on a container, image or task"},
{"update", "Update configuration of one or more containers"}, {"update", "Update configuration of one or more containers"},
} }