Get action details¶
Overview¶
Gets details for a specified action for a specified server instance. Deployers set permissions for this request in the policy.json file. By default, only administrators can get details for an action.
Classification¶
Show
API Operation Object¶
os-instance-actions
Synchronous / Asynchronous¶
-
Request¶
HTTP Request Method¶
GET
HTTP Request Path¶
{api_endpoint}/v2/{tenant_id}/servers/{server_id}/os-instance-actions/{action_id}
HTTP Request Header¶
Format¶
Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: <token_id>
Content-Type: application/json
HTTP Request Body¶
Format¶
none
Request Parameter¶
name |
style |
format |
description |
required/optional |
---|---|---|---|---|
tenant_id |
URI |
String |
The ID for the tenant or account in a multi-tenancy cloud. |
required |
server_id |
URI |
UUID |
The UUID of the server instance for which you want to list actions. |
required |
action_id |
URI |
UUID |
The UUID of the action for which you want to get details. |
required |
Response¶
HTTP Response Header¶
Format¶
HTTP/1.1 <response_code> <message> (ex. 200 OK)
<response_code>: see "HTTP Responses" section
<message>: message based on the response code
skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"
HTTP Response Body¶
Format¶
{
"instanceAction": {
"action": "<action>",
"events": [
{
"event": "<event>",
"finish_time": "<finish_time>",
"result": "<result>",
"start_time": "<start_time>",
"traceback": "<traceback>"
},
{
"event": "<event>",
"finish_time": "<finish_time>",
"result": "<result>",
"start_time": "<start_time>",
"traceback": "<traceback>"
}
],
"instance_uuid": "<instance_uuid>",
"message": "<message>",
"project_id": "<project_id>",
"request_id": "<request_id>",
"start_time": "<start_time>",
"user_id": "<user_id>"
}
}
Response Parameter¶
item |
format |
description |
---|---|---|
action |
String |
action instance |
instance_uuid |
UUID |
Unique identifier of an instance |
message |
String |
Message of action |
project_id |
UUID(3) |
project id |
request_id |
String |
request id |
start_time |
time/date |
Start time of the action |
user_id |
String(1-255 characters) |
owner of instance |
Sample API Request and Response¶
Sample API Request¶
Request URI¶
https://example.com/v2/{tenant_id}/servers/{server_id}/os-istance-actions/{action_id}
Request Header¶
Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: ajk3adjiown02
Content-Type: application/json
Request Body¶
none
Sample API Response¶
Response Header¶
HTTP/1.1 200 OK
<response_code>: see "HTTP Responses" section
<message>: message based on the response code
skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"
Response Body¶
{
"instanceAction": {
"action": "reboot",
"events": [
{
"event": "schedule",
"finish_time": "2012-12-05 01:02:00.000000",
"result": "Success",
"start_time": "2012-12-05 01:00:02.000000",
"traceback": ""
},
{
"event": "compute_create",
"finish_time": "2012-12-05 01:04:00.000000",
"result": "Success",
"start_time": "2012-12-05 01:03:00.000000",
"traceback": ""
}
],
"instance_uuid": "b48316c5-71e8-45e4-9884-6c78055b9b13",
"message": "",
"project_id": "147",
"request_id": "req-3293a3f1-b44c-4609-b8d2-d81b105636b8",
"start_time": "2012-12-05 00:00:00.000000",
"user_id": "789"
}
}
Execution Example¶
HTTP Request¶
GET /v2/ad355aa6ed3e4cf5ae0fa0df652bc291/servers/aef82e69-0b3e-4056-b1b6-c37d5a278183/os-instance-actions/req-bdff6b70-dede-4292-9f8f-2e9b00adf678 HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: c75def63cc764c50a96129a7069a3879
Accept: application/json
HTTP Response¶
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 313
X-Compute-Request-Id: req-6d94cb0c-d1f3-46fa-a125-21eff0dc708b
Date: Thu, 15 Oct 2015 05:45:25 GMT
{"instanceAction": {"instance_uuid": "aef82e69-0b3e-4056-b1b6-c37d5a278183", "user_id": "9789b276da0643e8b88bc7d6b85cf939", "start_time": "2015-10-15T00:40:25.000000", "request_id": "req-bdff6b70-dede-4292-9f8f-2e9b00adf678", "action": "create", "message": null, "project_id": "ad355aa6ed3e4cf5ae0fa0df652bc291", "events": [{"finish_time": "2015-10-15T00:40:32.000000.000000", "start_time": "2015-10-15T00:40:25.000000", "traceback": null, "event": "compute__do_build_and_run_instance", "result": "Success"}]}}
Error Execution Example¶
HTTP Request¶
GET /v2/ad355aa6ed3e4cf5ae0fa0df652bc290/servers/aef82e69-0b3e-4056-b1b6-c37d5a278183/os-instance-actions/req-bdff6b70-dede-4292-9f8f-2e9b00adf678 HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: c75def63cc764c50a96129a7069a3879
Accept: application/json
HTTP Response¶
HTTP/1.1 400 Bad Request
Content-Length: 188
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-1b8184fd-d518-45e6-a99f-8cbb22676d08
Date: Thu, 15 Oct 2015 05:47:01 GMT
{"badRequest": {"message": "Malformed request URL: URL's project_id 'ad355aa6ed3e4cf5ae0fa0df652bc290' doesn't match Context's project_id 'ad355aa6ed3e4cf5ae0fa0df652bc291'", "code": 400}}