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
 
_GetAddress(self)
Returns the socket address
source code
 
SetQueueDrainFlag(self, drain_flag) source code
 
SetWatcherPause(self, until) source code
 
PickupJob(self, job) source code
 
SubmitJob(self, ops) source code
 
SubmitJobToDrainedQueue(self, ops) source code
 
SubmitManyJobs(self, jobs) source code
 
CancelJob(self, job_id, kill=False) source code
 
ArchiveJob(self, job_id) source code
 
ChangeJobPriority(self, job_id, priority) 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
objects.QueryResponse
Query(self, what, fields, qfilter)
Query for resources/items.
source code
objects.QueryFieldsResponse
QueryFields(self, what, fields)
Query for available fields.
source code
 
QueryJobs(self, job_ids, fields) source code
 
QueryFilters(self, uuids, fields) source code
 
ReplaceFilter(self, uuid, priority, predicates, action, reason) source code
 
DeleteFilter(self, uuid) source code
 
QueryInstances(self, names, fields, use_locking) source code
 
QueryNodes(self, names, fields, use_locking) source code
 
QueryGroups(self, names, fields, use_locking) source code
 
QueryNetworks(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

Inherited from rpc.client.AbstractClient: CallMethod, Close, close

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

Static Methods [hide private]
 
_PrepareJobId(request_name, job_id) source code
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 are the same as for AbstractClient.

Parameters:
  • timeouts - timeouts to be used on connect and read/write
  • transport - the underlying transport to use for the RPC calls
  • allow_non_master - skip checks for the master node on errors
Overrides: object.__init__

_GetAddress(self)

source code 

Returns the socket address

Overrides: rpc.client.AbstractClient._GetAddress
(inherited documentation)

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)

Query(self, what, fields, qfilter)

source code 

Query for resources/items.

Parameters:
  • what - One of constants.QR_VIA_LUXI
  • fields (List of strings) - List of requested fields
  • qfilter (None or list) - Query filter
Returns: objects.QueryResponse

QueryFields(self, what, fields)

source code 

Query for available fields.

Parameters:
  • what - One of constants.QR_VIA_LUXI
  • fields (None or list of strings) - List of requested fields
Returns: objects.QueryFieldsResponse