Queries lifecycle actions.
Operation description
If a scaling activity is executed and a lifecycle hook is created for the scaling activity, the lifecycle hook triggers a lifecycle action. A lifecycle action can be in one of the following states:
- If a lifecycle action is in the Pending state, Elastic Compute Service (ECS) instances are waiting to be added to a scaling group or waiting to be removed from a scaling group.
- If a lifecycle action is in the Timeout state, the lifecycle hook that triggers the lifecycle action expires and ECS instances are added to or removed from a scaling group.
- If a lifecycle action is in the Completed state, you manually end the lifecycle hook that triggers the lifecycle action ahead of schedule.
If you do not specify the action to perform, such as execute a specific OOS template, after a lifecycle hook ends, you can call this operation to obtain the token of the lifecycle action that corresponds to the lifecycle hook. Then, you can specify a custom action to perform after the lifecycle hook ends.
Debugging
Authorization information
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 token that is used to specify the lifecycle action from which the query starts. For example, after the first 10 lifecycle actions are queried, the query starts from the 11th lifecycle action. Set this parameter to the NextToken value that is returned in the previous API call. If you do not specify this parameter, the query starts from the beginning. | AAAAAcSz4VTb1Nq**** |
MaxResults | integer | No | The maximum number of entries to return on each page. Valid values: 1 to 50. Default value: 10. | 10 |
RegionId | string | No | The region ID of the scaling group. | cn-qingdao |
Response parameters
Examples
Sample success responses
JSON
format
{
"NextToken": "AAAAAcSz4VTb1Nq****",
"RequestId": "42A742EB-FCF3-459E-9C62-E107048C17E3",
"TotalCount": 3,
"MaxResults": 3,
"LifecycleActions": [
{
"LifecycleHookId": "ash-bp18uoft0deax0f7****",
"LifecycleActionToken": "9C2E9DA7-F794-449A-ACF6-CEE24444F7BB",
"LifecycleActionStatus": "Pending",
"LifecycleActionResult": "CONTINUE",
"InstanceIds": [
"[\"i-bp11m3fzlqrgk5vh****\",\"i-bp11m3fzlqrgk5vh****\"]"
]
}
]
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|