Retrieves the Savings Plans utilization for your account across date ranges with daily or monthly granularity. Management account in an organization have access to member accounts. You can use GetDimensionValues in SAVINGS_PLANS to determine the possible dimension values.
You can't group by any dimension values for GetSavingsPlansUtilization.
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.
-
granularity
(Optional[Granularity], default:
None
)
–
The granularity of the Amazon Web Services utillization data for your Savings Plans.
The GetSavingsPlansUtilization operation supports only DAILY and MONTHLY granularities.
-
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
-
SAVINGS_PLANS_TYPE
-
REGION
-
PAYMENT_OPTION
-
INSTANCE_TYPE_FAMILY
GetSavingsPlansUtilization uses the same Expression object as the other operations, but only AND is supported among each dimension.
-
sort_by
(Optional[SortDefinition], default:
None
)
–
The value that you want to sort the data by.
The following values are supported for Key:
-
UtilizationPercentage
-
TotalCommitment
-
UsedCommitment
-
UnusedCommitment
-
NetSavings
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(
self,
time_period: "capo_cost_explorer.types.date_interval.DateInterval",
*,
config_overrides: Optional[AsyncCostExplorerClientConfig] = None,
granularity: Optional[
"capo_cost_explorer.types.granularity.Granularity"
] = None,
filter: Optional["capo_cost_explorer.types.expression.Expression"] = None,
sort_by: Optional[
"capo_cost_explorer.types.sort_definition.SortDefinition"
] = None,
) -> "capo_cost_explorer.types.get_savings_plans_utilization_response.GetSavingsPlansUtilizationResponse":
"""<p>Retrieves the Savings Plans utilization for your account across date ranges with daily or monthly granularity. Management account in an organization have access to member accounts. You can use <code>GetDimensionValues</code> in <code>SAVINGS_PLANS</code> to determine the possible dimension values.</p> <note> <p>You can't group by any dimension values for <code>GetSavingsPlansUtilization</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>
granularity: <p>The granularity of the Amazon Web Services utillization data for your Savings Plans.</p> <p>The <code>GetSavingsPlansUtilization</code> operation supports only <code>DAILY</code> and <code>MONTHLY</code> granularities.</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>SAVINGS_PLANS_TYPE</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>GetSavingsPlansUtilization</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>
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> </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.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_request.GetSavingsPlansUtilizationRequest]",
) -> AsyncOperationResponse[
"capo_cost_explorer.types.get_savings_plans_utilization_response.GetSavingsPlansUtilizationResponse"
]:
import capo_cost_explorer._operations.aws_insights_index_service.get_savings_plans_utilization
(
output,
http_response,
) = await capo_cost_explorer._operations.aws_insights_index_service.get_savings_plans_utilization.async_get_savings_plans_utilization(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetSavingsPlansUtilization")
)
input_: capo_cost_explorer.types.get_savings_plans_utilization_request.GetSavingsPlansUtilizationRequest = {
"time_period": time_period
}
if granularity is not None:
input_["granularity"] = granularity
if filter is not None:
input_["filter"] = filter
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
|