Listing Events of a Stack
Function
ListStackEvents
This API lists all deployment events of a stack.
-
If deployment_id is assigned, deployment_id is used as a query criterion and the stack events corresponding to a specific deployment are returned. If no deployment_id is assigned, all of the stack events are returned.
-
If the deployment corresponding to the given deployment_id does not exist, 404 is returned.
-
You can use filter to query stack events by specifying the event type (event_type), resource type (resource_type), and resource name (resource_name).
-
You can use field to set the attributes to be returned. The attribute event type (event_type) cannot be configured and it is returned by default. The available attributes are elapsed time (elapsed_seconds), event message (event_message), resource ID key (resource_id_key), resource ID value (resource_id_value), resource key (resource_key), resource type (resource_type), resource name (resource_name), and timestamp (timestamp).
-
The returned events are arranged in descending order of time.
-
Support pagination. If there is next_marker in the response, more output is available than is included in the current response. Use this value in the marker request parameter in a subsequent call to get the next part of the outputs. You should repeat this until the next_marker response is set to null.
URI
GET /v1/{project_id}/stacks/{stack_name}/events
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | A project ID is obtained by calling an API or from the console. Minimum: 3 Maximum: 64 |
| stack_name | Yes | String | A stack name is unique within its domain (domain_id), region, and project (project_id). It is case-sensitive and starts with a letter. Only letters, digits, underscores (_), and hyphens (-) are allowed. Minimum: 1 Maximum: 128 |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Client-Request-Id | Yes | String | A unique request ID is specified by a user to locate a request. UUID is recommended. Minimum: 36 Maximum: 128 |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| stack_events | Array of StackEvent objects | List of stack events. |
| page_info | PageInfo object | Pagination information |
| Parameter | Type | Description |
|---|---|---|
| next_marker | String | Forward pagination identifier. Marker for the next set of results. If present, more output is available than is included in the current response. Use this value in the marker request parameter in a subsequent call to get the next part of the outputs. You should repeat this until the next_marker response is set to null. |
| previous_marker | String | Backward pagination identifier. |
| current_count | Integer | The number of items returned on current page. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. Minimum: 11 Maximum: 11 |
| error_msg | String | Response message. |
| encoded_authorization_message | String | The message contains information about unauthorized requests. |
| details | Array of Detail objects | Detailed error messages returned by service when permission is denied. |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. |
| error_msg | String | Response message. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. Minimum: 11 Maximum: 11 |
| error_msg | String | Response message. |
| encoded_authorization_message | String | The message contains information about unauthorized requests. |
| details | Array of Detail objects | Detailed error messages returned by service when permission is denied. |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. |
| error_msg | String | Response message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. Minimum: 11 Maximum: 11 |
| error_msg | String | Response message. |
| encoded_authorization_message | String | The message contains information about unauthorized requests. |
| details | Array of Detail objects | Detailed error messages returned by service when permission is denied. |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. |
| error_msg | String | Response message. |
Status code: 404
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. Minimum: 11 Maximum: 11 |
| error_msg | String | Response message. |
| encoded_authorization_message | String | The message contains information about unauthorized requests. |
| details | Array of Detail objects | Detailed error messages returned by service when permission is denied. |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. |
| error_msg | String | Response message. |
Status code: 429
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. Minimum: 11 Maximum: 11 |
| error_msg | String | Response message. |
| encoded_authorization_message | String | The message contains information about unauthorized requests. |
| details | Array of Detail objects | Detailed error messages returned by service when permission is denied. |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. |
| error_msg | String | Response message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. Minimum: 11 Maximum: 11 |
| error_msg | String | Response message. |
| encoded_authorization_message | String | The message contains information about unauthorized requests. |
| details | Array of Detail objects | Detailed error messages returned by service when permission is denied. |
Example Requests
-
Use filter to obtain stack events with the specified event_type and resource_name.
GET https://{endpoint}/v1/ba2b9930c977f71edaeaa3a5e96a8ff1/stacks/my_hello_world_stack/events?filter=event_type==LOG,resource_name==my_hello_world_resource -
Use field to select the following returned attributes: resource_key, resource_name, and event_type. The event_type attribute is automatically selected even if you do not select it.
GET https://{endpoint}/v1/ba2b9930c977f71edaeaa3a5e96a8ff1/stacks/my_hello_world_stack/events?field=resource_key,resource_name -
Obtain stack events of a specified deployment using deployment_id.
GET https://{endpoint}/v1/ba2b9930c977f71edaeaa3a5e96a8ff1/stacks/my_hello_world_stack/events?deployment_id=81edbb3e-00d9-42fd-94c8-59c7525d0f28 -
Obtain stack events of a specified deployment using stack_id.
GET https://{endpoint}/v1/ba2b9930c977f71edaeaa3a5e96a8ff1/stacks/my_hello_world_stack/events?stack_id=ea6a4f0e-ee8a-494e-b12a-8be4a1e65af2
Example Responses
Status code: 200
Stack events listed.
{
"stack_events" : [ {
"event_message" : "Apply required resource success. ",
"event_type" : "LOG",
"time" : "2023-05-17T11:56:47Z"
}, {
"event_message" : "Apply complete! Resources: 1 added, 0 changed, 0 destroyed.",
"event_type" : "SUMMARY",
"time" : "2023-05-17T11:56:45Z"
}, {
"resource_type" : "huaweicloud_vpc",
"resource_name" : "vpc",
"elapsed_seconds" : 8,
"event_message" : "huaweicloud_vpc.vpc: Creation complete after 8s [id=38d617da-9b7f-4550-9ff7-d0e271dd4735]",
"event_type" : "CREATION_COMPLETE",
"resource_id_key" : "id",
"resource_id_value" : "38d617da-9b7f-4550-9ff7-d0e271dd4735",
"time" : "2023-05-17T11:56:40Z"
}, {
"resource_type" : "huaweicloud_vpc",
"resource_name" : "vpc",
"event_message" : "huaweicloud_vpc.vpc: Creating...",
"event_type" : "CREATION_IN_PROGRESS",
"time" : "2023-05-17T11:56:32Z"
}, {
"event_message" : "Creating required resource now",
"event_type" : "LOG",
"time" : "2023-05-17T11:56:31Z"
} ],
"page_info" : {
"current_count" : 5,
"next_marker" : null,
"previous_marker" : "zxc1oHc08HcCmypYGTsOoRcvoHUvHRUAW5NOSnc1oHc08HcCPZrwP5NOeTlRiukJgtGxeujJeuGwGIihaIUCmypYGTsOtqvKPr2xmH8fPqpGWyQ0axGwGZp9aqvx8pQ7m5FvGTsJiKk7gtNFiuaxetdRCks="
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Stack events listed. |
| 400 | Invalid request. |
| 401 | Authentication failed. |
| 403 | The user does not have the permission to call this API. |
| 404 | The stack or the specified deployment does not exist. |
| 429 | Too frequent requests. |
| 500 | Internal server error. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.