Part of libcloud.common.base View Source View In Hierarchy
Known subclasses: libcloud.common.base.PollingConnection, libcloud.compute.base.ConnectionKey
Method | __init__ | Undocumented |
Method | set_context | Undocumented |
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 | morph_action_hook | Undocumented |
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 | pre_connect_hook | A hook which is called before connecting to the remote server. This hook can perform a final manipulation on the params, headers and url parameters. |
Method | encode_data | Encode body data. |
Method | _tuple_from_url | Undocumented |
Method | _user_agent | Undocumented |
Parameters | host | Optional host to override our default (type: str ) |
port | Optional port to override our default (type: int ) | |
Returns | A connection |
Users of the library should call this to uniquely identify thier requests to a provider.
Parameters | token | Token to add to the user agent. (type: str ) |
Basically a wrapper around the connection object's `request` that does some helpful pre-processing.
Parameters | action | A path (type: str ) |
params | Optional mapping of additional parameters to send. If None, leave as an
empty dict . (type: dict ) | |
data | A body of data to send with the request. (type: unicode ) | |
headers | Extra headers to add to the request None, leave as an empty
dict . (type: dict ) | |
method | An HTTP method such as "GET" or "POST". (type: str ) | |
raw | True to perform a "raw" request aka only send the headers and use
the rawResponseCls class. This is used with storage API when uploading a
file. (type: bool ) | |
Returns | An instance of type responseCls |
Should return a dictionary.
Should return a dictionary.
Parameters | params | Request parameters. (type: dict ) |
headers | Request headers. (type: dict ) |