Add instance actions v284 samples test

Implements blueprint action-event-fault-details
Change-Id: I8e8a5ca1efe4a3554038dcddc503c3030956e0b9
This commit is contained in:
zhangbailin 2020-02-06 19:34:07 +08:00 committed by Brin Zhang
parent 5497365386
commit 59156bdf01
17 changed files with 304 additions and 0 deletions

View File

@ -114,6 +114,7 @@ Response
- events.traceback: event_traceback
- events.hostId: event_hostId
- events.host: event_host
- events.details: event_details
- updated_at: updated_instance_action
**Example Show Server Action Details For Admin (v2.62)**
@ -125,3 +126,8 @@ Response
.. literalinclude:: ../../doc/api_samples/os-instance-actions/v2.62/instance-action-get-non-admin-resp.json
:language: javascript
**Example Show Server Action Details For System Reader (v2.84)**
.. literalinclude:: ../../doc/api_samples/os-instance-actions/v2.84/instance-action-get-resp.json
:language: javascript

View File

@ -2611,6 +2611,13 @@ event:
in: body
required: true
type: string
event_details:
min_version: 2.84
description: |
Details of the event. May be ``null``.
in: body
required: true
type: string
event_finish_time:
description: |
The date and time when the event was finished. The date and time

View File

@ -0,0 +1,21 @@
{
"instanceAction": {
"action": "stop",
"events": [
{
"event": "compute_stop_instance",
"finish_time": "2018-04-25T01:26:34.784165",
"hostId": "2091634baaccdc4c5a1d57069c833e402921df696b7f970791b12ec6",
"result": "Success",
"start_time": "2018-04-25T01:26:34.612020"
}
],
"instance_uuid": "79edaa44-ad4f-4af7-b994-154518c2b927",
"message": null,
"project_id": "6f70656e737461636b20342065766572",
"request_id": "req-8eb28d4a-db6c-4337-bab8-ce154e9c620e",
"start_time": "2018-04-25T01:26:34.388280",
"updated_at": "2018-04-25T01:26:34.784165",
"user_id": "fake"
}
}

View File

@ -0,0 +1,24 @@
{
"instanceAction": {
"action": "stop",
"events": [
{
"event": "compute_stop_instance",
"finish_time": "2018-04-25T01:26:36.790544",
"host": "compute",
"hostId": "2091634baaccdc4c5a1d57069c833e402921df696b7f970791b12ec6",
"result": "Success",
"start_time": "2018-04-25T01:26:36.539271",
"traceback": null,
"details": null
}
],
"instance_uuid": "4bf3473b-d550-4b65-9409-292d44ab14a2",
"message": null,
"project_id": "6f70656e737461636b20342065766572",
"request_id": "req-0d819d5c-1527-4669-bdf0-ffad31b5105b",
"start_time": "2018-04-25T01:26:36.341290",
"updated_at": "2018-04-25T01:26:36.790544",
"user_id": "admin"
}
}

View File

@ -0,0 +1,24 @@
{
"instanceActions": [
{
"action": "stop",
"instance_uuid": "15835b6f-1e14-4cfa-9f66-1abea1a1c0d5",
"message": null,
"project_id": "6f70656e737461636b20342065766572",
"request_id": "req-f04d4b92-6241-42da-b82d-2cedb225c58d",
"start_time": "2018-04-25T01:26:36.036697",
"updated_at": "2018-04-25T01:26:36.525308",
"user_id": "admin"
},
{
"action": "create",
"instance_uuid": "15835b6f-1e14-4cfa-9f66-1abea1a1c0d5",
"message": null,
"project_id": "6f70656e737461636b20342065766572",
"request_id": "req-d8790618-9bbf-4df0-8af8-fc9e24de29c0",
"start_time": "2018-04-25T01:26:33.692125",
"updated_at": "2018-04-25T01:26:35.993821",
"user_id": "admin"
}
]
}

View File

@ -0,0 +1,24 @@
{
"instanceActions": [
{
"action": "stop",
"instance_uuid": "2150964c-30fe-4214-9547-8822375aa7d0",
"message": null,
"project_id": "6f70656e737461636b20342065766572",
"request_id": "req-0c3b2079-0a44-474d-a5b2-7466d4b4c642",
"start_time": "2018-04-25T01:26:29.594237",
"updated_at": "2018-04-25T01:26:30.065061",
"user_id": "admin"
},
{
"action": "create",
"instance_uuid": "15835b6f-1e14-4cfa-9f66-1abea1a1c0d5",
"message": null,
"project_id": "6f70656e737461636b20342065766572",
"request_id": "req-d8790618-9bbf-4df0-8af8-fc9e24de29c0",
"start_time": "2018-04-25T01:26:33.692125",
"updated_at": "2018-04-25T01:26:35.993821",
"user_id": "admin"
}
]
}

View File

@ -0,0 +1,14 @@
{
"instanceActions": [
{
"action": "stop",
"instance_uuid": "2150964c-30fe-4214-9547-8822375aa7d0",
"message": null,
"project_id": "6f70656e737461636b20342065766572",
"request_id": "req-0c3b2079-0a44-474d-a5b2-7466d4b4c642",
"start_time": "2018-04-25T01:26:29.594237",
"updated_at": "2018-04-25T01:26:30.065061",
"user_id": "admin"
}
]
}

View File

