github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/cli/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  # node inspect
     8  
     9  ```markdown
    10  Usage:  docker node inspect [OPTIONS] self|NODE [NODE...]
    11  
    12  Display detailed information on one or more nodes
    13  
    14  Options:
    15    -f, --format string   Format the output using the given Go template
    16        --help            Print usage
    17        --pretty          Print the information in a human friendly format
    18  ```
    19  
    20  ## Description
    21  
    22  Returns information about a node. By default, this command renders all results
    23  in a JSON array. You can specify an alternate format to execute a
    24  given template for each result. Go's
    25  [text/template](http://golang.org/pkg/text/template/) package describes all the
    26  details of the format.
    27  
    28  > **Note**
    29  >
    30  > This is a cluster management command, and must be executed on a swarm
    31  > manager node. To learn about managers and workers, refer to the
    32  > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the
    33  > documentation.
    34  
    35  ## Examples
    36  
    37  ### Inspect a node
    38  
    39  ```bash
    40  $ docker node inspect swarm-manager
    41  ```
    42  
    43  ```json
    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  ```bash
   117  $ docker node inspect --format '{{ .ManagerStatus.Leader }}' self
   118  
   119  false
   120  ```
   121  
   122  Use `--format=pretty` or the `--pretty` shorthand to pretty-print the output:
   123  
   124  ```bash
   125  $ docker node inspect --format=pretty self
   126  
   127  ID:                     e216jshn25ckzbvmwlnh5jr3g
   128  Hostname:               swarm-manager
   129  Joined at:              2017-05-16 22:52:44.9910662 +0000 utc
   130  Status:
   131   State:                 Ready
   132   Availability:          Active
   133   Address:               172.17.0.2
   134  Manager Status:
   135   Address:               172.17.0.2:2377
   136   Raft Status:           Reachable
   137   Leader:                Yes
   138  Platform:
   139   Operating System:      linux
   140   Architecture:          x86_64
   141  Resources:
   142   CPUs:                  4
   143   Memory:                7.704 GiB
   144  Plugins:
   145    Network:              overlay, bridge, null, host, overlay
   146    Volume:               local
   147  Engine Version:         17.06.0-ce
   148  TLS Info:
   149   TrustRoot:
   150  -----BEGIN CERTIFICATE-----
   151  MIIBazCCARCgAwIBAgIUOzgqU4tA2q5Yv1HnkzhSIwGyIBswCgYIKoZIzj0EAwIw
   152  EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNTAyMDAyNDAwWhcNMzcwNDI3MDAy
   153  NDAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH
   154  A0IABMbiAmET+HZyve35ujrnL2kOLBEQhFDZ5MhxAuYs96n796sFlfxTxC1lM/2g
   155  Ah8DI34pm3JmHgZxeBPKUURJHKWjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB
   156  Af8EBTADAQH/MB0GA1UdDgQWBBS3sjTJOcXdkls6WSY2rTx1KIJueTAKBggqhkjO
   157  PQQDAgNJADBGAiEAoeVWkaXgSUAucQmZ3Yhmx22N/cq1EPBgYHOBZmHt0NkCIQC3
   158  zONcJ/+WA21OXtb+vcijpUOXtNjyHfcox0N8wsLDqQ==
   159  -----END CERTIFICATE-----
   160  
   161   Issuer Public Key: MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExuICYRP4dnK97fm6OucvaQ4sERCEUNnkyHEC5iz3qfv3qwWV/FPELWUz/aACHwMjfimbcmYeBnF4E8pRREkcpQ==
   162   Issuer Subject:    MBMxETAPBgNVBAMTCHN3YXJtLWNh
   163  ```
   164  
   165  ## Related commands
   166  
   167  * [node demote](node_demote.md)
   168  * [node ls](node_ls.md)
   169  * [node promote](node_promote.md)
   170  * [node ps](node_ps.md)
   171  * [node rm](node_rm.md)
   172  * [node update](node_update.md)