Proposal
nomad job plan command outputs the plan in human readable format only and does not provide options such as
-json to print output in JSON format (ex: supported in nomad job run command), or
-t to format using Go template (ex: supported in nomad job inspect)
Use-cases
Having this option is useful where the jobspec is intentionally expressed in HCL for better readability, but the code to parse the human readable output format can get complicated. If instead the format can be controlled, it makes for cleaner parsing and presentation.
In addition, since nomad job plan supports -json input, so it only makes sense to have JSON output as a choice.
Attempted Solutions
HCL2JSON tool can help to an extent in converting ahead of time, but is not an officially supported tool by Hashicorp?
Also, if I am not wrong, when the job is converted and submitted in JSON format, UI does not show the jobspec in HCL format?
Proposal
nomad job plancommand outputs the plan in human readable format only and does not provide options such as-jsonto print output in JSON format (ex: supported innomad job runcommand), or-tto format using Go template (ex: supported innomad job inspect)Use-cases
Having this option is useful where the jobspec is intentionally expressed in HCL for better readability, but the code to parse the human readable output format can get complicated. If instead the format can be controlled, it makes for cleaner parsing and presentation.
In addition, since
nomad job plansupports-jsoninput, so it only makes sense to have JSON output as a choice.Attempted Solutions
HCL2JSON tool can help to an extent in converting ahead of time, but is not an officially supported tool by Hashicorp?
Also, if I am not wrong, when the job is converted and submitted in JSON format, UI does not show the jobspec in HCL format?