CostExplorer / Client / get_approximate_usage_records

get_approximate_usage_records#

CostExplorer.Client.get_approximate_usage_records(**kwargs)#

Retrieves estimated usage records for hourly granularity or resource-level data at daily granularity.

See also: AWS API Documentation

Request Syntax

response = client.get_approximate_usage_records(
    Granularity='DAILY'|'MONTHLY'|'HOURLY',
    Services=[
        'string',
    ],
    ApproximationDimension='SERVICE'|'RESOURCE'
)
Parameters:
  • Granularity (string) –

    [REQUIRED]

    How granular you want the data to be. You can enable data at hourly or daily granularity.

  • Services (list) –

    The service metadata for the service or services you want to query. If not specified, all elements are returned.

    • (string) –

  • ApproximationDimension (string) –

    [REQUIRED]

    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.

Return type:

dict

Returns:

Response Syntax

{
    'Services': {
        'string': 123
    },
    'TotalRecords': 123,
    'LookbackPeriod': {
        'Start': 'string',
        'End': 'string'
    }
}

Response Structure

  • (dict) –

    • Services (dict) –

      The service metadata for the service or services in the response.

      • (string) –

        • (integer) –

    • TotalRecords (integer) –

      The total number of usage records for all services in the services list.

    • LookbackPeriod (dict) –

      The lookback period that’s used for the estimation.

      • Start (string) –

        The beginning of the time period. The start date is inclusive. For example, if start is 2017-01-01, Amazon Web Services retrieves cost and usage data starting at 2017-01-01 up to the end date. The start date must be equal to or no later than the current date to avoid a validation error.

      • End (string) –

        The end of the time period. The end date is exclusive. For example, if end is 2017-05-01, Amazon Web Services retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

Exceptions