l.c.a.AbiquoResponse(XmlResponse) : class documentation

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.
def parse_error(self): (source)
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.
def success(self): (source)
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.
def async_success(self): (source)
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
API Documentation for libcloud, generated by pydoctor at 2013-02-18 10:41:20.