Skip to content

update_mitigation_action

update_mitigation_action(
    action_name: MitigationActionName,
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    role_arn: Optional[RoleArn] = None,
    action_params: Optional[MitigationActionParams] = None,
) -> UpdateMitigationActionResponse

Updates the definition for the specified mitigation action.

Requires permission to access the UpdateMitigationAction action.

Parameters:

  • action_name (MitigationActionName) –

    The friendly name for the mitigation action. You cannot change the name by using UpdateMitigationAction. Instead, you must delete and recreate the mitigation action with the new name.

  • role_arn (Optional[RoleArn], default: None ) –

    The ARN of the IAM role that is used to apply the mitigation action.

  • action_params (Optional[MitigationActionParams], default: None ) –

    Defines the type of action and the parameters for that action.

Raises:

Source code in docs_src/capo_iot/_services/io_t.py
def update_mitigation_action(
    self,
    action_name: "capo_iot.types.mitigation_action_name.MitigationActionName",
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    role_arn: Optional["capo_iot.types.role_arn.RoleArn"] = None,
    action_params: Optional[
        "capo_iot.types.mitigation_action_params.MitigationActionParams"
    ] = None,
) -> "capo_iot.types.update_mitigation_action_response.UpdateMitigationActionResponse":
    """<p>Updates the definition for the specified mitigation action.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">UpdateMitigationAction</a> action.</p>

    Args:
        action_name: <p>The friendly name for the mitigation action. You cannot change the name by using <code>UpdateMitigationAction</code>. Instead, you must delete and recreate the mitigation action with the new name.</p>
        role_arn: <p>The ARN of the IAM role that is used to apply the mitigation action.</p>
        action_params: <p>Defines the type of action and the parameters for that action.</p>

    Raises:
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot.types.update_mitigation_action_request.UpdateMitigationActionRequest]",
    ) -> OperationResponse[
        "capo_iot.types.update_mitigation_action_response.UpdateMitigationActionResponse"
    ]:
        import capo_iot._operations.aws_iot_service.update_mitigation_action

        output, http_response = (
            capo_iot._operations.aws_iot_service.update_mitigation_action.update_mitigation_action(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateMitigationAction")
    )
    input_: capo_iot.types.update_mitigation_action_request.UpdateMitigationActionRequest = {
        "action_name": action_name
    }
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if action_params is not None:
        input_["action_params"] = action_params

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