docs: improve job parse API documentation (#15387)

This commit is contained in:
Luiz Aoqui
2022-11-25 12:46:53 -05:00
committed by GitHub
parent a55c12418f
commit de4aba19bb

View File

@@ -235,15 +235,24 @@ The table below shows this endpoint's support for
- `Canonicalize` `(bool: false)` - Flag to enable setting any unset fields to
their default values.
- `HCLv1` `(bool: false)` - Use the legacy v1 HCL parser.
## Sample Payload
```json
{
"JobHCL": "job \"example\" { type = \"service\" group \"cache\" {} }",
"JobHCL": "job \"example\" {\n type = \"service\"\n group \"cache\" {}\n}",
"Canonicalize": true
}
```
You can use a tool such as [`jq`](https://stedolan.github.io/jq/) to generate
the payload from a local HCL file:
```shell-session
$ jq -Rsc '{ JobHCL: ., Canonicalize: true }' example.nomad > payload.json
```
### Sample Request
```shell-session