get_usage_forecast
¶
get_usage_forecast(
time_period: DateInterval,
metric: Metric,
granularity: Granularity,
*,
config_overrides: Optional[CostExplorerClientConfig] = 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/cost_explorer.py
2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 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 | |