Skip to content

disable_alarm_actions async

disable_alarm_actions(
    *,
    config_overrides: Optional[AsyncCloudWatchClientConfig] = None,
    alarm_names: Optional[AlarmNames] = None,
) -> None

Disables the actions for the specified alarms. When an alarm's actions are disabled, the alarm actions do not execute when the alarm state changes.

Parameters:

Raises:

Source code in docs_src/capo_cloudwatch/_services/async_cloud_watch.py
async def disable_alarm_actions(
    self,
    *,
    config_overrides: Optional[AsyncCloudWatchClientConfig] = None,
    alarm_names: Optional["capo_cloudwatch.types.alarm_names.AlarmNames"] = None,
) -> None:
    """<p>Disables the actions for the specified alarms. When an alarm's actions are disabled, the alarm actions do not execute when the alarm state changes.</p>

    Args:
        alarm_names: <p>The names of the alarms.</p>

    Raises:
        capo_cloudwatch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch.types.disable_alarm_actions_input.DisableAlarmActionsInput]",
    ) -> AsyncOperationResponse[None]:
        import capo_cloudwatch._operations.granite_service_version20100801.disable_alarm_actions

        (
            output,
            http_response,
        ) = await capo_cloudwatch._operations.granite_service_version20100801.disable_alarm_actions.async_disable_alarm_actions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisableAlarmActions")
    )
    input_: capo_cloudwatch.types.disable_alarm_actions_input.DisableAlarmActionsInput = {}
    if alarm_names is not None:
        input_["alarm_names"] = alarm_names

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