You can call this operation to extend the timeout period of an ECS instance and keep the instance in the wait state.

Description

The maximum amount of time that you can keep an ECS instance in the wait state is six hours. The timeout period for each wait state can be extended for a maximum of 20 times.

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.

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

The token that indicates a specific scaling activity associated with an instance. You can obtain this token by using an MNS queue or MNS topic specified for the lifecycle hook.

lifecycleHookId String Yes ash-****

The ID of the lifecycle hook.

heartbeatTimeout Integer No 600

The wait period before the lifecycle hook times out. When the lifecycle hook times out, the scaling group performs the default action. Valid values: 30 to 21600. Unit: seconds.

Default value: 600

After you create a lifecycle hook, you can call this operation to extend the timeout period and keep the ECS instance in the wait state. You can also call the CompleteLifecycleAction operation to terminate the wait state of a scaling activity.

Response parameters

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

The ID of the request.

Examples

Sample requests

http://ess.aliyuncs.com/?Action=RecordLifecycleActionHeartbeat
&LifecycleHookId=ash-****
&LifecycleActionToken=F324B880-900E-4968-85DD-81691113****
&<Common request parameters>

Sample success responses

XML format

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

JSON format

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

Error codes

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

HTTP status code

Error

Error message

Description

400

InvalidParamter

The specified value of parameter is not valid.

The error message returned because the specified 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 specified LifecycleActionToken parameter does not match any lifecycle hook IDs.

400

LifecycleAction.TimeExceeded

The specified parameter heartbeatTime exceed lifecycleAction max suspend time.

The error message returned because the period during which the ECS instance keeps in the wait state has exceeded the maximum value of six hours.

400

LifecycleAction.RecordTimesExceeded

The specified lifecycleAction exceed lifecycleAction max record times.

The error message returned because the timeout period for each wait state has been extended for more than 20 times.