Retrieves estimated usage records for hourly granularity or resource-level data at daily granularity.
Parameters:
-
granularity
(Granularity)
–
How granular you want the data to be. You can enable data at hourly or daily granularity.
-
services
(Optional[UsageServices], default:
None
)
–
The service metadata for the service or services you want to query. If not specified, all elements are returned.
-
approximation_dimension
(ApproximationDimension)
–
The service to evaluate for the usage records. You can choose resource-level data at daily granularity, or hourly granularity with or without resource-level data.
Raises:
Source code in docs_src/capo_cost_explorer/_services/cost_explorer.py
| def get_approximate_usage_records(
self,
granularity: "capo_cost_explorer.types.granularity.Granularity",
approximation_dimension: "capo_cost_explorer.types.approximation_dimension.ApproximationDimension",
*,
config_overrides: Optional[CostExplorerClientConfig] = None,
services: Optional[
"capo_cost_explorer.types.usage_services.UsageServices"
] = None,
) -> "capo_cost_explorer.types.get_approximate_usage_records_response.GetApproximateUsageRecordsResponse":
"""<p>Retrieves estimated usage records for hourly granularity or resource-level data at daily granularity.</p>
Args:
granularity: <p>How granular you want the data to be. You can enable data at hourly or daily granularity.</p>
services: <p>The service metadata for the service or services you want to query. If not specified, all elements are returned.</p>
approximation_dimension: <p>The service to evaluate for the usage records. You can choose resource-level data at daily granularity, or hourly granularity with or without resource-level data.</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.
"""
def _handler(
req: "OperationRequest[capo_cost_explorer.types.get_approximate_usage_records_request.GetApproximateUsageRecordsRequest]",
) -> OperationResponse[
"capo_cost_explorer.types.get_approximate_usage_records_response.GetApproximateUsageRecordsResponse"
]:
import capo_cost_explorer._operations.aws_insights_index_service.get_approximate_usage_records
output, http_response = (
capo_cost_explorer._operations.aws_insights_index_service.get_approximate_usage_records.get_approximate_usage_records(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetApproximateUsageRecords")
)
input_: capo_cost_explorer.types.get_approximate_usage_records_request.GetApproximateUsageRecordsRequest = {
"granularity": granularity,
"approximation_dimension": approximation_dimension,
}
if services is not None:
input_["services"] = services
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|