Skip to content

get_anomaly_monitors async

get_anomaly_monitors(
    *,
    config_overrides: Optional[AsyncCostExplorerClientConfig] = None,
    monitor_arn_list: Optional[Values] = None,
    next_page_token: Optional[NextPageToken] = None,
    max_results: Optional[PageSize] = None,
) -> GetAnomalyMonitorsResponse

Retrieves the cost anomaly monitor definitions for your account. You can filter using a list of cost anomaly monitor Amazon Resource Names (ARNs).

Parameters:

  • monitor_arn_list (Optional[Values], default: None ) –

    A list of cost anomaly monitor ARNs.

  • next_page_token (Optional[NextPageToken], default: None ) –

    The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

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

    The number of entries that a paginated response contains.

Raises:

Source code in docs_src/capo_cost_explorer/_services/async_cost_explorer.py
async def get_anomaly_monitors(
    self,
    *,
    config_overrides: Optional[AsyncCostExplorerClientConfig] = None,
    monitor_arn_list: Optional["capo_cost_explorer.types.values.Values"] = None,
    next_page_token: Optional[
        "capo_cost_explorer.types.next_page_token.NextPageToken"
    ] = None,
    max_results: Optional["capo_cost_explorer.types.page_size.PageSize"] = None,
) -> "capo_cost_explorer.types.get_anomaly_monitors_response.GetAnomalyMonitorsResponse":
    """<p>Retrieves the cost anomaly monitor definitions for your account. You can filter using a list of cost anomaly monitor Amazon Resource Names (ARNs). </p>

    Args:
        monitor_arn_list: <p>A list of cost anomaly monitor ARNs. </p>
        next_page_token: <p>The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size. </p>
        max_results: <p>The number of entries that a paginated response contains. </p>

    Raises:
        capo_cost_explorer.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The pagination token is invalid. Try again without a pagination token.</p>
        capo_cost_explorer.errors.limit_exceeded_exception.LimitExceededException: <p>You made too many calls in a short period of time. Try again later.</p>
        capo_cost_explorer.errors.unknown_monitor_exception.UnknownMonitorException: <p>The cost anomaly monitor does not exist for the account. </p>
        capo_cost_explorer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cost_explorer.types.get_anomaly_monitors_request.GetAnomalyMonitorsRequest]",
    ) -> AsyncOperationResponse[
        "capo_cost_explorer.types.get_anomaly_monitors_response.GetAnomalyMonitorsResponse"
    ]:
        import capo_cost_explorer._operations.aws_insights_index_service.get_anomaly_monitors

        (
            output,
            http_response,
        ) = await capo_cost_explorer._operations.aws_insights_index_service.get_anomaly_monitors.async_get_anomaly_monitors(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetAnomalyMonitors")
    )
    input_: capo_cost_explorer.types.get_anomaly_monitors_request.GetAnomalyMonitorsRequest = {}
    if monitor_arn_list is not None:
        input_["monitor_arn_list"] = monitor_arn_list
    if next_page_token is not None:
        input_["next_page_token"] = next_page_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