@ -0,0 +1,20 @@
{
"instanceActions": [
{
"action": "stop",
"instance_uuid": "ca3d3be5-1a40-427f-9515-f5e181f479d0",
"message": null,
"project_id": "6f70656e737461636b20342065766572",
"request_id": "req-4dbefbb7-d743-4d42-b0a1-a79cbe256138",
"start_time": "2018-04-25T01:26:28.909887",
"updated_at": "2018-04-25T01:26:29.400606",
"user_id": "admin"
}
],
"links": [
{
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/servers/ca3d3be5-1a40-427f-9515-f5e181f479d0/os-instance-actions?limit=1&marker=req-4dbefbb7-d743-4d42-b0a1-a79cbe256138",
"rel": "next"
}
]
}

View File

@ -0,0 +1,14 @@
{
"instanceActions": [
{
"action": "create",
"instance_uuid": "9bde1fd5-8435-45c5-afc1-bedd0605275b",
"message": null,
"project_id": "6f70656e737461636b20342065766572",
"request_id": "req-4510fb10-447f-4572-a64d-c2324547d86c",
"start_time": "2018-04-25T01:26:33.710291",
"updated_at": "2018-04-25T01:26:35.374936",
"user_id": "fake"
}
]
}

View File

@ -0,0 +1,21 @@
{
"instanceAction": {
"action": "stop",
"instance_uuid": "%(uuid)s",
"request_id": "%(request_id)s",
"user_id": "%(user_id)s",
"project_id": "%(project_id)s",
"start_time": "%(strtime)s",
"updated_at": "%(strtime)s",
"message": null,
"events": [
{
"event": "compute_stop_instance",
"start_time": "%(strtime)s",
"finish_time": "%(strtime)s",
"result": "Success",
"hostId": "%(event_hostId)s"
}
]
}
}

View File

@ -0,0 +1,24 @@
{
"instanceAction": {
"action": "stop",
"instance_uuid": "%(uuid)s",
"request_id": "%(request_id)s",
"user_id": "%(user_id)s",
"project_id": "%(project_id)s",
"start_time": "%(strtime)s",
"updated_at": "%(strtime)s",
"message": null,
"events": [
{
"event": "compute_stop_instance",
"start_time": "%(strtime)s",
"finish_time": "%(strtime)s",
"result": "Success",
"traceback": null,
"host": "%(event_host)s",
"hostId": "%(event_hostId)s",
"details": null
}
]
}
}

View File

@ -0,0 +1,24 @@
{
"instanceActions": [
{
"action": "stop",
"instance_uuid": "%(uuid)s",
"request_id": "%(request_id)s",
"user_id": "%(user_id)s",
"project_id": "%(project_id)s",
"start_time": "%(strtime)s",
"updated_at": "%(strtime)s",
"message": null
},
{
"action": "create",
"instance_uuid": "%(uuid)s",
"request_id": "%(request_id)s",
"user_id": "%(user_id)s",
"project_id": "%(project_id)s",
"start_time": "%(strtime)s",
"updated_at": "%(strtime)s",
"message": null
}
]
}

View File

@ -0,0 +1,24 @@
{
"instanceActions": [
{
"action": "stop",
"instance_uuid": "%(uuid)s",
"request_id": "%(request_id)s",
"user_id": "%(user_id)s",
"project_id": "%(project_id)s",
"start_time": "%(strtime)s",
"updated_at": "%(strtime)s",
"message": null
},
{
"action": "create",
"instance_uuid": "%(uuid)s",
"request_id": "%(request_id)s",
"user_id": "%(user_id)s",
"project_id": "%(project_id)s",
"start_time": "%(strtime)s",
"updated_at": "%(strtime)s",
"message": null
}
]
}

View File

@ -0,0 +1,14 @@
{
"instanceActions": [
{
"action": "stop",
"instance_uuid": "%(uuid)s",
"request_id": "%(request_id)s",
"user_id": "%(user_id)s",
"project_id": "%(project_id)s",
"start_time": "%(strtime)s",
"updated_at": "%(strtime)s",
"message": null
}
]
}

View File

@ -0,0 +1,20 @@
{
"instanceActions": [
{
"action": "stop",
"instance_uuid": "%(uuid)s",
"request_id": "%(request_id)s",
"user_id": "%(user_id)s",
"project_id": "%(project_id)s",
"start_time": "%(strtime)s",
"updated_at": "%(strtime)s",
"message": null
}
],
"links": [
{
"href": "%(versioned_compute_endpoint)s/servers/%(uuid)s/os-instance-actions?limit=1&marker=%(request_id)s",
"rel": "next"
}
]
}

View File

@ -0,0 +1,14 @@
{
"instanceActions": [
{
"action": "create",
"instance_uuid": "%(uuid)s",
"request_id": "%(request_id)s",
"user_id": "%(user_id)s",
"project_id": "%(project_id)s",
"start_time": "%(strtime)s",
"updated_at": "%(strtime)s",
"message": null
}
]
}

View File

@ -154,3 +154,12 @@ class ServerActionsV266SampleJsonTest(ServerActionsV262SampleJsonTest):
self._verify_response(
'instance-actions-list-with-changes-before',
self._get_subs(), response, 200)
class ServerActionsV284SampleJsonTest(ServerActionsV266SampleJsonTest):
microversion = '2.84'
scenarios = [('2.84', {'api_major_version': 'v2.1'})]
class ServerActionsV284NonAdminSampleJsonTest(ServerActionsV284SampleJsonTest):
ADMIN_API = False