@Generated(value="software.amazon.awssdk:codegen") public interface CostExplorerClient extends SdkClient
builder()
method.
The Cost Explorer API enables you to programmatically query your cost and usage data. You can query for aggregated data such as total monthly costs or total daily usage. You can also query for granular data, such as the number of daily write operations for Amazon DynamoDB database tables in your production environment.
Service Endpoint
The Cost Explorer API provides the following endpoint:
https://ce.us-east-1.amazonaws.com
For information about costs associated with the Cost Explorer API, see AWS Cost Management Pricing.
Modifier and Type | Field and Description |
---|---|
static String |
SERVICE_NAME |
Modifier and Type | Method and Description |
---|---|
static CostExplorerClientBuilder |
builder()
Create a builder that can be used to configure and create a
CostExplorerClient . |
static CostExplorerClient |
create()
Create a
CostExplorerClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider . |
default GetCostAndUsageResponse |
getCostAndUsage(Consumer<GetCostAndUsageRequest.Builder> getCostAndUsageRequest)
Retrieves cost and usage metrics for your account.
|
default GetCostAndUsageResponse |
getCostAndUsage(GetCostAndUsageRequest getCostAndUsageRequest)
Retrieves cost and usage metrics for your account.
|
default GetCostForecastResponse |
getCostForecast(Consumer<GetCostForecastRequest.Builder> getCostForecastRequest)
Retrieves a forecast for how much Amazon Web Services predicts that you will spend over the forecast time period
that you select, based on your past costs.
|
default GetCostForecastResponse |
getCostForecast(GetCostForecastRequest getCostForecastRequest)
Retrieves a forecast for how much Amazon Web Services predicts that you will spend over the forecast time period
that you select, based on your past costs.
|
default GetDimensionValuesResponse |
getDimensionValues(Consumer<GetDimensionValuesRequest.Builder> getDimensionValuesRequest)
Retrieves all available filter values for a specified filter over a period of time.
|
default GetDimensionValuesResponse |
getDimensionValues(GetDimensionValuesRequest getDimensionValuesRequest)
Retrieves all available filter values for a specified filter over a period of time.
|
default GetReservationCoverageResponse |
getReservationCoverage(Consumer<GetReservationCoverageRequest.Builder> getReservationCoverageRequest)
Retrieves the reservation coverage for your account.
|
default GetReservationCoverageResponse |
getReservationCoverage(GetReservationCoverageRequest getReservationCoverageRequest)
Retrieves the reservation coverage for your account.
|
default GetReservationPurchaseRecommendationResponse |
getReservationPurchaseRecommendation(Consumer<GetReservationPurchaseRecommendationRequest.Builder> getReservationPurchaseRecommendationRequest)
Gets recommendations for which reservations to purchase.
|
default GetReservationPurchaseRecommendationResponse |
getReservationPurchaseRecommendation(GetReservationPurchaseRecommendationRequest getReservationPurchaseRecommendationRequest)
Gets recommendations for which reservations to purchase.
|
default GetReservationUtilizationResponse |
getReservationUtilization(Consumer<GetReservationUtilizationRequest.Builder> getReservationUtilizationRequest)
Retrieves the reservation utilization for your account.
|
default GetReservationUtilizationResponse |
getReservationUtilization(GetReservationUtilizationRequest getReservationUtilizationRequest)
Retrieves the reservation utilization for your account.
|
default GetTagsResponse |
getTags(Consumer<GetTagsRequest.Builder> getTagsRequest)
Queries for available tag keys and tag values for a specified period.
|
default GetTagsResponse |
getTags(GetTagsRequest getTagsRequest)
Queries for available tag keys and tag values for a specified period.
|
static ServiceMetadata |
serviceMetadata() |
serviceName
close
static final String SERVICE_NAME
static CostExplorerClient create()
CostExplorerClient
with the region loaded from the
DefaultAwsRegionProviderChain
and credentials loaded from the
DefaultCredentialsProvider
.static CostExplorerClientBuilder builder()
CostExplorerClient
.default GetCostAndUsageResponse getCostAndUsage(GetCostAndUsageRequest getCostAndUsageRequest) throws LimitExceededException, BillExpirationException, DataUnavailableException, InvalidNextTokenException, RequestChangedException, AwsServiceException, SdkClientException, CostExplorerException
Retrieves cost and usage metrics for your account. You can specify which cost and usage-related metric, such as
BlendedCosts
or UsageQuantity
, that you want the request to return. You can also filter
and group your data by various dimensions, such as SERVICE
or AZ
, in a specific time
range. For a complete list of valid dimensions, see the GetDimensionValues operation. Master accounts in an organization in AWS Organizations have access to all
member accounts.
getCostAndUsageRequest
- LimitExceededException
- You made too many calls in a short period of time. Try again later.BillExpirationException
- The requested report expired. Update the date interval and try again.DataUnavailableException
- The requested data is unavailable.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.RequestChangedException
- Your request parameters changed between pages. Try again with the old parameters or without a pagination
token.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.CostExplorerException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default GetCostAndUsageResponse getCostAndUsage(Consumer<GetCostAndUsageRequest.Builder> getCostAndUsageRequest) throws LimitExceededException, BillExpirationException, DataUnavailableException, InvalidNextTokenException, RequestChangedException, AwsServiceException, SdkClientException, CostExplorerException
Retrieves cost and usage metrics for your account. You can specify which cost and usage-related metric, such as
BlendedCosts
or UsageQuantity
, that you want the request to return. You can also filter
and group your data by various dimensions, such as SERVICE
or AZ
, in a specific time
range. For a complete list of valid dimensions, see the GetDimensionValues operation. Master accounts in an organization in AWS Organizations have access to all
member accounts.
This is a convenience which creates an instance of the GetCostAndUsageRequest.Builder
avoiding the need
to create one manually via GetCostAndUsageRequest.builder()
getCostAndUsageRequest
- A Consumer
that will call methods on GetCostAndUsageRequest.Builder
to create a request.LimitExceededException
- You made too many calls in a short period of time. Try again later.BillExpirationException
- The requested report expired. Update the date interval and try again.DataUnavailableException
- The requested data is unavailable.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.RequestChangedException
- Your request parameters changed between pages. Try again with the old parameters or without a pagination
token.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.CostExplorerException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default GetCostForecastResponse getCostForecast(GetCostForecastRequest getCostForecastRequest) throws LimitExceededException, DataUnavailableException, AwsServiceException, SdkClientException, CostExplorerException
Retrieves a forecast for how much Amazon Web Services predicts that you will spend over the forecast time period that you select, based on your past costs.
getCostForecastRequest
- LimitExceededException
- You made too many calls in a short period of time. Try again later.DataUnavailableException
- The requested data is unavailable.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.CostExplorerException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default GetCostForecastResponse getCostForecast(Consumer<GetCostForecastRequest.Builder> getCostForecastRequest) throws LimitExceededException, DataUnavailableException, AwsServiceException, SdkClientException, CostExplorerException
Retrieves a forecast for how much Amazon Web Services predicts that you will spend over the forecast time period that you select, based on your past costs.
This is a convenience which creates an instance of the GetCostForecastRequest.Builder
avoiding the need
to create one manually via GetCostForecastRequest.builder()
getCostForecastRequest
- A Consumer
that will call methods on GetCostForecastRequest.Builder
to create a request.LimitExceededException
- You made too many calls in a short period of time. Try again later.DataUnavailableException
- The requested data is unavailable.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.CostExplorerException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default GetDimensionValuesResponse getDimensionValues(GetDimensionValuesRequest getDimensionValuesRequest) throws LimitExceededException, BillExpirationException, DataUnavailableException, InvalidNextTokenException, RequestChangedException, AwsServiceException, SdkClientException, CostExplorerException
Retrieves all available filter values for a specified filter over a period of time. You can search the dimension values for an arbitrary string.
getDimensionValuesRequest
- LimitExceededException
- You made too many calls in a short period of time. Try again later.BillExpirationException
- The requested report expired. Update the date interval and try again.DataUnavailableException
- The requested data is unavailable.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.RequestChangedException
- Your request parameters changed between pages. Try again with the old parameters or without a pagination
token.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.CostExplorerException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default GetDimensionValuesResponse getDimensionValues(Consumer<GetDimensionValuesRequest.Builder> getDimensionValuesRequest) throws LimitExceededException, BillExpirationException, DataUnavailableException, InvalidNextTokenException, RequestChangedException, AwsServiceException, SdkClientException, CostExplorerException
Retrieves all available filter values for a specified filter over a period of time. You can search the dimension values for an arbitrary string.
This is a convenience which creates an instance of the GetDimensionValuesRequest.Builder
avoiding the
need to create one manually via GetDimensionValuesRequest.builder()
getDimensionValuesRequest
- A Consumer
that will call methods on GetDimensionValuesRequest.Builder
to create a
request.LimitExceededException
- You made too many calls in a short period of time. Try again later.BillExpirationException
- The requested report expired. Update the date interval and try again.DataUnavailableException
- The requested data is unavailable.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.RequestChangedException
- Your request parameters changed between pages. Try again with the old parameters or without a pagination
token.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.CostExplorerException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default GetReservationCoverageResponse getReservationCoverage(GetReservationCoverageRequest getReservationCoverageRequest) throws LimitExceededException, DataUnavailableException, InvalidNextTokenException, AwsServiceException, SdkClientException, CostExplorerException
Retrieves the reservation coverage for your account. This enables you to see how much of your Amazon Elastic Compute Cloud, Amazon ElastiCache, Amazon Relational Database Service, or Amazon Redshift usage is covered by a reservation. An organization's master account can see the coverage of the associated member accounts. For any time period, you can filter data about reservation usage by the following dimensions:
AZ
CACHE_ENGINE
DATABASE_ENGINE
DEPLOYMENT_OPTION
INSTANCE_TYPE
LINKED_ACCOUNT
OPERATING_SYSTEM
PLATFORM
REGION
SERVICE
TAG
TENANCY
To determine valid values for a dimension, use the GetDimensionValues
operation.
getReservationCoverageRequest
- You can use the following request parameters to query for how much of your instance usage a reservation
covered.LimitExceededException
- You made too many calls in a short period of time. Try again later.DataUnavailableException
- The requested data is unavailable.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.CostExplorerException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default GetReservationCoverageResponse getReservationCoverage(Consumer<GetReservationCoverageRequest.Builder> getReservationCoverageRequest) throws LimitExceededException, DataUnavailableException, InvalidNextTokenException, AwsServiceException, SdkClientException, CostExplorerException
Retrieves the reservation coverage for your account. This enables you to see how much of your Amazon Elastic Compute Cloud, Amazon ElastiCache, Amazon Relational Database Service, or Amazon Redshift usage is covered by a reservation. An organization's master account can see the coverage of the associated member accounts. For any time period, you can filter data about reservation usage by the following dimensions:
AZ
CACHE_ENGINE
DATABASE_ENGINE
DEPLOYMENT_OPTION
INSTANCE_TYPE
LINKED_ACCOUNT
OPERATING_SYSTEM
PLATFORM
REGION
SERVICE
TAG
TENANCY
To determine valid values for a dimension, use the GetDimensionValues
operation.
This is a convenience which creates an instance of the GetReservationCoverageRequest.Builder
avoiding the
need to create one manually via GetReservationCoverageRequest.builder()
getReservationCoverageRequest
- A Consumer
that will call methods on GetReservationCoverageRequest.Builder
to create a
request. You can use the following request parameters to query for how much of your instance usage a
reservation covered.LimitExceededException
- You made too many calls in a short period of time. Try again later.DataUnavailableException
- The requested data is unavailable.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.CostExplorerException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default GetReservationPurchaseRecommendationResponse getReservationPurchaseRecommendation(GetReservationPurchaseRecommendationRequest getReservationPurchaseRecommendationRequest) throws LimitExceededException, DataUnavailableException, InvalidNextTokenException, AwsServiceException, SdkClientException, CostExplorerException
Gets recommendations for which reservations to purchase. These recommendations could help you reduce your costs. Reservations provide a discounted hourly rate (up to 75%) compared to On-Demand pricing.
AWS generates your recommendations by identifying your On-Demand usage during a specific time period and collecting your usage into categories that are eligible for a reservation. After AWS has these categories, it simulates every combination of reservations in each category of usage to identify the best number of each type of RI to purchase to maximize your estimated savings.
For example, AWS automatically aggregates your Amazon EC2 Linux, shared tenancy, and c4 family usage in the US
West (Oregon) Region and recommends that you buy size-flexible regional reservations to apply to the c4 family
usage. AWS recommends the smallest size instance in an instance family. This makes it easier to purchase a
size-flexible RI. AWS also shows the equal number of normalized units so that you can purchase any instance size
that you want. For this example, your RI recommendation would be for c4.large
because that is the
smallest size instance in the c4 instance family.
getReservationPurchaseRecommendationRequest
- LimitExceededException
- You made too many calls in a short period of time. Try again later.DataUnavailableException
- The requested data is unavailable.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.CostExplorerException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default GetReservationPurchaseRecommendationResponse getReservationPurchaseRecommendation(Consumer<GetReservationPurchaseRecommendationRequest.Builder> getReservationPurchaseRecommendationRequest) throws LimitExceededException, DataUnavailableException, InvalidNextTokenException, AwsServiceException, SdkClientException, CostExplorerException
Gets recommendations for which reservations to purchase. These recommendations could help you reduce your costs. Reservations provide a discounted hourly rate (up to 75%) compared to On-Demand pricing.
AWS generates your recommendations by identifying your On-Demand usage during a specific time period and collecting your usage into categories that are eligible for a reservation. After AWS has these categories, it simulates every combination of reservations in each category of usage to identify the best number of each type of RI to purchase to maximize your estimated savings.
For example, AWS automatically aggregates your Amazon EC2 Linux, shared tenancy, and c4 family usage in the US
West (Oregon) Region and recommends that you buy size-flexible regional reservations to apply to the c4 family
usage. AWS recommends the smallest size instance in an instance family. This makes it easier to purchase a
size-flexible RI. AWS also shows the equal number of normalized units so that you can purchase any instance size
that you want. For this example, your RI recommendation would be for c4.large
because that is the
smallest size instance in the c4 instance family.
This is a convenience which creates an instance of the
GetReservationPurchaseRecommendationRequest.Builder
avoiding the need to create one manually via
GetReservationPurchaseRecommendationRequest.builder()
getReservationPurchaseRecommendationRequest
- A Consumer
that will call methods on GetReservationPurchaseRecommendationRequest.Builder
to create a request.LimitExceededException
- You made too many calls in a short period of time. Try again later.DataUnavailableException
- The requested data is unavailable.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.CostExplorerException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default GetReservationUtilizationResponse getReservationUtilization(GetReservationUtilizationRequest getReservationUtilizationRequest) throws LimitExceededException, DataUnavailableException, InvalidNextTokenException, AwsServiceException, SdkClientException, CostExplorerException
Retrieves the reservation utilization for your account. Master accounts in an organization have access to member
accounts. You can filter data by dimensions in a time period. You can use GetDimensionValues
to
determine the possible dimension values. Currently, you can group only by SUBSCRIPTION_ID
.
getReservationUtilizationRequest
- LimitExceededException
- You made too many calls in a short period of time. Try again later.DataUnavailableException
- The requested data is unavailable.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.CostExplorerException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default GetReservationUtilizationResponse getReservationUtilization(Consumer<GetReservationUtilizationRequest.Builder> getReservationUtilizationRequest) throws LimitExceededException, DataUnavailableException, InvalidNextTokenException, AwsServiceException, SdkClientException, CostExplorerException
Retrieves the reservation utilization for your account. Master accounts in an organization have access to member
accounts. You can filter data by dimensions in a time period. You can use GetDimensionValues
to
determine the possible dimension values. Currently, you can group only by SUBSCRIPTION_ID
.
This is a convenience which creates an instance of the GetReservationUtilizationRequest.Builder
avoiding
the need to create one manually via GetReservationUtilizationRequest.builder()
getReservationUtilizationRequest
- A Consumer
that will call methods on GetReservationUtilizationRequest.Builder
to create a
request.LimitExceededException
- You made too many calls in a short period of time. Try again later.DataUnavailableException
- The requested data is unavailable.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.CostExplorerException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default GetTagsResponse getTags(GetTagsRequest getTagsRequest) throws LimitExceededException, BillExpirationException, DataUnavailableException, InvalidNextTokenException, RequestChangedException, AwsServiceException, SdkClientException, CostExplorerException
Queries for available tag keys and tag values for a specified period. You can search the tag values for an arbitrary string.
getTagsRequest
- LimitExceededException
- You made too many calls in a short period of time. Try again later.BillExpirationException
- The requested report expired. Update the date interval and try again.DataUnavailableException
- The requested data is unavailable.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.RequestChangedException
- Your request parameters changed between pages. Try again with the old parameters or without a pagination
token.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.CostExplorerException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default GetTagsResponse getTags(Consumer<GetTagsRequest.Builder> getTagsRequest) throws LimitExceededException, BillExpirationException, DataUnavailableException, InvalidNextTokenException, RequestChangedException, AwsServiceException, SdkClientException, CostExplorerException
Queries for available tag keys and tag values for a specified period. You can search the tag values for an arbitrary string.
This is a convenience which creates an instance of the GetTagsRequest.Builder
avoiding the need to create
one manually via GetTagsRequest.builder()
getTagsRequest
- A Consumer
that will call methods on GetTagsRequest.Builder
to create a request.LimitExceededException
- You made too many calls in a short period of time. Try again later.BillExpirationException
- The requested report expired. Update the date interval and try again.DataUnavailableException
- The requested data is unavailable.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.RequestChangedException
- Your request parameters changed between pages. Try again with the old parameters or without a pagination
token.SdkException
- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException
- If any client side error occurs such as an IO related failure, failure to get credentials, etc.CostExplorerException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
static ServiceMetadata serviceMetadata()
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.