update output for node commands, minor edits

Signed-off-by: Charles Smith <charles.smith@docker.com>
This commit is contained in:
Charles Smith 2016-06-16 21:28:07 -07:00 committed by Tibor Vass
parent 308888a8c6
commit a816f63e57
4 changed files with 84 additions and 62 deletions

View File

@ -30,17 +30,17 @@ Example output:
$ docker node inspect swarm-manager
[
{
"ID": "0gac67oclbxq7",
{
"ID": "e216jshn25ckzbvmwlnh5jr3g",
"Version": {
"Index": 2028
"Index": 10
},
"CreatedAt": "2016-06-06T20:49:32.720047494Z",
"UpdatedAt": "2016-06-07T00:23:31.207632893Z",
"CreatedAt": "2016-06-16T22:52:44.9910662Z",
"UpdatedAt": "2016-06-16T22:52:45.230878043Z",
"Spec": {
"Role": "MANAGER",
"Membership": "ACCEPTED",
"Availability": "ACTIVE"
"Role": "manager",
"Membership": "accepted",
"Availability": "active"
},
"Description": {
"Hostname": "swarm-manager",
@ -50,38 +50,55 @@ Example output:
},
"Resources": {
"NanoCPUs": 1000000000,
"MemoryBytes": 1044250624
"MemoryBytes": 1039843328
},
"Engine": {
"EngineVersion": "1.12.0",
"Labels": {
"provider": "virtualbox"
}
"Plugins": [
{
"Type": "Volume",
"Name": "local"
},
{
"Type": "Network",
"Name": "overlay"
},
{
"Type": "Network",
"Name": "null"
},
{
"Type": "Network",
"Name": "host"
},
{
"Type": "Network",
"Name": "bridge"
},
{
"Type": "Network",
"Name": "overlay"
}
]
}
},
"Status": {
"State": "READY"
"State": "ready"
},
"Manager": {
"Raft": {
"RaftID": 2143745093569717375,
"Addr": "192.168.99.118:4500",
"Status": {
"Leader": true,
"Reachability": "REACHABLE"
}
}
},
"Attachment": {},
}
"ManagerStatus": {
"Leader": true,
"Reachability": "reachable",
"Addr": "168.0.32.137:2377"
}
}
]
$ docker node inspect --format '{{ .Manager.Raft.Status.Leader }}' self
$ docker node inspect --format '{{ .ManagerStatus.Leader }}' self
false
$ docker node inspect --pretty self
ID: 2otfhz83efcc7
Hostname: ad960a848573
ID: e216jshn25ckzbvmwlnh5jr3g
Hostname: swarm-manager
Status:
State: Ready
Availability: Active

View File

@ -29,10 +29,10 @@ Lists all the nodes that the Docker Swarm manager knows about. You can filter us
Example output:
$ docker node ls
ID NAME STATUS AVAILABILITY MANAGER STATUS LEADER
0gac67oclbxq swarm-master Ready Active Reachable Yes
0pwvm3ve66q7 swarm-node-02 Ready Active
15xwihgw71aw * swarm-node-01 Ready Active Reachable
ID NAME MEMBERSHIP STATUS AVAILABILITY MANAGER STATUS LEADER
1bcef6utixb0l0ca7gxuivsj0 swarm-worker2 Accepted Ready Active
38ciaotwjuritcdtn9npbnkuz swarm-worker1 Accepted Ready Active
e216jshn25ckzbvmwlnh5jr3g * swarm-manager1 Accepted Ready Active Reachable Yes
## Filtering
@ -49,22 +49,21 @@ The currently supported filters are:
### name
The `name` filter matches on all or part of a tasks's name.
The `name` filter matches on all or part of a node name.
The following filter matches the node with a name equal to `swarm-master` string.
$ docker node ls -f name=swarm-master
ID NAME STATUS AVAILABILITY MANAGER STATUS LEADER
0gac67oclbxq * swarm-master Ready Active Reachable Yes
$ docker node ls -f name=swarm-manager1
ID NAME MEMBERSHIP STATUS AVAILABILITY MANAGER STATUS LEADER
e216jshn25ckzbvmwlnh5jr3g * swarm-manager1 Accepted Ready Active Reachable Yes
### id
The `id` filter matches all or part of a node's id.
$ docker node ls -f id=0
ID NAME STATUS AVAILABILITY MANAGER STATUS LEADER
0gac67oclbxq * swarm-master Ready Active Reachable Yes
0pwvm3ve66q7 swarm-node-02 Ready Active
$ docker node ls -f id=1
ID NAME MEMBERSHIP STATUS AVAILABILITY MANAGER STATUS LEADER
1bcef6utixb0l0ca7gxuivsj0 swarm-worker2 Accepted Ready Active
#### label
@ -76,8 +75,8 @@ The following filter matches nodes with the `usage` label regardless of its valu
```bash
$ docker node ls -f "label=foo"
ID NAME STATUS AVAILABILITY MANAGER STATUS LEADER
15xwihgw71aw * swarm-node-01 Ready Active Reachable
ID NAME MEMBERSHIP STATUS AVAILABILITY MANAGER STATUS LEADER
1bcef6utixb0l0ca7gxuivsj0 swarm-worker2 Accepted Ready Active
```

