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