All Products
Search
Document Center

Auto Scaling:DescribeLifecycleActions

Last Updated:Jun 06, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ScalingActivityIdstringYes

The ID of the scaling activity.

asa-bp17mug9t0pegagw****
LifecycleActionStatusstringNo

The status of the lifecycle action. Valid values:

  • 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 ends, and ECS instances are added to or removed from the 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.
Pending
NextTokenstringNo

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****
MaxResultsintegerNo

The maximum number of entries to return on each page. Valid values: 1 to 50.

Default value: 10.

10
RegionIdstringNo

The region ID of the scaling group.

cn-qingdao

Response parameters

ParameterTypeDescriptionExample
object
NextTokenstring

The query token returned in this call.

AAAAAcSz4VTb1Nq****
RequestIdstring

The ID of the request.

42A742EB-FCF3-459E-9C62-E107048C17E3
TotalCountinteger

The total number of the queried lifecycle actions.

3
MaxResultsinteger

The maximum number of entries returned per page.

3
LifecycleActionsobject []

The lifecycle actions.

LifecycleHookIdstring

The ID of the lifecycle hook.

ash-bp18uoft0deax0f7****
LifecycleActionTokenstring

The token of the lifecycle action.

9C2E9DA7-F794-449A-ACF6-CEE24444F7BB
LifecycleActionStatusstring

The status of the lifecycle action.

Pending
LifecycleActionResultstring

The action that is performed after the lifecycle action triggered by the lifecycle hook is complete. Valid values:

  • CONTINUE: Auto Scaling continues to add ECS instances to the scaling group, or continues to remove ECS instances from the scaling group.
  • ABANDON: Auto Scaling stops adding ECS instances to the scaling group and releases the ECS instances, or continues to respond to scale-in requests and remove ECS instances from the scaling group.
CONTINUE
InstanceIdsarray

The IDs of the ECS instances to which the lifecycle hook applies.

string

The IDs of the ECS instances to which the lifecycle hook applies.

["i-bp11m3fzlqrgk5vh****","i-bp11m3fzlqrgk5vh****"]

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
No change history