Commit 1b1a08e8 authored by Michael Hanselmann's avatar Michael Hanselmann

gnt-group list: Query filter support

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 2afd577f
......@@ -101,7 +101,8 @@ def ListGroups(opts, args):
return GenericList(constants.QR_GROUP, desired_fields, args, None,
opts.separator, not opts.no_headers,
format_override=fmtoverride, verbose=opts.verbose)
format_override=fmtoverride, verbose=opts.verbose,
force_filter=opts.force_filter)
def ListGroupFields(opts, args):
......@@ -189,7 +190,7 @@ commands = {
"<group_name> <node>...", "Assign nodes to a group"),
"list": (
ListGroups, ARGS_MANY_GROUPS,
[NOHDR_OPT, SEP_OPT, FIELDS_OPT, VERBOSE_OPT],
[NOHDR_OPT, SEP_OPT, FIELDS_OPT, VERBOSE_OPT, FORCE_FILTER_OPT],
"[<group_name>...]",
"Lists the node groups in the cluster. The available fields can be shown"
" using the \"list-fields\" command (see the man page for details)."
......
......@@ -93,7 +93,7 @@ LIST
~~~~
| **list** [--no-headers] [--separator=*SEPARATOR*] [-v]
| [-o *[+]FIELD,...*] [group...]
| [-o *[+]FIELD,...*] [--filter] [group...]
Lists all existing node groups in the cluster.
......@@ -115,6 +115,11 @@ The available fields and their meaning are:
@QUERY_FIELDS_GROUP@
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.
If no group names are given, then all groups are included. Otherwise,
only the named groups will be listed.
......
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