...

Text file src/github.com/docker/cli/docs/reference/commandline/node_inspect.md

Documentation: github.com/docker/cli/docs/reference/commandline

     1# node inspect
     2
     3<!---MARKER_GEN_START-->
     4Display detailed information on one or more nodes
     5
     6### Options
     7
     8| Name                                   | Type     | Default | Description                                                                                                                                                                                                                                                        |
     9|:---------------------------------------|:---------|:--------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
    10| [`-f`](#format), [`--format`](#format) | `string` |         | Format output using a custom template:<br>'json':             Print in JSON format<br>'TEMPLATE':         Print output using the given Go template.<br>Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates |
    11| `--pretty`                             |          |         | Print the information in a human friendly format                                                                                                                                                                                                                   |
    12
    13
    14<!---MARKER_GEN_END-->
    15
    16## Description
    17
    18Returns information about a node. By default, this command renders all results
    19in a JSON array. You can specify an alternate format to execute a
    20given template for each result. Go's
    21[text/template](https://pkg.go.dev/text/template) package describes all the
    22details of the format.
    23
    24> **Note**
    25>
    26> This is a cluster management command, and must be executed on a swarm
    27> manager node. To learn about managers and workers, refer to the
    28> [Swarm mode section](https://docs.docker.com/engine/swarm/) in the
    29> documentation.
    30
    31## Examples
    32
    33### Inspect a node
    34
    35```console
    36$ docker node inspect swarm-manager
    37```
    38
    39```json
    40[
    41  {
    42    "ID": "e216jshn25ckzbvmwlnh5jr3g",
    43    "Version": {
    44      "Index": 10
    45    },
    46    "CreatedAt": "2017-05-16T22:52:44.9910662Z",
    47    "UpdatedAt": "2017-05-16T22:52:45.230878043Z",
    48    "Spec": {
    49      "Role": "manager",
    50      "Availability": "active"
    51    },
    52    "Description": {
    53      "Hostname": "swarm-manager",
    54      "Platform": {
    55        "Architecture": "x86_64",
    56        "OS": "linux"
    57      },
    58      "Resources": {
    59        "NanoCPUs": 1000000000,
    60        "MemoryBytes": 1039843328
    61      },
    62      "Engine": {
    63        "EngineVersion": "17.06.0-ce",
    64        "Plugins": [
    65          {
    66            "Type": "Volume",
    67            "Name": "local"
    68          },
    69          {
    70            "Type": "Network",
    71            "Name": "overlay"
    72          },
    73          {
    74            "Type": "Network",
    75            "Name": "null"
    76          },
    77          {
    78            "Type": "Network",
    79            "Name": "host"
    80          },
    81          {
    82            "Type": "Network",
    83            "Name": "bridge"
    84          },
    85          {
    86            "Type": "Network",
    87            "Name": "overlay"
    88          }
    89        ]
    90      },
    91      "TLSInfo": {
    92        "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBazCCARCgAwIBAgIUOzgqU4tA2q5Yv1HnkzhSIwGyIBswCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNTAyMDAyNDAwWhcNMzcwNDI3MDAy\nNDAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABMbiAmET+HZyve35ujrnL2kOLBEQhFDZ5MhxAuYs96n796sFlfxTxC1lM/2g\nAh8DI34pm3JmHgZxeBPKUURJHKWjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBS3sjTJOcXdkls6WSY2rTx1KIJueTAKBggqhkjO\nPQQDAgNJADBGAiEAoeVWkaXgSUAucQmZ3Yhmx22N/cq1EPBgYHOBZmHt0NkCIQC3\nzONcJ/+WA21OXtb+vcijpUOXtNjyHfcox0N8wsLDqQ==\n-----END CERTIFICATE-----\n",
    93        "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh",
    94        "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExuICYRP4dnK97fm6OucvaQ4sERCEUNnkyHEC5iz3qfv3qwWV/FPELWUz/aACHwMjfimbcmYeBnF4E8pRREkcpQ=="
    95      }
    96    },
    97    "Status": {
    98      "State": "ready",
    99      "Addr": "168.0.32.137"
   100    },
   101    "ManagerStatus": {
   102      "Leader": true,
   103      "Reachability": "reachable",
   104      "Addr": "168.0.32.137:2377"
   105    }
   106  }
   107]
   108```
   109
   110### <a name="format"></a> Format the output (--format)
   111
   112```console
   113$ docker node inspect --format '{{ .ManagerStatus.Leader }}' self
   114
   115false
   116```
   117
   118Use `--format=pretty` or the `--pretty` shorthand to pretty-print the output:
   119
   120```console
   121$ docker node inspect --format=pretty self
   122
   123ID:                     e216jshn25ckzbvmwlnh5jr3g
   124Hostname:               swarm-manager
   125Joined at:              2017-05-16 22:52:44.9910662 +0000 utc
   126Status:
   127 State:                 Ready
   128 Availability:          Active
   129 Address:               172.17.0.2
   130Manager Status:
   131 Address:               172.17.0.2:2377
   132 Raft Status:           Reachable
   133 Leader:                Yes
   134Platform:
   135 Operating System:      linux
   136 Architecture:          x86_64
   137Resources:
   138 CPUs:                  4
   139 Memory:                7.704 GiB
   140Plugins:
   141  Network:              overlay, bridge, null, host, overlay
   142  Volume:               local
   143Engine Version:         17.06.0-ce
   144TLS Info:
   145 TrustRoot:
   146-----BEGIN CERTIFICATE-----
   147MIIBazCCARCgAwIBAgIUOzgqU4tA2q5Yv1HnkzhSIwGyIBswCgYIKoZIzj0EAwIw
   148EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNTAyMDAyNDAwWhcNMzcwNDI3MDAy
   149NDAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH
   150A0IABMbiAmET+HZyve35ujrnL2kOLBEQhFDZ5MhxAuYs96n796sFlfxTxC1lM/2g
   151Ah8DI34pm3JmHgZxeBPKUURJHKWjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB
   152Af8EBTADAQH/MB0GA1UdDgQWBBS3sjTJOcXdkls6WSY2rTx1KIJueTAKBggqhkjO
   153PQQDAgNJADBGAiEAoeVWkaXgSUAucQmZ3Yhmx22N/cq1EPBgYHOBZmHt0NkCIQC3
   154zONcJ/+WA21OXtb+vcijpUOXtNjyHfcox0N8wsLDqQ==
   155-----END CERTIFICATE-----
   156
   157 Issuer Public Key: MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExuICYRP4dnK97fm6OucvaQ4sERCEUNnkyHEC5iz3qfv3qwWV/FPELWUz/aACHwMjfimbcmYeBnF4E8pRREkcpQ==
   158 Issuer Subject:    MBMxETAPBgNVBAMTCHN3YXJtLWNh
   159```
   160
   161## Related commands
   162
   163* [node demote](node_demote.md)
   164* [node ls](node_ls.md)
   165* [node promote](node_promote.md)
   166* [node ps](node_ps.md)
   167* [node rm](node_rm.md)
   168* [node update](node_update.md)

View as plain text