Retrieves attribute data along with aggregate utilization and savings data for a given time period. This doesn't support granular or grouped data (daily/monthly) in response. You can't retrieve data by dates in a single response similar to GetSavingsPlanUtilization, but you have the option to make multiple calls to GetSavingsPlanUtilizationDetails by providing individual dates. You can use GetDimensionValues in SAVINGS_PLANS to determine the possible dimension values.
GetSavingsPlanUtilizationDetails internally groups data by SavingsPlansArn.
Parameters:
-
time_period
(DateInterval)
–
The time period that you want the usage and costs for. The Start date must be within 13 months. The End date must be after the Start date, and before the current date. Future dates can't be used as an End date.
-
filter
(Optional[Expression], default:
None
)
–
Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data with the following dimensions:
-
LINKED_ACCOUNT
-
SAVINGS_PLAN_ARN
-
REGION
-
PAYMENT_OPTION
-
INSTANCE_TYPE_FAMILY
GetSavingsPlansUtilizationDetails uses the same Expression object as the other operations, but only AND is supported among each dimension.
-
data_type
(Optional[SavingsPlansDataTypes], default:
None
)
–
-
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 of 1.
-
sort_by
(Optional[SortDefinition], default:
None
)
–
The value that you want to sort the data by.
The following values are supported for Key:
The supported values for SortOrder are ASCENDING and DESCENDING.
Raises:
Source code in docs_src/capo_cost_explorer/_services/async_cost_explorer.py
| async def get_savings_plans_utilization_details(
self,
time_period: "capo_cost_explorer.types.date_interval.DateInterval",
*,
config_overrides: Optional[AsyncCostExplorerClientConfig] = None,
filter: Optional["capo_cost_explorer.types.expression.Expression"] = None,
data_type: Optional[
"capo_cost_explorer.types.savings_plans_data_types.SavingsPlansDataTypes"
] = None,
next_token: Optional[
"capo_cost_explorer.types.next_page_token.NextPageToken"
] = None,
max_results: Optional["capo_cost_explorer.types.max_results.MaxResults"] = None,
sort_by: Optional[
"capo_cost_explorer.types.sort_definition.SortDefinition"
] = None,
) -> "capo_cost_explorer.types.get_savings_plans_utilization_details_response.GetSavingsPlansUtilizationDetailsResponse":
"""<p>Retrieves attribute data along with aggregate utilization and savings data for a given time period. This doesn't support granular or grouped data (daily/monthly) in response. You can't retrieve data by dates in a single response similar to <code>GetSavingsPlanUtilization</code>, but you have the option to make multiple calls to <code>GetSavingsPlanUtilizationDetails</code> by providing individual dates. You can use <code>GetDimensionValues</code> in <code>SAVINGS_PLANS</code> to determine the possible dimension values.</p> <note> <p> <code>GetSavingsPlanUtilizationDetails</code> internally groups data by <code>SavingsPlansArn</code>.</p> </note>
Args:
time_period: <p>The time period that you want the usage and costs for. The <code>Start</code> date must be within 13 months. The <code>End</code> date must be after the <code>Start</code> date, and before the current date. Future dates can't be used as an <code>End</code> date.</p>
filter: <p>Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data with the following dimensions:</p> <ul> <li> <p> <code>LINKED_ACCOUNT</code> </p> </li> <li> <p> <code>SAVINGS_PLAN_ARN</code> </p> </li> <li> <p> <code>REGION</code> </p> </li> <li> <p> <code>PAYMENT_OPTION</code> </p> </li> <li> <p> <code>INSTANCE_TYPE_FAMILY</code> </p> </li> </ul> <p> <code>GetSavingsPlansUtilizationDetails</code> uses the same <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html">Expression</a> object as the other operations, but only <code>AND</code> is supported among each dimension.</p>
data_type: <p>The data type.</p>
next_token: <p>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.</p>
max_results: <p>The number of items to be returned in a response. The default is <code>20</code>, with a minimum value of <code>1</code>.</p>
sort_by: <p>The value that you want to sort the data by.</p> <p>The following values are supported for <code>Key</code>:</p> <ul> <li> <p> <code>UtilizationPercentage</code> </p> </li> <li> <p> <code>TotalCommitment</code> </p> </li> <li> <p> <code>UsedCommitment</code> </p> </li> <li> <p> <code>UnusedCommitment</code> </p> </li> <li> <p> <code>NetSavings</code> </p> </li> <li> <p> <code>AmortizedRecurringCommitment</code> </p> </li> <li> <p> <code>AmortizedUpfrontCommitment</code> </p> </li> </ul> <p>The supported values for <code>SortOrder</code> are <code>ASCENDING</code> and <code>DESCENDING</code>.</p>
Raises:
capo_cost_explorer.errors.data_unavailable_exception.DataUnavailableException: <p>The requested data is unavailable.</p>
capo_cost_explorer.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The pagination token is invalid. Try again without a pagination token.</p>
capo_cost_explorer.errors.limit_exceeded_exception.LimitExceededException: <p>You made too many calls in a short period of time. Try again later.</p>
capo_cost_explorer.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cost_explorer.types.get_savings_plans_utilization_details_request.GetSavingsPlansUtilizationDetailsRequest]",
) -> AsyncOperationResponse[
"capo_cost_explorer.types.get_savings_plans_utilization_details_response.GetSavingsPlansUtilizationDetailsResponse"
]:
import capo_cost_explorer._operations.aws_insights_index_service.get_savings_plans_utilization_details
(
output,
http_response,
) = await capo_cost_explorer._operations.aws_insights_index_service.get_savings_plans_utilization_details.async_get_savings_plans_utilization_details(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetSavingsPlansUtilizationDetails")
)
input_: capo_cost_explorer.types.get_savings_plans_utilization_details_request.GetSavingsPlansUtilizationDetailsRequest = {
"time_period": time_period
}
if filter is not None:
input_["filter"] = filter
if data_type is not None:
input_["data_type"] = data_type
if next_token is not None:
input_["next_token"] = next_token
if max_results is not None:
input_["max_results"] = max_results
if sort_by is not None:
input_["sort_by"] = sort_by
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|