Commit Graph

96 Commits

Author SHA1 Message Date
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
Alex Dadgar
bf9355ac4f Children fixes + nomad status outputs summaries
Children object is always initialized instead of lazily.
`nomad status` outputs children summaries and has specialized view for
constructor jobs.
2016-12-14 16:58:54 -08:00
Diptanu Choudhury
5eb4e8adb3 Making the status command return the allocs of currently registered job 2016-11-24 16:31:30 +01:00
Cameron Davison
561d7e3e97 s/Created/Created At/ 2016-08-15 21:40:34 -05:00
Cameron Davison
0b7acd5825 move formatUnixNanoTime into a utility function 2016-08-08 21:24:38 -05:00
Cameron Davison
a66c568b3b remove time flag, and update docs with new column 2016-08-08 21:15:45 -05:00
Cameron Davison
40bc21fa8f add time flag to add created column to allocation 2016-08-07 19:44:56 -05:00
Cameron Davison
bc6db9c138 code cleanup of inconsistent naming, spacing, and duplicate code 2016-08-07 19:37:52 -05:00
Diptanu Choudhury
4cc24c0354 Removing the custom sorting logic 2016-08-04 13:17:21 -07:00