Skip to content

describe_budget_performance_history async

describe_budget_performance_history(
    account_id: AccountId,
    budget_name: BudgetName,
    *,
    config_overrides: Optional[AsyncBudgetsClientConfig] = None,
    time_period: Optional[TimePeriod] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[GenericString] = None,
) -> DescribeBudgetPerformanceHistoryResponse

Describes the history for DAILY, MONTHLY, and QUARTERLY budgets. Budget history isn't available for ANNUAL budgets.

Parameters:

  • time_period (Optional[TimePeriod], default: None ) –

    Retrieves how often the budget went into an ALARM state for the specified time period.

Raises:

Source code in docs_src/capo_budgets/_services/async_budgets.py
async def describe_budget_performance_history(
    self,
    account_id: "capo_budgets.types.account_id.AccountId",
    budget_name: "capo_budgets.types.budget_name.BudgetName",
    *,
    config_overrides: Optional[AsyncBudgetsClientConfig] = None,
    time_period: Optional["capo_budgets.types.time_period.TimePeriod"] = None,
    max_results: Optional["capo_budgets.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_budgets.types.generic_string.GenericString"] = None,
) -> "capo_budgets.types.describe_budget_performance_history_response.DescribeBudgetPerformanceHistoryResponse":
    """<p>Describes the history for <code>DAILY</code>, <code>MONTHLY</code>, and <code>QUARTERLY</code> budgets. Budget history isn't available for <code>ANNUAL</code> budgets.</p>

    Args:
        time_period: <p>Retrieves how often the budget went into an <code>ALARM</code> state for the specified time period.</p>

    Raises:
        capo_budgets.errors.access_denied_exception.AccessDeniedException: <p>You are not authorized to use this operation with the given parameters.</p>
        capo_budgets.errors.billing_view_health_status_exception.BillingViewHealthStatusException: <p> The billing view status must be HEALTHY to perform this action. Try again when the status is HEALTHY. </p>
        capo_budgets.errors.expired_next_token_exception.ExpiredNextTokenException: <p>The pagination token expired.</p>
        capo_budgets.errors.internal_error_exception.InternalErrorException: <p>An error on the server occurred during the processing of your request. Try again later.</p>
        capo_budgets.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The pagination token is invalid.</p>
        capo_budgets.errors.invalid_parameter_exception.InvalidParameterException: <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
        capo_budgets.errors.not_found_exception.NotFoundException: <p>We can’t locate the resource that you specified.</p>
        capo_budgets.errors.throttling_exception.ThrottlingException: <p>The number of API requests has exceeded the maximum allowed API request throttling limit for the account.</p>
        capo_budgets.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_budgets.types.describe_budget_performance_history_request.DescribeBudgetPerformanceHistoryRequest]",
    ) -> AsyncOperationResponse[
        "capo_budgets.types.describe_budget_performance_history_response.DescribeBudgetPerformanceHistoryResponse"
    ]:
        import capo_budgets._operations.aws_budget_service_gateway.describe_budget_performance_history

        (
            output,
            http_response,
        ) = await capo_budgets._operations.aws_budget_service_gateway.describe_budget_performance_history.async_describe_budget_performance_history(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeBudgetPerformanceHistory")
    )
    input_: capo_budgets.types.describe_budget_performance_history_request.DescribeBudgetPerformanceHistoryRequest = {
        "account_id": account_id,
        "budget_name": budget_name,
    }
    if time_period is not None:
        input_["time_period"] = time_period
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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