summaryrefslogtreecommitdiff
path: root/plugins/nomad/_nomad
diff options
context:
space:
mode:
authorLaurent Commarieu <laurent.commarieu@iadvize.com>2016-09-26 15:26:38 +0200
committerMarc Cornellà <marc.cornella@live.com>2016-10-04 00:03:14 +0200
commit6b7003c3efcabe5ce185d5c2a1a8b708d92dfb82 (patch)
tree044c1bfc29ded5e12ce0540fd6ebbba6ff68f431 /plugins/nomad/_nomad
parent0576895d038823d06330ece4d5883cc9c99487f9 (diff)
downloadzsh-6b7003c3efcabe5ce185d5c2a1a8b708d92dfb82.tar.gz
zsh-6b7003c3efcabe5ce185d5c2a1a8b708d92dfb82.tar.bz2
zsh-6b7003c3efcabe5ce185d5c2a1a8b708d92dfb82.zip
feat(plugin): add nomad
Diffstat (limited to 'plugins/nomad/_nomad')
-rw-r--r--plugins/nomad/_nomad51
1 files changed, 51 insertions, 0 deletions
diff --git a/plugins/nomad/_nomad b/plugins/nomad/_nomad
new file mode 100644
index 000000000..25169f394
--- /dev/null
+++ b/plugins/nomad/_nomad
@@ -0,0 +1,51 @@
+#compdef nomad
+
+local -a _nomad_cmds
+_nomad_cmds=(
+ 'agent:Runs a Nomad agent'
+ 'agent-info:Display status information about the local agent'
+ 'alloc-status:Display allocation status information and metadata'
+ 'client-config:View or modify client configuration details'
+ 'eval-status:Display evaluation status and placement failure reasons'
+ 'fs:Inspect the contents of an allocation directory'
+ 'init:Create an example job file'
+ 'inspect:Inspect a submitted job'
+ 'logs:Streams the logs of a task.'
+ 'node-drain:Toggle drain mode on a given node'
+ 'node-status:Display status information about nodes'
+ 'plan:Dry-run a job update to determine its effects'
+ 'run:Run a new job or update an existing'
+ 'server-force-leave:Force a server into the left state'
+ 'server-join:Join server nodes together'
+ 'server-members:Display a list of known servers and their'
+ 'status:Display status information about jobs'
+ 'stop:Stop a running job'
+ 'validate:Checks if a given job specification is valid'
+ 'version:Prints the Nomad version'
+)
+
+
+__allocstatus() {
+ _arguments \
+ '-address=[(addr) The address of the Nomad server. Overrides the NOMAD_ADDR environment variable if set. Default = http://127.0.0.1:4646]' \
+ '-region=[(region) The region of the Nomad servers to forward commands to. Overrides the NOMAD_REGION environment variable if set. Defaults to the Agent s local region.]' \
+ '-no-color[Disables colored command output.]' \
+ '-short[Display short output. Shows only the most recent task event.]' \
+ '-stats[Display detailed resource usage statistics.]' \
+ '-verbose[Show full information.]' \
+ '-json[Output the allocation in its JSON format.]' \
+ '-t[Format and display allocation using a Go template.]'
+}
+
+_arguments '*:: :->command'
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "nomad command" _nomad_cmds
+ return
+fi
+
+local -a _command_args
+case "$words[1]" in
+ alloc-status)
+ __allocstatus ;;
+esac