Queries lifecycle tokens by scaling activity ID and status.
Operation description
Operation description
If a scaling activity that matches the type applicable to a lifecycle hook occurs in a scaling group, each lifecycle hook triggers a lifecycle action. A lifecycle action can be in one of the following states:
Pending: The ECS instance is still in the wait state.
Timeout: The timeout period of the lifecycle hook has elapsed, and the wait state of the ECS instance is automatically ended.
Completed: You manually ended the wait state of the ECS instance ahead of schedule.
If you did not configure a subsequent action when you created the lifecycle hook, such as triggering a specific OOS template after the wait state ends, you can call this operation to obtain the identifier of the lifecycle action that corresponds to the current scaling activity. This way, you can customize subsequent actions.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ScalingActivityId |
string |
Yes |
The ID of the scaling activity. |
asa-bp17mug9t0pegagw**** |
| LifecycleActionStatus |
string |
No |
The status of the lifecycle action. Valid values:
|
Pending |
| NextToken |
string |
No |
The pagination token that is used to specify the position from which to start the query. For example, if you queried 10 lifecycle actions in the previous request, you can set this parameter to the value of NextToken returned in the previous response to query lifecycle actions starting from the 11th one. If you do not specify this parameter, the query starts from the beginning. |
AAAAAcSz4VTb1Nq**** |
| MaxResults |
integer |
No |
The maximum number of entries per page. Valid values: 1 to 50. Default value: 10. |
10 |
| RegionId |
string |
No |
The region ID of the scaling group. |
cn-qingdao |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| NextToken |
string |
The pagination token returned in this response. |
AAAAAcSz4VTb1Nq**** |
| RequestId |
string |
The request ID. |
42A742EB-FCF3-459E-9C62-E107048C17E3 |
| TotalCount |
integer |
The total number of lifecycle actions returned in this query. |
3 |
| MaxResults |
integer |
The maximum number of entries per page. |
3 |
| LifecycleActions |
object |
||
| LifecycleAction |
array<object> |
The list of lifecycle actions that correspond to lifecycle hooks. |
|
|
array<object> |
The lifecycle action that corresponds to a lifecycle hook. |
||
| LifecycleHookId |
string |
The ID of the lifecycle hook. |
ash-bp18uoft0deax0f7**** |
| LifecycleActionToken |
string |
The token of the lifecycle action. |
9C2E9DA7-F794-449A-ACF6-CEE24444**** |
| LifecycleActionStatus |
string |
The status of the lifecycle action. |
Pending |
| LifecycleActionResult |
string |
The action that is performed after the lifecycle action triggered by the lifecycle hook is complete. Valid values:
|
CONTINUE |
| InstanceIds |
object |
||
| InstanceId |
array |
The IDs of the ECS instances to which the lifecycle hook applies. |
|
|
string |
The IDs of the ECS instances. |
["i-bp11m3fzlqrgk5vh****","i-bp11m3fzlqrgk5vh****"] |
Examples
Success response
JSON format
{
"NextToken": "AAAAAcSz4VTb1Nq****",
"RequestId": "42A742EB-FCF3-459E-9C62-E107048C17E3",
"TotalCount": 3,
"MaxResults": 3,
"LifecycleActions": {
"LifecycleAction": [
{
"LifecycleHookId": "ash-bp18uoft0deax0f7****",
"LifecycleActionToken": "9C2E9DA7-F794-449A-ACF6-CEE24444****",
"LifecycleActionStatus": "Pending",
"LifecycleActionResult": "CONTINUE",
"InstanceIds": {
"InstanceId": [
"[\"i-bp11m3fzlqrgk5vh****\",\"i-bp11m3fzlqrgk5vh****\"]"
]
}
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.