Browse code

cli: `docker service|node|stack ps` instead of tasks

Rather than conflict with the unexposed task model, change the names of
the object-oriented task display to `docker <object> ps`. The command
works identically to `docker service tasks`. This change is superficial.

This provides a more sensical docker experience while not trampling on
the task model that may be introduced as a top-level command at a later
date.

The following is an example of the display using `docker service ps`
with a service named `condescending_cori`:

```
$ docker service ps condescending_cori
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
e2cd9vqb62qjk38lw65uoffd2 condescending_cori.1 condescending_cori alpine Running 13 minutes ago Running 6c6d232a5d0e
```

The following shows the output for the node on which the command is
running:

```console
$ docker node ps self
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
b1tpbi43k1ibevg2e94bmqo0s mad_kalam.1 mad_kalam apline Accepted 2 seconds ago Accepted 6c6d232a5d0e
e2cd9vqb62qjk38lw65uoffd2 condescending_cori.1 condescending_cori alpine Running 12 minutes ago Running 6c6d232a5d0e
4x609m5o0qyn0kgpzvf0ad8x5 furious_davinci.1 furious_davinci redis Running 32 minutes ago Running 6c6d232a5d0e
```

Signed-off-by: Stephen J Day <stephen.day@docker.com>

Stephen J Day authored on 2016/07/20 06:01:31
Showing 33 changed files
... ...
@@ -28,7 +28,7 @@ func NewNodeCommand(dockerCli *client.DockerCli) *cobra.Command {
28 28
 		newListCommand(dockerCli),
29 29
 		newPromoteCommand(dockerCli),
30 30
 		newRemoveCommand(dockerCli),
31
-		newTasksCommand(dockerCli),
31
+		newPSCommand(dockerCli),
32 32
 		newUpdateCommand(dockerCli),
33 33
 	)
34 34
 	return cmd
