Package ganeti :: Module rpc_defs
[hide private]
[frames] | no frames]

Module rpc_defs

source code

RPC definitions for communication between master and node daemons.

RPC definition fields:

Functions [hide private]
 
_Prepare(calls)
Converts list of calls to dictionary.
source code
 
_MigrationStatusPostProc(result)
Post-processor for rpc.RpcRunner.call_instance_get_migration_status.
source code
 
_BlockdevFindPostProc(result)
Post-processor for rpc.RpcRunner.call_blockdev_find.
source code
 
_BlockdevGetMirrorStatusPostProc(result)
Post-processor for rpc.RpcRunner.call_blockdev_getmirrorstatus.
source code
 
_BlockdevGetMirrorStatusMultiPreProc(node, args)
Prepares the appropriate node values for blockdev_getmirrorstatus_multi.
source code
 
_BlockdevGetMirrorStatusMultiPostProc(result)
Post-processor for rpc.RpcRunner.call_blockdev_getmirrorstatus_multi.
source code
 
_OsGetPostProc(result)
Post-processor for rpc.RpcRunner.call_os_get.
source code
Payload containing list of objects.ImportExportStatus instances
_ImpExpStatusPostProc(result)
Post-processor for import/export status.
source code
 
_TestDelayTimeout((duration,))
Calculate timeout for "test_delay" RPC.
source code
Variables [hide private]
  TMO_URGENT = 60
  TMO_FAST = 5* 60
  TMO_NORMAL = 15* 60
  TMO_SLOW = 3600
  TMO_4HRS = 4* 3600
  TMO_1DAY = 86400
  SINGLE = "single-node"
  MULTI = "multi-node"
  ACCEPT_OFFLINE_NODE = object()
  _FILE_STORAGE_CALLS = [("file_storage_dir_create", SINGLE, Non...
  _STORAGE_CALLS = [("storage_list", MULTI, None, TMO_NORMAL, [(...
  _INSTANCE_CALLS = [("instance_info", SINGLE, None, TMO_URGENT,...
  _IMPEXP_CALLS = [("import_start", SINGLE, None, TMO_NORMAL, [(...
  _X509_CALLS = [("x509_cert_create", SINGLE, None, TMO_NORMAL, ...
  _BLOCKDEV_CALLS = [("bdev_sizes", MULTI, None, TMO_URGENT, [("...
  _OS_CALLS = [("os_diagnose", MULTI, None, TMO_FAST, [], None, ...
  _NODE_CALLS = [("node_has_ip_address", SINGLE, None, TMO_FAST,...
  _MISC_CALLS = [("lv_list", MULTI, None, TMO_URGENT, [("vg_name...
  CALLS = {"RpcClientDefault": _Prepare(_IMPEXP_CALLS+ _X509_CAL...

Imports: utils, objects


Function Details [hide private]

_ImpExpStatusPostProc(result)

source code 

Post-processor for import/export status.

Returns: Payload containing list of objects.ImportExportStatus instances
Returns a list of the state of each named import/export or None if a status couldn't be retrieved

Variables Details [hide private]

_FILE_STORAGE_CALLS

Value:
[("file_storage_dir_create", SINGLE, None, TMO_FAST, [("file_storage_d\
ir", None, "File storage directory"),], None, None, "Create the given \
file storage directory"), ("file_storage_dir_remove", SINGLE, None, TM\
O_FAST, [("file_storage_dir", None, "File storage directory"),], None,\
 None, "Remove the given file storage directory"), ("file_storage_dir_\
rename", SINGLE, None, TMO_FAST, [("old_file_storage_dir", None, "Old \
name"), ("new_file_storage_dir", None, "New name"),], None, None, "Ren\
ame file storage directory"),]

_STORAGE_CALLS

Value:
[("storage_list", MULTI, None, TMO_NORMAL, [("su_name", None, None), (\
"su_args", None, None), ("name", None, None), ("fields", None, None),]\
, None, None, "Get list of storage units"), ("storage_modify", SINGLE,\
 None, TMO_NORMAL, [("su_name", None, None), ("su_args", None, None), \
("name", None, None), ("changes", None, None),], None, None, "Modify a\
 storage unit"), ("storage_execute", SINGLE, None, TMO_NORMAL, [("su_n\
ame", None, None), ("su_args", None, None), ("name", None, None), ("op\
", None, None),], None, None, "Executes an operation on a storage unit\
...

_INSTANCE_CALLS

Value:
[("instance_info", SINGLE, None, TMO_URGENT, [("instance", None, "Inst\
ance name"), ("hname", None, "Hypervisor type"),], None, None, "Return\
s information about a single instance"), ("all_instances_info", MULTI,\
 None, TMO_URGENT, [("hypervisor_list", None, "Hypervisors to query fo\
r instances"),], None, None, "Returns information about all instances \
on the given nodes"), ("instance_list", MULTI, None, TMO_URGENT, [("hy\
pervisor_list", None, "Hypervisors to query for instances"),], None, N\
one, "Returns the list of running instances on the given nodes"), ("in\
...

_IMPEXP_CALLS

Value:
[("import_start", SINGLE, None, TMO_NORMAL, [("opts", ED_OBJECT_DICT, \
None), ("instance", ED_INST_DICT, None), ("component", None, None), ("\
dest", ED_IMPEXP_IO, "Import destination"),], None, None, "Starts an i\
mport daemon"), ("export_start", SINGLE, None, TMO_NORMAL, [("opts", E\
D_OBJECT_DICT, None), ("host", None, None), ("port", None, None), ("in\
stance", ED_INST_DICT, None), ("component", None, None), ("source", ED\
_IMPEXP_IO, "Export source"),], None, None, "Starts an export daemon")\
, ("impexp_status", SINGLE, None, TMO_FAST, [("names", None, "Import/e\
...

_X509_CALLS

Value:
[("x509_cert_create", SINGLE, None, TMO_NORMAL, [("validity", None, "V\
alidity in seconds"),], None, None, "Creates a new X509 certificate fo\
r SSL/TLS"), ("x509_cert_remove", SINGLE, None, TMO_NORMAL, [("name", \
None, "Certificate name"),], None, None, "Removes a X509 certificate")\
,]

_BLOCKDEV_CALLS

Value:
[("bdev_sizes", MULTI, None, TMO_URGENT, [("devices", None, None),], N\
one, None, "Gets the sizes of requested block devices present on a nod\
e"), ("blockdev_create", SINGLE, None, TMO_NORMAL, [("bdev", ED_OBJECT\
_DICT, None), ("size", None, None), ("owner", None, None), ("on_primar\
y", None, None), ("info", None, None),], None, None, "Request creation\
 of a given block device"), ("blockdev_wipe", SINGLE, None, TMO_SLOW, \
[("bdev", ED_SINGLE_DISK_DICT_DP, None), ("offset", None, None), ("siz\
e", None, None),], None, None, "Request wipe at given offset with give\
...

_OS_CALLS

Value:
[("os_diagnose", MULTI, None, TMO_FAST, [], None, None, "Request a dia\
gnose of OS definitions"), ("os_validate", MULTI, None, TMO_FAST, [("r\
equired", None, None), ("name", None, None), ("checks", None, None), (\
"params", None, None),], None, None, "Run a validation routine for a g\
iven OS"), ("os_get", SINGLE, None, TMO_FAST, [("name", None, None),],\
 None, _OsGetPostProc, "Returns an OS definition"),]

_NODE_CALLS

Value:
[("node_has_ip_address", SINGLE, None, TMO_FAST, [("address", None, "I\
P address"),], None, None, "Checks if a node has the given IP address"\
), ("node_info", MULTI, None, TMO_URGENT, [("vg_names", None, "Names o\
f the volume groups to ask for disk space information"), ("hv_names", \
None, "Names of the hypervisors to ask for node information"),], None,\
 None, "Return node information"), ("node_verify", MULTI, None, TMO_NO\
RMAL, [("checkdict", None, None), ("cluster_name", None, None),], None\
, None, "Request verification of given parameters"), ("node_volumes", \
...

_MISC_CALLS

Value:
[("lv_list", MULTI, None, TMO_URGENT, [("vg_name", None, None),], None\
, None, "Gets the logical volumes present in a given volume group"), (\
"vg_list", MULTI, None, TMO_URGENT, [], None, None, "Gets the volume g\
roup list"), ("bridges_exist", SINGLE, None, TMO_URGENT, [("bridges_li\
st", None, "Bridges which must be present on remote node"),], None, No\
ne, "Checks if a node has all the bridges given"), ("etc_hosts_modify"\
, SINGLE, None, TMO_NORMAL, [("mode", None, "Mode to operate; currentl\
y L{constants.ETC_HOSTS_ADD} or" " L{constants.ETC_HOSTS_REMOVE}"), ("\
...

CALLS

Value:
{"RpcClientDefault": _Prepare(_IMPEXP_CALLS+ _X509_CALLS+ _OS_CALLS+ _\
NODE_CALLS+ _FILE_STORAGE_CALLS+ _MISC_CALLS+ _INSTANCE_CALLS+ _BLOCKD\
EV_CALLS+ _STORAGE_CALLS), "RpcClientJobQueue": _Prepare([("jobqueue_u\
pdate", MULTI, None, TMO_URGENT, [("file_name", None, None), ("content\
", ED_COMPRESS, None),], None, None, "Update job queue file"), ("jobqu\
eue_purge", SINGLE, None, TMO_NORMAL, [], None, None, "Purge job queue\
"), ("jobqueue_rename", MULTI, None, TMO_URGENT, [("rename", None, Non\
e),], None, None, "Rename job queue file"),]), "RpcClientBootstrap": _\
...