github.com/adityamillind98/nomad@v0.11.8/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-session
    41  $ nomad job inspect redis
    42  {
    43      "Job": {
    44          "Region": "global",
    45          "ID": "redis
    46          "Name": "redis
    47          "Type": "service",
    48          "Priority": 50,
    49          "AllAtOnce": false,
    50          "Datacenters": [
    51              "dc1"
    52          ],
    53          "Constraints": [
    54              {
    55                  "LTarget": "${attr.kernel.name}",
    56                  "RTarget": "linux",
    57                  "Operand": "="
    58              }
    59          ],
    60          "TaskGroups": [
    61              {
    62                  "Name": "cache",
    63                  "Count": 1,
    64                  "Constraints": null,
    65                  "Tasks": [
    66                      {
    67                          "Name": "redis",
    68                          "Driver": "docker",
    69                          "User": "",
    70                          "Config": {
    71                              "image": "redis:latest",
    72                              "port_map": [
    73                                  {
    74                                      "db": 6379
    75                                  }
    76                              ]
    77                          },
    78                          "Constraints": null,
    79                          "Env": null,
    80                          "Services": [
    81                              {
    82                                  "Id": "",
    83                                  "Name": "cache-redis",
    84                                  "Tags": [
    85                                      "global",
    86                                      "cache"
    87                                  ],
    88                                  "PortLabel": "db",
    89                                  "Checks": [
    90                                      {
    91                                          "Id": "",
    92                                          "Name": "alive",
    93                                          "Type": "tcp",
    94                                          "Command": "",
    95                                          "Args": null,
    96                                          "Path": "",
    97                                          "Protocol": "",
    98                                          "Interval": 10000000000,
    99                                          "Timeout": 2000000000
   100                                      }
   101                                  ]
   102                              }
   103                          ],
   104                          "Resources": {
   105                              "CPU": 500,
   106                              "MemoryMB": 256,
   107                              "DiskMB": 300,
   108                              "Networks": [
   109                                  {
   110                                      "Public": false,
   111                                      "CIDR": "",
   112                                      "ReservedPorts": null,
   113                                      "DynamicPorts": [
   114                                          {
   115                                              "Label": "db",
   116                                              "Value": 0
   117                                          }
   118                                      ],
   119                                      "IP": "",
   120                                      "MBits": 10
   121                                  }
   122                              ]
   123                          },
   124                          "Meta": null,
   125                          "KillTimeout": 5000000000,
   126                          "LogConfig": {
   127                              "MaxFiles": 10,
   128                              "MaxFileSizeMB": 10
   129                          },
   130                          "Artifacts": null
   131                      }
   132                  ],
   133                  "RestartPolicy": {
   134                      "Interval": 300000000000,
   135                      "Attempts": 10,
   136                      "Delay": 25000000000,
   137                      "Mode": "delay"
   138                  },
   139                  "Meta": null
   140              }
   141          ],
   142          "Update": {
   143              "Stagger": 10000000000,
   144              "MaxParallel": 1
   145          },
   146          "Periodic": null,
   147          "Meta": null,
   148          "Status": "running",
   149          "StatusDescription": "",
   150          "CreateIndex": 5,
   151          "ModifyIndex": 7
   152      }
   153  }
   154  ```
   155  
   156  [job http api]: /api-docs/jobs