libcloud.common.linode module¶
- class libcloud.common.linode.LinodeConnection(key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, backoff=None, retry_delay=None)[source]¶
Bases:
ConnectionKey
A connection to the Linode API
Wraps SSL connections to the Linode API, automagically injecting the parameters that the API needs for each request.
Initialize user_id and key; set secure to an
int
based on passed value.- add_default_params(params)[source]¶
Add parameters that are necessary for every request
This method adds
api_key
andapi_responseFormat
to the request.
- responseCls¶
alias of
LinodeResponse
- class libcloud.common.linode.LinodeConnectionV4(key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, backoff=None, retry_delay=None)[source]¶
Bases:
ConnectionKey
A connection to the Linode API
Wraps SSL connections to the Linode API
Initialize user_id and key; set secure to an
int
based on passed value.- add_default_headers(headers)[source]¶
Add headers that are necessary for every request
This method adds
token
to the request.
- add_default_params(params)[source]¶
Add parameters that are necessary for every request
This method adds
page_size
to the request to reduce the total number of paginated requests to the API.
- responseCls¶
alias of
LinodeResponseV4
- class libcloud.common.linode.LinodeDisk(id, state, name, filesystem, driver, size, extra=None)[source]¶
Bases:
BaseObject
- exception libcloud.common.linode.LinodeException(code, message)[source]¶
Bases:
Exception
Error originating from the Linode API
This class wraps a Linode API error, a list of which is available in the API documentation. All Linode API errors are a numeric code and a human-readable description.
- class libcloud.common.linode.LinodeIPAddress(inet, public, version, driver, extra=None)[source]¶
Bases:
object
- class libcloud.common.linode.LinodeResponse(response, connection)[source]¶
Bases:
JsonResponse
Linode API response
Wraps the HTTP response returned by the Linode API.
libcloud does not take advantage of batching, so a response will always reflect the above format. A few weird quirks are caught here as well.
Instantiate a LinodeResponse from the HTTP response
- Parameters:
response – The raw response returned by urllib
- Returns:
parsed
LinodeResponse
- objects = None¶
- class libcloud.common.linode.LinodeResponseV4(response, connection)[source]¶
Bases:
JsonResponse
- Parameters:
response (
httplib.HTTPResponse
) – HTTP response object. (optional)connection (
Connection
) – Parent connection object.
- valid_response_codes = [<HTTPStatus.OK: 200>, <HTTPStatus.NO_CONTENT: 204>]¶