@Generated(value="software.amazon.awssdk:codegen") public class GetCostAndUsageRequest extends CostExplorerRequest implements ToCopyableBuilder<GetCostAndUsageRequest.Builder,GetCostAndUsageRequest>
Modifier and Type | Class and Description |
---|---|
static interface |
GetCostAndUsageRequest.Builder |
Modifier and Type | Method and Description |
---|---|
static GetCostAndUsageRequest.Builder |
builder() |
boolean |
equals(Object obj) |
Expression |
filter()
Filters AWS costs by different dimensions.
|
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz)
Used to retrieve the value of a field from any class that extends
SdkRequest . |
Granularity |
granularity()
Sets the AWS cost granularity to
MONTHLY or DAILY . |
String |
granularityString()
Sets the AWS cost granularity to
MONTHLY or DAILY . |
List<GroupDefinition> |
groupBy()
You can group AWS costs using up to two different groups, either dimensions, tag keys, or both.
|
int |
hashCode() |
List<String> |
metrics()
Which metrics are returned in the query.
|
String |
nextPageToken()
The token to retrieve the next set of results.
|
static Class<? extends GetCostAndUsageRequest.Builder> |
serializableBuilderClass() |
DateInterval |
timePeriod()
Sets the start and end dates for retrieving AWS costs.
|
GetCostAndUsageRequest.Builder |
toBuilder()
Take this object and create a builder that contains all of the current property values of this object.
|
String |
toString() |
requestOverrideConfig
copy
public DateInterval timePeriod()
Sets the start and end dates for retrieving AWS costs. The start date is inclusive, but the end date is
exclusive. For example, if start
is 2017-01-01
and end
is
2017-05-01
, then the cost and usage data is retrieved from 2017-01-01
up to and
including 2017-04-30
but not including 2017-05-01
.
start
is 2017-01-01
and end
is
2017-05-01
, then the cost and usage data is retrieved from 2017-01-01
up to and
including 2017-04-30
but not including 2017-05-01
.public Granularity granularity()
Sets the AWS cost granularity to MONTHLY
or DAILY
.
If the service returns an enum value that is not available in the current SDK version, granularity
will
return Granularity.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available from
granularityString()
.
MONTHLY
or DAILY
.Granularity
public String granularityString()
Sets the AWS cost granularity to MONTHLY
or DAILY
.
If the service returns an enum value that is not available in the current SDK version, granularity
will
return Granularity.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available from
granularityString()
.
MONTHLY
or DAILY
.Granularity
public Expression filter()
Filters AWS costs by different dimensions. For example, you can specify Service
and
Linked Account
and get the costs associated with that account's usage of that service. You can nest
Expression
objects to define any combination of dimension filters. For more information, see the
Expression
object or More Examples
.
Service
and
Linked Account
and get the costs associated with that account's usage of that service. You
can nest Expression
objects to define any combination of dimension filters. For more
information, see the Expression
object or More Examples
.public List<String> metrics()
Which metrics are returned in the query. For more information about blended and unblended rates, see https://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/.
Valid values are BlendedCost
, UnblendedCost
, and UsageQuantity
.
If you return the UsageQuantity
metric, the service aggregates all usage numbers without taking into
account the units. For example, if you aggregate usageQuantity
across all of EC2, the results aren't
meaningful because EC2 compute hours and data transfer are measured in different units (for example, hours vs.
GB). To get more meaningful UsageQuantity
metrics, filter by UsageType
or
UsageTypeGroups
.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
Valid values are BlendedCost
, UnblendedCost
, and UsageQuantity
.
If you return the UsageQuantity
metric, the service aggregates all usage numbers without
taking into account the units. For example, if you aggregate usageQuantity
across all of
EC2, the results aren't meaningful because EC2 compute hours and data transfer are measured in different
units (for example, hours vs. GB). To get more meaningful UsageQuantity
metrics, filter by
UsageType
or UsageTypeGroups
.
public List<GroupDefinition> groupBy()
You can group AWS costs using up to two different groups, either dimensions, tag keys, or both.
When you group by tag key, you get all tag values, including empty strings.
Valid values are: AZ
, INSTANCE_TYPE
, LINKED_ACCCOUNT
,
OPERATION
, PURCHASE_TYPE
, SERVICE
, USAGE_TYPE
,
TAGS
, and PLATFORM
.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
When you group by tag key, you get all tag values, including empty strings.
Valid values are: AZ
, INSTANCE_TYPE
, LINKED_ACCCOUNT
,
OPERATION
, PURCHASE_TYPE
, SERVICE
, USAGE_TYPE
,
TAGS
, and PLATFORM
.
public String nextPageToken()
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.
public GetCostAndUsageRequest.Builder toBuilder()
ToCopyableBuilder
toBuilder
in interface ToCopyableBuilder<GetCostAndUsageRequest.Builder,GetCostAndUsageRequest>
toBuilder
in class CostExplorerRequest
public static GetCostAndUsageRequest.Builder builder()
public static Class<? extends GetCostAndUsageRequest.Builder> serializableBuilderClass()
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
SdkRequest
SdkRequest
. The field name
specified should match the member name from the corresponding service-2.json model specified in the
codegen-resources folder for a given service. The class specifies what class to cast the returned value to.
If the returned value is also a modeled class, the SdkRequest.getValueForField(String, Class)
method will
again be available.getValueForField
in class SdkRequest
fieldName
- The name of the member to be retrieved.clazz
- The class to cast the returned object to.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.