104 Commits

Author SHA1 Message Date
Phil Renaud
35e1ea4328 [cli] UI URL hints for common CLI commands (#24454)
* Basic implementation for server members and node status

* Commands for alloc status and job status

* -ui flag for most commands

* url hints for variables

* url hints for job dispatch, evals, and deployments

* agent config ui.cli_url_links to disable

* Fix an issue where path prefix was presumed for variables

* driver uncomment and general cleanup

* -ui flag on the generic status endpoint

* Job run command gets namespaces, and no longer gets ui hints for --output flag

* Dispatch command hints get a namespace, and bunch o tests

* Lots of tests depend on specific output, so let's not mess with them

* figured out what flagAddress is all about for testServer, oof

* Parallel outside of test instances

* Browser-opening test, sorta

* Env var for disabling/enabling CLI hints

* Addressing a few PR comments

* CLI docs available flags now all have -ui

* PR comments addressed; switched the env var to be consistent and scrunched monitor-adjacent hints a bit more

* ui.Output -> ui.Warn; moves hints from stdout to stderr

* isTerminal check and parseBool on command option

* terminal.IsTerminal check removed for test-runner-not-being-terminal reasons
2025-03-07 13:23:35 -05:00
Charlie Voiselle
30ab8897d2 deps: Switch from mitchellh/cli to hashicorp/cli (#19321)
Co-authored-by: James Rasell <jrasell@hashicorp.com>
2024-12-19 15:41:11 +00:00
Kevin Wang
e7b70adc2c cli: improve job and status text (#18628) 2023-10-02 10:31:57 -04:00
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
James Rasell
ab9ba35e6a chore: fixup inconsistent method receiver names. (#11704) 2021-12-20 11:44:21 +01:00
Kris Hicks
85ed8ddd4f Add gosimple linter (#9590) 2020-12-09 11:05:18 -08:00
Tim Gross
89f4f51746 command: remove -namespace from help options when not applicable 2020-11-19 16:28:39 -05:00
Lang Martin
aea212d34d csi: CLI for volume status, registration/deregistration and plugin status (#7193)
* command/csi: csi, csi_plugin, csi_volume

* helper/funcs: move ExtraKeys from parse_config to UnusedKeys

* command/agent/config_parse: use helper.UnusedKeys

* api/csi: annotate CSIVolumes with hcl fields

* command/csi_plugin: add Synopsis

* command/csi_volume_register: use hcl.Decode style parsing

* command/csi_volume_list

* command/csi_volume_status: list format, cleanup

* command/csi_plugin_list

* command/csi_plugin_status

* command/csi_volume_deregister

* command/csi_volume: add Synopsis

* api/contexts/contexts: add csi search contexts to the constants

* command/commands: register csi commands

* api/csi: fix struct tag for linter

* command/csi_plugin_list: unused struct vars

* command/csi_plugin_status: unused struct vars

* command/csi_volume_list: unused struct vars

* api/csi: add allocs to CSIPlugin

* command/csi_plugin_status: format the allocs

* api/allocations: copy Allocation.Stub in from structs

* nomad/client_rpc: add some error context with Errorf

* api/csi: collapse read & write alloc maps to a stub list

* command/csi_volume_status: cleanup allocation display

* command/csi_volume_list: use Schedulable instead of Healthy

* command/csi_volume_status: use Schedulable instead of Healthy

* command/csi_volume_list: sprintf string

* command/csi: delete csi.go, csi_plugin.go

* command/plugin: refactor csi components to sub-command plugin status

* command/plugin: remove csi

* command/plugin_status: remove csi

* command/volume: remove csi

* command/volume_status: split out csi specific

* helper/funcs: add RemoveEqualFold

* command/agent/config_parse: use helper.RemoveEqualFold

* api/csi: do ,unusedKeys right

* command/volume: refactor csi components to `nomad volume`

* command/volume_register: split out csi specific

* command/commands: use the new top level commands

* command/volume_deregister: hardwired type csi for now

* command/volume_status: csiFormatVolumes rescued from volume_list

* command/plugin_status: avoid a panic on no args

* command/volume_status: avoid a panic on no args

* command/plugin_status: predictVolumeType

* command/volume_status: predictVolumeType

* nomad/csi_endpoint_test: move CreateTestPlugin to testing

* command/plugin_status_test: use CreateTestCSIPlugin

* nomad/structs/structs: add CSIPlugins and CSIVolumes search consts

* nomad/state/state_store: add CSIPlugins and CSIVolumesByIDPrefix

* nomad/search_endpoint: add CSIPlugins and CSIVolumes

* command/plugin_status: move the header to the csi specific

* command/volume_status: move the header to the csi specific

* nomad/state/state_store: CSIPluginByID prefix

* command/status: rename the search context to just Plugins/Volumes

* command/plugin,volume_status: test return ids now

* command/status: rename the search context to just Plugins/Volumes

* command/plugin_status: support -json and -t

* command/volume_status: support -json and -t

* command/plugin_status_csi: comments

* command/*_status: clean up text

* api/csi: fix stale comments

* command/volume: make deregister sound less fearsome

* command/plugin_status: set the id length

* command/plugin_status_csi: more compact plugin health

* command/volume: better error message, comment
2020-03-23 13:58:30 -04:00
Danielle Lancashire
38e73b51e9 status: Allow passing -verbose to meta status
A common issue when using nomad is needing to add in the object verb to
a command to include the `-verbose` flag.

This commit allows users to pass `-verbose` via the `nomad status` alias by
adding a placeholder boolean in the metacommand which allows subcommands
to parse the flag.
2019-04-11 13:15:44 +02:00
Alex Dadgar
f6fbb36054 sync 2017-10-13 14:36:02 -07:00
Alex Dadgar
2c4c6b6ff6 Nomad UI Command 2017-10-09 23:01:55 -07:00
Alex Dadgar
c85e8aa02f Merge pull request #3127 from hashicorp/b-tls-api
Fix TLSServerName for Node API Client
2017-08-29 16:10:58 -07:00
Alex Dadgar
5d65af523d Check for errors initializing client for autocomplete 2017-08-29 14:29:32 -07:00
Alex Dadgar
cd5a54bc74 respond to comments 2017-08-29 09:46:14 -07:00
Alex Dadgar
3902385b3e Status honors exact match and displays matches when more than one is available 2017-08-29 08:42:09 -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
1fdabecad3 get status of deployment via status cli command 2017-08-25 21:06:33 +00:00
Chelsea Holland Komlo
039c2070cc add global flags to status; re-order functions 2017-08-25 19:47:21 +00:00
Chelsea Holland Komlo
f6ca06ce43 refactor and fixups from code review 2017-08-25 17:34:05 +00:00
Chelsea Holland Komlo
497432bc71 cli help and logging formatting 2017-08-25 16:42:11 +00:00
Chelsea Holland Komlo
d123a4a2b4 fix up formatting of error message
fixups from code review
2017-08-25 16:42:11 +00:00
Chelsea Holland Komlo
a5238232aa limit argument autocompletion to one 2017-08-25 16:42:11 +00:00
Chelsea Holland Komlo
3d8c3c59de use existing arg parsing functionality 2017-08-25 16:42:11 +00:00
Chelsea Holland Komlo
d1ab4f4317 small fixups 2017-08-25 16:42:11 +00:00
Chelsea Holland Komlo
c24caaaa18 fix autocomplete to list all matches 2017-08-25 16:42:11 +00:00
Chelsea Holland Komlo
d003af3125 default to job status if no arguments are provided 2017-08-25 16:42:11 +00:00
Chelsea Holland Komlo
9e3be518e3 adds any resource autocomplete
defaults to listing jobs if no id is provided
2017-08-25 16:42:11 +00:00
Chelsea Holland Komlo
7a476c6049 migrate nomad status to nomad job status 2017-08-09 15:16:04 +00:00
Alex Dadgar
aa05302ed8 Ensure backwards compatibility between 0.6.X CLI and 0.5.X
This PR goes through the CLI commands and ensures that a 0.6.X cli
gracefully handles interacting with a 0.5.X Nomad Agent.

Fixes https://github.com/hashicorp/nomad/issues/2918
2017-07-28 10:20:47 -07:00
Alex Dadgar
3cd8d50bbc Multiple matched objects now treated as an error condition. 2017-07-20 17:31:07 -07:00
Alex Dadgar
e1c631064a @jippi Changed my mind! Good suggestion 2017-07-07 12:12:48 -07:00
Alex Dadgar
466702a2db deployment status in job status view 2017-07-07 12:12:48 -07:00
Alex Dadgar
c5b1e2dcc1 alloc-list shows version 2017-07-07 12:12:48 -07:00
Alex Dadgar
3935656d14 Show submit time 2017-07-07 12:07:07 -07:00
Alex Dadgar
376e177836 Status shows type of job 2017-04-15 17:08:05 -07:00
Alex Dadgar
5e1e7afc62 GC and some fixes 2017-04-15 17:08:05 -07:00
Alex Dadgar
950171f094 non-purge deregisters 2017-04-15 17:08:05 -07:00
Alex Dadgar
b92e091a81 Handle periodic paramaterized jobs
Fixes https://github.com/hashicorp/nomad/issues/2382
2017-03-01 11:45:20 -08:00
Alex Dadgar
76ab4b6448 Merge branch 'master' into refactor-parser 2017-02-20 15:13:21 -08:00
Alex Dadgar
ef00766e31 Fix CLI handling of parameterized/periodic jobs 2017-02-16 14:29:34 -08:00
Diptanu Choudhury
67e6098f87 Removing un-neccessary conversions 2017-02-16 13:52:39 -08:00
Diptanu Choudhury
b56764a0ec Fixed the nomad status command 2017-02-16 13:52:39 -08:00
Diptanu Choudhury
f551dcb83e Making the job spec return api.Job 2017-02-16 13:52:39 -08:00
Alex Dadgar
8d101c0d25 Allow specification of timezones 2017-02-15 14:37:06 -08:00
Michael Schurter
1a845561dd Rename Constructor -> Parameterized Job 2017-01-20 12:43:10 -08:00
Alex Dadgar
248c069652 Merge pull request #2128 from hashicorp/f-dispatch
Nomad Constructor Jobs and Dispatch
2017-01-06 05:22:49 +08:00
Diptanu Choudhury
e5ca8f4709 Added comments 2016-12-19 18:10:02 -08:00