Skip to content

list_alarms async

list_alarms(
    alarm_model_name: AlarmModelName,
    *,
    config_overrides: Optional[AsyncIoTEventsDataClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListAlarmsResponse

Lists one or more alarms. The operation returns only the metadata associated with each alarm.

Parameters:

  • alarm_model_name (AlarmModelName) –

    The name of the alarm model.

  • next_token (Optional[NextToken], default: None ) –

    The token that you can use to return the next set of results.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to be returned per request.

Raises:

Source code in docs_src/capo_iot_events_data/_services/async_io_t_events_data.py
async def list_alarms(
    self,
    alarm_model_name: "capo_iot_events_data.types.alarm_model_name.AlarmModelName",
    *,
    config_overrides: Optional[AsyncIoTEventsDataClientConfig] = None,
    next_token: Optional["capo_iot_events_data.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_iot_events_data.types.max_results.MaxResults"
    ] = None,
) -> "capo_iot_events_data.types.list_alarms_response.ListAlarmsResponse":
    """<p>Lists one or more alarms. The operation returns only the metadata associated with each alarm.</p>

    Args:
        alarm_model_name: <p>The name of the alarm model.</p>
        next_token: <p>The token that you can use to return the next set of results.</p>
        max_results: <p>The maximum number of results to be returned per request.</p>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_iot_events_data.types.list_alarms_request.ListAlarmsRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot_events_data.types.list_alarms_response.ListAlarmsResponse"
    ]:
        import capo_iot_events_data._operations.iot_columbo_data_service.list_alarms

        (
            output,
            http_response,
        ) = await capo_iot_events_data._operations.iot_columbo_data_service.list_alarms.async_list_alarms(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAlarms")
    )
    input_: capo_iot_events_data.types.list_alarms_request.ListAlarmsRequest = {
        "alarm_model_name": alarm_model_name
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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