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
 
_FormatDict(custom, actual, level=2)
Helper function to cli.FormatParameterDict.
source code
 
GroupInfo(_, args)
Shows info about 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
  _ENV_OVERRIDE = frozenset(["list"])
  commands = {"add":(AddGroup, ARGS_ONE_GROUP, [DRY_RUN_OPT, ALL...

Imports: constants, opcodes, utils, StringIO


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

_FormatDict(custom, actual, level=2)

source code 

Helper function to cli.FormatParameterDict.

Parameters:
  • custom - The customized dict
  • actual - The fully filled dict

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, DISK_PARAMS_OPT, HV_STATE_OPT, DISK_STATE_OPT, PRIORITY_O\
PT, SUBMIT_OPT]+ INSTANCE_POLICY_OPTS, "<group_name>", "Add a new node\
 group to the cluster"), "assign-nodes":(AssignNodes, ARGS_ONE_GROUP+ \
ARGS_MANY_NODES, [DRY_RUN_OPT, FORCE_OPT, PRIORITY_OPT, SUBMIT_OPT], "\
<group_name> <node>...", "Assign nodes to a group"), "list":(ListGroup\
s, ARGS_MANY_GROUPS, [NOHDR_OPT, SEP_OPT, FIELDS_OPT, VERBOSE_OPT, FOR\
CE_FILTER_OPT], "[<group_name>...]", "Lists the node groups in the clu\
...