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/dlm.py
| def delete_lifecycle_policy(
self,
policy_id: "capo_dlm.types.policy_id.PolicyId",
*,
config_overrides: Optional[DLMClientConfig] = 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.
"""
def _handler(
req: "OperationRequest[capo_dlm.types.delete_lifecycle_policy_request.DeleteLifecyclePolicyRequest]",
) -> OperationResponse[
"capo_dlm.types.delete_lifecycle_policy_response.DeleteLifecyclePolicyResponse"
]:
import capo_dlm._operations.dlm_20180112.delete_lifecycle_policy
output, http_response = (
capo_dlm._operations.dlm_20180112.delete_lifecycle_policy.delete_lifecycle_policy(
req.options, req.input
)
)
return OperationResponse(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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|