Extends the timeout period during which an Elastic Compute Service (ECS) instance is in the pending state after a lifecycle hook is triggered.

Description

You can call the operation up to 20 times to extend the timeout period of a lifecycle hook. However, the total length of the timeout period cannot exceed 6 hours because an ECS instance cannot be in the pending state for more than 6 hours.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes RecordLifecycleActionHeartbeat

The operation that you want to perform. Set the value to RecordLifecycleActionHeartbeat.

lifecycleHookId String Yes ash-bp1fxuqyi98w0aib****

The ID of the lifecycle hook.

lifecycleActionToken String Yes F324B880-900E-4968-85DD-81691113****

The token that indicates the pending state of a scaling activity. You can obtain this token by using a Message Service (MNS) queue or an MNS topic that is specified for the lifecycle hook.

heartbeatTimeout Integer No 600

The timeout period of the lifecycle hook. When the lifecycle hook times out, Auto Scaling performs the default action. Unit: seconds. Valid values: 30 to 21600.

After you create a lifecycle hook, you can call the RecordLifecycleActionHeartbeat operation to extend the timeout period of the lifecycle hook. You can also call the CompleteLifecycleAction operation to end the timeout period of the lifecycle hook in advance.

Default value: 600.

RegionId String No cn-hangzhou

The ID of the region where the scaling group resides.

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Examples

Sample requests

http(s)://ess.aliyuncs.com/?Action=RecordLifecycleActionHeartbeat
&lifecycleHookId=ash-bp1fxuqyi98w0aib****
&lifecycleActionToken=F324B880-900E-4968-85DD-81691113****
&heartbeatTimeout=600
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<RecordLifecycleActionHeartbeatResponse>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
</RecordLifecycleActionHeartbeatResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

For a list of error codes, visit the API Error Center.

HTTP status code

Error code

Error message

Description

400

InvalidParamter

The specified value of parameter is not valid.

The error message returned because the value that you specified for a parameter is invalid.

400

LifecycleHookIdAndLifecycleActionToken.Invalid

The specified lifecycleActionToken and LifecycleHookId you provided does not match any in process lifecycle action.

The error message returned because the value specified for the lifecycleActionToken parameter does not match the value specified for the LifecycleHookId parameter.

400

LifecycleAction.TimeExceeded

The specified parameter heartbeatTime exceed lifecycleAction max suspend time.

The error message returned because the timeout period during which the ECS instance is in the pending state has exceeded 6 hours.

400

LifecycleAction.RecordTimesExceeded

The specified lifecycleAction exceed lifecycleAction max record times.

The error message returned because the operation is called more than 20 times.