get_reservation_utilization
¶
get_reservation_utilization(
time_period: DateInterval,
*,
config_overrides: Optional[CostExplorerClientConfig] = None,
group_by: Optional[GroupDefinitions] = None,
granularity: Optional[Granularity] = None,
filter: Optional[Expression] = None,
sort_by: Optional[SortDefinition] = None,
next_page_token: Optional[NextPageToken] = None,
max_results: Optional[MaxResults] = None,
) -> GetReservationUtilizationResponse
Retrieves the reservation utilization for your account. Management account in an organization have access to member accounts. You can filter data by dimensions in a time period. You can use GetDimensionValues to determine the possible dimension values. Currently, you can group only by SUBSCRIPTION_ID.
Parameters:
-
time_period(DateInterval) –Sets the start and end dates for retrieving Reserved Instance (RI) utilization. The start date is inclusive, but the end date is exclusive. 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. -
group_by(Optional[GroupDefinitions], default:None) –Groups only by
SUBSCRIPTION_ID. Metadata is included. -
granularity(Optional[Granularity], default:None) –If
GroupByis set,Granularitycan't be set. IfGranularityisn't set, the response object doesn't includeGranularity, eitherMONTHLYorDAILY. If bothGroupByandGranularityaren't set,GetReservationUtilizationdefaults toDAILY.The
GetReservationUtilizationoperation supports onlyDAILYandMONTHLYgranularities. -
filter(Optional[Expression], default:None) –Filters utilization data by dimensions. You can filter by the following dimensions:
-
AZ
-
INSTANCE_TYPE
-
INSTANCE_TYPE_FAMILY
-
LINKED_ACCOUNT
-
PLATFORM
-
REGION
-
SERVICE
If not specified, the
SERVICEfilter defaults to Amazon Elastic Compute Cloud - Compute. Supported values forSERVICEare Amazon Elastic Compute Cloud - Compute, Amazon Relational Database Service, Amazon ElastiCache, Amazon MemoryDB, Amazon Redshift, Amazon Elasticsearch Service, and Amazon OpenSearch Service. -
SCOPE
The valid values for
SCOPEare the following. Use them exactly as shown, including capitalization.-
Region- Matches reservations that aren't tied to an Availability Zone. -
Availability Zone- Matches reservations for a specific Availability Zone.
-
-
SUBSCRIPTION_ID
Values for
SUBSCRIPTION_IDmust contain only digits. -
TENANCY
GetReservationUtilizationuses the same Expression object as the other operations, with the following limits.Filteraccepts oneDimensionsexpression, aNotof oneDimensionsexpression, or oneAndof two or more of these. The operation doesn't supportOr, anAndinside anAnd, aNotaround any other expression,Tags, orCostCategories.Each dimension can appear only once in a filter, including inside a
Not. To filter on several values of a dimension, put them in one expression. The operation ORs multiple values for a dimension together. -
-
sort_by(Optional[SortDefinition], default:None) –The value that you want to sort the data by.
The following values are supported for
Key:-
UtilizationPercentage -
UtilizationPercentageInUnits -
PurchasedHours -
PurchasedUnits -
TotalActualHours -
TotalActualUnits -
UnusedHours -
UnusedUnits -
OnDemandCostOfRIHoursUsed -
NetRISavings -
TotalPotentialRISavings -
AmortizedUpfrontFee -
AmortizedRecurringFee -
TotalAmortizedFee -
RICostForUnusedHours -
RealizedSavings -
UnrealizedSavings
SortByapplies only when you setGroupBy. If you don't setGroupBy, the operation ignoresSortBy, including itsKey.If you specify
SortBywithGroupBy, you must also specifySortOrder. There is no default. The supported values forSortOrderareASCENDINGandDESCENDING. -
-
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[MaxResults], default:None) –The maximum number of objects that you returned for this request. If more objects are available, in the response, Amazon Web Services provides a NextPageToken value that you can use in a subsequent call to get the next batch of objects.
Raises:
-
DataUnavailableException–The requested data is unavailable.
-
InvalidNextTokenException–The pagination token is invalid. Try again without a pagination token.
-
LimitExceededException–You made too many calls in a short period of time. Try again later.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cost_explorer/_services/cost_explorer.py
1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 | |