get_savings_plans_coverage
async
¶
get_savings_plans_coverage(
time_period: DateInterval,
*,
config_overrides: Optional[AsyncCostExplorerClientConfig] = None,
group_by: Optional[GroupDefinitions] = None,
granularity: Optional[Granularity] = None,
filter: Optional[Expression] = None,
metrics: Optional[MetricNames] = None,
next_token: Optional[NextPageToken] = None,
max_results: Optional[MaxResults] = None,
sort_by: Optional[SortDefinition] = None,
) -> GetSavingsPlansCoverageResponse
Retrieves the Savings Plans covered for your account. This enables you to see how much of your cost is covered by a Savings Plan. An organization’s management account can see the coverage of the associated member accounts. The filter supports dimensions and cost categories, combined with one level of And or Not. For details, see Filter. For any time period, you can filter data for Savings Plans usage with the following dimensions:
-
LINKED_ACCOUNT -
REGION -
SERVICE -
INSTANCE_TYPE_FAMILY
To determine valid values for a dimension, use the GetDimensionValues operation.
Parameters:
-
time_period(DateInterval) –The time period that you want the usage and costs for. The
Startdate must be within 13 months. TheEnddate must be after theStartdate, and before the current date. Future dates can't be used as anEnddate. -
group_by(Optional[GroupDefinitions], default:None) –You can group the data using the attributes
INSTANCE_TYPE_FAMILY,REGION, orSERVICE. -
granularity(Optional[Granularity], default:None) –The granularity of the Amazon Web Services cost data for your Savings Plans.
Granularitycan't be set ifGroupByis set.The
GetSavingsPlansCoverageoperation supports onlyDAILYandMONTHLYgranularities. -
filter(Optional[Expression], default:None) –Filters Savings Plans coverage data by dimensions. You can filter data for Savings Plans usage with the following dimensions:
-
LINKED_ACCOUNT -
REGION -
SERVICE -
INSTANCE_TYPE_FAMILY
GetSavingsPlansCoverageuses the same Expression object as the other operations. The filter must have one of the following shapes:-
A
DimensionsorCostCategoriesexpression. -
A
Notexpression that contains oneDimensionsorCostCategoriesexpression. -
An
Andexpression with two or more operands, where each operand has one of the two shapes above.
OrandTagsexpressions aren't supported. AnAndexpression can't contain anotherAnd, and aNotexpression can't contain anAndor anotherNot.Each dimension can appear only once in the filter, including inside
Not, and you can use only oneCostCategoriesexpression. To filter on several values of a dimension, put all of the values in one expression. Cost Explorer combines the values in one expression with OR. -
-
metrics(Optional[MetricNames], default:None) –The measurement that you want your Savings Plans coverage reported in. The only valid value is
SpendCoveredBySavingsPlans. -
next_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 number of items to be returned in a response. The default is
20, with a minimum value of1. -
sort_by(Optional[SortDefinition], default:None) –The value that you want to sort the data by.
The following values are supported for
Key:-
SpendCoveredBySavingsPlan -
OnDemandCost -
CoveragePercentage -
TotalCost -
InstanceFamily -
Region -
Service
The supported values for
SortOrderareASCENDINGandDESCENDING. -
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/async_cost_explorer.py
2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 | |