|
| 1 | +<!--[metadata]> |
| 2 | ++++ |
| 3 | +title = "node inspect" |
| 4 | +description = "The node inspect command description and usage" |
| 5 | +keywords = ["node, inspect"] |
| 6 | +[menu.main] |
| 7 | +parent = "smn_cli" |
| 8 | ++++ |
| 9 | +<![end-metadata]--> |
| 10 | + |
| 11 | +**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. |
| 12 | + |
| 13 | +# node inspect |
| 14 | + |
| 15 | + Usage: docker node inspect [OPTIONS] self|NODE [NODE...] |
| 16 | + |
| 17 | + Return low-level information on a volume |
| 18 | + |
| 19 | + -f, --format= Format the output using the given go template. |
| 20 | + --help Print usage |
| 21 | + -p, --pretty Print the information in a human friendly format. |
| 22 | + |
| 23 | +Returns information about a node. By default, this command renders all results |
| 24 | +in a JSON array. You can specify an alternate format to execute a |
| 25 | +given template for each result. Go's |
| 26 | +[text/template](http://golang.org/pkg/text/template/) package describes all the |
| 27 | +details of the format. |
| 28 | + |
| 29 | +Example output: |
| 30 | + |
| 31 | + $ docker node inspect swarm-manager |
| 32 | + [ |
| 33 | + { |
| 34 | + "ID": "0gac67oclbxq7", |
| 35 | + "Version": { |
| 36 | + "Index": 2028 |
| 37 | + }, |
| 38 | + "CreatedAt": "2016-06-06T20:49:32.720047494Z", |
| 39 | + "UpdatedAt": "2016-06-07T00:23:31.207632893Z", |
| 40 | + "Spec": { |
| 41 | + "Role": "MANAGER", |
| 42 | + "Membership": "ACCEPTED", |
| 43 | + "Availability": "ACTIVE" |
| 44 | + }, |
| 45 | + "Description": { |
| 46 | + "Hostname": "swarm-manager", |
| 47 | + "Platform": { |
| 48 | + "Architecture": "x86_64", |
| 49 | + "OS": "linux" |
| 50 | + }, |
| 51 | + "Resources": { |
| 52 | + "NanoCPUs": 1000000000, |
| 53 | + "MemoryBytes": 1044250624 |
| 54 | + }, |
| 55 | + "Engine": { |
| 56 | + "EngineVersion": "1.12.0", |
| 57 | + "Labels": { |
| 58 | + "provider": "virtualbox" |
| 59 | + } |
| 60 | + } |
| 61 | + }, |
| 62 | + "Status": { |
| 63 | + "State": "READY" |
| 64 | + }, |
| 65 | + "Manager": { |
| 66 | + "Raft": { |
| 67 | + "RaftID": 2143745093569717375, |
| 68 | + "Addr": "192.168.99.118:4500", |
| 69 | + "Status": { |
| 70 | + "Leader": true, |
| 71 | + "Reachability": "REACHABLE" |
| 72 | + } |
| 73 | + } |
| 74 | + }, |
| 75 | + "Attachment": {}, |
| 76 | + } |
| 77 | + ] |
| 78 | + |
| 79 | + $ docker node inspect --format '{{ .Manager.Raft.Status.Leader }}' self |
| 80 | + false |
| 81 | + |
| 82 | + $ docker node inspect --pretty self |
| 83 | + ID: 2otfhz83efcc7 |
| 84 | + Hostname: ad960a848573 |
| 85 | + Status: |
| 86 | + State: Ready |
| 87 | + Availability: Active |
| 88 | + Manager Status: |
| 89 | + Address: 172.17.0.2:2377 |
| 90 | + Raft status: Reachable |
| 91 | + Leader: Yes |
| 92 | + Platform: |
| 93 | + Operating System: linux |
| 94 | + Architecture: x86_64 |
| 95 | + Resources: |
| 96 | + CPUs: 4 |
| 97 | + Memory: 7.704 GiB |
| 98 | + Plugins: |
| 99 | + Network: overlay, bridge, null, host, overlay |
| 100 | + Volume: local |
| 101 | + Engine Version: 1.12.0 |
| 102 | + |
| 103 | +## Related information |
| 104 | + |
| 105 | +* [node update](node_update.md) |
| 106 | +* [node tasks](node_tasks.md) |
| 107 | +* [node ls](node_ls.md) |
| 108 | +* [node rm](node_rm.md) |
0 commit comments