Skip to content

list_alerts

list_alerts(
    resource_arn: __string,
    *,
    config_overrides: Optional[MediaTailorClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[__string] = None,
) -> ListAlertsResponse

Lists the alerts that are associated with a MediaTailor channel assembly resource.

Parameters:

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

    The maximum number of alerts that you want MediaTailor to return in response to the current request. If there are more than MaxResults alerts, use the value of NextToken in the response to get the next page of results.

    The default value is 100. MediaTailor uses DynamoDB-based pagination, which means that a response might contain fewer than MaxResults items, including 0 items, even when more results are available. To retrieve all results, you must continue making requests using the NextToken value from each response until the response no longer includes a NextToken value.

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

    Pagination token returned by the list request when results exceed the maximum allowed. Use the token to fetch the next page of results.

    For the first ListAlerts request, omit this value. For subsequent requests, get the value of NextToken from the previous response and specify that value for NextToken in the request. Continue making requests until the response no longer includes a NextToken value, which indicates that all results have been retrieved.

  • resource_arn (__string) –

    The Amazon Resource Name (ARN) of the resource.

Raises:

Source code in docs_src/capo_mediatailor/_services/media_tailor.py
def list_alerts(
    self,
    resource_arn: "capo_mediatailor.types.__string.__string",
    *,
    config_overrides: Optional[MediaTailorClientConfig] = None,
    max_results: Optional["capo_mediatailor.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_mediatailor.types.__string.__string"] = None,
) -> "capo_mediatailor.types.list_alerts_response.ListAlertsResponse":
    """<p>Lists the alerts that are associated with a MediaTailor channel assembly resource.</p>

    Args:
        max_results: <p>The maximum number of alerts that you want MediaTailor to return in response to the current request. If there are more than <code>MaxResults</code> alerts, use the value of <code>NextToken</code> in the response to get the next page of results.</p> <p>The default value is 100. MediaTailor uses DynamoDB-based pagination, which means that a response might contain fewer than <code>MaxResults</code> items, including 0 items, even when more results are available. To retrieve all results, you must continue making requests using the <code>NextToken</code> value from each response until the response no longer includes a <code>NextToken</code> value.</p>
        next_token: <p>Pagination token returned by the list request when results exceed the maximum allowed. Use the token to fetch the next page of results.</p> <p>For the first <code>ListAlerts</code> request, omit this value. For subsequent requests, get the value of <code>NextToken</code> from the previous response and specify that value for <code>NextToken</code> in the request. Continue making requests until the response no longer includes a <code>NextToken</code> value, which indicates that all results have been retrieved.</p>
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource.</p>

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

    def _handler(
        req: "OperationRequest[capo_mediatailor.types.list_alerts_request.ListAlertsRequest]",
    ) -> OperationResponse[
        "capo_mediatailor.types.list_alerts_response.ListAlertsResponse"
    ]:
        import capo_mediatailor._operations.media_tailor.list_alerts

        output, http_response = (
            capo_mediatailor._operations.media_tailor.list_alerts.list_alerts(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAlerts")
    )
    input_: capo_mediatailor.types.list_alerts_request.ListAlertsRequest = {
        "resource_arn": resource_arn
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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