Skip to content

update_safety_rule

update_safety_rule(
    *,
    config_overrides: Optional[Route53RecoveryControlConfigClientConfig] = None,
    assertion_rule_update: Optional[AssertionRuleUpdate] = None,
    gating_rule_update: Optional[GatingRuleUpdate] = None,
) -> UpdateSafetyRuleResponse

Update a safety rule (an assertion rule or gating rule). You can only update the name and the waiting period for a safety rule. To make other updates, delete the safety rule and create a new one.

Parameters:

Raises:

  • InternalServerException –

    500 response - InternalServiceError. Temporary service error. Retry the request.

  • ResourceNotFoundException –

    404 response - MalformedQueryString. The query string contains a syntax error or resource not found.

  • ValidationException –

    400 response - Multiple causes. For example, you might have a malformed query string and input parameter might be out of range, or you might have used parameters together incorrectly.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_route53_recovery_control_config/_services/route53_recovery_control_config.py
def update_safety_rule(
    self,
    *,
    config_overrides: Optional[Route53RecoveryControlConfigClientConfig] = None,
    assertion_rule_update: Optional[
        "capo_route53_recovery_control_config.types.assertion_rule_update.AssertionRuleUpdate"
    ] = None,
    gating_rule_update: Optional[
        "capo_route53_recovery_control_config.types.gating_rule_update.GatingRuleUpdate"
    ] = None,
) -> "capo_route53_recovery_control_config.types.update_safety_rule_response.UpdateSafetyRuleResponse":
    """<p>Update a safety rule (an assertion rule or gating rule). You can only update the name and the waiting period for a safety rule. To make other updates, delete the safety rule and create a new one.</p>

    Args:
        assertion_rule_update: <p>The assertion rule to update.</p>
        gating_rule_update: <p>The gating rule to update.</p>

    Raises:
        capo_route53_recovery_control_config.errors.internal_server_exception.InternalServerException: <p>500 response - InternalServiceError. Temporary service error. Retry the request.</p>
        capo_route53_recovery_control_config.errors.resource_not_found_exception.ResourceNotFoundException: <p>404 response - MalformedQueryString. The query string contains a syntax error or resource not found.</p>
        capo_route53_recovery_control_config.errors.validation_exception.ValidationException: <p>400 response - Multiple causes. For example, you might have a malformed query string and input parameter might be out of range, or you might have used parameters together incorrectly.</p>
        capo_route53_recovery_control_config.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_route53_recovery_control_config.types.update_safety_rule_request.UpdateSafetyRuleRequest]",
    ) -> OperationResponse[
        "capo_route53_recovery_control_config.types.update_safety_rule_response.UpdateSafetyRuleResponse"
    ]:
        import capo_route53_recovery_control_config._operations.route53_recovery_control_config.update_safety_rule

        output, http_response = (
            capo_route53_recovery_control_config._operations.route53_recovery_control_config.update_safety_rule.update_safety_rule(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateSafetyRule")
    )
    input_: capo_route53_recovery_control_config.types.update_safety_rule_request.UpdateSafetyRuleRequest = {}
    if assertion_rule_update is not None:
        input_["assertion_rule_update"] = assertion_rule_update
    if gating_rule_update is not None:
        input_["gating_rule_update"] = gating_rule_update

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output