All Products
Search
Document Center

Auto Scaling:DeleteLifecycleHook

最終更新日:Jun 13, 2024

Deletes a lifecycle hook. If you do not require a lifecycle hook, you can call the DeleteLifecycleHook operation to delete it.

Usage notes

If you delete a lifecycle hook that is in effect in a scaling group, instances on which the lifecycle hook takes effect exit the Pending state ahead of schedule. You can use one of the following methods to specify the lifecycle hooks that you want to delete:

  • Specify the lifecycle hook ID by using LifecycleHookId. In this case, ScalingGroupId and LifecycleHookName are ignored.

  • Specify the scaling group ID by using ScalingGroupId and specify the lifecycle hook name by using LifecycleHookName.

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

DeleteLifecycleHook

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

LifecycleHookId

String

No

ash-bp14g3ee6bt3sc98****

The ID of the lifecycle hook that you want to delete.

ScalingGroupId

String

No

asg-bp18p2yfxow2dloq****

The ID of the scaling group.

LifecycleHookName

String

No

lifecyclehook****

The name of the lifecycle hook that you want to delete.

RegionId

String

No

cn-hangzhou

The region ID of the scaling group.

Response parameters

Parameter

Type

Example

Description

RequestId

String

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

The request ID.

Examples

Sample requests

http(s)://ess.aliyuncs.com/?Action=DeleteLifecycleHook
&LifecycleHookId=ash-bp14g3ee6bt3sc98****
&ScalingGroupId=asg-bp18p2yfxow2dloq****
&LifecycleHookName=lifecyclehook****
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

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

<DeleteLifecycleHookResponse>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3****</RequestId>
</DeleteLifecycleHookResponse>

JSON format

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

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

Error codes

For a list of error codes, see Service error codes.

HTTP status code

Error code

Error message

Description

400

InvalidParamter

The specified value of parameter is invalid.

The value of a parameter is invalid.

400

InvalidLifecycleHookId.NotExist

The specified lifecycleHookId does not exist.

The lifecycle hook ID does not exist.

400

InvalidLifecycleHookName.NotExist

The specified lifecycleHookName you provided does not exist.

The lifecycle hook name does not exist.