View File

@ -26,13 +26,13 @@ Lists all the tasks on a Node that Docker knows about. You can filter using the
Example output:
$ docker node tasks swarm-master
ID NAME SERVICE IMAGE DESIRED STATE LAST STATE NODE
dx2g0fe3zsdb6y6q453f8dqw2 redis.1 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master
f33pcf8lwhs4c1t4kq8szwzta redis.4 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master
5v26yzixl3one3ptjyqqbd0ro redis.5 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master
adcaphlhsfr30d47lby6walg6 redis.8 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master
chancjvk9tex6768uzzacslq2 redis.9 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master
$ docker node tasks swarm-manager1
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
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
bg8c07zzg87di2mufeq51a2qp redis.7 redis redis:3.0.6 Running 5 seconds Running swarm-manager1
dkkual96p4bb3s6b10r7coxxt redis.9 redis redis:3.0.6 Running 5 seconds Running swarm-manager1
0tgctg8h8cech4w0k0gwrmr23 redis.10 redis redis:3.0.6 Running 5 seconds Running swarm-manager1
## Filtering
@ -53,22 +53,22 @@ 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.
$ docker node tasks -f name=redis swarm-master
ID NAME SERVICE IMAGE DESIRED STATE LAST STATE NODE
dx2g0fe3zsdb6y6q453f8dqw2 redis.1 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master
f33pcf8lwhs4c1t4kq8szwzta redis.4 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master
5v26yzixl3one3ptjyqqbd0ro redis.5 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master
adcaphlhsfr30d47lby6walg6 redis.8 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master
chancjvk9tex6768uzzacslq2 redis.9 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master
$ docker node tasks -f name=redis swarm-manager1
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
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
bg8c07zzg87di2mufeq51a2qp redis.7 redis redis:3.0.6 Running 5 seconds Running swarm-manager1
dkkual96p4bb3s6b10r7coxxt redis.9 redis redis:3.0.6 Running 5 seconds Running swarm-manager1
0tgctg8h8cech4w0k0gwrmr23 redis.10 redis redis:3.0.6 Running 5 seconds Running swarm-manager1
### id
The `id` filter matches a task's id.
$ docker node tasks -f id=f33pcf8lwhs4c1t4kq8szwzta swarm-master
ID NAME SERVICE IMAGE DESIRED STATE LAST STATE NODE
f33pcf8lwhs4c1t4kq8szwzta redis.4 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master
$ docker node tasks -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
bg8c07zzg87di2mufeq51a2qp redis.7 redis redis:3.0.6 Running 5 seconds Running swarm-manager1
#### label
@ -80,9 +80,9 @@ The following filter matches tasks with the `usage` label regardless of its valu
```bash
$ docker node tasks -f "label=usage"
ID NAME SERVICE IMAGE DESIRED STATE LAST STATE NODE
dx2g0fe3zsdb6y6q453f8dqw2 redis.1 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master
f33pcf8lwhs4c1t4kq8szwzta redis.4 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
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
```

View File

@ -16,6 +16,12 @@ parent = "smn_cli"
Update a node
Options:
--availability string Availability of the node (active/pause/drain)
--help Print usage
--membership string Membership of the node (accepted/rejected)
--role string Role of the node (worker/manager)
## Related information