-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support nomad CLI output with JSON and template format #1503
Conversation
For example... e.g. JSON output (same with HTTP API access and
e.g. template output
|
@nak3 can you look into the panics? If you give an invalid template it panics. Also I wonder if it is better to have a |
Thank you. I updated. If they are alright, I will squash the commits. |
Yeah that looks good. Okay so some comments. It would be nice if this could work on arrays of elements (aka These all make sense to me except Once we settle on what we are doing, please add docs to the website. And tests |
Yes, it is possible. You can get the info as below. (I'm sorry,
Agree about I added the docs. But do we need tests for each commands? I already added |
@nak3 I meant it would be nice if this worked without specify the individual node, alloc, or evaluation. If it could work on all of them! We should probably add this to I would add a test that if you pass the -json that -t can't be specified as well. |
For first cut we can leave as is though without support for the lists of elements |
|
||
-verbose | ||
Show full information. | ||
|
||
-json | ||
Display information with json format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Output the allocation in its JSON format.
Similar for all the others and docs
Thank you. (Sorry, I have already included the lists of elements.)
(e.g)
|
This is pretty awesome. Not sure if this is the best way to do it by this lets you do basic bash autocomplete:
We could definitely use this to build an autocomplete |
t.Fatalf("expected output: %s, actual: %s", expectOutput[k], result) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test that you get an error with an invalid go template format
Thank you @dadgar I updated. |
Awesome work! |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
No description provided.