Part of libcloud.common.abiquo View Source View In Hierarchy
Abiquo XML Response. Wraps the response in XML bodies or extract the error data in case of error.
Method | parse_error | Parse the error messages. |
Method | success | Determine if the request was successful. |
Method | async_success | Determinate if async request was successful. |
Inherited from XmlResponse:
Method | parse_body | Parse response body. |
Inherited from Response (via XmlResponse):
Method | __init__ | Undocumented |
Method | _decompress_response | Decompress a response body if it is using deflate or gzip encoding. |
Parse the error messages. Response body can easily be handled by this class parent L{XmlResponse}, but there are use cases which Abiquo API does not respond an XML but an HTML. So we need to handle these special cases.
Determine if the request was successful. Any of the 2XX HTTP response codes are accepted as successfull requests @rtype: C{bool} @return: successful request or not.
Determinate if async request was successful. An async_request retrieves for a task object that can be successfully retrieved (self.status == OK), but the asyncronous task (the body of the HTTP response) which we are asking for has finished with an error. So this method checks if the status code is 'OK' and if the task has finished successfully. @rtype: C{bool} @return: successful asynchronous request or not