Package ganeti :: Package rpc :: Module client :: Class AbstractClient
[hide private]
[frames] | no frames]

Class AbstractClient

source code


High-level client abstraction.

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

Instance Methods [hide private]
 
__init__(self, timeouts=None, transport=t.Transport, allow_non_master=False)
Constructor for the Client class.
source code
 
_GetAddress(self)
Returns the socket address
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
 
Close(self)
Close the underlying connection.
source code
 
close(self)
Same as Close, to be used with contextlib.closing(...).
source code
 
CallMethod(self, method, args)
Send a generic request and return the response.
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, timeouts=None, transport=t.Transport, allow_non_master=False)
(Constructor)

source code 

Constructor for the Client class.

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

Parameters:
  • timeouts (list of ints) - timeouts to be used on connect and read/write
  • transport (Transport or another compatible class) - the underlying transport to use for the RPC calls
  • allow_non_master (bool) - skip checks for the master node on errors
Overrides: object.__init__