get_cost_forecast
async
¶
get_cost_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,
) -> GetCostForecastResponse
Retrieves a forecast for how much Amazon Web Services predicts that you will spend over the forecast time period that you select, based on your past costs.
Parameters:
-
time_period(DateInterval) –The period of time that you want the forecast to cover. The start date must be equal to or no later than the current date to avoid a validation error.
-
metric(Metric) –Which metric Cost Explorer uses to create your forecast. For more information about blended and unblended rates, see Why does the "blended" annotation appear on some line items in my bill?.
Valid values for a
GetCostForecastcall are the following:-
AMORTIZED_COST
-
BLENDED_COST
-
NET_AMORTIZED_COST
-
NET_UNBLENDED_COST
-
UNBLENDED_COST
-
-
granularity(Granularity) –How granular you want the forecast to be. You can get 3 months of
DAILYforecasts or 18 months ofMONTHLYforecasts.The
GetCostForecastoperation supports onlyDAILYandMONTHLYgranularities. -
filter(Optional[Expression], default:None) –The filters that you want to use to filter your forecast. The
GetCostForecastAPI supports filtering by the following dimensions:-
AZ -
INSTANCE_TYPE -
LINKED_ACCOUNT -
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) –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.
-
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
1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 | |