Deletes the specified lifecycle policy and halts the automated operations that the policy specified.
For more information about deleting a policy, see Delete lifecycle policies.
Parameters:
-
policy_id
(PolicyId)
–
The identifier of the lifecycle policy.
Raises:
Source code in docs_src/capo_dlm/_services/async_dlm.py
| async def delete_lifecycle_policy(
self,
policy_id: "capo_dlm.types.policy_id.PolicyId",
*,
config_overrides: Optional[AsyncDLMClientConfig] = None,
) -> (
"capo_dlm.types.delete_lifecycle_policy_response.DeleteLifecyclePolicyResponse"
):
"""<p>Deletes the specified lifecycle policy and halts the automated operations that the policy specified.</p> <p>For more information about deleting a policy, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/view-modify-delete.html#delete">Delete lifecycle policies</a>.</p>
Args:
policy_id: <p>The identifier of the lifecycle policy.</p>
Raises:
capo_dlm.errors.internal_server_exception.InternalServerException: <p>The service failed in an unexpected way.</p>
capo_dlm.errors.limit_exceeded_exception.LimitExceededException: <p>The request failed because a limit was exceeded.</p>
capo_dlm.errors.resource_not_found_exception.ResourceNotFoundException: <p>A requested resource was not found.</p>
capo_dlm.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_dlm.types.delete_lifecycle_policy_request.DeleteLifecyclePolicyRequest]",
) -> AsyncOperationResponse[
"capo_dlm.types.delete_lifecycle_policy_response.DeleteLifecyclePolicyResponse"
]:
import capo_dlm._operations.dlm_20180112.delete_lifecycle_policy
(
output,
http_response,
) = await capo_dlm._operations.dlm_20180112.delete_lifecycle_policy.async_delete_lifecycle_policy(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteLifecyclePolicy")
)
input_: capo_dlm.types.delete_lifecycle_policy_request.DeleteLifecyclePolicyRequest = {
"policy_id": policy_id
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|