Skip to content
Snippets Groups Projects
Commit d8a4b51d authored by Iustin Pop's avatar Iustin Pop
Browse files

Improve the documentation of query output fields

The gnt-node and gnt-instance list commands have a customizable list of
output fields, but the list is not up to date (in the man page) and not
easily understandable from the ‘--help’ output.

This patch updates the man pages and adds the available fields and
default fields in the ‘--help’ output, as part of the description.

Example:
Usage
=====
  gnt-node list

Lists the nodes in the cluster. The available fields are (see the man page for
details): name, pinst_cnt, pinst_list, sinst_cnt, sinst_list, pip, sip,
dtotal, dfree, mtotal, mnode, mfree, bootid. The default field list is (in
order): name, dtotal, dfree, mtotal, mnode, mfree, pinst_cnt, sinst_cnt.

Reviewed-by: imsnah,ultrotter
parent 4a160927
No related branches found
No related tags found
No related merge requests found
......@@ -167,7 +167,8 @@ USEUNITS_OPT = make_option("--human-readable", default=False,
help="Print sizes in human readable format")
FIELDS_OPT = make_option("-o", "--output", dest="output", action="store",
type="string", help="Select output fields",
type="string", help="Comma separated list of"
" output fields",
metavar="FIELDS")
FORCE_OPT = make_option("-f", "--force", dest="force", action="store_true",
......
......@@ -436,6 +436,25 @@
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>sda_size</term>
<listitem>
<simpara>the size of the instance's first disk</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>sdb_size</term>
<listitem>
<simpara>the size of the instance's second disk</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>vcpus</term>
<listitem>
<simpara>the number of VCPUs allocated to the
instance</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
......
......@@ -232,19 +232,33 @@
</listitem>
</varlistentry>
<varlistentry>
<term>pinst</term>
<term>pinst_cnt</term>
<listitem>
<simpara>the number of instances having this node as
primary</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>sinst</term>
<term>pinst_list</term>
<listitem>
<simpara>the list of instances having this node as
primary, comma separated</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>sinst_cnt</term>
<listitem>
<simpara>the number of instances having this node as a
secondary node</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>sinst_list</term>
<listitem>
<simpara>the list of instances having this node as a
secondary node, comma separated</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>pip</term>
<listitem>
......@@ -296,6 +310,15 @@
allocations</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>bootid</term>
<listitem>
<simpara>the node bootid value; this is a linux specific
feature that assigns a new UUID to the node at each boot
and can be use to detect node reboots (by tracking
changes in this value)</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
......
......@@ -811,7 +811,12 @@ commands = {
"Show information on the specified instance"),
'list': (ListInstances, ARGS_NONE,
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT],
"", "Lists the instances and their status"),
"", "Lists the instances and their status. The available fields"
" are (see the man page for details): oper_state, oper_ram,"
" name, os, pnode, snodes, admin_state, admin_ram, disk_template,"
" ip, mac, bridge, sda_size, sdb_size, vcpus. The default field"
" list is (in order): name, os, pnode, admin_state, oper_state,"
" oper_ram."),
'reinstall': (ReinstallInstance, ARGS_ONE, [DEBUG_OPT, FORCE_OPT, os_opt],
"[-f] <instance>", "Reinstall the instance"),
'remove': (RemoveInstance, ARGS_ONE,
......
......@@ -300,7 +300,11 @@ commands = {
"[<node_name>...]", "Show information about the node(s)"),
'list': (ListNodes, ARGS_NONE,
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT],
"", "Lists the nodes in the cluster"),
"", "Lists the nodes in the cluster. The available fields"
" are (see the man page for details): name, pinst_cnt, pinst_list,"
" sinst_cnt, sinst_list, pip, sip, dtotal, dfree, mtotal, mnode,"
" mfree, bootid. The default field list is (in order): name,"
" dtotal, dfree, mtotal, mnode, mfree, pinst_cnt, sinst_cnt."),
'remove': (RemoveNode, ARGS_ONE, [DEBUG_OPT],
"<node_name>", "Removes a node from the cluster"),
'volumes': (ListVolumes, ARGS_ANY,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment