Commit fcdb582d authored by Michael Hanselmann's avatar Michael Hanselmann

Generate query fields in man pages

This patch replaces the hand-written lists of fields, sometimes
incomplete, wrong or inconsistent, with generated ones. What's not very
nice yet is the representation for numbered lists (“nic.ip/0: IP address
of 1st network interface”, “nic.ip/1: IP address of 2nd network
interface”, etc.), but some kind of grouping can be done later.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 95eb4188
......@@ -73,6 +73,7 @@
/man/*.[0-9]
/man/*.html
/man/*.in
/man/*.gen
/man/footer.man
# tools
......
......@@ -450,10 +450,11 @@ man_MANS = \
manrst = $(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS)))
manhtml = $(patsubst %.rst,%.html,$(manrst))
mangen = $(patsubst %.rst,%.gen,$(manrst))
maninput = \
$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
$(patsubst %.html,%.html.in,$(manhtml)) \
man/footer.man man/footer.html
man/footer.man man/footer.html $(mangen)
TEST_FILES = \
test/data/bdev-drbd-8.0.txt \
......@@ -630,7 +631,10 @@ man/footer.html: man/footer.rst
{ echo 'pandoc' not found during configure; exit 1; }
$(PANDOC) -f rst -t html -o $@ $<
man/%.7.in man/%.8.in: man/%.rst man/footer.man
man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py
PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@
man/%.7.in man/%.8.in: man/%.gen man/footer.man
@test -n "$(PANDOC)" || \
{ echo 'pandoc' not found during configure; exit 1; }
set -o pipefail ; \
......@@ -638,7 +642,7 @@ man/%.7.in man/%.8.in: man/%.rst man/footer.man
sed -e 's/\\@/@/g' > $@
if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
man/%.html.in: man/%.rst man/footer.html
man/%.html.in: man/%.gen man/footer.html
@test -n "$(PANDOC)" || \
{ echo 'pandoc' not found during configure; exit 1; }
set -o pipefail ; \
......
......@@ -109,18 +109,7 @@ special field states (see **ganeti(7)**).
The ``-o`` option takes a comma-separated list of output fields.
The available fields and their meaning are:
name
Lock name
mode
Mode in which the lock is currently acquired (exclusive or shared)
owner
Current lock owner(s)
pending
Threads waiting for the lock
@QUERY_FIELDS_LOCK@
If the value of the option starts with the character ``+``, the new
fields will be added to the default list. This allows to quickly
......
......@@ -113,43 +113,7 @@ the entire list of fields.
The available fields and their meaning are:
name
the group name
uuid
the group's UUID
node_cnt
the number of nodes in the node group
node_list
the list of nodes that belong to this group
pinst_cnt
the number of primary instances in the group (i.e., the number of
primary instances nodes in this group have)
pinst_list
the list of primary instances in the group
alloc_policy
the current allocation policy for the group
ctime
the creation time of the group; note that this field contains spaces
and as such it's harder to parse
if this attribute is not present (e.g. when upgrading from older
versions), then "N/A" will be shown instead
mtime
the last modification time of the group; note that this field
contains spaces and as such it's harder to parse
serial_no
the so called 'serial number' of the group; this is a numeric field
that is incremented each time the node is modified, and it can be
used to detect modifications
@QUERY_FIELDS_GROUP@
If no group names are given, then all groups are included. Otherwise,
only the named groups will be listed.
......
......@@ -648,161 +648,7 @@ special field states (see **ganeti(7)**).
The ``-o`` option takes a comma-separated list of output fields.
The available fields and their meaning are:
name
the instance name
os
the OS of the instance
pnode
the primary node of the instance
snodes
comma-separated list of secondary nodes for the instance; usually
this will be just one node
admin\_state
the desired state of the instance (either "yes" or "no" denoting
the instance should run or not)
disk\_template
the disk template of the instance
oper\_state
the actual state of the instance; can be one of the values
"running", "stopped", "(node down)"
status
combined form of ``admin_state`` and ``oper_stat``; this can be one of:
``ERROR_nodedown`` if the node of the instance is down, ``ERROR_down`` if
the instance should run but is down, ``ERROR_up`` if the instance should be
stopped but is actually running, ``ERROR_wrongnode`` if the instance is
running but not on the primary, ``ADMIN_down`` if the instance has been
stopped (and is stopped) and ``running`` if the instance is set to be
running (and is running)
oper\_ram
the actual memory usage of the instance as seen by the hypervisor
oper\_vcpus
the actual number of VCPUs the instance is using as seen by the
hypervisor
ip
the ip address Ganeti recognizes as associated with the first
instance interface
mac
the first instance interface MAC address
nic\_mode
the mode of the first instance NIC (routed or bridged)
nic\_link
the link of the first instance NIC
sda\_size
the size of the instance's first disk
sdb\_size
the size of the instance's second disk, if any
vcpus
the number of VCPUs allocated to the instance
tags
comma-separated list of the instances's tags
serial\_no
the so called 'serial number' of the instance; this is a numeric
field that is incremented each time the instance is modified, and
it can be used to track modifications
ctime
the creation time of the instance; note that this field contains
spaces and as such it's harder to parse
if this attribute is not present (e.g. when upgrading from older
versions), then "N/A" will be shown instead
mtime
the last modification time of the instance; note that this field
contains spaces and as such it's harder to parse
if this attribute is not present (e.g. when upgrading from older
versions), then "N/A" will be shown instead
uuid
Show the UUID of the instance (generated automatically by Ganeti)
network\_port
If the instance has a network port assigned to it (e.g. for VNC
connections), this will be shown, otherwise - will be displayed.
beparams
A text format of the entire beparams for the instance. It's more
useful to select individual fields from this dictionary, see
below.
disk.count
The number of instance disks.
disk.size/N
The size of the instance's Nth disk. This is a more generic form of
the sda\_size and sdb\_size fields.
disk.sizes
A comma-separated list of the disk sizes for this instance.
disk\_usage
The total disk space used by this instance on each of its nodes.
This is not the instance-visible disk size, but the actual disk
"cost" of the instance.
nic.mac/N
The MAC of the Nth instance NIC.
nic.ip/N
The IP address of the Nth instance NIC.
nic.mode/N
The mode of the Nth instance NIC
nic.link/N
The link of the Nth instance NIC
nic.macs
A comma-separated list of all the MACs of the instance's NICs.
nic.ips
A comma-separated list of all the IP addresses of the instance's
NICs.
nic.modes
A comma-separated list of all the modes of the instance's NICs.
nic.links
A comma-separated list of all the link parameters of the instance's
NICs.
nic.count
The number of instance nics.
hv/*NAME*
The value of the hypervisor parameter called *NAME*. For details of
what hypervisor parameters exist and their meaning, see the **add**
command.
be/memory
The configured memory for the instance.
be/vcpus
The configured number of VCPUs for the instance.
be/auto\_balance
Whether the instance is considered in N+1 checks.
@QUERY_FIELDS_INSTANCE@
If the value of the option starts with the character ``+``, the new
field(s) will be added to the default list. This allows to quickly
......
......@@ -175,126 +175,7 @@ special field states (see **ganeti(7)**).
The ``-o`` option takes a comma-separated list of output fields.
The available fields and their meaning are:
name
the node name
pinst_cnt
the number of instances having this node as primary
pinst_list
the list of instances having this node as primary, comma separated
sinst_cnt
the number of instances having this node as a secondary node
sinst_list
the list of instances having this node as a secondary node, comma
separated
pip
the primary ip of this node (used for cluster communication)
sip
the secondary ip of this node (used for data replication in dual-ip
clusters, see gnt-cluster(8)
dtotal
total disk space in the volume group used for instance disk
allocations
dfree
available disk space in the volume group
mtotal
total memory on the physical node
mnode
the memory used by the node itself
mfree
memory available for instance allocations
bootid
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)
tags
comma-separated list of the node's tags
serial_no
the so called 'serial number' of the node; this is a numeric field
that is incremented each time the node is modified, and it can be
used to detect modifications
ctime
the creation time of the node; note that this field contains spaces
and as such it's harder to parse
if this attribute is not present (e.g. when upgrading from older
versions), then "N/A" will be shown instead
mtime
the last modification time of the node; note that this field
contains spaces and as such it's harder to parse
if this attribute is not present (e.g. when upgrading from older
versions), then "N/A" will be shown instead
uuid
Show the UUID of the node (generated automatically by Ganeti)
ctotal
the toal number of logical processors
cnodes
the number of NUMA domains on the node, if the hypervisor can
export this information
csockets
the number of physical CPU sockets, if the hypervisor can export
this information
master_candidate
whether the node is a master candidate or not
drained
whether the node is drained or not; the cluster still communicates
with drained nodes but excludes them from allocation operations
offline
whether the node is offline or not; if offline, the cluster does
not communicate with offline nodes; useful for nodes that are not
reachable in order to avoid delays
role
A condensed version of the node flags; this field will output a
one-character field, with the following possible values:
- *M* for the master node
- *C* for a master candidate
- *R* for a regular node
- *D* for a drained node
- *O* for an offline node
master_capable
whether the node can become a master candidate
vm_capable
whether the node can host instances
group
the name of the node's group, if known (the query is done without
locking, so data consistency is not guaranteed)
group.uuid
the UUID of the node's group
@QUERY_FIELDS_NODE@
If the value of the option starts with the character ``+``, the new
fields will be added to the default list. This allows to quickly
......
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