get_usage_forecast
async
¶
get_usage_forecast(
time_period: DateInterval,
metric: Metric,
granularity: Granularity,
*,
config_overrides: Optional[AsyncCostExplorerClientConfig] = None,
filter: Optional[Expression] = None,
billing_view_arn: Optional[BillingViewArn] = None,
prediction_interval_level: Optional[PredictionIntervalLevel] = None,
) -> GetUsageForecastResponse
Retrieves a forecast for how much Amazon Web Services predicts that you will use over the forecast time period that you select, based on your past usage.
Parameters:
-
time_period(DateInterval) –The start and end dates of the period that you want to retrieve usage forecast for. The start date is included in the period, but the end date isn't included in the period. For example, if
startis2017-01-01andendis2017-05-01, then the cost and usage data is retrieved from2017-01-01up to and including2017-04-30but not including2017-05-01. The start date must be equal to or later than the current date to avoid a validation error. -
metric(Metric) –Which metric Cost Explorer uses to create your forecast.
Valid values for a
GetUsageForecastcall are the following:-
USAGE_QUANTITY
-
NORMALIZED_USAGE_AMOUNT
-
-
granularity(Granularity) –How granular you want the forecast to be. You can get 3 months of
DAILYforecasts or 18 months ofMONTHLYforecasts.The
GetUsageForecastoperation supports onlyDAILYandMONTHLYgranularities. -
filter(Optional[Expression], default:None) –The filters that you want to use to filter your forecast. The
GetUsageForecastAPI supports filtering by the following dimensions:-
AZ -
INSTANCE_TYPE -
LINKED_ACCOUNT -
LINKED_ACCOUNT_NAME -
OPERATION -
PURCHASE_TYPE -
REGION -
SERVICE -
USAGE_TYPE -
USAGE_TYPE_GROUP -
RECORD_TYPE -
OPERATING_SYSTEM -
TENANCY -
SCOPE -
PLATFORM -
SUBSCRIPTION_ID -
LEGAL_ENTITY_NAME -
DEPLOYMENT_OPTION -
DATABASE_ENGINE -
INSTANCE_TYPE_FAMILY -
BILLING_ENTITY -
RESERVATION_ID -
SAVINGS_PLAN_ARN
-
-
billing_view_arn(Optional[BillingViewArn], default:None) –The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to Amazon Web Services Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.
-
prediction_interval_level(Optional[PredictionIntervalLevel], default:None) –Amazon Web Services Cost Explorer always returns the mean forecast as a single point. You can request a prediction interval around the mean by specifying a confidence level. The higher the confidence level, the more confident Cost Explorer is about the actual value falling in the prediction interval. Higher confidence levels result in wider prediction intervals.
Raises:
-
BillingViewHealthStatusException–The billing view status must be
HEALTHYto perform this action. Try again when the status isHEALTHY. -
DataUnavailableException–The requested data is unavailable.
-
LimitExceededException–You made too many calls in a short period of time. Try again later.
-
ResourceNotFoundException–The specified ARN in the request doesn't exist.
-
UnresolvableUsageUnitException–Cost Explorer was unable to identify the usage unit. Provide
UsageType/UsageTypeGroupfilter selections that contain matching units, for example:hours. -
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cost_explorer/_services/async_cost_explorer.py
2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 | |