API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see

We welcome your feedback on this new version of the documentation. Send your comments to


import ""

type GetReservationCoverageInput struct { Filter *Expression `type:"structure"` Granularity *string `type:"string" enum:"Granularity"` GroupBy []*GroupDefinition `type:"list"` Metrics []*string `type:"list"` NextPageToken *string `type:"string"` TimePeriod *DateInterval `type:"structure" required:"true"` }

You can use the following request parameters to query for how much of your instance usage a reservation covered.


Use Expression to filter by cost or by usage. There are two patterns:

  • Simple dimension values - You can set the dimension name and values for the filters that you plan to use. For example, you can filter for INSTANCE_TYPE==m4.xlarge OR INSTANCE_TYPE==c4.large. The Expression for that looks like this:

{ "Dimensions": { "Key": "INSTANCE_TYPE", "Values": [ "m4.xlarge", “c4.large”

] } }

The list of dimension values are OR'd together to retrieve cost or usage

data. You can create Expression and DimensionValues objects using either with* methods or set* methods in multiple lines.
  • Compound dimension values with logical operations - You can use multiple Expression types and the logical operators AND/OR/NOT to create a list of one or more Expression objects. This allows you to filter on more advanced options. For example, you can filter on ((INSTANCE_TYPE == m4.large OR INSTANCE_TYPE == m3.large) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer). The Expression for that looks like this:

{ "And": [ {"Or": [ {"Dimensions": { "Key": "INSTANCE_TYPE", "Values": [

"m4.x.large", "c4.large" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] }

Because each Expression can have only one operator, the service returns an

error if more than one is specified. The following example shows an Expression object that creates an error.

{ "And": [ ... ], "DimensionValues": { "Dimension": "USAGE_TYPE", "Values":

[ "DataTransfer" ] } }

Type: *string

The granularity of the AWS cost data for the reservation. Valid values are MONTHLY and DAILY.

If GroupBy is set, Granularity can't be set. If Granularity isn't set, the response object doesn't include Granularity, either MONTHLY or DAILY.

The GetReservationCoverage operation supports only DAILY and MONTHLY granularities.


Represents a group when you specify a group by criteria or in the response to a query with a specific grouping.


Type: []*string

The measurement that you want your reservation coverage reported in.

Valid values are Hour, Unit, and Cost. You can use multiple values in a request.


Type: *string

The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.


The time period that you want the usage and costs for.



func (s GetReservationCoverageInput) GoString() string

GoString returns the string representation


func (s *GetReservationCoverageInput) SetFilter(v *Expression) *GetReservationCoverageInput

SetFilter sets the Filter field's value.


func (s *GetReservationCoverageInput) SetGranularity(v string) *GetReservationCoverageInput

SetGranularity sets the Granularity field's value.


func (s *GetReservationCoverageInput) SetGroupBy(v []*GroupDefinition) *GetReservationCoverageInput

SetGroupBy sets the GroupBy field's value.


func (s *GetReservationCoverageInput) SetMetrics(v []*string) *GetReservationCoverageInput

SetMetrics sets the Metrics field's value.


func (s *GetReservationCoverageInput) SetNextPageToken(v string) *GetReservationCoverageInput

SetNextPageToken sets the NextPageToken field's value.


func (s *GetReservationCoverageInput) SetTimePeriod(v *DateInterval) *GetReservationCoverageInput

SetTimePeriod sets the TimePeriod field's value.


func (s GetReservationCoverageInput) String() string

String returns the string representation


func (s *GetReservationCoverageInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

On this page: