29 Commits

Author SHA1 Message Date
hashicorp-copywrite[bot]
a9d61ea3fd Update copyright file headers to BUSL-1.1 2023-08-10 17:27:29 -05:00
hashicorp-copywrite[bot]
f005448366 [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
Luiz Aoqui
4fdb5c477e cli: remove hard requirement on list-jobs (#16380)
Most job subcommands allow for job ID prefix match as a convenience
functionality so users don't have to type the full job ID.

But this introduces a hard ACL requirement that the token used to run
these commands have the `list-jobs` permission, even if the token has
enough permission to execute the basic command action and the user
passed an exact job ID.

This change softens this requirement by not failing the prefix match in
case the request results in a permission denied error and instead using
the information passed by the user directly.
2023-03-09 15:00:04 -05:00
Luiz Aoqui
0e824d363a cli: use shared logic for resolving job prefix (#16306)
Several `nomad job` subcommands had duplicate or slightly similar logic
for resolving a job ID from a CLI argument prefix, while others did not
have this functionality at all.

This commit pulls the shared logic to the command Meta and updates all
`nomad job` subcommands to use it.
2023-03-03 14:43:20 -05:00
Shishir Mahajan
e14e3555c5 Code cleanup: Remove extra if clause.
Signed-off-by: Shishir Mahajan <smahajan@roblox.com>
2021-10-19 16:52:11 -07:00
Tim Gross
479b4f634d cli: improve wildcard namespace prefix matches (#10648)
When a wildcard namespace is used for `nomad job` commands that support prefix
matching, avoid asking the user for input if a prefix is an unambiguous exact
match so that the behavior is similar to the commands using a specific or
unset namespace.
2021-05-24 11:38:05 -04:00
Tim Gross
8a66f11bb3 docs: describe required ACLs for all commands 2020-11-20 13:38:29 -05:00
Tim Gross
89f4f51746 command: remove -namespace from help options when not applicable 2020-11-19 16:28:39 -05:00
Mahmood Ali
7e51f80d1d cli: warn on multiple prefix matches when querying all namespaces 2020-06-17 16:32:51 -04:00
Mahmood Ali
85db7187fb cli: jobs allow querying jobs in all namespaces 2020-06-17 16:31:01 -04:00
Drew Bailey
ce8f230cab Multiregion deploy status and job status CLI 2020-06-17 11:03:34 -04:00
Chris Baker
4b67fd89d4 fixed incorrect CLI documentation in job deployments
listed `-all-allocs` instead of `-all`
2019-09-20 12:24:53 -05:00
Preetha Appan
9abd35285f Add -all to help text and flags 2019-05-15 21:16:57 -05:00
Preetha Appan
af2ed66749 Add flag similar to --all for allocs to be able to filter deployments by latest 2019-05-13 18:33:41 -05:00
Nick Ethier
0216a8e377 command: use ':' instead of ',' in error msg 2018-04-18 13:55:51 -04:00
Nick Ethier
45b0ce9177 command: improve help text when invalid arguments are given 2018-04-18 12:02:11 -04:00
Alex Dadgar
f6fbb36054 sync 2017-10-13 14:36:02 -07:00
Alex Dadgar
5d65af523d Check for errors initializing client for autocomplete 2017-08-29 14:29:32 -07:00
Alex Dadgar
ce3c316592 don't limit on one arg 2017-08-28 13:40:04 -07:00
Alex Dadgar
85a1899dfa Reduce startup time on Mac
This PR moves creating the API client into the returned predict
function. The creation of the client causes a lookup of all the system
certificates and doing that for each command on mac was extremely slow.
2017-08-28 11:29:27 -07:00
Alex Dadgar
4d97b302a0 Search respects QueryOptions and returns QueryMeta
@chelseakomlo heads up on this change
2017-08-27 22:17:51 -07:00
Chelsea Holland Komlo
e88228cc5d add global flags to autocomplete 2017-08-23 22:58:44 +00:00
Chelsea Holland Komlo
335cf888b0 use PredictAnything when an flag accepts an argument 2017-08-23 22:58:44 +00:00
Chelsea Holland Komlo
c1e5c7132a enable autocompletion of flags 2017-08-23 22:57:07 +00:00
Alex Dadgar
c0e3b503d1 flesh out the rest of the job subcommands 2017-08-22 13:39:06 -07:00
Alex Dadgar
3cd8d50bbc Multiple matched objects now treated as an error condition. 2017-07-20 17:31:07 -07:00
Michael Schurter
6dac431a89 Implement -json for job deployments
Fixes #2849
2017-07-18 17:28:44 -07:00
Alex Dadgar
468c886282 Formatting abilities 2017-07-07 12:07:07 -07:00
Alex Dadgar
4ce7b62105 job deployments 2017-07-07 12:07:07 -07:00