Commit 2afd577f authored by Michael Hanselmann's avatar Michael Hanselmann

gnt-node 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 87e87959
......@@ -232,7 +232,8 @@ def ListNodes(opts, args):
return GenericList(constants.QR_NODE, 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 ListNodeFields(opts, args):
......@@ -835,7 +836,8 @@ commands = {
"[<node_name>...]", "Show information about the node(s)"),
'list': (
ListNodes, ARGS_MANY_NODES,
[NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, VERBOSE_OPT],
[NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, VERBOSE_OPT,
FORCE_FILTER_OPT],
"[nodes...]",
"Lists the nodes in the cluster. The available fields can be shown using"
" the \"list-fields\" command (see the man page for details)."
......
......@@ -150,6 +150,7 @@ LIST
| **list**
| [--no-headers] [--separator=*SEPARATOR*]
| [--units=*UNITS*] [-v] [-o *[+]FIELD,...*]
| [--filter]
| [node...]
Lists the nodes in the cluster.
......@@ -182,19 +183,24 @@ fields will be added to the default list. This allows to quickly
see the default list plus a few other fields, instead of retyping
the entire list of fields.
Note that some of this fields are known from the configuration of
the cluster (e.g. name, pinst, sinst, pip, sip and thus the master
does not need to contact the node for this data (making the listing
fast if only fields from this set are selected), whereas the other
fields are "live" fields and we need to make a query to the cluster
nodes.
Depending on the virtualization type and implementation details,
the mtotal, mnode and mfree may have slighly varying meanings. For
example, some solutions share the node memory with the pool of
memory used for instances (KVM), whereas others have separate
Note that some of these fields are known from the configuration of the
cluster (e.g. ``name``, ``pinst``, ``sinst``, ``pip``, ``sip``) and thus
the master does not need to contact the node for this data (making the
listing fast if only fields from this set are selected), whereas the
other fields are "live" fields and require a query to the cluster nodes.
Depending on the virtualization type and implementation details, the
``mtotal``, ``mnode`` and ``mfree`` fields may have slighly varying
meanings. For example, some solutions share the node memory with the
pool of memory used for instances (KVM), whereas others have separate
memory for the node and for the instances (Xen).
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-node list -F master_candidate``).
If no node names are given, then all nodes are queried. Otherwise,
only the given nodes 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