Files
4a9133d46443e9a0157480687e6e7da099c9fa8b
nova /api-guide /source /faults.rst

181 lines
5.8 KiB
ReStructuredText
Raw Normal View History

Faults
======
However, that is often not the end of the story. That generally only means the
request to start the operation has been accepted, it does not mean the action
you requested has successfully completed.
==============================
This is returned in a response header.
Here is an example response header:
--------------
referencing the requested action by request id.
http://developer.openstack.org/api-ref-compute-v2.1.html#os-instance-actions-v2.1
----
This allows an administrator to track the API request processing as it
transitions between all the different nova services.
---------------
while processing an API request. This often includes more admin focused
information, such as a stack trace.
However, there is currently no API to retrieve this information.
-------------
This is an administrator focused API, that works best when treated as
structured logging.
==================
API status code. The system also returns additional
information about the fault in the body of the response.
.. code::
{
"code":500,
"message":"Fault!",
}
}
The message section returns a human-readable message that is appropriate
for display to the end user. The details section is optional and may
contain information—for example, a stack trace—to assist in tracking
down an error. The detail section might or might not be appropriate for
display to an end user.
depending on the type of error. The following is a list of possible
elements along with their associated error codes.
http://specs.openstack.org/openstack/api-wg/guidelines/http.html#http-response-codes
Asynchronous faults
An error may occur in the background while a server or image is being
In these cases, the server or image is usually placed in an ``ERROR`` state.
For some operations, like resize, its possible that the operations fails but
the instance gracefully returned to its original state before attempting the
operation. In both of these cases, you should be able to find out more from
the Server Actions API described above.
When a server or image is placed into an ``ERROR`` state, a fault is
embedded in the offending server or image. Note that these asynchronous
faults follow the same format as the synchronous ones. The fault
contains an error code, a human readable message, and optional details
about the error. Additionally, asynchronous faults may also contain a
created timestamp that specify when the fault occurred.
**Example:Server in error state: JSON response**
.. code::
{
"server": {
"id": "52415800-8b69-11e0-9b19-734f0000ffff",
"tenant_id": "1234",
"user_id": "5678",
"name": "sample-server",
"created": "2010年08月10日T12:00:00Z",
"hostId": "e4d909c290d0fb1ca068ffafff22cbd0",
"status": "ERROR",
"progress": 66,
"image" : {
"id": "52415800-8b69-11e0-9b19-734f6f007777"
},
"flavor" : {
"id": "52415800-8b69-11e0-9b19-734f216543fd"
},
"fault" : {
"code" : 404,
"created": "2010年08月10日T11:59:59Z",
"message" : "Could not find image 52415800-8b69-11e0-9b19-734f6f007777",
"details" : "Fault details"
},
"links": [
{
"rel": "self",
"href": "http://servers.api.openstack.org/v2/1234/servers/52415800-8b69-11e0-9b19-734f000004d2"
},
{
"rel": "bookmark",
"href": "http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f000004d2"
}
]
}
}
**Example:Image in error state: JSON response**
.. code::
{
"image" : {
"id" : "52415800-8b69-11e0-9b19-734f5736d2a2",
"name" : "My Server Backup",
"created" : "2010年08月10日T12:00:00Z",
"status" : "SAVING",
"progress" : 89,
"server" : {
"id": "52415800-8b69-11e0-9b19-734f335aa7b3"
},
"fault" : {
"code" : 500,
"message" : "An internal error occurred",
"details" : "Error details"
},
"links": [
{
"rel" : "self",
"href" : "http://servers.api.openstack.org/v2/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"
},
{
"rel" : "bookmark",
"href" : "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"
}
]
}
}