mirror of https://github.com/docker/cli.git
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>
This commit is contained in:
parent
6895b9f339
commit
9d114f0fae
|
@ -1573,7 +1573,7 @@ _docker_service() {
|
||||||
ls list
|
ls list
|
||||||
rm remove
|
rm remove
|
||||||
scale
|
scale
|
||||||
tasks
|
ps
|
||||||
update
|
update
|
||||||
"
|
"
|
||||||
__docker_subcommands "$subcommands" && return
|
__docker_subcommands "$subcommands" && return
|
||||||
|
@ -1667,7 +1667,7 @@ _docker_service_scale() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
_docker_service_tasks() {
|
_docker_service_ps() {
|
||||||
local key=$(__docker_map_key_of_current_option '--filter|-f')
|
local key=$(__docker_map_key_of_current_option '--filter|-f')
|
||||||
case "$key" in
|
case "$key" in
|
||||||
desired-state)
|
desired-state)
|
||||||
|
@ -1929,7 +1929,7 @@ _docker_node() {
|
||||||
ls list
|
ls list
|
||||||
promote
|
promote
|
||||||
rm remove
|
rm remove
|
||||||
tasks
|
ps
|
||||||
update
|
update
|
||||||
"
|
"
|
||||||
__docker_subcommands "$subcommands" && return
|
__docker_subcommands "$subcommands" && return
|
||||||
|
@ -2026,7 +2026,7 @@ _docker_node_rm() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
_docker_node_tasks() {
|
_docker_node_ps() {
|
||||||
local key=$(__docker_map_key_of_current_option '--filter|-f')
|
local key=$(__docker_map_key_of_current_option '--filter|-f')
|
||||||
case "$key" in
|
case "$key" in
|
||||||
desired-state)
|
desired-state)
|
||||||
|
|
|
@ -683,7 +683,7 @@ __docker_node_complete_ls_filters() {
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
__docker_node_complete_tasks_filters() {
|
__docker_node_complete_ps_filters() {
|
||||||
[[ $PREFIX = -* ]] && return 1
|
[[ $PREFIX = -* ]] && return 1
|
||||||
integer ret=1
|
integer ret=1
|
||||||
|
|
||||||
|
@ -787,7 +787,7 @@ __docker_node_commands() {
|
||||||
"ls:List nodes in the swarm"
|
"ls:List nodes in the swarm"
|
||||||
"promote:Promote a node as manager in the swarm"
|
"promote:Promote a node as manager in the swarm"
|
||||||
"rm:Remove a node from the swarm"
|
"rm:Remove a node from the swarm"
|
||||||
"tasks:List tasks running on a node"
|
"ps:List tasks running on a node"
|
||||||
"update:Update a node"
|
"update:Update a node"
|
||||||
)
|
)
|
||||||
_describe -t docker-node-commands "docker node command" _docker_node_subcommands
|
_describe -t docker-node-commands "docker node command" _docker_node_subcommands
|
||||||
|
@ -834,7 +834,7 @@ __docker_node_subcommand() {
|
||||||
$opts_help \
|
$opts_help \
|
||||||
"($help -)*:node:__docker_complete_worker_nodes" && ret=0
|
"($help -)*:node:__docker_complete_worker_nodes" && ret=0
|
||||||
;;
|
;;
|
||||||
(tasks)
|
(ps)
|
||||||
_arguments $(__docker_arguments) \
|
_arguments $(__docker_arguments) \
|
||||||
$opts_help \
|
$opts_help \
|
||||||
"($help -a --all)"{-a,--all}"[Display all instances]" \
|
"($help -a --all)"{-a,--all}"[Display all instances]" \
|
||||||
|
@ -843,7 +843,7 @@ __docker_node_subcommand() {
|
||||||
"($help -)1:node:__docker_complete_nodes" && ret=0
|
"($help -)1:node:__docker_complete_nodes" && ret=0
|
||||||
case $state in
|
case $state in
|
||||||
(filter-options)
|
(filter-options)
|
||||||
__docker_node_complete_tasks_filters && ret=0
|
__docker_node_complete_ps_filters && ret=0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
@ -970,7 +970,7 @@ __docker_service_complete_ls_filters() {
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
__docker_service_complete_tasks_filters() {
|
__docker_service_complete_ps_filters() {
|
||||||
[[ $PREFIX = -* ]] && return 1
|
[[ $PREFIX = -* ]] && return 1
|
||||||
integer ret=1
|
integer ret=1
|
||||||
|
|
||||||
|
@ -1060,7 +1060,7 @@ __docker_service_commands() {
|
||||||
"ls:List services"
|
"ls:List services"
|
||||||
"rm:Remove a service"
|
"rm:Remove a service"
|
||||||
"scale:Scale one or multiple services"
|
"scale:Scale one or multiple services"
|
||||||
"tasks:List the tasks of a service"
|
"ps:List the tasks of a service"
|
||||||
"update:Update a service"
|
"update:Update a service"
|
||||||
)
|
)
|
||||||
_describe -t docker-service-commands "docker service command" _docker_service_subcommands
|
_describe -t docker-service-commands "docker service command" _docker_service_subcommands
|
||||||
|
@ -1148,7 +1148,7 @@ __docker_service_subcommand() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
(tasks)
|
(ps)
|
||||||
_arguments $(__docker_arguments) \
|
_arguments $(__docker_arguments) \
|
||||||
$opts_help \
|
$opts_help \
|
||||||
"($help -a --all)"{-a,--all}"[Display all tasks]" \
|
"($help -a --all)"{-a,--all}"[Display all tasks]" \
|
||||||
|
@ -1157,7 +1157,7 @@ __docker_service_subcommand() {
|
||||||
"($help -)1:service:__docker_complete_services" && ret=0
|
"($help -)1:service:__docker_complete_services" && ret=0
|
||||||
case $state in
|
case $state in
|
||||||
(filter-options)
|
(filter-options)
|
||||||
__docker_service_complete_tasks_filters && ret=0
|
__docker_service_complete_ps_filters && ret=0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -115,7 +115,7 @@ read the [`dockerd`](dockerd.md) reference page.
|
||||||
| [node demote](node_demote.md) | Demotes an existing manager so that it is no longer a manager |
|
| [node demote](node_demote.md) | Demotes an existing manager so that it is no longer a manager |
|
||||||
| [node inspect](node_inspect.md) | Inspect a node in the swarm |
|
| [node inspect](node_inspect.md) | Inspect a node in the swarm |
|
||||||
| [node update](node_update.md) | Update attributes for a node |
|
| [node update](node_update.md) | Update attributes for a node |
|
||||||
| [node tasks](node_tasks.md) | List tasks running on a node |
|
| [node ps](node_ps.md) | List tasks running on a node |
|
||||||
| [node ls](node_ls.md) | List nodes in the swarm |
|
| [node ls](node_ls.md) | List nodes in the swarm |
|
||||||
| [node rm](node_rm.md) | Remove a node from the swarm |
|
| [node rm](node_rm.md) | Remove a node from the swarm |
|
||||||
|
|
||||||
|
@ -138,5 +138,5 @@ read the [`dockerd`](dockerd.md) reference page.
|
||||||
| [service ls](service_ls.md) | List services in the swarm |
|
| [service ls](service_ls.md) | List services in the swarm |
|
||||||
| [service rm](service_rm.md) | Reemove a swervice from the swarm |
|
| [service rm](service_rm.md) | Reemove a swervice from the swarm |
|
||||||
| [service scale](service_scale.md) | Set the number of replicas for the desired state of the service |
|
| [service scale](service_scale.md) | Set the number of replicas for the desired state of the service |
|
||||||
| [service tasks](service_tasks.md) | List the tasks of a service |
|
| [service ps](service_ps.md) | List the tasks of a service |
|
||||||
| [service update](service_update.md) | Update the attributes of a service |
|
| [service update](service_update.md) | Update the attributes of a service |
|
||||||
|
|
|
@ -120,6 +120,6 @@ Example output:
|
||||||
## Related information
|
## Related information
|
||||||
|
|
||||||
* [node update](node_update.md)
|
* [node update](node_update.md)
|
||||||
* [node tasks](node_tasks.md)
|
* [node ps](node_ps.md)
|
||||||
* [node ls](node_ls.md)
|
* [node ls](node_ls.md)
|
||||||
* [node rm](node_rm.md)
|
* [node rm](node_rm.md)
|
||||||
|
|
|
@ -91,5 +91,5 @@ ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
|
||||||
|
|
||||||
* [node inspect](node_inspect.md)
|
* [node inspect](node_inspect.md)
|
||||||
* [node update](node_update.md)
|
* [node update](node_update.md)
|
||||||
* [node tasks](node_tasks.md)
|
* [node ps](node_ps.md)
|
||||||
* [node rm](node_rm.md)
|
* [node rm](node_rm.md)
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
<!--[metadata]>
|
<!--[metadata]>
|
||||||
+++
|
+++
|
||||||
title = "node tasks"
|
title = "node ps"
|
||||||
description = "The node tasks command description and usage"
|
description = "The node ps command description and usage"
|
||||||
keywords = ["node, tasks"]
|
keywords = ["node, tasks", "ps"]
|
||||||
|
aliases = ["/engine/reference/commandline/node_tasks/"]
|
||||||
[menu.main]
|
[menu.main]
|
||||||
parent = "smn_cli"
|
parent = "smn_cli"
|
||||||
+++
|
+++
|
||||||
<![end-metadata]-->
|
<![end-metadata]-->
|
||||||
|
|
||||||
# node tasks
|
# node ps
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
Usage: docker node tasks [OPTIONS] self|NODE
|
Usage: docker node ps [OPTIONS] self|NODE
|
||||||
|
|
||||||
List tasks running on a node
|
List tasks running on a node
|
||||||
|
|
||||||
|
@ -26,7 +27,7 @@ Lists all the tasks on a Node that Docker knows about. You can filter using the
|
||||||
|
|
||||||
Example output:
|
Example output:
|
||||||
|
|
||||||
$ docker node tasks swarm-manager1
|
$ docker node ps swarm-manager1
|
||||||
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
|
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
|
||||||
7q92v0nr1hcgts2amcjyqg3pq redis.1 redis redis:3.0.6 Running 5 hours Running swarm-manager1
|
7q92v0nr1hcgts2amcjyqg3pq redis.1 redis redis:3.0.6 Running 5 hours Running swarm-manager1
|
||||||
b465edgho06e318egmgjbqo4o redis.6 redis redis:3.0.6 Running 29 seconds Running swarm-manager1
|
b465edgho06e318egmgjbqo4o redis.6 redis redis:3.0.6 Running 29 seconds Running swarm-manager1
|
||||||
|
@ -53,7 +54,7 @@ The `name` filter matches on all or part of a task's name.
|
||||||
|
|
||||||
The following filter matches all tasks with a name containing the `redis` string.
|
The following filter matches all tasks with a name containing the `redis` string.
|
||||||
|
|
||||||
$ docker node tasks -f name=redis swarm-manager1
|
$ docker node ps -f name=redis swarm-manager1
|
||||||
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
|
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
|
||||||
7q92v0nr1hcgts2amcjyqg3pq redis.1 redis redis:3.0.6 Running 5 hours Running swarm-manager1
|
7q92v0nr1hcgts2amcjyqg3pq redis.1 redis redis:3.0.6 Running 5 hours Running swarm-manager1
|
||||||
b465edgho06e318egmgjbqo4o redis.6 redis redis:3.0.6 Running 29 seconds Running swarm-manager1
|
b465edgho06e318egmgjbqo4o redis.6 redis redis:3.0.6 Running 29 seconds Running swarm-manager1
|
||||||
|
@ -66,7 +67,7 @@ The following filter matches all tasks with a name containing the `redis` string
|
||||||
|
|
||||||
The `id` filter matches a task's id.
|
The `id` filter matches a task's id.
|
||||||
|
|
||||||
$ docker node tasks -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1
|
$ docker node ps -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1
|
||||||
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
|
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
|
||||||
bg8c07zzg87di2mufeq51a2qp redis.7 redis redis:3.0.6 Running 5 seconds Running swarm-manager1
|
bg8c07zzg87di2mufeq51a2qp redis.7 redis redis:3.0.6 Running 5 seconds Running swarm-manager1
|
||||||
|
|
||||||
|
@ -79,7 +80,7 @@ value.
|
||||||
The following filter matches tasks with the `usage` label regardless of its value.
|
The following filter matches tasks with the `usage` label regardless of its value.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ docker node tasks -f "label=usage"
|
$ docker node ps -f "label=usage"
|
||||||
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
|
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
|
||||||
b465edgho06e318egmgjbqo4o redis.6 redis redis:3.0.6 Running 10 minutes Running swarm-manager1
|
b465edgho06e318egmgjbqo4o redis.6 redis redis:3.0.6 Running 10 minutes Running swarm-manager1
|
||||||
bg8c07zzg87di2mufeq51a2qp redis.7 redis redis:3.0.6 Running 9 minutes Running swarm-manager1
|
bg8c07zzg87di2mufeq51a2qp redis.7 redis redis:3.0.6 Running 9 minutes Running swarm-manager1
|
|
@ -35,5 +35,5 @@ Example output:
|
||||||
|
|
||||||
* [node inspect](node_inspect.md)
|
* [node inspect](node_inspect.md)
|
||||||
* [node update](node_update.md)
|
* [node update](node_update.md)
|
||||||
* [node tasks](node_tasks.md)
|
* [node ps](node_ps.md)
|
||||||
* [node ls](node_ls.md)
|
* [node ls](node_ls.md)
|
||||||
|
|
|
@ -59,6 +59,6 @@ metadata](../../userguide/labels-custom-metadata.md).
|
||||||
## Related information
|
## Related information
|
||||||
|
|
||||||
* [node inspect](node_inspect.md)
|
* [node inspect](node_inspect.md)
|
||||||
* [node tasks](node_tasks.md)
|
* [node ps](node_ps.md)
|
||||||
* [node ls](node_ls.md)
|
* [node ls](node_ls.md)
|
||||||
* [node rm](node_rm.md)
|
* [node rm](node_rm.md)
|
||||||
|
|
|
@ -183,5 +183,5 @@ $ docker service create \
|
||||||
* [service ls](service_ls.md)
|
* [service ls](service_ls.md)
|
||||||
* [service rm](service_rm.md)
|
* [service rm](service_rm.md)
|
||||||
* [service scale](service_scale.md)
|
* [service scale](service_scale.md)
|
||||||
* [service tasks](service_tasks.md)
|
* [service ps](service_ps.md)
|
||||||
* [service update](service_update.md)
|
* [service update](service_update.md)
|
||||||
|
|
|
@ -149,5 +149,5 @@ $ docker service inspect --format='{{.Spec.Mode.Replicated.Replicas}}' redis
|
||||||
* [service ls](service_ls.md)
|
* [service ls](service_ls.md)
|
||||||
* [service rm](service_rm.md)
|
* [service rm](service_rm.md)
|
||||||
* [service scale](service_scale.md)
|
* [service scale](service_scale.md)
|
||||||
* [service tasks](service_tasks.md)
|
* [service ps](service_ps.md)
|
||||||
* [service update](service_update.md)
|
* [service update](service_update.md)
|
||||||
|
|
|
@ -104,5 +104,5 @@ ID NAME REPLICAS IMAGE COMMAND
|
||||||
* [service inspect](service_inspect.md)
|
* [service inspect](service_inspect.md)
|
||||||
* [service rm](service_rm.md)
|
* [service rm](service_rm.md)
|
||||||
* [service scale](service_scale.md)
|
* [service scale](service_scale.md)
|
||||||
* [service tasks](service_tasks.md)
|
* [service ps](service_ps.md)
|
||||||
* [service update](service_update.md)
|
* [service update](service_update.md)
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
<!--[metadata]>
|
<!--[metadata]>
|
||||||
+++
|
+++
|
||||||
title = "service tasks"
|
title = "service ps"
|
||||||
description = "The service tasks command description and usage"
|
description = "The service ps command description and usage"
|
||||||
keywords = ["service, tasks"]
|
keywords = ["service, tasks", "ps"]
|
||||||
|
aliases = ["/engine/reference/commandline/service_tasks/"]
|
||||||
[menu.main]
|
[menu.main]
|
||||||
parent = "smn_cli"
|
parent = "smn_cli"
|
||||||
+++
|
+++
|
||||||
<![end-metadata]-->
|
<![end-metadata]-->
|
||||||
|
|
||||||
# service tasks
|
# service ps
|
||||||
|
|
||||||
```Markdown
|
```Markdown
|
||||||
Usage: docker service tasks [OPTIONS] SERVICE
|
Usage: docker service ps [OPTIONS] SERVICE
|
||||||
|
|
||||||
List the tasks of a service
|
List the tasks of a service
|
||||||
|
|
||||||
|
@ -33,7 +34,7 @@ has to be run targeting a manager node.
|
||||||
The following command shows all the tasks that are part of the `redis` service:
|
The following command shows all the tasks that are part of the `redis` service:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ docker service tasks redis
|
$ docker service ps redis
|
||||||
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
|
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
|
||||||
0qihejybwf1x5vqi8lgzlgnpq redis.1 redis redis:3.0.6 Running 8 seconds Running manager1
|
0qihejybwf1x5vqi8lgzlgnpq redis.1 redis redis:3.0.6 Running 8 seconds Running manager1
|
||||||
bk658fpbex0d57cqcwoe3jthu redis.2 redis redis:3.0.6 Running 9 seconds Running worker2
|
bk658fpbex0d57cqcwoe3jthu redis.2 redis redis:3.0.6 Running 9 seconds Running worker2
|
||||||
|
@ -67,7 +68,7 @@ The currently supported filters are:
|
||||||
The `id` filter matches on all or a prefix of a task's ID.
|
The `id` filter matches on all or a prefix of a task's ID.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ docker service tasks -f "id=8" redis
|
$ docker service ps -f "id=8" redis
|
||||||
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
|
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
|
||||||
8ryt076polmclyihzx67zsssj redis.4 redis redis:3.0.6 Running 4 minutes Running worker1
|
8ryt076polmclyihzx67zsssj redis.4 redis redis:3.0.6 Running 4 minutes Running worker1
|
||||||
8eaxrb2fqpbnv9x30vr06i6vt redis.10 redis redis:3.0.6 Running 4 minutes Running manager1
|
8eaxrb2fqpbnv9x30vr06i6vt redis.10 redis redis:3.0.6 Running 4 minutes Running manager1
|
||||||
|
@ -78,7 +79,7 @@ ID NAME SERVICE IMAGE LAST STATE DE
|
||||||
The `name` filter matches on task names.
|
The `name` filter matches on task names.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ docker service tasks -f "name=redis.1" redis
|
$ docker service ps -f "name=redis.1" redis
|
||||||
ID NAME SERVICE IMAGE DESIRED STATE LAST STATE NODE
|
ID NAME SERVICE IMAGE DESIRED STATE LAST STATE NODE
|
||||||
0qihejybwf1x5vqi8lgzlgnpq redis.1 redis redis:3.0.6 Running Running 8 seconds manager1
|
0qihejybwf1x5vqi8lgzlgnpq redis.1 redis redis:3.0.6 Running Running 8 seconds manager1
|
||||||
```
|
```
|
|
@ -45,5 +45,5 @@ ID NAME SCALE IMAGE COMMAND
|
||||||
* [service inspect](service_inspect.md)
|
* [service inspect](service_inspect.md)
|
||||||
* [service ls](service_ls.md)
|
* [service ls](service_ls.md)
|
||||||
* [service scale](service_scale.md)
|
* [service scale](service_scale.md)
|
||||||
* [service tasks](service_tasks.md)
|
* [service ps](service_ps.md)
|
||||||
* [service update](service_update.md)
|
* [service update](service_update.md)
|
||||||
|
|
|
@ -74,5 +74,5 @@ ID NAME REPLICAS IMAGE COMMAND
|
||||||
* [service inspect](service_inspect.md)
|
* [service inspect](service_inspect.md)
|
||||||
* [service ls](service_ls.md)
|
* [service ls](service_ls.md)
|
||||||
* [service rm](service_rm.md)
|
* [service rm](service_rm.md)
|
||||||
* [service tasks](service_tasks.md)
|
* [service ps](service_ps.md)
|
||||||
* [service update](service_update.md)
|
* [service update](service_update.md)
|
||||||
|
|
|
@ -71,6 +71,6 @@ $ docker service update --limit-cpu 2 redis
|
||||||
|
|
||||||
* [service create](service_create.md)
|
* [service create](service_create.md)
|
||||||
* [service inspect](service_inspect.md)
|
* [service inspect](service_inspect.md)
|
||||||
* [service tasks](service_tasks.md)
|
* [service ps](service_ps.md)
|
||||||
* [service ls](service_ls.md)
|
* [service ls](service_ls.md)
|
||||||
* [service rm](service_rm.md)
|
* [service rm](service_rm.md)
|
||||||
|
|
Loading…
Reference in New Issue