Part of libcloud.drivers.linode View Source View In Hierarchy
Linode API response Wraps the HTTP response returned by the Linode API, which should be JSON in this structure: { "ERRORARRAY": [ ... ], "DATA": [ ... ], "ACTION": " ... " } 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.
Method | __init__ | Instantiate a LinodeResponse from the HTTP response |
Method | parse_body | Parse the body of the response into JSON objects |
Method | success | Check the response for success |
Method | _make_excp | Convert an API error to a LinodeException instance |
Inherited from Response:
Method | parse_error | Parse the error messages. |
Parameters | response | The raw response returned by urllib |
Returns | parsed LinodeResponse |
If the response chokes the parser, action and data will be returned as None and errorarray will indicate an invalid JSON exception.
Returns | list of objects and list of errors |
The way we determine success is by the presence of an error in ERRORARRAY. If one is there, we assume the whole request failed.
Returns | bool indicating a successful request |
Parameters | error | JSON object containing ERRORCODE and ERRORMESSAGE (type: dict) |