github.com/AliyunContainerService/cli@v0.0.0-20181009023821-814ced4b30d0/docs/reference/commandline/node_inspect.md (about)

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