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

Module luxi

source code

Module for the unix socket protocol

This module implements the local unix socket protocol. You only need this module and the opcodes module in the client program in order to communicate with the master.

The module is also used by the master daemon.

Classes [hide private]
  ProtocolError
Denotes an error in the LUXI protocol.
  ConnectionClosedError
Connection closed error.
  TimeoutError
Operation timeout error.
  RequestError
Error on request.
  NoMasterError
The master cannot be reached.
  PermissionError
Permission denied while connecting to the master socket.
  Transport
Low-level transport class.
  Client
High-level client implementation.
Functions [hide private]
 
ParseRequest(msg)
Parses a LUXI request message.
source code
 
ParseResponse(msg)
Parses a LUXI response message.
source code
 
FormatResponse(success, result)
Formats a LUXI response message.
source code
 
FormatRequest(method, args)
Formats a LUXI request message.
source code
 
CallLuxiMethod(transport_cb, method, args)
Send a LUXI request via a transport and return the response.
source code
Variables [hide private]
  KEY_METHOD = "method"
  KEY_ARGS = "args"
  KEY_SUCCESS = "success"
  KEY_RESULT = "result"
  REQ_SUBMIT_JOB = "SubmitJob"
  REQ_SUBMIT_MANY_JOBS = "SubmitManyJobs"
  REQ_WAIT_FOR_JOB_CHANGE = "WaitForJobChange"
  REQ_CANCEL_JOB = "CancelJob"
  REQ_ARCHIVE_JOB = "ArchiveJob"
  REQ_AUTOARCHIVE_JOBS = "AutoArchiveJobs"
  REQ_QUERY_JOBS = "QueryJobs"
  REQ_QUERY_INSTANCES = "QueryInstances"
  REQ_QUERY_NODES = "QueryNodes"
  REQ_QUERY_EXPORTS = "QueryExports"
  REQ_QUERY_CONFIG_VALUES = "QueryConfigValues"
  REQ_QUERY_CLUSTER_INFO = "QueryClusterInfo"
  REQ_QUERY_TAGS = "QueryTags"
  REQ_QUERY_LOCKS = "QueryLocks"
  REQ_QUEUE_SET_DRAIN_FLAG = "SetDrainFlag"
  REQ_SET_WATCHER_PAUSE = "SetWatcherPause"
  DEF_CTMO = 10
  DEF_RWTO = 60
  WFJC_TIMEOUT = DEF_RWTO-1/ 2

Imports: socket, collections, time, errno, logging, serializer, constants, errors, utils