open-nomad/website/content/api-docs
Michael Schurter 1256c8ef66
docs: update json jobs docs (#12766)
* docs: update json jobs docs

Did you know that Nomad has not 1 but 2 JSON formats for jobs? 2½ if you
want to acknowledge that sometimes our JSON job representations have a
Job top-level wrapper and sometimes do not.

The 2½ formats are:
```
 1.   HCL JSON
 2.   Input API JSON (top-level Job field)
 2.5. Output API JSON (lacks top-level Job field)
```

`#2` is what our docs consider our API JSON. `#2.5` seems to be an
accident of history we can't fix with breaking API compatibility.

`#1` is an even more interesting accident of history: the `jobspec2`
package automatically detects if the input to Parse is JSON and switches
to a JSON parser. This behavior is undocumented, the format is
unspecified, and there is no official HashiCorp tooling to produce this
JSON from HCL. The plot thickens when you discover popular third party
tools like hcl2json.com and https://github.com/tmccombs/hcl2json seem to
produce JSON that `nomad run` accepts!

Since we have no telemetry around whether or not anyone passes HCL JSON
to `nomad run`, and people don't file bugs around features that Just
Work, I'm choosing to leave that code path in place and *acknowledged
but not suggested* in documentation.

See https://github.com/hashicorp/hcl/issues/498 for a more comprehensive
discussion of what officially supporting HCL JSON in Nomad would look
like.

(I also added some of the missing fields to the (Input API flavor) JSON
Job documentation, but it still needs a lot of work to be
comprehensive.)

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2022-04-22 15:57:27 -07:00
..
operator api-docs: add SysBatchSchedulerEnabled docs (#11973) 2022-02-02 16:54:47 -05:00
acl-policies.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
acl-tokens.mdx docs: initial docs for the new API features (#12094) 2022-03-14 10:58:42 -04:00
agent.mdx Fixed scheduler config examples (#12049) 2022-02-23 12:58:29 -05:00
allocations.mdx website: redirect /api to api-docs and update internal links (#12410) 2022-03-31 11:33:27 -05:00
client.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
deployments.mdx docs: initial docs for the new API features (#12094) 2022-03-14 10:58:42 -04:00
evaluations.mdx api: add related evals to eval details (#12305) 2022-03-17 13:56:14 -04:00
events.mdx website: add initial website docs for Nomad service discovery. (#12456) 2022-04-06 18:51:14 +02:00
index.mdx docs: initial docs for the new API features (#12094) 2022-03-14 10:58:42 -04:00
jobs.mdx MaxClientDisconnect Jobspec checklist (#12177) 2022-04-05 17:12:23 -04:00
json-jobs.mdx docs: update json jobs docs (#12766) 2022-04-22 15:57:27 -07:00
libraries-and-sdks.mdx Update libraries-and-sdks.mdx 2021-04-27 16:34:55 -04:00
metrics.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
namespaces.mdx docs: add meta to namespace docs 2022-03-04 14:18:57 -08:00
nodes.mdx api: Add support for filtering and pagination to the node list endpoint (#12727) 2022-04-21 17:04:33 +02:00
plugins.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
quotas.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
recommendations.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
regions.mdx docs: fixup regions API documentation path to include version. 2021-07-21 12:14:19 +02:00
scaling-policies.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
search.mdx docs: Fix minor fuzzy search things (#10423) 2021-04-21 14:55:17 -05:00
sentinel-policies.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
services.mdx service discovery: add pagination and filtering support to info requests (#12552) 2022-04-13 07:41:44 +02:00
status.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
system.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
ui.mdx feat(website): extract /plugins /tools docs (#11584) 2021-12-09 14:25:18 -05:00
validate.mdx feat(website): migrates to new nav data format (#10264) 2021-03-31 08:43:17 -05:00
volumes.mdx CSI: Add secrets flag support for delete volume (#11245) 2022-04-05 08:59:11 -04:00