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.node.RpcRunner.call_instance_get_migration_status
source code
 
_BlockdevFindPostProc(result)
Post-processor for rpc.node.RpcRunner.call_blockdev_find.
source code
 
_BlockdevGetMirrorStatusPostProc(result)
Post-processor for call_blockdev_getmirrorstatus.
source code
 
_BlockdevGetMirrorStatusMultiPreProc(node, args)
Prepares the appropriate node values for blockdev_getmirrorstatus_multi.
source code
 
_BlockdevGetMirrorStatusMultiPostProc(result)
Post-processor for call_blockdev_getmirrorstatus_multi.
source code
 
_NodeInfoPreProc(node, args)
Prepare the storage_units argument for node_info calls.
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]
  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, constants.RPC_...
  _INSTANCE_CALLS = [("instance_info", SINGLE, None, constants.R...
  _IMPEXP_CALLS = [("import_start", SINGLE, None, constants.RPC_...
  _X509_CALLS = [("x509_cert_create", SINGLE, None, constants.RP...
  _BLOCKDEV_CALLS = [("bdev_sizes", MULTI, None, constants.RPC_T...
  _OS_CALLS = [("os_diagnose", MULTI, None, constants.RPC_TMO_FA...
  _EXTSTORAGE_CALLS = [("extstorage_diagnose", MULTI, None, cons...
  _NODE_CALLS = [("node_has_ip_address", SINGLE, None, constants...
  _MISC_CALLS = [("lv_list", MULTI, None, constants.RPC_TMO_URGE...
  CALLS = {"RpcClientDefault": _Prepare(_IMPEXP_CALLS+ _X509_CAL...

Imports: constants, 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, constants.RPC_TMO_FAST, [("\
file_storage_dir", None, "File storage directory"),], None, None, "Cre\
ate the given file storage directory"), ("file_storage_dir_remove", SI\
NGLE, None, constants.RPC_TMO_FAST, [("file_storage_dir", None, "File \
storage directory"),], None, None, "Remove the given file storage dire\
ctory"), ("file_storage_dir_rename", SINGLE, None, constants.RPC_TMO_F\
AST, [("old_file_storage_dir", None, "Old name"), ("new_file_storage_d\
ir", None, "New name"),], None, None, "Rename file storage directory")\
...

_STORAGE_CALLS

Value:
[("storage_list", MULTI, None, constants.RPC_TMO_NORMAL, [("su_name", \
None, None), ("su_args", None, None), ("name", None, None), ("fields",\
 None, None),], None, None, "Get list of storage units"), ("storage_mo\
dify", SINGLE, None, constants.RPC_TMO_NORMAL, [("su_name", None, None\
), ("su_args", None, None), ("name", None, None), ("changes", None, No\
ne),], None, None, "Modify a storage unit"), ("storage_execute", SINGL\
E, None, constants.RPC_TMO_NORMAL, [("su_name", None, None), ("su_args\
", None, None), ("name", None, None), ("op", None, None),], None, None\
...

_INSTANCE_CALLS

Value:
[("instance_info", SINGLE, None, constants.RPC_TMO_URGENT, [("instance\
", None, "Instance name"), ("hname", None, "Hypervisor type"), ("hvpar\
ams", None, "Hypervisor parameters"),], None, None, "Returns informati\
on about a single instance"), ("all_instances_info", MULTI, None, cons\
tants.RPC_TMO_URGENT, [("hypervisor_list", None, "Hypervisors to query\
 for instances"), ("all_hvparams", None, "Dictionary mapping hyperviso\
r names to hvparams"),], None, None, "Returns information about all in\
stances on the given nodes"), ("instance_list", MULTI, None, constants\
...

_IMPEXP_CALLS

Value:
[("import_start", SINGLE, None, constants.RPC_TMO_NORMAL, [("opts", ED\
_OBJECT_DICT, None), ("instance", ED_INST_DICT, None), ("component", N\
one, None), ("dest", ED_IMPEXP_IO, "Import destination"),], None, None\
, "Starts an import daemon"), ("export_start", SINGLE, None, constants\
.RPC_TMO_NORMAL, [("opts", ED_OBJECT_DICT, None), ("host", None, None)\
, ("port", None, None), ("instance", ED_INST_DICT, None), ("component"\
, None, None), ("source", ED_IMPEXP_IO, "Export source"),], None, None\
, "Starts an export daemon"), ("impexp_status", SINGLE, None, constant\
...

_X509_CALLS

Value:
[("x509_cert_create", SINGLE, None, constants.RPC_TMO_NORMAL, [("valid\
ity", None, "Validity in seconds"),], None, None, "Creates a new X509 \
certificate for SSL/TLS"), ("x509_cert_remove", SINGLE, None, constant\
s.RPC_TMO_NORMAL, [("name", None, "Certificate name"),], None, None, "\
Removes a X509 certificate"),]

_BLOCKDEV_CALLS

Value:
[("bdev_sizes", MULTI, None, constants.RPC_TMO_URGENT, [("devices", No\
ne, None),], None, None, "Gets the sizes of requested block devices pr\
esent on a node"), ("blockdev_create", SINGLE, None, constants.RPC_TMO\
_NORMAL, [("bdev", ED_SINGLE_DISK_DICT_DP, None), ("size", None, None)\
, ("owner", None, None), ("on_primary", None, None), ("info", None, No\
ne), ("exclusive_storage", None, None),], None, None, "Request creatio\
n of a given block device"), ("blockdev_convert", SINGLE, None, consta\
nts.RPC_TMO_SLOW, [("bdev_src", ED_SINGLE_DISK_DICT_DP, None), ("bdev_\
...

_OS_CALLS

Value:
[("os_diagnose", MULTI, None, constants.RPC_TMO_FAST, [], None, None, \
"Request a diagnose of OS definitions"), ("os_validate", MULTI, None, \
constants.RPC_TMO_FAST, [("required", None, None), ("name", None, None\
), ("checks", None, None), ("params", None, None), ("force_variant", N\
one, None),], None, None, "Run a validation routine for a given OS"), \
("os_export", SINGLE, None, constants.RPC_TMO_FAST, [("instance", ED_I\
NST_DICT, None), ("override_env", None, None),], None, None, "Export a\
n OS for a given instance"),]

_EXTSTORAGE_CALLS

Value:
[("extstorage_diagnose", MULTI, None, constants.RPC_TMO_FAST, [], None\
, None, "Request a diagnose of ExtStorage Providers"),]

_NODE_CALLS

Value:
[("node_has_ip_address", SINGLE, None, constants.RPC_TMO_FAST, [("addr\
ess", None, "IP address"),], None, None, "Checks if a node has the giv\
en IP address"), ("node_info", MULTI, None, constants.RPC_TMO_URGENT, \
[("storage_units", None, "List of tuples '<storage_type>,<key>,[<param\
>]' to ask for disk space" " information; the parameter list varies de\
pending on the storage_type"), ("hv_specs", None, "List of hypervisor \
specification (name, hvparams) to ask for node " "information"),], _No\
deInfoPreProc, None, "Return node information"), ("node_verify", MULTI\
...

_MISC_CALLS

Value:
[("lv_list", MULTI, None, constants.RPC_TMO_URGENT, [("vg_name", None,\
 None),], None, None, "Gets the logical volumes present in a given vol\
ume group"), ("vg_list", MULTI, None, constants.RPC_TMO_URGENT, [], No\
ne, None, "Gets the volume group list"), ("bridges_exist", SINGLE, Non\
e, constants.RPC_TMO_URGENT, [("bridges_list", None, "Bridges which mu\
st be present on remote node"),], None, None, "Checks if a node has al\
l the bridges given"), ("etc_hosts_modify", SINGLE, None, constants.RP\
C_TMO_NORMAL, [("mode", None, "Mode to operate; currently L{constants.\
...

CALLS

Value:
{"RpcClientDefault": _Prepare(_IMPEXP_CALLS+ _X509_CALLS+ _OS_CALLS+ _\
NODE_CALLS+ _FILE_STORAGE_CALLS+ _MISC_CALLS+ _INSTANCE_CALLS+ _BLOCKD\
EV_CALLS+ _STORAGE_CALLS+ _EXTSTORAGE_CALLS), "RpcClientJobQueue": _Pr\
epare([("jobqueue_update", MULTI, None, constants.RPC_TMO_URGENT, [("f\
ile_name", None, None), ("content", ED_COMPRESS, None),], None, None, \
"Update job queue file"), ("jobqueue_purge", SINGLE, None, constants.R\
PC_TMO_NORMAL, [], None, None, "Purge job queue"), ("jobqueue_rename",\
 MULTI, None, constants.RPC_TMO_URGENT, [("rename", None, None),], Non\
...