Skip to content

update_alarm_model async

update_alarm_model(
    alarm_model_name: AlarmModelName,
    role_arn: AmazonResourceName,
    alarm_rule: AlarmRule,
    *,
    config_overrides: Optional[AsyncIoTEventsClientConfig] = None,
    alarm_model_description: Optional[AlarmModelDescription] = None,
    severity: Optional[Severity] = None,
    alarm_notification: Optional[AlarmNotification] = None,
    alarm_event_actions: Optional[AlarmEventActions] = None,
    alarm_capabilities: Optional[AlarmCapabilities] = None,
) -> UpdateAlarmModelResponse

Updates an alarm model. Any alarms that were created based on the previous version are deleted and then created again as new data arrives.

Parameters:

  • alarm_model_name (AlarmModelName) –

    The name of the alarm model.

  • alarm_model_description (Optional[AlarmModelDescription], default: None ) –

    The description of the alarm model.

  • role_arn (AmazonResourceName) –

    The ARN of the IAM role that allows the alarm to perform actions and access AWS resources. For more information, see Amazon Resource Names (ARNs) in the AWS General Reference.

  • severity (Optional[Severity], default: None ) –

    A non-negative integer that reflects the severity level of the alarm.

  • alarm_rule (AlarmRule) –

    Defines when your alarm is invoked.

  • alarm_notification (Optional[AlarmNotification], default: None ) –

    Contains information about one or more notification actions.

  • alarm_event_actions (Optional[AlarmEventActions], default: None ) –

    Contains information about one or more alarm actions.

  • alarm_capabilities (Optional[AlarmCapabilities], default: None ) –

    Contains the configuration information of alarm state changes.

Raises:

Source code in docs_src/capo_iot_events/_services/async_io_t_events.py
async def update_alarm_model(
    self,
    alarm_model_name: "capo_iot_events.types.alarm_model_name.AlarmModelName",
    role_arn: "capo_iot_events.types.amazon_resource_name.AmazonResourceName",
    alarm_rule: "capo_iot_events.types.alarm_rule.AlarmRule",
    *,
    config_overrides: Optional[AsyncIoTEventsClientConfig] = None,
    alarm_model_description: Optional[
        "capo_iot_events.types.alarm_model_description.AlarmModelDescription"
    ] = None,
    severity: Optional["capo_iot_events.types.severity.Severity"] = None,
    alarm_notification: Optional[
        "capo_iot_events.types.alarm_notification.AlarmNotification"
    ] = None,
    alarm_event_actions: Optional[
        "capo_iot_events.types.alarm_event_actions.AlarmEventActions"
    ] = None,
    alarm_capabilities: Optional[
        "capo_iot_events.types.alarm_capabilities.AlarmCapabilities"
    ] = None,
) -> "capo_iot_events.types.update_alarm_model_response.UpdateAlarmModelResponse":
    """<p>Updates an alarm model. Any alarms that were created based on the previous version are deleted and then created again as new data arrives.</p>

    Args:
        alarm_model_name: <p>The name of the alarm model.</p>
        alarm_model_description: <p>The description of the alarm model.</p>
        role_arn: <p>The ARN of the IAM role that allows the alarm to perform actions and access AWS resources. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>AWS General Reference</i>.</p>
        severity: <p>A non-negative integer that reflects the severity level of the alarm.</p>
        alarm_rule: <p>Defines when your alarm is invoked.</p>
        alarm_notification: <p>Contains information about one or more notification actions.</p>
        alarm_event_actions: <p>Contains information about one or more alarm actions.</p>
        alarm_capabilities: <p>Contains the configuration information of alarm state changes.</p>

    Raises:
        capo_iot_events.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
        capo_iot_events.errors.invalid_request_exception.InvalidRequestException: <p>The request was invalid.</p>
        capo_iot_events.errors.resource_in_use_exception.ResourceInUseException: <p>The resource is in use.</p>
        capo_iot_events.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource was not found.</p>
        capo_iot_events.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable.</p>
        capo_iot_events.errors.throttling_exception.ThrottlingException: <p>The request could not be completed due to throttling.</p>
        capo_iot_events.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot_events.types.update_alarm_model_request.UpdateAlarmModelRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot_events.types.update_alarm_model_response.UpdateAlarmModelResponse"
    ]:
        import capo_iot_events._operations.iot_columbo_service.update_alarm_model

        (
            output,
            http_response,
        ) = await capo_iot_events._operations.iot_columbo_service.update_alarm_model.async_update_alarm_model(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateAlarmModel")
    )
    input_: capo_iot_events.types.update_alarm_model_request.UpdateAlarmModelRequest = {
        "alarm_model_name": alarm_model_name,
        "role_arn": role_arn,
        "alarm_rule": alarm_rule,
    }
    if alarm_model_description is not None:
        input_["alarm_model_description"] = alarm_model_description
    if severity is not None:
        input_["severity"] = severity
    if alarm_notification is not None:
        input_["alarm_notification"] = alarm_notification
    if alarm_event_actions is not None:
        input_["alarm_event_actions"] = alarm_event_actions
    if alarm_capabilities is not None:
        input_["alarm_capabilities"] = alarm_capabilities

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output