Revision 4edc512c

b/lib/client/gnt_group.py
26 26

  
27 27
from ganeti.cli import *
28 28
from ganeti import compat
29
from ganeti import utils
29 30

  
30 31

  
31 32
#: default list of fields for L{ListGroups}
......
37 38
  "name": "Group", "uuid": "UUID",
38 39
  "node_cnt": "Nodes", "node_list": "NodeList",
39 40
  "pinst_cnt": "Instances", "pinst_list": "InstanceList",
41
  "ctime": "CTime", "mtime": "MTime", "serial_no": "SerialNo",
40 42
}
41 43

  
42 44

  
......
59 61
  else:
60 62
    headers = _LIST_HEADERS
61 63

  
62
  int_type_fields = frozenset(["node_cnt", "pinst_cnt"])
64
  int_type_fields = frozenset(["node_cnt", "pinst_cnt", "serial_no"])
63 65
  list_type_fields = frozenset(["node_list", "pinst_list"])
66
  date_type_fields = frozenset(["mtime", "ctime"])
64 67

  
65 68
  for row in output:
66 69
    for idx, field in enumerate(desired_fields):
......
70 73
        val = ",".join(val)
71 74
      elif opts.roman_integers and field in int_type_fields:
72 75
        val = compat.TryToRoman(val)
76
      elif field in date_type_fields:
77
        val = utils.FormatTime(val)
73 78
      elif val is None:
74 79
        val = "?"
75 80

  
......
88 93
  "list": (
89 94
    ListGroups, ARGS_MANY_GROUPS,
90 95
    [NOHDR_OPT, SEP_OPT, FIELDS_OPT, SYNC_OPT, ROMAN_OPT],
91
    "[<group_name>...]", "Lists the node groups in the cluster."),
96
    "[<group_name>...]",
97
    "Lists the node groups in the cluster. The available fields are (see"
98
    " the man page for details): %s. The default list is (in order): %s." %
99
    (utils.CommaJoin(_LIST_HEADERS), utils.CommaJoin(_LIST_DEF_FIELDS))),
92 100
}
93 101

  
94 102

  
b/lib/cmdlib.py
10311 10311

  
10312 10312
  _FIELDS_DYNAMIC = utils.FieldSet()
10313 10313

  
10314
  _SIMPLE_FIELDS = ["name", "uuid"]
10314
  _SIMPLE_FIELDS = ["name", "uuid", "ctime", "mtime", "serial_no"]
10315 10315

  
10316 10316
  _FIELDS_STATIC = utils.FieldSet(
10317 10317
      "node_cnt", "node_list", "pinst_cnt", "pinst_list", *_SIMPLE_FIELDS)
b/lib/rapi/rlib2.py
75 75

  
76 76
G_FIELDS = ["name", "uuid",
77 77
            "node_cnt", "node_list",
78
            ]
78
            "ctime", "mtime", "serial_no",
79
            ]  # "tags" is missing to be able to use _COMMON_FIELDS here.
79 80

  
80 81
_NR_DRAINED = "drained"
81 82
_NR_MASTER_CANDIATE = "master-candidate"
b/man/gnt-group.rst
60 60
pinst_list
61 61
    the list of primary instances in the group
62 62

  
63
ctime
64
    the creation time of the group; note that this field contains spaces
65
    and as such it's harder to parse
66

  
67
    if this attribute is not present (e.g. when upgrading from older
68
    versions), then "N/A" will be shown instead
69

  
70
mtime
71
    the last modification time of the group; note that this field
72
    contains spaces and as such it's harder to parse
73

  
74
serial_no
75
    the so called 'serial number' of the group; this is a numeric field
76
    that is incremented each time the node is modified, and it can be
77
    used to detect modifications
78

  
63 79
If no group names are given, then all groups are included. Otherwise,
64 80
only the named groups will be listed.

Also available in: Unified diff