Commit 87e87959 authored by Michael Hanselmann's avatar Michael Hanselmann

gnt-instance list: Query filter support

Update manpage, quote field names.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 2928de47
......@@ -219,7 +219,8 @@ def ListInstances(opts, args):
return GenericList(constants.QR_INSTANCE, selected_fields, args, opts.units,
opts.separator, not opts.no_headers,
format_override=fmtoverride, verbose=opts.verbose)
format_override=fmtoverride, verbose=opts.verbose,
force_filter=opts.force_filter)
def ListInstanceFields(opts, args):
......@@ -1382,7 +1383,8 @@ commands = {
"Show information on the specified instance(s)"),
'list': (
ListInstances, ARGS_MANY_INSTANCES,
[NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, VERBOSE_OPT],
[NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, VERBOSE_OPT,
FORCE_FILTER_OPT],
"[<instance>...]",
"Lists the instances and their status. The available fields can be shown"
" using the \"list-fields\" command (see the man page for details)."
......
......@@ -625,7 +625,7 @@ LIST
| **list**
| [--no-headers] [--separator=*SEPARATOR*] [--units=*UNITS*] [-v]
| [-o *[+]FIELD,...*] [instance...]
| [-o *[+]FIELD,...*] [--filter] [instance...]
Shows the currently configured instances with memory usage, disk
usage, the node they are running on, and their run status.
......@@ -664,8 +664,14 @@ to ask the remote nodes for the data. This can be helpful for big
clusters when you only want some data and it makes sense to specify
a reduced set of output fields.
The default output field list is: name, os, pnode, admin\_state,
oper\_state, oper\_ram.
If exactly one argument is given and it appears to be a query filter
(see **ganeti(7)**), the query result is filtered accordingly. For
ambiguous cases (e.g. a single field name as a filter) the ``--filter``
(``-F``) option forces the argument to be treated as a filter (e.g.
``gnt-instance list -F admin_state``).
The default output field list is: ``name``, ``os``, ``pnode``,
``admin_state``, ``oper_state``, ``oper_ram``.
LIST-FIELDS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment