github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/website/pages/docs/commands/job/inspect.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: 'Commands: job inspect'
     4  sidebar_title: inspect
     5  description: |
     6    The job inspect command is used to inspect a submitted job.
     7  ---
     8  
     9  # Command: job inspect
    10  
    11  **Alias: `nomad inspect`**
    12  
    13  The `job inspect` command is used to inspect the content of a submitted job.
    14  
    15  ## Usage
    16  
    17  ```plaintext
    18  nomad job inspect [options] <job>
    19  ```
    20  
    21  The `job inspect` command requires a single argument, a submitted job's name, and
    22  will retrieve the JSON version of the job. This JSON is valid to be submitted to
    23  the [Job HTTP API]. This command is useful to inspect what version of a job
    24  Nomad is running.
    25  
    26  ## General Options
    27  
    28  @include 'general_options.mdx'
    29  
    30  ## Inspect Options
    31  
    32  - `-version`: Display only the job at the given job version.
    33  - `-json` : Output the job in its JSON format.
    34  - `-t` : Format and display the job using a Go template.
    35  
    36  ## Examples
    37  
    38  Inspect a submitted job:
    39  
    40  ```shell-sessionnomad job inspect redis
    41  {
    42      "Job": {
    43          "Region": "global",
    44          "ID": "redis
    45          "Name": "redis
    46          "Type": "service",
    47          "Priority": 50,
    48          "AllAtOnce": false,
    49          "Datacenters": [
    50              "dc1"
    51          ],
    52          "Constraints": [
    53              {
    54                  "LTarget": "${attr.kernel.name}",
    55                  "RTarget": "linux",
    56                  "Operand": "="
    57              }
    58          ],
    59          "TaskGroups": [
    60              {
    61                  "Name": "cache",
    62                  "Count": 1,
    63                  "Constraints": null,
    64                  "Tasks": [
    65                      {
    66                          "Name": "redis",
    67                          "Driver": "docker",
    68                          "User": "",
    69                          "Config": {
    70                              "image": "redis:latest",
    71                              "port_map": [
    72                                  {
    73                                      "db": 6379
    74                                  }
    75                              ]
    76                          },
    77                          "Constraints": null,
    78                          "Env": null,
    79                          "Services": [
    80                              {
    81                                  "Id": "",
    82                                  "Name": "cache-redis",
    83                                  "Tags": [
    84                                      "global",
    85                                      "cache"
    86                                  ],
    87                                  "PortLabel": "db",
    88                                  "Checks": [
    89                                      {
    90                                          "Id": "",
    91                                          "Name": "alive",
    92                                          "Type": "tcp",
    93                                          "Command": "",
    94                                          "Args": null,
    95                                          "Path": "",
    96                                          "Protocol": "",
    97                                          "Interval": 10000000000,
    98                                          "Timeout": 2000000000
    99                                      }
   100                                  ]
   101                              }
   102                          ],
   103                          "Resources": {
   104                              "CPU": 500,
   105                              "MemoryMB": 256,
   106                              "DiskMB": 300,
   107                              "Networks": [
   108                                  {
   109                                      "Public": false,
   110                                      "CIDR": "",
   111                                      "ReservedPorts": null,
   112                                      "DynamicPorts": [
   113                                          {
   114                                              "Label": "db",
   115                                              "Value": 0
   116                                          }
   117                                      ],
   118                                      "IP": "",
   119                                      "MBits": 10
   120                                  }
   121                              ]
   122                          },
   123                          "Meta": null,
   124                          "KillTimeout": 5000000000,
   125                          "LogConfig": {
   126                              "MaxFiles": 10,
   127                              "MaxFileSizeMB": 10
   128                          },
   129                          "Artifacts": null
   130                      }
   131                  ],
   132                  "RestartPolicy": {
   133                      "Interval": 300000000000,
   134                      "Attempts": 10,
   135                      "Delay": 25000000000,
   136                      "Mode": "delay"
   137                  },
   138                  "Meta": null
   139              }
   140          ],
   141          "Update": {
   142              "Stagger": 10000000000,
   143              "MaxParallel": 1
   144          },
   145          "Periodic": null,
   146          "Meta": null,
   147          "Status": "running",
   148          "StatusDescription": "",
   149          "CreateIndex": 5,
   150          "ModifyIndex": 7
   151      }
   152  }
   153  ```
   154  
   155  [job http api]: /api-docs/jobs