- added support for query in resource list - changed call to resource list from GET to POST - added support for resource count new api Story: 2004669 Task: 28652 Task: 28655 Depends-On: https://review.openstack.org/627309 Change-Id: Ib75b67c15c0a175e804fd020958fb7e50ec4df07
78 lines
3.7 KiB
Plaintext
Executable File
78 lines
3.7 KiB
Plaintext
Executable File
_vitrage()
|
|
{
|
|
local cur prev words
|
|
COMPREPLY=()
|
|
_get_comp_words_by_ref -n : cur prev words
|
|
|
|
# Command data:
|
|
cmds='alarm complete event healthcheck help rca resource template topology webhook'
|
|
cmds_alarm='count history list show'
|
|
cmds_alarm_count='-h --help -f --format -c --column --max-width --fit-width --print-empty --noindent --variable --prefix --all-tenants'
|
|
cmds_alarm_history='-h --help -f --format -c --column --max-width --fit-width --print-empty --quote --noindent --sort-column --all-tenants --limit --marker --start --end'
|
|
cmds_alarm_list='-h --help -f --format -c --column --max-width --fit-width --print-empty --quote --noindent --sort-column --all-tenants --limit --marker'
|
|
cmds_alarm_show='-h --help -f --format -c --column --max-width --fit-width --print-empty --noindent --variable --prefix'
|
|
cmds_complete='-h --help --name --shell'
|
|
cmds_event='post'
|
|
cmds_event_post='-h --help --type --time --details'
|
|
cmds_healthcheck='-h --help -f --format -c --column --max-width --fit-width --print-empty --noindent --variable --prefix'
|
|
cmds_help='-h --help'
|
|
cmds_rca='show'
|
|
cmds_rca_show='-h --help -f --format -c --column --max-width --fit-width --print-empty --noindent --variable --prefix --all-tenants'
|
|
cmds_resource='list show'
|
|
cmds_resource_count='-h --help --type --all-tenants --filter --group-by'
|
|
cmds_resource_list='-h --help -f --format -c --column --max-width --fit-width --print-empty --quote --noindent --sort-column --type --all-tenants --filter'
|
|
cmds_resource_show='-h --help -f --format -c --column --max-width --fit-width --print-empty --noindent --variable --prefix'
|
|
cmds_template='add delete list show validate'
|
|
cmds_template_add='-h --help -f --format -c --column --max-width --fit-width --print-empty --quote --noindent --sort-column --path --type'
|
|
cmds_template_delete='-h --help'
|
|
cmds_template_list='-h --help -f --format -c --column --max-width --fit-width --print-empty --quote --noindent --sort-column'
|
|
cmds_template_show='-h --help -f --format -c --column --max-width --fit-width --print-empty --noindent --variable --prefix'
|
|
cmds_template_validate='-h --help -f --format -c --column --max-width --fit-width --print-empty --noindent --variable --prefix --path --type'
|
|
cmds_topology='show'
|
|
cmds_topology_show='-h --help -f --format -c --column --max-width --fit-width --print-empty --noindent --variable --prefix --filter --limit --root --graph-type --all-tenants'
|
|
cmds_webhook='add delete list show'
|
|
cmds_webhook_add='-h --help -f --format -c --column --max-width --fit-width --print-empty --noindent --variable --prefix --url --regex_filter --headers'
|
|
cmds_webhook_delete='-h --help -f --format -c --column --max-width --fit-width --print-empty --noindent --variable --prefix'
|
|
cmds_webhook_list='-h --help -f --format -c --column --max-width --fit-width --print-empty --quote --noindent --sort-column --all-tenants'
|
|
cmds_webhook_show='-h --help -f --format -c --column --max-width --fit-width --print-empty --noindent --variable --prefix'
|
|
|
|
dash=-
|
|
underscore=_
|
|
cmd=""
|
|
words[0]=""
|
|
completed="${cmds}"
|
|
for var in "${words[@]:1}"
|
|
do
|
|
if [[ ${var} == -* ]] ; then
|
|
break
|
|
fi
|
|
if [ -z "${cmd}" ] ; then
|
|
proposed="${var}"
|
|
else
|
|
proposed="${cmd}_${var}"
|
|
fi
|
|
local i="cmds_${proposed}"
|
|
i=${i//$dash/$underscore}
|
|
local comp="${!i}"
|
|
if [ -z "${comp}" ] ; then
|
|
break
|
|
fi
|
|
if [[ ${comp} == -* ]] ; then
|
|
if [[ ${cur} != -* ]] ; then
|
|
completed=""
|
|
break
|
|
fi
|
|
fi
|
|
cmd="${proposed}"
|
|
completed="${comp}"
|
|
done
|
|
|
|
if [ -z "${completed}" ] ; then
|
|
COMPREPLY=( $( compgen -f -- "$cur" ) $( compgen -d -- "$cur" ) )
|
|
else
|
|
COMPREPLY=( $(compgen -W "${completed}" -- ${cur}) )
|
|
fi
|
|
return 0
|
|
}
|
|
complete -F _vitrage vitrage
|