l.i.IConnection(Interface) : interface documentation

Part of libcloud.interface View Source View In Hierarchy

Known subclasses: libcloud.interface.IConnectionKey

A Connection represents an interface between a Client and a Provider's Web Service. It is capable of authenticating, making requests, and returning responses.
Attribute conn_classes Classes used to create connections, should be in the form of `(insecure, secure)`
Attribute responseCls Provider-specific Class used for creating responses
Attribute connection Represents the lower-level connection to the server
Attribute host Default host for this connection
Attribute port Default port for this connection. This should be a tuple of the form `(insecure, secure)` or for single-port Providers, simply `(port,)`
Attribute secure Indicates if this is a secure connection. If previous recommendations were followed, it would be advantageous for this to be in the form: 0=insecure, 1=secure
Attribute driver The NodeDriver that belongs to this Node
Method connect A method for establishing a connection. If no host or port are given, existing ivars should be used.
Method request Make a request.
Method add_default_params Adds default parameters (such as API key, version, etc.) to the passed `params`
Method add_default_headers Adds default headers (such as Authorization, X-Foo-Bar) to the passed `headers`
Method encode_data Data may need to be encoded before sent in a request. If not, simply return the data.
conn_classes =
Classes used to create connections, should be in the form of `(insecure, secure)`
responseCls =
Provider-specific Class used for creating responses
connection =
Represents the lower-level connection to the server
host =
Default host for this connection
port =
Default port for this connection. This should be a tuple of the form `(insecure, secure)` or for single-port Providers, simply `(port,)`
secure =
Indicates if this is a secure connection. If previous recommendations were followed, it would be advantageous for this to be in the form: 0=insecure, 1=secure
driver =
The NodeDriver that belongs to this Node
def connect(host=None, port=None): (source)
A method for establishing a connection. If no host or port are given, existing ivars should be used.
def request(action, params={}, data='', method='GET'): (source)
Make a request.

An `action` should represent a path, such as `/list/nodes`. Query parameters necessary to the request should be passed in `params` and any data to encode goes in `data`. `method` should be one of: (GET, POST).

Should return a response object (specific to a provider).

def add_default_params(params): (source)
Adds default parameters (such as API key, version, etc.) to the passed `params`

Should return a dictionary.

def add_default_headers(headers): (source)
Adds default headers (such as Authorization, X-Foo-Bar) to the passed `headers`

Should return a dictionary.

def encode_data(data): (source)
Data may need to be encoded before sent in a request. If not, simply return the data.
API Documentation for libcloud, generated by pydoctor at 2012-07-15 18:42:22.