35 35
new file mode 100644
... ...
@@ -0,0 +1,63 @@
0
+package node
1
+
2
+import (
3
+	"golang.org/x/net/context"
4
+
5
+	"github.com/docker/docker/api/client"
6
+	"github.com/docker/docker/api/client/idresolver"
7
+	"github.com/docker/docker/api/client/task"
8
+	"github.com/docker/docker/cli"
9
+	"github.com/docker/docker/opts"
10
+	"github.com/docker/engine-api/types"
11
+	"github.com/spf13/cobra"
12
+)
13
+
14
+type psOptions struct {
15
+	nodeID    string
16
+	noResolve bool
17
+	filter    opts.FilterOpt
18
+}
19
+
20
+func newPSCommand(dockerCli *client.DockerCli) *cobra.Command {
21
+	opts := psOptions{filter: opts.NewFilterOpt()}
22
+
23
+	cmd := &cobra.Command{
24
+		Use:   "ps [OPTIONS] self|NODE",
25
+		Short: "List tasks running on a node",
26
+		Args:  cli.ExactArgs(1),
27
+		RunE: func(cmd *cobra.Command, args []string) error {
28
+			opts.nodeID = args[0]
29
+			return runPS(dockerCli, opts)
30
+		},
31
+	}
32
+	flags := cmd.Flags()
33
+	flags.BoolVar(&opts.noResolve, "no-resolve", false, "Do not map IDs to Names")
34
+	flags.VarP(&opts.filter, "filter", "f", "Filter output based on conditions provided")
35
+
36
+	return cmd
37
+}
38
+
39
+func runPS(dockerCli *client.DockerCli, opts psOptions) error {
40
+	client := dockerCli.Client()
41
+	ctx := context.Background()
42
+
43
+	nodeRef, err := Reference(client, ctx, opts.nodeID)
44
+	if err != nil {
45
+		return nil
46
+	}
47
+	node, _, err := client.NodeInspectWithRaw(ctx, nodeRef)
48
+	if err != nil {
49
+		return err
50
+	}
51
+
52
+	filter := opts.filter.Value()
53
+	filter.Add("node", node.ID)
54
+	tasks, err := client.TaskList(
55
+		ctx,
56
+		types.TaskListOptions{Filter: filter})
57
+	if err != nil {
58
+		return err
59
+	}
60
+
61
+	return task.Print(dockerCli, ctx, tasks, idresolver.New(client, opts.noResolve))
62
+}
0 63
deleted file mode 100644
... ...
@@ -1,63 +0,0 @@
1
-package node
2
-
3
-import (
4
-	"golang.org/x/net/context"
5
-
6
-	"github.com/docker/docker/api/client"
7
-	"github.com/docker/docker/api/client/idresolver"
8
-	"github.com/docker/docker/api/client/task"
9
-	"github.com/docker/docker/cli"
10
-	"github.com/docker/docker/opts"
11
-	"github.com/docker/engine-api/types"
12
-	"github.com/spf13/cobra"
13
-)
14
-
15
-type tasksOptions struct {
16
-	nodeID    string
17
-	noResolve bool
18
-	filter    opts.FilterOpt
19
-}
20
-
21
-func newTasksCommand(dockerCli *client.DockerCli) *cobra.Command {
22
-	opts := tasksOptions{filter: opts.NewFilterOpt()}
23
-
24
-	cmd := &cobra.Command{
25
-		Use:   "tasks [OPTIONS] self|NODE",
26
-		Short: "List tasks running on a node",
27
-		Args:  cli.ExactArgs(1),
28
-		RunE: func(cmd *cobra.Command, args []string) error {
29
-			opts.nodeID = args[0]
30
-			return runTasks(dockerCli, opts)
31
-		},
32
-	}
33
-	flags := cmd.Flags()
34
-	flags.BoolVar(&opts.noResolve, "no-resolve", false, "Do not map IDs to Names")
35
-	flags.VarP(&opts.filter, "filter", "f", "Filter output based on conditions provided")
36
-
37
-	return cmd
38
-}
39
-
40
-func runTasks(dockerCli *client.DockerCli, opts tasksOptions) error {
41
-	client := dockerCli.Client()
42
-	ctx := context.Background()
43
-
44
-	nodeRef, err := Reference(client, ctx, opts.nodeID)
45
-	if err != nil {
46
-		return nil
47
-	}
48
-	node, _, err := client.NodeInspectWithRaw(ctx, nodeRef)
49
-	if err != nil {
50
-		return err
51
-	}
52
-
53
-	filter := opts.filter.Value()
54
-	filter.Add("node", node.ID)
55
-	tasks, err := client.TaskList(
56
-		ctx,
57
-		types.TaskListOptions{Filter: filter})
58
-	if err != nil {
59
-		return err
60
-	}
61
-
62
-	return task.Print(dockerCli, ctx, tasks, idresolver.New(client, opts.noResolve))
63
-}
... ...
@@ -22,7 +22,7 @@ func NewServiceCommand(dockerCli *client.DockerCli) *cobra.Command {
22 22
 	cmd.AddCommand(
23 23
 		newCreateCommand(dockerCli),
24 24
 		newInspectCommand(dockerCli),
25
-		newTasksCommand(dockerCli),
25
+		newPSCommand(dockerCli),
26 26
 		newListCommand(dockerCli),
27 27
 		newRemoveCommand(dockerCli),
28 28
 		newScaleCommand(dockerCli),
29 29
new file mode 100644
... ...
@@ -0,0 +1,70 @@
0
+package service
1
+
2
+import (
3
+	"golang.org/x/net/context"
4
+
5
+	"github.com/docker/docker/api/client"
6
+	"github.com/docker/docker/api/client/idresolver"
7
+	"github.com/docker/docker/api/client/node"
8
+	"github.com/docker/docker/api/client/task"
9
+	"github.com/docker/docker/cli"
10
+	"github.com/docker/docker/opts"
11
+	"github.com/docker/engine-api/types"
12
+	"github.com/spf13/cobra"
13
+)
14
+
15
+type psOptions struct {
16
+	serviceID string
17
+	noResolve bool
18
+	filter    opts.FilterOpt
19
+}
20
+
21
+func newPSCommand(dockerCli *client.DockerCli) *cobra.Command {
22
+	opts := psOptions{filter: opts.NewFilterOpt()}
23
+
24
+	cmd := &cobra.Command{
25
+		Use:   "ps [OPTIONS] SERVICE",
26
+		Short: "List the tasks of a service",
27
+		Args:  cli.ExactArgs(1),
28
+		RunE: func(cmd *cobra.Command, args []string) error {
29
+			opts.serviceID = args[0]
30
+			return runPS(dockerCli, opts)
31
+		},
32
+	}
33
+	flags := cmd.Flags()
34
+	flags.BoolVar(&opts.noResolve, "no-resolve", false, "Do not map IDs to Names")
35
+	flags.VarP(&opts.filter, "filter", "f", "Filter output based on conditions provided")
36
+
37
+	return cmd
38
+}
39
+
40
+func runPS(dockerCli *client.DockerCli, opts psOptions) error {
41
+	client := dockerCli.Client()
42
+	ctx := context.Background()
43
+
44
+	service, _, err := client.ServiceInspectWithRaw(ctx, opts.serviceID)
45
+	if err != nil {
46
+		return err
47
+	}
48
+
49
+	filter := opts.filter.Value()
50
+	filter.Add("service", service.ID)
51
+	if filter.Include("node") {
52
+		nodeFilters := filter.Get("node")
53
+		for _, nodeFilter := range nodeFilters {
54
+			nodeReference, err := node.Reference(client, ctx, nodeFilter)
55
+			if err != nil {
56
+				return err
57
+			}
58
+			filter.Del("node", nodeFilter)
59
+			filter.Add("node", nodeReference)
60
+		}
61
+	}
62
+
63
+	tasks, err := client.TaskList(ctx, types.TaskListOptions{Filter: filter})
64
+	if err != nil {
65
+		return err
66
+	}
67
+
68
+	return task.Print(dockerCli, ctx, tasks, idresolver.New(client, opts.noResolve))
69
+}
0 70
deleted file mode 100644
... ...
@@ -1,70 +0,0 @@
1
-package service
2
-
3
-import (
4
-	"golang.org/x/net/context"
5
-
6
-	"github.com/docker/docker/api/client"
7
-	"github.com/docker/docker/api/client/idresolver"
8
-	"github.com/docker/docker/api/client/node"
9
-	"github.com/docker/docker/api/client/task"
10
-	"github.com/docker/docker/cli"
11
-	"github.com/docker/docker/opts"
12
-	"github.com/docker/engine-api/types"
13
-	"github.com/spf13/cobra"
14
-)
15
-
16
-type tasksOptions struct {
17
-	serviceID string
18
-	noResolve bool
19
-	filter    opts.FilterOpt
20
-}
21
-
22
-func newTasksCommand(dockerCli *client.DockerCli) *cobra.Command {
23
-	opts := tasksOptions{filter: opts.NewFilterOpt()}
24
-
25
-	cmd := &cobra.Command{
26
-		Use:   "tasks [OPTIONS] SERVICE",
27
-		Short: "List the tasks of a service",
28
-		Args:  cli.ExactArgs(1),
29
-		RunE: func(cmd *cobra.Command, args []string) error {
30
-			opts.serviceID = args[0]
31
-			return runTasks(dockerCli, opts)
32
-		},
33
-	}
34
-	flags := cmd.Flags()
35
-	flags.BoolVar(&opts.noResolve, "no-resolve", false, "Do not map IDs to Names")
36
-	flags.VarP(&opts.filter, "filter", "f", "Filter output based on conditions provided")
37
-
38
-	return cmd
39
-}
40
-
41
-func runTasks(dockerCli *client.DockerCli, opts tasksOptions) error {
42
-	client := dockerCli.Client()
43
-	ctx := context.Background()
44
-
45
-	service, _, err := client.ServiceInspectWithRaw(ctx, opts.serviceID)
46
-	if err != nil {
47
-		return err
48
-	}
49
-
50
-	filter := opts.filter.Value()
51
-	filter.Add("service", service.ID)
52
-	if filter.Include("node") {
53
-		nodeFilters := filter.Get("node")
54
-		for _, nodeFilter := range nodeFilters {
55
-			nodeReference, err := node.Reference(client, ctx, nodeFilter)
56
-			if err != nil {
57
-				return err
58
-			}
59
-			filter.Del("node", nodeFilter)
60
-			filter.Add("node", nodeReference)
61
-		}
62
-	}
63
-
64
-	tasks, err := client.TaskList(ctx, types.TaskListOptions{Filter: filter})
65
-	if err != nil {
66
-		return err
67
-	}
68
-
69
-	return task.Print(dockerCli, ctx, tasks, idresolver.New(client, opts.noResolve))
70
-}
... ...
@@ -25,7 +25,7 @@ func NewStackCommand(dockerCli *client.DockerCli) *cobra.Command {
25 25
 		newDeployCommand(dockerCli),
26 26
 		newRemoveCommand(dockerCli),
27 27
 		newServicesCommand(dockerCli),
28
-		newTasksCommand(dockerCli),
28
+		newPSCommand(dockerCli),
29 29
 	)
30 30
 	return cmd
31 31
 }
32 32
new file mode 100644
... ...
@@ -0,0 +1,70 @@
0
+// +build experimental
1
+
2
+package stack
3
+
4
+import (
5
+	"fmt"
6
+
7
+	"golang.org/x/net/context"
8
+
9
+	"github.com/docker/docker/api/client"
10
+	"github.com/docker/docker/api/client/idresolver"
11
+	"github.com/docker/docker/api/client/task"
12
+	"github.com/docker/docker/cli"
13
+	"github.com/docker/docker/opts"
14
+	"github.com/docker/engine-api/types"
15
+	"github.com/docker/engine-api/types/swarm"
16
+	"github.com/spf13/cobra"
17
+)
18
+
19
+type psOptions struct {
20
+	all       bool
21
+	filter    opts.FilterOpt
22
+	namespace string
23
+	noResolve bool
24
+}
25
+
26
+func newPSCommand(dockerCli *client.DockerCli) *cobra.Command {
27
+	opts := psOptions{filter: opts.NewFilterOpt()}
28
+
29
+	cmd := &cobra.Command{
30
+		Use:   "ps [OPTIONS] STACK",
31
+		Short: "List the tasks in the stack",
32
+		Args:  cli.ExactArgs(1),
33
+		RunE: func(cmd *cobra.Command, args []string) error {
34
+			opts.namespace = args[0]
35
+			return runPS(dockerCli, opts)
36
+		},
37
+	}
38
+	flags := cmd.Flags()
39
+	flags.BoolVarP(&opts.all, "all", "a", false, "Display all tasks")
40
+	flags.BoolVar(&opts.noResolve, "no-resolve", false, "Do not map IDs to Names")
41
+	flags.VarP(&opts.filter, "filter", "f", "Filter output based on conditions provided")
42
+
43
+	return cmd
44
+}
45
+
46
+func runPS(dockerCli *client.DockerCli, opts psOptions) error {
47
+	namespace := opts.namespace
48
+	client := dockerCli.Client()
49
+	ctx := context.Background()
50
+
51
+	filter := opts.filter.Value()
52
+	filter.Add("label", labelNamespace+"="+opts.namespace)
53
+	if !opts.all && !filter.Include("desired-state") {
54
+		filter.Add("desired-state", string(swarm.TaskStateRunning))
55
+		filter.Add("desired-state", string(swarm.TaskStateAccepted))
56
+	}
57
+
58
+	tasks, err := client.TaskList(ctx, types.TaskListOptions{Filter: filter})
59
+	if err != nil {
60
+		return err
61
+	}
62
+
63
+	if len(tasks) == 0 {
64
+		fmt.Fprintf(dockerCli.Out(), "Nothing found in stack: %s\n", namespace)
65
+		return nil
66
+	}
67
+
68
+	return task.Print(dockerCli, ctx, tasks, idresolver.New(client, opts.noResolve))
69
+}
0 70
deleted file mode 100644
... ...
@@ -1,70 +0,0 @@
1
-// +build experimental
2
-
3
-package stack
4
-
5
-import (
6
-	"fmt"
7
-
8
-	"golang.org/x/net/context"
9
-
10
-	"github.com/docker/docker/api/client"
11
-	"github.com/docker/docker/api/client/idresolver"
12
-	"github.com/docker/docker/api/client/task"
13
-	"github.com/docker/docker/cli"
14
-	"github.com/docker/docker/opts"
15
-	"github.com/docker/engine-api/types"
16
-	"github.com/docker/engine-api/types/swarm"
17
-	"github.com/spf13/cobra"
18
-)
19
-
20
-type tasksOptions struct {
21
-	all       bool
22
-	filter    opts.FilterOpt
23
-	namespace string
24
-	noResolve bool
25
-}
26
-
27
-func newTasksCommand(dockerCli *client.DockerCli) *cobra.Command {
28
-	opts := tasksOptions{filter: opts.NewFilterOpt()}
29
-
30
-	cmd := &cobra.Command{
31
-		Use:   "tasks [OPTIONS] STACK",
32
-		Short: "List the tasks in the stack",
33
-		Args:  cli.ExactArgs(1),
34
-		RunE: func(cmd *cobra.Command, args []string) error {
35
-			opts.namespace = args[0]
36
-			return runTasks(dockerCli, opts)
37
-		},
38
-	}
39
-	flags := cmd.Flags()
40
-	flags.BoolVarP(&opts.all, "all", "a", false, "Display all tasks")
41
-	flags.BoolVar(&opts.noResolve, "no-resolve", false, "Do not map IDs to Names")
42
-	flags.VarP(&opts.filter, "filter", "f", "Filter output based on conditions provided")
43
-
44
-	return cmd
45
-}
46
-
47
-func runTasks(dockerCli *client.DockerCli, opts tasksOptions) error {
48
-	namespace := opts.namespace
49
-	client := dockerCli.Client()
50
-	ctx := context.Background()
51
-
52
-	filter := opts.filter.Value()
53
-	filter.Add("label", labelNamespace+"="+opts.namespace)
54
-	if !opts.all && !filter.Include("desired-state") {
55
-		filter.Add("desired-state", string(swarm.TaskStateRunning))
56
-		filter.Add("desired-state", string(swarm.TaskStateAccepted))
57
-	}
58
-
59
-	tasks, err := client.TaskList(ctx, types.TaskListOptions{Filter: filter})
60
-	if err != nil {
61
-		return err
62
-	}
63
-
64
-	if len(tasks) == 0 {
65
-		fmt.Fprintf(dockerCli.Out(), "Nothing found in stack: %s\n", namespace)
66
-		return nil
67
-	}
68
-
69
-	return task.Print(dockerCli, ctx, tasks, idresolver.New(client, opts.noResolve))
70
-}
... ...
@@ -1573,7 +1573,7 @@ _docker_service() {
1573 1573
 		ls list
1574 1574
 		rm remove
1575 1575
 		scale
1576
-		tasks
1576
+		ps
1577 1577
 		update
1578 1578
 	"
1579 1579
 	__docker_subcommands "$subcommands" && return
... ...
@@ -1667,7 +1667,7 @@ _docker_service_scale() {
1667 1667
 	esac
1668 1668
 }
1669 1669
 
1670
-_docker_service_tasks() {
1670
+_docker_service_ps() {
1671 1671
 	local key=$(__docker_map_key_of_current_option '--filter|-f')
1672 1672
 	case "$key" in
1673 1673
 		desired-state)
... ...
@@ -1929,7 +1929,7 @@ _docker_node() {
1929 1929
 		ls list
1930 1930
 		promote
1931 1931
 		rm remove
1932
-		tasks
1932
+		ps
1933 1933
 		update
1934 1934
 	"
1935 1935
 	__docker_subcommands "$subcommands" && return
... ...
@@ -2026,7 +2026,7 @@ _docker_node_rm() {
2026 2026
 	esac
2027 2027
 }
2028 2028
 
2029
-_docker_node_tasks() {
2029
+_docker_node_ps() {
2030 2030
 	local key=$(__docker_map_key_of_current_option '--filter|-f')
2031 2031
 	case "$key" in
2032 2032
 		desired-state)
... ...
@@ -683,7 +683,7 @@ __docker_node_complete_ls_filters() {
683 683
     return ret
684 684
 }
685 685
 
686
-__docker_node_complete_tasks_filters() {
686
+__docker_node_complete_ps_filters() {
687 687
     [[ $PREFIX = -* ]] && return 1
688 688
     integer ret=1
689 689
 
... ...
@@ -787,7 +787,7 @@ __docker_node_commands() {
787 787
         "ls:List nodes in the swarm"
788 788
         "promote:Promote a node as manager in the swarm"
789 789
         "rm:Remove a node from the swarm"
790
-        "tasks:List tasks running on a node"
790
+        "ps:List tasks running on a node"
791 791
         "update:Update a node"
792 792
     )
793 793
     _describe -t docker-node-commands "docker node command" _docker_node_subcommands
... ...
@@ -834,7 +834,7 @@ __docker_node_subcommand() {
834 834
                 $opts_help \
835 835
                 "($help -)*:node:__docker_complete_worker_nodes" && ret=0
836 836
             ;;
837
-        (tasks)
837
+        (ps)
838 838
             _arguments $(__docker_arguments) \
839 839
                 $opts_help \
840 840
                 "($help -a --all)"{-a,--all}"[Display all instances]" \
... ...
@@ -843,7 +843,7 @@ __docker_node_subcommand() {
843 843
                 "($help -)1:node:__docker_complete_nodes" && ret=0
844 844
             case $state in
845 845
                 (filter-options)
846
-                    __docker_node_complete_tasks_filters && ret=0
846
+                    __docker_node_complete_ps_filters && ret=0
847 847
                     ;;
848 848
             esac
849 849
             ;;
... ...
@@ -970,7 +970,7 @@ __docker_service_complete_ls_filters() {
970 970
     return ret
971 971
 }
972 972
 
973
-__docker_service_complete_tasks_filters() {
973
+__docker_service_complete_ps_filters() {
974 974
     [[ $PREFIX = -* ]] && return 1
975 975
     integer ret=1
976 976
 
... ...
@@ -1060,7 +1060,7 @@ __docker_service_commands() {
1060 1060
         "ls:List services"
1061 1061
         "rm:Remove a service"
1062 1062
         "scale:Scale one or multiple services"
1063
-        "tasks:List the tasks of a service"
1063
+        "ps:List the tasks of a service"
1064 1064
         "update:Update a service"
1065 1065
     )
1066 1066
     _describe -t docker-service-commands "docker service command" _docker_service_subcommands
... ...
@@ -1148,7 +1148,7 @@ __docker_service_subcommand() {
1148 1148
                     ;;
1149 1149
             esac
1150 1150
             ;;
1151
-        (tasks)
1151
+        (ps)
1152 1152
             _arguments $(__docker_arguments) \
1153 1153
                 $opts_help \
1154 1154
                 "($help -a --all)"{-a,--all}"[Display all tasks]" \
... ...
@@ -1157,7 +1157,7 @@ __docker_service_subcommand() {
1157 1157
                 "($help -)1:service:__docker_complete_services" && ret=0
1158 1158
             case $state in
1159 1159
                 (filter-options)
1160
-                    __docker_service_complete_tasks_filters && ret=0
1160
+                    __docker_service_complete_ps_filters && ret=0
1161 1161
                     ;;
1162 1162
             esac
1163 1163
             ;;
... ...
@@ -115,7 +115,7 @@ read the [`dockerd`](dockerd.md) reference page.
115 115
 | [node demote](node_demote.md) | Demotes an existing manager so that it is no longer a manager |
116 116
 | [node inspect](node_inspect.md) | Inspect a node in the swarm                |
117 117
 | [node update](node_update.md) | Update attributes for a node                 |
118
-| [node tasks](node_tasks.md) | List tasks running on a node                   |
118
+| [node ps](node_ps.md) | List tasks running on a node                   |
119 119
 | [node ls](node_ls.md) | List nodes in the swarm                              |
120 120
 | [node rm](node_rm.md) | Remove a node from the swarm                         |
121 121
 
... ...
@@ -138,5 +138,5 @@ read the [`dockerd`](dockerd.md) reference page.
138 138
 | [service ls](service_ls.md) | List services in the swarm                     |
139 139
 | [service rm](service_rm.md) | Reemove a swervice from the swarm              |
140 140
 | [service scale](service_scale.md) | Set the number of replicas for the desired state of the service |
141
-| [service tasks](service_tasks.md) | List the tasks of a service              |
141
+| [service ps](service_ps.md) | List the tasks of a service              |
142 142
 | [service update](service_update.md)  | Update the attributes of a service    |
... ...
@@ -120,6 +120,6 @@ Example output:
120 120
 ## Related information
121 121
 
122 122
 * [node update](node_update.md)
123
-* [node tasks](node_tasks.md)
123
+* [node ps](node_ps.md)
124 124
 * [node ls](node_ls.md)
125 125
 * [node rm](node_rm.md)
... ...
@@ -91,5 +91,5 @@ ID                         HOSTNAME       STATUS  AVAILABILITY  MANAGER STATUS
91 91
 
92 92
 * [node inspect](node_inspect.md)
93 93
 * [node update](node_update.md)
94
-* [node tasks](node_tasks.md)
94
+* [node ps](node_ps.md)
95 95
 * [node rm](node_rm.md)
96 96
new file mode 100644
... ...
@@ -0,0 +1,100 @@
0
+<!--[metadata]>
1
+title = "node ps"
2
+description = "The node ps command description and usage"
3
+keywords = ["node, tasks", "ps"]
4
+aliases = ["/engine/reference/commandline/node_tasks/"]
5
+[menu.main]
6
+parent = "smn_cli"
7
+<![end-metadata]-->
8
+
9
+# node ps
10
+
11
+```markdown
12
+Usage:  docker node ps [OPTIONS] self|NODE
13
+
14
+List tasks running on a node
15
+
16
+Options:
17
+  -a, --all            Display all instances
18
+  -f, --filter value   Filter output based on conditions provided
19
+      --help           Print usage
20
+      --no-resolve     Do not map IDs to Names
21
+```
22
+
23
+Lists all the tasks on a Node that Docker knows about. You can filter using the `-f` or `--filter` flag. Refer to the [filtering](#filtering) section for more information about available filter options.
24
+
25
+Example output:
26
+
27
+    $ docker node ps swarm-manager1
28
+    ID                         NAME      SERVICE  IMAGE        LAST STATE          DESIRED STATE  NODE
29
+    7q92v0nr1hcgts2amcjyqg3pq  redis.1   redis    redis:3.0.6  Running 5 hours     Running        swarm-manager1
30
+    b465edgho06e318egmgjbqo4o  redis.6   redis    redis:3.0.6  Running 29 seconds  Running        swarm-manager1
31
+    bg8c07zzg87di2mufeq51a2qp  redis.7   redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
32
+    dkkual96p4bb3s6b10r7coxxt  redis.9   redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
33
+    0tgctg8h8cech4w0k0gwrmr23  redis.10  redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
34
+
35
+
36
+## Filtering
37
+
38
+The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
39
+than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
40
+
41
+The currently supported filters are:
42
+
43
+* [name](#name)
44
+* [id](#id)
45
+* [label](#label)
46
+* [desired-state](#desired-state)
47
+
48
+#### name
49
+
50
+The `name` filter matches on all or part of a task's name.
51
+
52
+The following filter matches all tasks with a name containing the `redis` string.
53
+
54
+    $ docker node ps -f name=redis swarm-manager1
55
+    ID                         NAME      SERVICE  IMAGE        LAST STATE          DESIRED STATE  NODE
56
+    7q92v0nr1hcgts2amcjyqg3pq  redis.1   redis    redis:3.0.6  Running 5 hours     Running        swarm-manager1
57
+    b465edgho06e318egmgjbqo4o  redis.6   redis    redis:3.0.6  Running 29 seconds  Running        swarm-manager1
58
+    bg8c07zzg87di2mufeq51a2qp  redis.7   redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
59
+    dkkual96p4bb3s6b10r7coxxt  redis.9   redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
60
+    0tgctg8h8cech4w0k0gwrmr23  redis.10  redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
61
+
62
+
63
+#### id
64
+
65
+The `id` filter matches a task's id.
66
+
67
+    $ docker node ps -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1
68
+    ID                         NAME      SERVICE  IMAGE        LAST STATE             DESIRED STATE  NODE
69
+    bg8c07zzg87di2mufeq51a2qp  redis.7   redis    redis:3.0.6  Running 5 seconds      Running        swarm-manager1
70
+
71
+
72
+#### label
73
+
74
+The `label` filter matches tasks based on the presence of a `label` alone or a `label` and a
75
+value.
76
+
77
+The following filter matches tasks with the `usage` label regardless of its value.
78
+
79
+```bash
80
+$ docker node ps -f "label=usage"
81
+ID                         NAME     SERVICE  IMAGE        LAST STATE          DESIRED STATE  NODE
82
+b465edgho06e318egmgjbqo4o  redis.6  redis    redis:3.0.6  Running 10 minutes  Running        swarm-manager1
83
+bg8c07zzg87di2mufeq51a2qp  redis.7  redis    redis:3.0.6  Running 9 minutes   Running        swarm-manager1
84
+```
85
+
86
+
87
+#### desired-state
88
+
89
+The `desired-state` filter can take the values `running` and `accepted`.
90
+
91
+
92
+## Related information
93
+
94
+* [node inspect](node_inspect.md)
95
+* [node update](node_update.md)
96
+* [node ls](node_ls.md)
97
+* [node rm](node_rm.md)
... ...
@@ -35,5 +35,5 @@ Example output:
35 35
 
36 36
 * [node inspect](node_inspect.md)
37 37
 * [node update](node_update.md)
38
-* [node tasks](node_tasks.md)
38
+* [node ps](node_ps.md)
39 39
 * [node ls](node_ls.md)
40 40
deleted file mode 100644
... ...
@@ -1,99 +0,0 @@
1
-<!--[metadata]>
2
-+++
3
-title = "node tasks"
4
-description = "The node tasks command description and usage"
5
-keywords = ["node, tasks"]
6
-[menu.main]
7
-parent = "smn_cli"
8
-+++
9
-<![end-metadata]-->
10
-
11
-# node tasks
12
-
13
-```markdown
14
-Usage:  docker node tasks [OPTIONS] self|NODE
15
-
16
-List tasks running on a node
17
-
18
-Options:
19
-  -a, --all            Display all instances
20
-  -f, --filter value   Filter output based on conditions provided
21
-      --help           Print usage
22
-      --no-resolve     Do not map IDs to Names
23
-```
24
-
25
-Lists all the tasks on a Node that Docker knows about. You can filter using the `-f` or `--filter` flag. Refer to the [filtering](#filtering) section for more information about available filter options.
26
-
27
-Example output:
28
-
29
-    $ docker node tasks swarm-manager1
30
-    ID                         NAME      SERVICE  IMAGE        LAST STATE          DESIRED STATE  NODE
31
-    7q92v0nr1hcgts2amcjyqg3pq  redis.1   redis    redis:3.0.6  Running 5 hours     Running        swarm-manager1
32
-    b465edgho06e318egmgjbqo4o  redis.6   redis    redis:3.0.6  Running 29 seconds  Running        swarm-manager1
33
-    bg8c07zzg87di2mufeq51a2qp  redis.7   redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
34
-    dkkual96p4bb3s6b10r7coxxt  redis.9   redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
35
-    0tgctg8h8cech4w0k0gwrmr23  redis.10  redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
36
-
37
-
38
-## Filtering
39
-
40
-The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
41
-than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
42
-
43
-The currently supported filters are:
44
-
45
-* [name](#name)
46
-* [id](#id)
47
-* [label](#label)
48
-* [desired-state](#desired-state)
49
-
50
-#### name
51
-
52
-The `name` filter matches on all or part of a task's name.
53
-
54
-The following filter matches all tasks with a name containing the `redis` string.
55
-
56
-    $ docker node tasks -f name=redis swarm-manager1
57
-    ID                         NAME      SERVICE  IMAGE        LAST STATE          DESIRED STATE  NODE
58
-    7q92v0nr1hcgts2amcjyqg3pq  redis.1   redis    redis:3.0.6  Running 5 hours     Running        swarm-manager1
59
-    b465edgho06e318egmgjbqo4o  redis.6   redis    redis:3.0.6  Running 29 seconds  Running        swarm-manager1
60
-    bg8c07zzg87di2mufeq51a2qp  redis.7   redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
61
-    dkkual96p4bb3s6b10r7coxxt  redis.9   redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
62
-    0tgctg8h8cech4w0k0gwrmr23  redis.10  redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
63
-
64
-
65
-#### id
66
-
67
-The `id` filter matches a task's id.
68
-
69
-    $ docker node tasks -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1
70
-    ID                         NAME      SERVICE  IMAGE        LAST STATE             DESIRED STATE  NODE
71
-    bg8c07zzg87di2mufeq51a2qp  redis.7   redis    redis:3.0.6  Running 5 seconds      Running        swarm-manager1
72
-
73
-
74
-#### label
75
-
76
-The `label` filter matches tasks based on the presence of a `label` alone or a `label` and a
77
-value.
78
-
79
-The following filter matches tasks with the `usage` label regardless of its value.
80
-
81
-```bash
82
-$ docker node tasks -f "label=usage"
83
-ID                         NAME     SERVICE  IMAGE        LAST STATE          DESIRED STATE  NODE
84
-b465edgho06e318egmgjbqo4o  redis.6  redis    redis:3.0.6  Running 10 minutes  Running        swarm-manager1
85
-bg8c07zzg87di2mufeq51a2qp  redis.7  redis    redis:3.0.6  Running 9 minutes   Running        swarm-manager1
86
-```
87
-
88
-
89
-#### desired-state
90
-
91
-The `desired-state` filter can take the values `running` and `accepted`.
92
-
93
-
94
-## Related information
95
-
96
-* [node inspect](node_inspect.md)
97
-* [node update](node_update.md)
98
-* [node ls](node_ls.md)
99
-* [node rm](node_rm.md)
... ...
@@ -59,6 +59,6 @@ metadata](../../userguide/labels-custom-metadata.md).
59 59
 ## Related information
60 60
 
61 61
 * [node inspect](node_inspect.md)
62
-* [node tasks](node_tasks.md)
62
+* [node ps](node_ps.md)
63 63
 * [node ls](node_ls.md)
64 64
 * [node rm](node_rm.md)
... ...
@@ -183,5 +183,5 @@ $ docker service create \
183 183
 * [service ls](service_ls.md)
184 184
 * [service rm](service_rm.md)
185 185
 * [service scale](service_scale.md)
186
-* [service tasks](service_tasks.md)
186
+* [service ps](service_ps.md)
187 187
 * [service update](service_update.md)
... ...
@@ -149,5 +149,5 @@ $ docker service inspect --format='{{.Spec.Mode.Replicated.Replicas}}' redis
149 149
 * [service ls](service_ls.md)
150 150
 * [service rm](service_rm.md)
151 151
 * [service scale](service_scale.md)
152
-* [service tasks](service_tasks.md)
152
+* [service ps](service_ps.md)
153 153
 * [service update](service_update.md)
... ...
@@ -104,5 +104,5 @@ ID            NAME   REPLICAS  IMAGE        COMMAND
104 104
 * [service inspect](service_inspect.md)
105 105
 * [service rm](service_rm.md)
106 106
 * [service scale](service_scale.md)
107
-* [service tasks](service_tasks.md)
107
+* [service ps](service_ps.md)
108 108
 * [service update](service_update.md)
109 109
new file mode 100644
... ...
@@ -0,0 +1,100 @@
0
+<!--[metadata]>
1
+title = "service ps"
2
+description = "The service ps command description and usage"
3
+keywords = ["service, tasks", "ps"]
4
+aliases = ["/engine/reference/commandline/service_tasks/"]
5
+[menu.main]
6
+parent = "smn_cli"
7
+<![end-metadata]-->
8
+
9
+# service ps
10
+
11
+```Markdown
12
+Usage:	docker service ps [OPTIONS] SERVICE
13
+
14
+List the tasks of a service
15
+
16
+Options:
17
+  -a, --all            Display all tasks
18
+  -f, --filter value   Filter output based on conditions provided
19
+      --help           Print usage
20
+      --no-resolve     Do not map IDs to Names
21
+```
22
+
23
+Lists the tasks that are running as part of the specified service. This command
24
+has to be run targeting a manager node.
25
+
26
+
27
+## Examples
28
+
29
+### Listing the tasks that are part of a service
30
+
31
+The following command shows all the tasks that are part of the `redis` service:
32
+
33
+```bash
34
+$ docker service ps redis
35
+ID                         NAME      SERVICE IMAGE        LAST STATE          DESIRED STATE  NODE
36
+0qihejybwf1x5vqi8lgzlgnpq  redis.1   redis   redis:3.0.6  Running 8 seconds   Running        manager1
37
+bk658fpbex0d57cqcwoe3jthu  redis.2   redis   redis:3.0.6  Running 9 seconds   Running        worker2
38
+5ls5s5fldaqg37s9pwayjecrf  redis.3   redis   redis:3.0.6  Running 9 seconds   Running        worker1
39
+8ryt076polmclyihzx67zsssj  redis.4   redis   redis:3.0.6  Running 9 seconds   Running        worker1
40
+1x0v8yomsncd6sbvfn0ph6ogc  redis.5   redis   redis:3.0.6  Running 8 seconds   Running        manager1
41
+71v7je3el7rrw0osfywzs0lko  redis.6   redis   redis:3.0.6  Running 9 seconds   Running        worker2
42
+4l3zm9b7tfr7cedaik8roxq6r  redis.7   redis   redis:3.0.6  Running 9 seconds   Running        worker2
43
+9tfpyixiy2i74ad9uqmzp1q6o  redis.8   redis   redis:3.0.6  Running 9 seconds   Running        worker1
44
+3w1wu13yuplna8ri3fx47iwad  redis.9   redis   redis:3.0.6  Running 8 seconds   Running        manager1
45
+8eaxrb2fqpbnv9x30vr06i6vt  redis.10  redis   redis:3.0.6  Running 8 seconds   Running        manager1
46
+```
47
+
48
+
49
+## Filtering
50
+
51
+The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
52
+is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
53
+Multiple filter flags are combined as an `OR` filter. For example,
54
+`-f name=redis.1 -f name=redis.7` returns both `redis.1` and `redis.7` tasks.
55
+
56
+The currently supported filters are:
57
+
58
+* [id](#id)
59
+* [name](#name)
60
+* [desired-state](#desired-state)
61
+
62
+
63
+#### ID
64
+
65
+The `id` filter matches on all or a prefix of a task's ID.
66
+
67
+```bash
68
+$ docker service ps -f "id=8" redis
69
+ID                         NAME      SERVICE  IMAGE        LAST STATE         DESIRED STATE  NODE
70
+8ryt076polmclyihzx67zsssj  redis.4   redis    redis:3.0.6  Running 4 minutes  Running        worker1
71
+8eaxrb2fqpbnv9x30vr06i6vt  redis.10  redis    redis:3.0.6  Running 4 minutes  Running        manager1
72
+```
73
+
74
+#### Name
75
+
76
+The `name` filter matches on task names.
77
+
78
+```bash
79
+$ docker service ps -f "name=redis.1" redis
80
+ID                         NAME      SERVICE  IMAGE        DESIRED STATE  LAST STATE         NODE
81
+0qihejybwf1x5vqi8lgzlgnpq  redis.1   redis    redis:3.0.6  Running        Running 8 seconds  manager1
82
+```
83
+
84
+
85
+#### desired-state
86
+
87
+The `desired-state` filter can take the values `running` and `accepted`.
88
+
89
+
90
+## Related information
91
+
92
+* [service create](service_create.md)
93
+* [service inspect](service_inspect.md)
94
+* [service ls](service_ls.md)
95
+* [service rm](service_rm.md)
96
+* [service scale](service_scale.md)
97
+* [service update](service_update.md)
... ...
@@ -45,5 +45,5 @@ ID            NAME   SCALE  IMAGE        COMMAND
45 45
 * [service inspect](service_inspect.md)
46 46
 * [service ls](service_ls.md)
47 47
 * [service scale](service_scale.md)
48
-* [service tasks](service_tasks.md)
48
+* [service ps](service_ps.md)
49 49
 * [service update](service_update.md)
... ...
@@ -74,5 +74,5 @@ ID            NAME      REPLICAS  IMAGE         COMMAND
74 74
 * [service inspect](service_inspect.md)
75 75
 * [service ls](service_ls.md)
76 76
 * [service rm](service_rm.md)
77
-* [service tasks](service_tasks.md)
77
+* [service ps](service_ps.md)
78 78
 * [service update](service_update.md)
79 79
deleted file mode 100644
... ...
@@ -1,99 +0,0 @@
1
-<!--[metadata]>
2
-+++
3
-title = "service tasks"
4
-description = "The service tasks command description and usage"
5
-keywords = ["service, tasks"]
6
-[menu.main]
7
-parent = "smn_cli"
8
-+++
9
-<![end-metadata]-->
10
-
11
-# service tasks
12
-
13
-```Markdown
14
-Usage:	docker service tasks [OPTIONS] SERVICE
15
-
16
-List the tasks of a service
17
-
18
-Options:
19
-  -a, --all            Display all tasks
20
-  -f, --filter value   Filter output based on conditions provided
21
-      --help           Print usage
22
-      --no-resolve     Do not map IDs to Names
23
-```
24
-
25
-Lists the tasks that are running as part of the specified service. This command
26
-has to be run targeting a manager node.
27
-
28
-
29
-## Examples
30
-
31
-### Listing the tasks that are part of a service
32
-
33
-The following command shows all the tasks that are part of the `redis` service:
34
-
35
-```bash
36
-$ docker service tasks redis
37
-ID                         NAME      SERVICE IMAGE        LAST STATE          DESIRED STATE  NODE
38
-0qihejybwf1x5vqi8lgzlgnpq  redis.1   redis   redis:3.0.6  Running 8 seconds   Running        manager1
39
-bk658fpbex0d57cqcwoe3jthu  redis.2   redis   redis:3.0.6  Running 9 seconds   Running        worker2
40
-5ls5s5fldaqg37s9pwayjecrf  redis.3   redis   redis:3.0.6  Running 9 seconds   Running        worker1
41
-8ryt076polmclyihzx67zsssj  redis.4   redis   redis:3.0.6  Running 9 seconds   Running        worker1
42
-1x0v8yomsncd6sbvfn0ph6ogc  redis.5   redis   redis:3.0.6  Running 8 seconds   Running        manager1
43
-71v7je3el7rrw0osfywzs0lko  redis.6   redis   redis:3.0.6  Running 9 seconds   Running        worker2
44
-4l3zm9b7tfr7cedaik8roxq6r  redis.7   redis   redis:3.0.6  Running 9 seconds   Running        worker2
45
-9tfpyixiy2i74ad9uqmzp1q6o  redis.8   redis   redis:3.0.6  Running 9 seconds   Running        worker1
46
-3w1wu13yuplna8ri3fx47iwad  redis.9   redis   redis:3.0.6  Running 8 seconds   Running        manager1
47
-8eaxrb2fqpbnv9x30vr06i6vt  redis.10  redis   redis:3.0.6  Running 8 seconds   Running        manager1
48
-```
49
-
50
-
51
-## Filtering
52
-
53
-The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
54
-is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
55
-Multiple filter flags are combined as an `OR` filter. For example,
56
-`-f name=redis.1 -f name=redis.7` returns both `redis.1` and `redis.7` tasks.
57
-
58
-The currently supported filters are:
59
-
60
-* [id](#id)
61
-* [name](#name)
62
-* [desired-state](#desired-state)
63
-
64
-
65
-#### ID
66
-
67
-The `id` filter matches on all or a prefix of a task's ID.
68
-
69
-```bash
70
-$ docker service tasks -f "id=8" redis
71
-ID                         NAME      SERVICE  IMAGE        LAST STATE         DESIRED STATE  NODE
72
-8ryt076polmclyihzx67zsssj  redis.4   redis    redis:3.0.6  Running 4 minutes  Running        worker1
73
-8eaxrb2fqpbnv9x30vr06i6vt  redis.10  redis    redis:3.0.6  Running 4 minutes  Running        manager1
74
-```
75
-
76
-#### Name
77
-
78
-The `name` filter matches on task names.
79
-
80
-```bash
81
-$ docker service tasks -f "name=redis.1" redis
82
-ID                         NAME      SERVICE  IMAGE        DESIRED STATE  LAST STATE         NODE
83
-0qihejybwf1x5vqi8lgzlgnpq  redis.1   redis    redis:3.0.6  Running        Running 8 seconds  manager1
84
-```
85
-
86
-
87
-#### desired-state
88
-
89
-The `desired-state` filter can take the values `running` and `accepted`.
90
-
91
-
92
-## Related information
93
-
94
-* [service create](service_create.md)
95
-* [service inspect](service_inspect.md)
96
-* [service ls](service_ls.md)
97
-* [service rm](service_rm.md)
98
-* [service scale](service_scale.md)
99
-* [service update](service_update.md)
... ...
@@ -71,6 +71,6 @@ $ docker service update --limit-cpu 2 redis
71 71
 
72 72
 * [service create](service_create.md)
73 73
 * [service inspect](service_inspect.md)
74
-* [service tasks](service_tasks.md)
74
+* [service ps](service_ps.md)
75 75
 * [service ls](service_ls.md)
76 76
 * [service rm](service_rm.md)
... ...
@@ -87,5 +87,5 @@ roll-back a task to a previous version of the service.
87 87
     * [service ls](../reference/commandline/service_ls.md)
88 88
     * [service rm](../reference/commandline/service_rm.md)
89 89
     * [service scale](../reference/commandline/service_scale.md)
90
-    * [service tasks](../reference/commandline/service_tasks.md)
90
+    * [service ps](../reference/commandline/service_ps.md)
91 91
     * [service update](../reference/commandline/service_update.md)
... ...
@@ -45,11 +45,11 @@ update](rolling-update.md) tutorial, start it now:
45 45
     c5uo6kdmzpon37mgj9mwglcfw
46 46
     ```
47 47
 
48
-4. Run `docker service tasks redis` to see how the Swarm manager assigned the
48
+4. Run `docker service ps redis` to see how the Swarm manager assigned the
49 49
 tasks to different nodes:
50 50
 
51 51
     ```bash
52
-    $ docker service tasks redis
52
+    $ docker service ps redis
53 53
 
54 54
     ID                         NAME     SERVICE  IMAGE        LAST STATE          DESIRED STATE  NODE
55 55
     7q92v0nr1hcgts2amcjyqg3pq  redis.1  redis    redis:3.0.6  Running 26 seconds  Running        manager1
... ...
@@ -84,11 +84,11 @@ had a task assigned to it:
84 84
 
85 85
     The drained node shows `Drain` for `AVAILABILITY`.
86 86
 
87
-7. Run `docker service tasks redis` to see how the Swarm manager updated the
87
+7. Run `docker service ps redis` to see how the Swarm manager updated the
88 88
 task assignments for the `redis` service:
89 89
 
90 90
     ```bash
91
-    $ docker service tasks redis
91
+    $ docker service ps redis
92 92
 
93 93
     ID                         NAME     SERVICE  IMAGE        LAST STATE              DESIRED STATE  NODE
94 94
     7q92v0nr1hcgts2amcjyqg3pq  redis.1  redis    redis:3.0.6  Running 4 minutes       Running        manager1
... ...
@@ -91,11 +91,11 @@ about a service in an easily readable format.
91 91
     ]
92 92
     ```
93 93
 
94
-4. Run `docker service tasks <SERVICE-ID>` to see which nodes are running the
94
+4. Run `docker service ps <SERVICE-ID>` to see which nodes are running the
95 95
 service:
96 96
 
97 97
     ```
98
-    $ docker service tasks helloworld
98
+    $ docker service ps helloworld
99 99
 
100 100
     ID                         NAME          SERVICE     IMAGE   LAST STATE         DESIRED STATE  NODE
101 101
     8p1vev3fq5zm0mi8g0as41w35  helloworld.1  helloworld  alpine  Running 3 minutes  Running        worker2
... ...
@@ -133,10 +133,10 @@ desired state:
133 133
     To avoid repeating certain update failures, you may need to reconfigure the
134 134
     service by passing flags to `docker service update`.
135 135
 
136
-6. Run `docker service tasks <SERVICE-ID>` to watch the rolling update:
136
+6. Run `docker service ps <SERVICE-ID>` to watch the rolling update:
137 137
 
138 138
     ```bash
139
-    $ docker service tasks redis
139
+    $ docker service ps redis
140 140
 
141 141
     ID                         NAME     SERVICE  IMAGE        LAST STATE              DESIRED STATE  NODE
142 142
     dos1zffgeofhagnve8w864fco  redis.1  redis    redis:3.0.7  Running 37 seconds      Running        worker1
... ...
@@ -13,7 +13,7 @@ weight=18
13 13
 # Scale the service in the swarm
14 14
 
15 15
 Once you have [deployed a service](deploy-service.md) to a swarm, you are ready
16
-to use the Docker CLI to scale the number of service tasks in
16
+to use the Docker CLI to scale the number of service ps in
17 17
 the swarm.
18 18
 
19 19
 1. If you haven't already, open a terminal and ssh into the machine where you
... ...
@@ -35,10 +35,10 @@ service running in the swarm:
35 35
     helloworld scaled to 5
36 36
     ```
37 37
 
38
-3. Run `docker service tasks <SERVICE-ID>` to see the updated task list:
38
+3. Run `docker service ps <SERVICE-ID>` to see the updated task list:
39 39
 
40 40
     ```
41
-    $ docker service tasks helloworld
41
+    $ docker service ps helloworld
42 42
 
43 43
     ID                         NAME          SERVICE     IMAGE   LAST STATE          DESIRED STATE  NODE
44 44
     8p1vev3fq5zm0mi8g0as41w35  helloworld.1  helloworld  alpine  Running 7 minutes   Running        worker2
... ...
@@ -20,7 +20,7 @@ func (s *DockerSwarmSuite) TestStackRemove(c *check.C) {
20 20
 func (s *DockerSwarmSuite) TestStackTasks(c *check.C) {
21 21
 	d := s.AddDaemon(c, true, true)
22 22
 
23
-	stackArgs := append([]string{"tasks", "UNKNOWN_STACK"})
23
+	stackArgs := append([]string{"ps", "UNKNOWN_STACK"})
24 24
 
25 25
 	out, err := d.Cmd("stack", stackArgs...)
26 26
 	c.Assert(err, checker.IsNil)
... ...
@@ -182,13 +182,13 @@ func (s *DockerSwarmSuite) TestSwarmNodeTaskListFilter(c *check.C) {
182 182
 
183 183
 	filter := "name=redis-cluster"
184 184
 
185
-	out, err = d.Cmd("node", "tasks", "--filter", filter, "self")
185
+	out, err = d.Cmd("node", "ps", "--filter", filter, "self")
186 186
 	c.Assert(err, checker.IsNil)
187 187
 	c.Assert(out, checker.Contains, name+".1")
188 188
 	c.Assert(out, checker.Contains, name+".2")
189 189
 	c.Assert(out, checker.Contains, name+".3")
190 190
 
191
-	out, err = d.Cmd("node", "tasks", "--filter", "name=none", "self")
191
+	out, err = d.Cmd("node", "ps", "--filter", "name=none", "self")
192 192
 	c.Assert(err, checker.IsNil)
193 193
 	c.Assert(out, checker.Not(checker.Contains), name+".1")
194 194
 	c.Assert(out, checker.Not(checker.Contains), name+".2")