@Generated(value="software.amazon.awssdk:codegen") public interface PricingClient extends SdkClient, SdkAutoCloseable
builder()
method.
AWS Price List Service API (AWS Price List Service) is a centralized and convenient way to programmatically query
Amazon Web Services for services, products, and pricing information. The AWS Price List Service uses standardized
product attributes such as Location
, Storage Class
, and Operating System
, and
provides prices at the SKU level. You can use the AWS Price List Service to build cost control and scenario planning
tools, reconcile billing data, forecast future spend for budgeting purposes, and provide cost benefit analysis that
compare your internal workloads with AWS.
Use GetServices
without a service code to retrieve the service codes for all AWS services, then
GetServices
with a service code to retreive the attribute names for that service. After you have the
service code and attribute names, you can use GetAttributeValues
to see what values are available for an
attribute. With the service code and an attribute name and value, you can use GetProducts
to find
specific products that you're interested in, such as an AmazonEC2
instance, with a
Provisioned IOPS
volumeType
.
Service Endpoint
AWS Price List Service API provides the following two endpoints:
https://api.pricing.us-east-1.amazonaws.com
https://api.pricing.ap-south-1.amazonaws.com
Modifier and Type | Field and Description |
---|---|
static String |
SERVICE_NAME |
Modifier and Type | Method and Description |
---|---|
static PricingClientBuilder |
builder()
Create a builder that can be used to configure and create a
PricingClient . |
static PricingClient |
create()
Create a
PricingClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from
the DefaultCredentialsProvider . |
default DescribeServicesResponse |
describeServices()
Returns the metadata for one service or a list of the metadata for all services.
|
default DescribeServicesResponse |
describeServices(Consumer<DescribeServicesRequest.Builder> describeServicesRequest)
Returns the metadata for one service or a list of the metadata for all services.
|
default DescribeServicesResponse |
describeServices(DescribeServicesRequest describeServicesRequest)
Returns the metadata for one service or a list of the metadata for all services.
|
default DescribeServicesIterable |
describeServicesPaginator()
Returns the metadata for one service or a list of the metadata for all services.
|
default DescribeServicesIterable |
describeServicesPaginator(DescribeServicesRequest describeServicesRequest)
Returns the metadata for one service or a list of the metadata for all services.
|
default GetAttributeValuesResponse |
getAttributeValues(Consumer<GetAttributeValuesRequest.Builder> getAttributeValuesRequest)
Returns a list of attribute values.
|
default GetAttributeValuesResponse |
getAttributeValues(GetAttributeValuesRequest getAttributeValuesRequest)
Returns a list of attribute values.
|
default GetAttributeValuesIterable |
getAttributeValuesPaginator(GetAttributeValuesRequest getAttributeValuesRequest)
Returns a list of attribute values.
|
default GetProductsResponse |
getProducts(Consumer<GetProductsRequest.Builder> getProductsRequest)
Returns a list of all products that match the filter criteria.
|
default GetProductsResponse |
getProducts(GetProductsRequest getProductsRequest)
Returns a list of all products that match the filter criteria.
|
default GetProductsIterable |
getProductsPaginator(GetProductsRequest getProductsRequest)
Returns a list of all products that match the filter criteria.
|
static ServiceMetadata |
serviceMetadata() |
serviceName
close
static final String SERVICE_NAME
static PricingClient create()
PricingClient
with the region loaded from the
DefaultAwsRegionProviderChain
and credentials loaded from
the DefaultCredentialsProvider
.static PricingClientBuilder builder()
PricingClient
.default DescribeServicesResponse describeServices() throws InternalErrorException, InvalidParameterException, NotFoundException, InvalidNextTokenException, ExpiredNextTokenException, SdkServiceException, SdkClientException, PricingException
Returns the metadata for one service or a list of the metadata for all services. Use this without a service code
to get the service codes for all services. Use it with a service code, such as AmazonEC2
, to get
information specific to that service, such as the attribute names available for that service. For example, some
of the attribute names available for EC2 are volumeType
, maxIopsVolume
,
operation
, locationType
, and instanceCapacity10xlarge
.
InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.InvalidParameterException
- One or more parameters had an invalid value.NotFoundException
- The requested resource can't be found.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.ExpiredNextTokenException
- The pagination token expired. 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.PricingException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
describeServices(DescribeServicesRequest)
,
AWS API
Documentationdefault DescribeServicesResponse describeServices(DescribeServicesRequest describeServicesRequest) throws InternalErrorException, InvalidParameterException, NotFoundException, InvalidNextTokenException, ExpiredNextTokenException, SdkServiceException, SdkClientException, PricingException
Returns the metadata for one service or a list of the metadata for all services. Use this without a service code
to get the service codes for all services. Use it with a service code, such as AmazonEC2
, to get
information specific to that service, such as the attribute names available for that service. For example, some
of the attribute names available for EC2 are volumeType
, maxIopsVolume
,
operation
, locationType
, and instanceCapacity10xlarge
.
describeServicesRequest
- InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.InvalidParameterException
- One or more parameters had an invalid value.NotFoundException
- The requested resource can't be found.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.ExpiredNextTokenException
- The pagination token expired. 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.PricingException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default DescribeServicesResponse describeServices(Consumer<DescribeServicesRequest.Builder> describeServicesRequest) throws InternalErrorException, InvalidParameterException, NotFoundException, InvalidNextTokenException, ExpiredNextTokenException, SdkServiceException, SdkClientException, PricingException
Returns the metadata for one service or a list of the metadata for all services. Use this without a service code
to get the service codes for all services. Use it with a service code, such as AmazonEC2
, to get
information specific to that service, such as the attribute names available for that service. For example, some
of the attribute names available for EC2 are volumeType
, maxIopsVolume
,
operation
, locationType
, and instanceCapacity10xlarge
.
describeServicesRequest
- InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.InvalidParameterException
- One or more parameters had an invalid value.NotFoundException
- The requested resource can't be found.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.ExpiredNextTokenException
- The pagination token expired. 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.PricingException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default DescribeServicesIterable describeServicesPaginator() throws InternalErrorException, InvalidParameterException, NotFoundException, InvalidNextTokenException, ExpiredNextTokenException, SdkServiceException, SdkClientException, PricingException
Returns the metadata for one service or a list of the metadata for all services. Use this without a service code
to get the service codes for all services. Use it with a service code, such as AmazonEC2
, to get
information specific to that service, such as the attribute names available for that service. For example, some
of the attribute names available for EC2 are volumeType
, maxIopsVolume
,
operation
, locationType
, and instanceCapacity10xlarge
.
This is a variant of
describeServices(software.amazon.awssdk.services.pricing.model.DescribeServicesRequest)
operation. The
return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle
making service calls for you.
When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
software.amazon.awssdk.services.pricing.paginators.DescribeServicesIterable responses = client.describeServicesPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{ @code software.amazon.awssdk.services.pricing.paginators.DescribeServicesIterable responses = client .describeServicesPaginator(request); for (software.amazon.awssdk.services.pricing.model.DescribeServicesResponse response : responses) { // do something; } }3) Use iterator directly
software.amazon.awssdk.services.pricing.paginators.DescribeServicesIterable responses = client.describeServicesPaginator(request);
responses.iterator().forEachRemaining(....);
Note: If you prefer to have control on service calls, use the
describeServices(software.amazon.awssdk.services.pricing.model.DescribeServicesRequest)
operation.
InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.InvalidParameterException
- One or more parameters had an invalid value.NotFoundException
- The requested resource can't be found.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.ExpiredNextTokenException
- The pagination token expired. 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.PricingException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
describeServicesPaginator(DescribeServicesRequest)
,
AWS API
Documentationdefault DescribeServicesIterable describeServicesPaginator(DescribeServicesRequest describeServicesRequest) throws InternalErrorException, InvalidParameterException, NotFoundException, InvalidNextTokenException, ExpiredNextTokenException, SdkServiceException, SdkClientException, PricingException
Returns the metadata for one service or a list of the metadata for all services. Use this without a service code
to get the service codes for all services. Use it with a service code, such as AmazonEC2
, to get
information specific to that service, such as the attribute names available for that service. For example, some
of the attribute names available for EC2 are volumeType
, maxIopsVolume
,
operation
, locationType
, and instanceCapacity10xlarge
.
This is a variant of
describeServices(software.amazon.awssdk.services.pricing.model.DescribeServicesRequest)
operation. The
return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle
making service calls for you.
When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
software.amazon.awssdk.services.pricing.paginators.DescribeServicesIterable responses = client.describeServicesPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{ @code software.amazon.awssdk.services.pricing.paginators.DescribeServicesIterable responses = client .describeServicesPaginator(request); for (software.amazon.awssdk.services.pricing.model.DescribeServicesResponse response : responses) { // do something; } }3) Use iterator directly
software.amazon.awssdk.services.pricing.paginators.DescribeServicesIterable responses = client.describeServicesPaginator(request);
responses.iterator().forEachRemaining(....);
Note: If you prefer to have control on service calls, use the
describeServices(software.amazon.awssdk.services.pricing.model.DescribeServicesRequest)
operation.
describeServicesRequest
- InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.InvalidParameterException
- One or more parameters had an invalid value.NotFoundException
- The requested resource can't be found.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.ExpiredNextTokenException
- The pagination token expired. 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.PricingException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default GetAttributeValuesResponse getAttributeValues(GetAttributeValuesRequest getAttributeValuesRequest) throws InternalErrorException, InvalidParameterException, NotFoundException, InvalidNextTokenException, ExpiredNextTokenException, SdkServiceException, SdkClientException, PricingException
Returns a list of attribute values. Attibutes are similar to the details in a Price List API offer file. For a list of available attributes, see Offer File Definitions in the AWS Billing and Cost Management User Guide.
getAttributeValuesRequest
- InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.InvalidParameterException
- One or more parameters had an invalid value.NotFoundException
- The requested resource can't be found.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.ExpiredNextTokenException
- The pagination token expired. 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.PricingException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default GetAttributeValuesResponse getAttributeValues(Consumer<GetAttributeValuesRequest.Builder> getAttributeValuesRequest) throws InternalErrorException, InvalidParameterException, NotFoundException, InvalidNextTokenException, ExpiredNextTokenException, SdkServiceException, SdkClientException, PricingException
Returns a list of attribute values. Attibutes are similar to the details in a Price List API offer file. For a list of available attributes, see Offer File Definitions in the AWS Billing and Cost Management User Guide.
getAttributeValuesRequest
- InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.InvalidParameterException
- One or more parameters had an invalid value.NotFoundException
- The requested resource can't be found.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.ExpiredNextTokenException
- The pagination token expired. 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.PricingException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default GetAttributeValuesIterable getAttributeValuesPaginator(GetAttributeValuesRequest getAttributeValuesRequest) throws InternalErrorException, InvalidParameterException, NotFoundException, InvalidNextTokenException, ExpiredNextTokenException, SdkServiceException, SdkClientException, PricingException
Returns a list of attribute values. Attibutes are similar to the details in a Price List API offer file. For a list of available attributes, see Offer File Definitions in the AWS Billing and Cost Management User Guide.
This is a variant of
getAttributeValues(software.amazon.awssdk.services.pricing.model.GetAttributeValuesRequest)
operation.
The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally
handle making service calls for you.
When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
software.amazon.awssdk.services.pricing.paginators.GetAttributeValuesIterable responses = client.getAttributeValuesPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{ @code software.amazon.awssdk.services.pricing.paginators.GetAttributeValuesIterable responses = client .getAttributeValuesPaginator(request); for (software.amazon.awssdk.services.pricing.model.GetAttributeValuesResponse response : responses) { // do something; } }3) Use iterator directly
software.amazon.awssdk.services.pricing.paginators.GetAttributeValuesIterable responses = client.getAttributeValuesPaginator(request);
responses.iterator().forEachRemaining(....);
Note: If you prefer to have control on service calls, use the
getAttributeValues(software.amazon.awssdk.services.pricing.model.GetAttributeValuesRequest)
operation.
getAttributeValuesRequest
- InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.InvalidParameterException
- One or more parameters had an invalid value.NotFoundException
- The requested resource can't be found.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.ExpiredNextTokenException
- The pagination token expired. 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.PricingException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default GetProductsResponse getProducts(GetProductsRequest getProductsRequest) throws InternalErrorException, InvalidParameterException, NotFoundException, InvalidNextTokenException, ExpiredNextTokenException, SdkServiceException, SdkClientException, PricingException
Returns a list of all products that match the filter criteria.
getProductsRequest
- InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.InvalidParameterException
- One or more parameters had an invalid value.NotFoundException
- The requested resource can't be found.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.ExpiredNextTokenException
- The pagination token expired. 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.PricingException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default GetProductsResponse getProducts(Consumer<GetProductsRequest.Builder> getProductsRequest) throws InternalErrorException, InvalidParameterException, NotFoundException, InvalidNextTokenException, ExpiredNextTokenException, SdkServiceException, SdkClientException, PricingException
Returns a list of all products that match the filter criteria.
getProductsRequest
- InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.InvalidParameterException
- One or more parameters had an invalid value.NotFoundException
- The requested resource can't be found.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.ExpiredNextTokenException
- The pagination token expired. 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.PricingException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
default GetProductsIterable getProductsPaginator(GetProductsRequest getProductsRequest) throws InternalErrorException, InvalidParameterException, NotFoundException, InvalidNextTokenException, ExpiredNextTokenException, SdkServiceException, SdkClientException, PricingException
Returns a list of all products that match the filter criteria.
This is a variant of getProducts(software.amazon.awssdk.services.pricing.model.GetProductsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
internally handle making service calls for you.
When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
software.amazon.awssdk.services.pricing.paginators.GetProductsIterable responses = client.getProductsPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{ @code software.amazon.awssdk.services.pricing.paginators.GetProductsIterable responses = client.getProductsPaginator(request); for (software.amazon.awssdk.services.pricing.model.GetProductsResponse response : responses) { // do something; } }3) Use iterator directly
software.amazon.awssdk.services.pricing.paginators.GetProductsIterable responses = client.getProductsPaginator(request);
responses.iterator().forEachRemaining(....);
Note: If you prefer to have control on service calls, use the
getProducts(software.amazon.awssdk.services.pricing.model.GetProductsRequest)
operation.
getProductsRequest
- InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.InvalidParameterException
- One or more parameters had an invalid value.NotFoundException
- The requested resource can't be found.InvalidNextTokenException
- The pagination token is invalid. Try again without a pagination token.ExpiredNextTokenException
- The pagination token expired. 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.PricingException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.SdkServiceException
static ServiceMetadata serviceMetadata()
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.