github.com/smintz/nomad@v0.8.3/website/source/docs/commands/job/validate.html.md.erb (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Commands: job validate"
     4  sidebar_current: "docs-commands-job-validate"
     5  description: >
     6    The job validate command is used to check a job specification for syntax errors and validation problems.
     7  ---
     8  
     9  # Command: job validate
    10  **Alias: `nomad validate`**
    11  
    12  The `job validate` command is used to check a [HCL job specification](/docs/job-specification/index.html)
    13  for any syntax errors or validation problems.
    14  
    15  ## Usage
    16  
    17  ```
    18  nomad job validate <file>
    19  ```
    20  
    21  The `job validate` command requires a single argument, specifying the path to a file
    22  containing a [HCL job specification](/docs/job-specification/index.html). This file
    23  will be read and the job checked for any problems. If the
    24  supplied path is "-", the job file is read from STDIN. Otherwise it is read
    25  from the file at the supplied path or downloaded and read from URL specified.
    26  Nomad downloads the job file using [`go-getter`](https://github.com/hashicorp/go-getter)
    27  and supports `go-getter` syntax.
    28  
    29  On successful validation, exit code 0 will be returned, otherwise an exit code
    30  of 1 indicates an error.
    31  
    32  ## Examples
    33  
    34  Validate a job with invalid syntax:
    35  
    36  ```
    37  $ nomad job validate example.nomad
    38  Job validation errors:
    39  1 error(s) occurred:
    40  
    41  * group "cache" -> task "redis" -> config: 1 error(s) occurred:
    42  
    43  * field "image" is required
    44  ```
    45  
    46  Validate a job that has a configuration that causes warnings:
    47  
    48  ```
    49  $ nomad job validate example.nomad
    50  Job Warnings:
    51  1 warning(s):
    52  
    53  * Group "cache" has warnings: 1 error(s) occurred:
    54  
    55  * Update max parallel count is greater than task group count (6 > 3). A destructive change would result in the simultaneous replacement of all allocations.
    56  
    57  Job validation successful
    58  ```