Gets information about the lifecycle hooks for the specified Auto Scaling group.
Parameters:
-
auto_scaling_group_name
(Optional[XmlStringMaxLen255], default:
None
)
–
The name of the Auto Scaling group.
-
lifecycle_hook_names
(Optional[LifecycleHookNames], default:
None
)
–
The names of one or more lifecycle hooks. If you omit this property, all lifecycle hooks are described.
Raises:
-
ResourceContentionFault
–
You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To describe your lifecycle hooks
This example describes the lifecycle hooks for the specified Auto Scaling group.
>>> await client.describe_lifecycle_hooks(auto_scaling_group_name='my-auto-scaling-group')
Source code in docs_src/capo_auto_scaling/_services/async_auto_scaling.py
| async def describe_lifecycle_hooks(
self,
*,
config_overrides: Optional[AsyncAutoScalingClientConfig] = None,
auto_scaling_group_name: Optional[
"capo_auto_scaling.types.xml_string_max_len255.XmlStringMaxLen255"
] = None,
lifecycle_hook_names: Optional[
"capo_auto_scaling.types.lifecycle_hook_names.LifecycleHookNames"
] = None,
) -> "capo_auto_scaling.types.describe_lifecycle_hooks_answer.DescribeLifecycleHooksAnswer":
"""<p>Gets information about the lifecycle hooks for the specified Auto Scaling group.</p>
Args:
auto_scaling_group_name: <p>The name of the Auto Scaling group.</p>
lifecycle_hook_names: <p>The names of one or more lifecycle hooks. If you omit this property, all lifecycle hooks are described.</p>
Raises:
capo_auto_scaling.errors.resource_contention_fault.ResourceContentionFault: <p>You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).</p>
capo_auto_scaling.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To describe your lifecycle hooks
This example describes the lifecycle hooks for the specified Auto Scaling group.
>>> await client.describe_lifecycle_hooks(auto_scaling_group_name='my-auto-scaling-group')
"""
async def _handler(
req: "AsyncOperationRequest[capo_auto_scaling.types.describe_lifecycle_hooks_type.DescribeLifecycleHooksType]",
) -> AsyncOperationResponse[
"capo_auto_scaling.types.describe_lifecycle_hooks_answer.DescribeLifecycleHooksAnswer"
]:
import capo_auto_scaling._operations.auto_scaling_2011_01_01.describe_lifecycle_hooks
(
output,
http_response,
) = await capo_auto_scaling._operations.auto_scaling_2011_01_01.describe_lifecycle_hooks.async_describe_lifecycle_hooks(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeLifecycleHooks")
)
input_: capo_auto_scaling.types.describe_lifecycle_hooks_type.DescribeLifecycleHooksType = {}
if auto_scaling_group_name is not None:
input_["auto_scaling_group_name"] = auto_scaling_group_name
if lifecycle_hook_names is not None:
input_["lifecycle_hook_names"] = lifecycle_hook_names
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|