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 GetReservationUtilizationInput struct { Filter *Expression `type:"structure"` Granularity *string `type:"string" enum:"Granularity"` GroupBy []*GroupDefinition `type:"list"` NextPageToken *string `type:"string"` TimePeriod *DateInterval `type:"structure" required:"true"` }


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

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. If both GroupBy and Granularity aren't set, GetReservationUtilization defaults to DAILY.

The GetReservationUtilization 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 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 GetReservationUtilizationInput) GoString() string

GoString returns the string representation


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

SetFilter sets the Filter field's value.


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

SetGranularity sets the Granularity field's value.


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

SetGroupBy sets the GroupBy field's value.


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

SetNextPageToken sets the NextPageToken field's value.


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

SetTimePeriod sets the TimePeriod field's value.


func (s GetReservationUtilizationInput) String() string

String returns the string representation


func (s *GetReservationUtilizationInput) Validate() error

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

On this page: