From de4aba19bbdd515f5aeebdb80213ad59a2974a9f Mon Sep 17 00:00:00 2001 From: Luiz Aoqui Date: Fri, 25 Nov 2022 12:46:53 -0500 Subject: [PATCH] docs: improve job parse API documentation (#15387) --- website/content/api-docs/jobs.mdx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/website/content/api-docs/jobs.mdx b/website/content/api-docs/jobs.mdx index f0daa4026..c7113f6e1 100644 --- a/website/content/api-docs/jobs.mdx +++ b/website/content/api-docs/jobs.mdx @@ -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