Queries lifecycle hooks. When you call this operation, you can specify the lifecycle hook ID or scaling group ID to query the details of the desired lifecycle hook, such as the default action after the lifecycle hook times out, scaling activity that corresponds to the lifecycle hook, Alibaba Cloud Resource Name (ARN) of the notification recipient, and effective period of the lifecycle hook.
Operation description
You can use one of the following methods to query lifecycle hooks:
- Specify a list of lifecycle hook IDs by using the LifecycleHookIds parameter. In this case, you do not need to specify the ScalingGroupId and LifecycleHookName parameters.
- Specify the scaling group ID by using the ScalingGroupId parameter.
- Specify the scaling group ID by using the ScalingGroupId parameter and the lifecycle hook name by using the LifecycleHookName parameter at the same time.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ess:DescribeLifecycleHooks | get | *ScalingGroup acs:ess:{#regionId}:{#accountId}:scalinggroup/{#ScalingGroupId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ScalingGroupId | string | No | The ID of the scaling group. | asg-bp1igpak5ft1flyp**** |
LifecycleHookName | string | No | The name of the lifecycle hook. | lifecyclehook**** |
PageNumber | integer | No | The number of the page to return. Pages start from page 1. Default value: 1. | 1 |
PageSize | integer | No | The number of entries to return on each page. Maximum value: 50. Default value: 50. | 50 |
LifecycleHookIds | array | No | The IDs of the lifecycle hooks that you want to query. | |
string | No | The ID of the lifecycle hook that you want to query. | ash-bp1at9ufhmcf9cmy**** | |
RegionId | string | No | The region ID of the scaling group. | cn-beijing |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"PageNumber": 1,
"PageSize": 50,
"TotalCount": 1,
"LifecycleHooks": [
{
"DefaultResult": "CONTINUE",
"LifecycleHookId": "ash-bp19d1032y9kij96****",
"LifecycleHookName": "lifecyclehook****",
"LifecycleTransition": "SCALE_OUT",
"NotificationMetadata": "Test Lifecycle Hook.",
"NotificationArn": "acs:ess:cn-beijing:161456884340****:null/null",
"HeartbeatTimeout": 60,
"ScalingGroupId": "asg-bp1igpak5ft1flyp****",
"LifecycleHookStatus": "Active"
}
]
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2022-10-13 | The response structure of the API has changed | View Change Details |