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

Class Client

source code


High-level client implementation.

This uses a backing Transport-like class on top of which it implements data serialization/deserialization.

Instance Methods [hide private]
 
__init__(self, address=None, timeouts=None, transport=Transport)
Constructor for the Client class.
source code
 
_InitTransport(self)
(Re)initialize the transport if needed.
source code
 
_CloseTransport(self)
Close the transport, ignoring errors.
source code
 
_SendMethodCall(self, data) source code
 
CallMethod(self, method, args)
Send a generic request and return the response.
source code
 
SetQueueDrainFlag(self, drain_flag) source code
 
SetWatcherPause(self, until) source code
 
SubmitJob(self, ops) source code
 
SubmitManyJobs(self, jobs) source code
 
CancelJob(self, job_id) source code
 
ArchiveJob(self, job_id) source code
 
AutoArchiveJobs(self, age) source code
 
WaitForJobChangeOnce(self, job_id, fields, prev_job_info, prev_log_serial, timeout=WFJC_TIMEOUT)
Waits for changes on a job.
source code
 
WaitForJobChange(self, job_id, fields, prev_job_info, prev_log_serial) source code
 
QueryJobs(self, job_ids, fields) source code
 
QueryInstances(self, names, fields, use_locking) source code
 
QueryNodes(self, names, fields, use_locking) source code
 
QueryExports(self, nodes, use_locking) source code
 
QueryClusterInfo(self) source code
 
QueryConfigValues(self, fields) source code
 
QueryTags(self, kind, name) source code
 
QueryLocks(self, fields, sync) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, address=None, timeouts=None, transport=Transport)
(Constructor)

source code 

Constructor for the Client class.

Arguments:

  • address: a valid address the the used transport class
  • timeout: a list of timeouts, to be used on connect and read/write
  • transport: a Transport-like class

If timeout is not passed, the default timeouts of the transport class are used.

Overrides: object.__init__

WaitForJobChangeOnce(self, job_id, fields, prev_job_info, prev_log_serial, timeout=WFJC_TIMEOUT)

source code 

Waits for changes on a job.

Parameters:
  • job_id - Job ID
  • fields (list) - List of field names to be observed
  • prev_job_info (None or list) - Previously received job information
  • prev_log_serial (None or int/long) - Highest log serial number previously received
  • timeout (int/float) - Timeout in seconds (values larger than WFJC_TIMEOUT will be capped to that value)