l.b.ConnectionKey(object) : class documentation

Part of libcloud.base View Source View In Hierarchy

Known subclasses: libcloud.base.ConnectionUserAndKey, libcloud.drivers.dreamhost.DreamhostConnection, libcloud.drivers.dummy.DummyConnection, libcloud.drivers.linode.LinodeConnection, libcloud.drivers.rimuhosting.RimuHostingConnection, libcloud.drivers.slicehost.SlicehostConnection

A Base Connection class to derive from.
Method __init__ Initialize `user_id` and `key`; set `secure` to an int based on passed value.
Method connect Establish a connection with the API server.
Method user_agent_append Append a token to a user agent string.
Method request Request a given `action`.
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 Encode body data.
Method _user_agent Undocumented
def __init__(self, key, secure=True, host=None, force_port=None): (source)
Initialize `user_id` and `key`; set `secure` to an int based on passed value.
def connect(self, host=None, port=None): (source)
Establish a connection with the API server.
ParametershostOptional host to override our default (type: str)
portOptional port to override our default (type: int)
ReturnsA connection
def _user_agent(self): (source)
Undocumented
def user_agent_append(self, token): (source)
Append a token to a user agent string.

Users of the library should call this to uniquely identify thier requests to a provider.

ParameterstokenToken to add to the user agent. (type: str)
def request(self, action, params=None, data='', headers=None, method='GET'): (source)
Request a given `action`.

Basically a wrapper around the connection object's `request` that does some helpful pre-processing.

ParametersactionA path (type: str)
paramsOptional mapping of additional parameters to send. If None, leave as an empty dict. (type: dict)
dataA body of data to send with the request. (type: unicode)
headersExtra headers to add to the request None, leave as an empty dict. (type: dict)
methodAn HTTP method such as "GET" or "POST". (type: str)
ReturnsAn instance of type responseCls
def add_default_params(self, params): (source)
Adds default parameters (such as API key, version, etc.) to the passed `params`

Should return a dictionary.

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

Should return a dictionary.

def encode_data(self, data): (source)
Encode body data.

Override in a provider's subclass.

API Documentation for libcloud, generated by pydoctor at 2012-07-15 18:44:33.