Package ganeti :: Package client :: Module gnt_group
[hide private]
[frames] | no frames]

Module gnt_group

source code

Node group related commands

Functions [hide private]
int
AddGroup(opts, args)
Add a node group to the cluster.
source code
int
AssignNodes(opts, args)
Assign nodes to a group.
source code
 
_FmtDict(data)
Format dict data into command-line format.
source code
int
ListGroups(opts, args)
List node groups and their properties.
source code
int
ListGroupFields(opts, args)
List node fields.
source code
int
SetGroupParams(opts, args)
Modifies a node group's parameters.
source code
int
RemoveGroup(opts, args)
Remove a node group from the cluster.
source code
int
RenameGroup(opts, args)
Rename a node group.
source code
 
EvacuateGroup(opts, args)
Evacuate a node group.
source code
 
Main() source code
Variables [hide private]
  _LIST_DEF_FIELDS = ["name", "node_cnt", "pinst_cnt", "alloc_po...
default list of fields for ListGroups
  commands = {"add":(AddGroup, ARGS_ONE_GROUP, [DRY_RUN_OPT, ALL...

Imports: constants, opcodes, utils


Function Details [hide private]

AddGroup(opts, args)

source code 

Add a node group to the cluster.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - a list of length 1 with the name of the group to create
Returns: int
the desired exit code

AssignNodes(opts, args)

source code 

Assign nodes to a group.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - args[0]: group to assign nodes to; args[1:]: nodes to assign
Returns: int
the desired exit code

_FmtDict(data)

source code 

Format dict data into command-line format.

Parameters:
  • data - The input dict to be formatted
Returns:
The formatted dict

ListGroups(opts, args)

source code 

List node groups and their properties.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - groups to list, or empty for all
Returns: int
the desired exit code

ListGroupFields(opts, args)

source code 

List node fields.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - fields to list, or empty for all
Returns: int
the desired exit code

SetGroupParams(opts, args)

source code 

Modifies a node group's parameters.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - should contain only one element, the node group name
Returns: int
the desired exit code

RemoveGroup(opts, args)

source code 

Remove a node group from the cluster.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - a list of length 1 with the name of the group to remove
Returns: int
the desired exit code

RenameGroup(opts, args)

source code 

Rename a node group.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - a list of length 2, [old_name, new_name]
Returns: int
the desired exit code

Variables Details [hide private]

_LIST_DEF_FIELDS

default list of fields for ListGroups

Value:
["name", "node_cnt", "pinst_cnt", "alloc_policy", "ndparams"]

commands

Value:
{"add":(AddGroup, ARGS_ONE_GROUP, [DRY_RUN_OPT, ALLOC_POLICY_OPT, NODE\
_PARAMS_OPT], "<group_name>", "Add a new node group to the cluster"), \
"assign-nodes":(AssignNodes, ARGS_ONE_GROUP+ ARGS_MANY_NODES, [DRY_RUN\
_OPT, FORCE_OPT], "<group_name> <node>...", "Assign nodes to a group")\
, "list":(ListGroups, ARGS_MANY_GROUPS, [NOHDR_OPT, SEP_OPT, FIELDS_OP\
T, VERBOSE_OPT, FORCE_FILTER_OPT], "[<group_name>...]", "Lists the nod\
e groups in the cluster. The available fields can be shown" " using th\
e \"list-fields\" command (see the man page for details)." " The defau\
...