DescribeLifecycleHooks
Queries lifecycle hooks.
Operation description
Operation description
You can query lifecycle hooks by using one of the following methods:
-
Specify a list of lifecycle hook IDs (LifecycleHookId.N). In this case, the scaling group ID (ScalingGroupId) and lifecycle hook name (LifecycleHookName) parameters are ignored.
-
Specify a scaling group ID (ScalingGroupId).
-
Specify both a scaling group ID (ScalingGroupId) and a lifecycle hook name (LifecycleHookName).
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ess:DescribeLifecycleHooks |
get |
*ScalingGroup
|
None | 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 page number of the instance status list. Minimum value: 1. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page for a paged query. Maximum value: 50. Default value: 50. |
50 |
| LifecycleHookId |
array |
No |
The IDs of the lifecycle hooks. |
ash-bp19d1032y9kij96**** |
|
string |
No |
The ID of the lifecycle hook. |
ash-bp1at9ufhmcf9cmy**** |
|
| RegionId |
string |
No |
The ID of the region where the scaling group resides. |
cn-beijing |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| PageNumber |
integer |
The page number of the returned page. |
1 |
| PageSize |
integer |
The number of entries returned per page. |
50 |
| TotalCount |
integer |
The total number of lifecycle hooks. |
1 |
| LifecycleHooks |
object |
||
| LifecycleHook |
array<object> |
The list of lifecycle hooks. |
|
|
object |
The lifecycle hook information. |
||
| DefaultResult |
string |
The action that Auto Scaling performs when the lifecycle hook times out. |
CONTINUE |
| LifecycleHookId |
string |
The ID of the lifecycle hook. |
ash-bp19d1032y9kij96**** |
| LifecycleHookName |
string |
The name of the lifecycle hook. |
lifecyclehook**** |
| LifecycleTransition |
string |
The type of the scaling activity to which the lifecycle hook applies. |
SCALE_OUT |
| NotificationMetadata |
string |
The fixed string that is included in a notification. Auto Scaling sends the notification when the lifecycle hook takes effect. |
Test Lifecycle Hook. |
| NotificationArn |
string |
The Alibaba Cloud Resource Name (ARN) of the method that is used by Auto Scaling to send notifications when the lifecycle hook takes effect. Specify the value in one of the following formats:
The variables in the preceding parameter formats have the following meanings:
|
acs:ess:cn-beijing:161456884340****:null/null |
| HeartbeatTimeout |
integer |
The period of time during which the lifecycle hook is in effect. Auto Scaling performs the default action when the lifecycle hook times out. |
60 |
| ScalingGroupId |
string |
The ID of the scaling group. |
asg-bp1igpak5ft1flyp**** |
| LifecycleHookStatus |
string |
The status of the lifecycle hook. Valid values:
|
Active |
Examples
Success response
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"PageNumber": 1,
"PageSize": 50,
"TotalCount": 1,
"LifecycleHooks": {
"LifecycleHook": [
{
"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
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.