Atom feed of this document
 

 Faults

When an error occurs at request time, the system will return an HTTP error response code denoting the type of error. The system will also return additional information about the fault in the body of the response.

 

Example 3.9. "Network not found" fault Response (XML)

<networkNotFound code="420" xmlns="http://netstack.org/quantum/api/v1.0">
   <message>
       Unable to find a network with the specified identifier.
   </message>
   <detail>
       Network 8de6af7c-ef95-4ac1-9d37-172f8df33a1f could not be found
   </detail>
</networkNotFound

                    

 

Example 3.10. "Network not found" fault Response (XML)

{
   "networkNotFound": {
       "message": "Unable to find a network with the specified identifier.",
        "code": 420,
        "detail": "Network 8de6af7c-ef95-4ac1-9d37-172f8df33a1f could not be found"
   }
}
                   

The error code is returned in the body of the response for convenience. The message section returns a human-readable message that is appropriate for display to the end user. The detail section is optional and may contain information—for example, a stack trace—to assist in tracking down an error.

The root element of the fault (e.g. networkNotFound) may change depending on the type of error. The following is a list of possible elements along with their associated error codes.

Table 3.2. Fault Elements and Error Codes
Fault Element Error Code Description
BadRequest 400 Malformed request body. The Quantum service is unable to parse the contents of the request body.
Unauthorized 401 User has not provided authentication credentials. If authentication is provided by the Keystone identity service, this might mean that either no authentication token has been supplied in the request, or that the token itself is either invalid or expired.
Forbidden 403 The user does not have the necessary rights to execute the requested operation.
ItemNotFound 404 The requested resource does not exist on the Quantum API server.
NetworkNotFound 420 The specified network has not been created or has been removed.
NetworkInUse 421 The specified network has attachments plugged into one or more of its ports.
PortNotFound 430 The specified port has not been created or has been removed.
RequestedStateInvalid 431 Indicates a request to change port to an administrative state not currently supported.
PortInUse 432 The specified port cannot be removed as there is an attachment plugged in it.
AlreadyAttached 440 Attachment is already plugged into another port.
[Note]Note

The error codes 401 and 403 will be returned only if some Authentication/Authorization system has been enabled in the Quantum pipeline