@Generated(value="software.amazon.awssdk:codegen") public interface CostAndUsageReportClient extends SdkClient
builder()
method.
The AWS Cost and Usage Report API enables you to programmatically create, query, and delete AWS Cost and Usage report definitions.
AWS Cost and Usage reports track the monthly AWS costs and usage associated with your AWS account. The report contains line items for each unique combination of AWS product, usage type, and operation that your AWS account uses. You can configure the AWS Cost and Usage report to show only the data that you want, using the AWS Cost and Usage API.
Service Endpoint
The AWS Cost and Usage Report API provides the following endpoint:
cur.us-east-1.amazonaws.com
Modifier and Type | Field and Description |
---|---|
static String |
SERVICE_METADATA_ID
Value for looking up the service's metadata from the
ServiceMetadataProvider . |
static String |
SERVICE_NAME |
Modifier and Type | Method and Description |
---|---|
static CostAndUsageReportClientBuilder |
builder()
Create a builder that can be used to configure and create a
CostAndUsageReportClient . |
static CostAndUsageReportClient |
create()
Create a
CostAndUsageReportClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider . |
default DeleteReportDefinitionResponse |
deleteReportDefinition(Consumer<DeleteReportDefinitionRequest.Builder> deleteReportDefinitionRequest)
Deletes the specified report.
|
default DeleteReportDefinitionResponse |
deleteReportDefinition(DeleteReportDefinitionRequest deleteReportDefinitionRequest)
Deletes the specified report.
|
default DescribeReportDefinitionsResponse |
describeReportDefinitions()
Lists the AWS Cost and Usage reports available to this account.
|
default DescribeReportDefinitionsResponse |
describeReportDefinitions(Consumer<DescribeReportDefinitionsRequest.Builder> describeReportDefinitionsRequest)
Lists the AWS Cost and Usage reports available to this account.
|
default DescribeReportDefinitionsResponse |
describeReportDefinitions(DescribeReportDefinitionsRequest describeReportDefinitionsRequest)
Lists the AWS Cost and Usage reports available to this account.
|
default DescribeReportDefinitionsIterable |
describeReportDefinitionsPaginator()
Lists the AWS Cost and Usage reports available to this account.
|
default DescribeReportDefinitionsIterable |
describeReportDefinitionsPaginator(Consumer<DescribeReportDefinitionsRequest.Builder> describeReportDefinitionsRequest)
Lists the AWS Cost and Usage reports available to this account.
|
default DescribeReportDefinitionsIterable |
describeReportDefinitionsPaginator(DescribeReportDefinitionsRequest describeReportDefinitionsRequest)
Lists the AWS Cost and Usage reports available to this account.
|
default ModifyReportDefinitionResponse |
modifyReportDefinition(Consumer<ModifyReportDefinitionRequest.Builder> modifyReportDefinitionRequest)
Allows you to programatically update your report preferences.
|
default ModifyReportDefinitionResponse |
modifyReportDefinition(ModifyReportDefinitionRequest modifyReportDefinitionRequest)
Allows you to programatically update your report preferences.
|
default PutReportDefinitionResponse |
putReportDefinition(Consumer<PutReportDefinitionRequest.Builder> putReportDefinitionRequest)
Creates a new report using the description that you provide.
|
default PutReportDefinitionResponse |
putReportDefinition(PutReportDefinitionRequest putReportDefinitionRequest)
Creates a new report using the description that you provide.
|
static ServiceMetadata |
serviceMetadata() |
serviceName
close
static final String SERVICE_NAME
static final String SERVICE_METADATA_ID
ServiceMetadataProvider
.static CostAndUsageReportClient create()
CostAndUsageReportClient
with the region loaded from the
DefaultAwsRegionProviderChain
and credentials loaded from the
DefaultCredentialsProvider
.static CostAndUsageReportClientBuilder builder()
CostAndUsageReportClient
.default DeleteReportDefinitionResponse deleteReportDefinition(DeleteReportDefinitionRequest deleteReportDefinitionRequest) throws InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException
Deletes the specified report.
deleteReportDefinitionRequest
- Deletes the specified report.InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.ValidationException
- The input fails to satisfy the constraints specified by an AWS service.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.CostAndUsageReportException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default DeleteReportDefinitionResponse deleteReportDefinition(Consumer<DeleteReportDefinitionRequest.Builder> deleteReportDefinitionRequest) throws InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException
Deletes the specified report.
This is a convenience which creates an instance of the DeleteReportDefinitionRequest.Builder
avoiding the
need to create one manually via DeleteReportDefinitionRequest.builder()
deleteReportDefinitionRequest
- A Consumer
that will call methods on DeleteReportDefinitionRequest.Builder
to create a
request. Deletes the specified report.InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.ValidationException
- The input fails to satisfy the constraints specified by an AWS service.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.CostAndUsageReportException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default DescribeReportDefinitionsResponse describeReportDefinitions() throws InternalErrorException, AwsServiceException, SdkClientException, CostAndUsageReportException
Lists the AWS Cost and Usage reports available to this account.
InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.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.CostAndUsageReportException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
describeReportDefinitions(DescribeReportDefinitionsRequest)
,
AWS
API Documentationdefault DescribeReportDefinitionsResponse describeReportDefinitions(DescribeReportDefinitionsRequest describeReportDefinitionsRequest) throws InternalErrorException, AwsServiceException, SdkClientException, CostAndUsageReportException
Lists the AWS Cost and Usage reports available to this account.
describeReportDefinitionsRequest
- Requests a list of AWS Cost and Usage reports owned by the account.InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.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.CostAndUsageReportException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default DescribeReportDefinitionsResponse describeReportDefinitions(Consumer<DescribeReportDefinitionsRequest.Builder> describeReportDefinitionsRequest) throws InternalErrorException, AwsServiceException, SdkClientException, CostAndUsageReportException
Lists the AWS Cost and Usage reports available to this account.
This is a convenience which creates an instance of the DescribeReportDefinitionsRequest.Builder
avoiding
the need to create one manually via DescribeReportDefinitionsRequest.builder()
describeReportDefinitionsRequest
- A Consumer
that will call methods on DescribeReportDefinitionsRequest.Builder
to create a
request. Requests a list of AWS Cost and Usage reports owned by the account.InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.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.CostAndUsageReportException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default DescribeReportDefinitionsIterable describeReportDefinitionsPaginator() throws InternalErrorException, AwsServiceException, SdkClientException, CostAndUsageReportException
Lists the AWS Cost and Usage reports available to this account.
This is a variant of
describeReportDefinitions(software.amazon.awssdk.services.costandusagereport.model.DescribeReportDefinitionsRequest)
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.costandusagereport.paginators.DescribeReportDefinitionsIterable responses = client.describeReportDefinitionsPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{ @code software.amazon.awssdk.services.costandusagereport.paginators.DescribeReportDefinitionsIterable responses = client .describeReportDefinitionsPaginator(request); for (software.amazon.awssdk.services.costandusagereport.model.DescribeReportDefinitionsResponse response : responses) { // do something; } }3) Use iterator directly
software.amazon.awssdk.services.costandusagereport.paginators.DescribeReportDefinitionsIterable responses = client.describeReportDefinitionsPaginator(request);
responses.iterator().forEachRemaining(....);
Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeReportDefinitions(software.amazon.awssdk.services.costandusagereport.model.DescribeReportDefinitionsRequest)
operation.
InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.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.CostAndUsageReportException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
describeReportDefinitionsPaginator(DescribeReportDefinitionsRequest)
,
AWS
API Documentationdefault DescribeReportDefinitionsIterable describeReportDefinitionsPaginator(DescribeReportDefinitionsRequest describeReportDefinitionsRequest) throws InternalErrorException, AwsServiceException, SdkClientException, CostAndUsageReportException
Lists the AWS Cost and Usage reports available to this account.
This is a variant of
describeReportDefinitions(software.amazon.awssdk.services.costandusagereport.model.DescribeReportDefinitionsRequest)
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.costandusagereport.paginators.DescribeReportDefinitionsIterable responses = client.describeReportDefinitionsPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{ @code software.amazon.awssdk.services.costandusagereport.paginators.DescribeReportDefinitionsIterable responses = client .describeReportDefinitionsPaginator(request); for (software.amazon.awssdk.services.costandusagereport.model.DescribeReportDefinitionsResponse response : responses) { // do something; } }3) Use iterator directly
software.amazon.awssdk.services.costandusagereport.paginators.DescribeReportDefinitionsIterable responses = client.describeReportDefinitionsPaginator(request);
responses.iterator().forEachRemaining(....);
Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeReportDefinitions(software.amazon.awssdk.services.costandusagereport.model.DescribeReportDefinitionsRequest)
operation.
describeReportDefinitionsRequest
- Requests a list of AWS Cost and Usage reports owned by the account.InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.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.CostAndUsageReportException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default DescribeReportDefinitionsIterable describeReportDefinitionsPaginator(Consumer<DescribeReportDefinitionsRequest.Builder> describeReportDefinitionsRequest) throws InternalErrorException, AwsServiceException, SdkClientException, CostAndUsageReportException
Lists the AWS Cost and Usage reports available to this account.
This is a variant of
describeReportDefinitions(software.amazon.awssdk.services.costandusagereport.model.DescribeReportDefinitionsRequest)
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.costandusagereport.paginators.DescribeReportDefinitionsIterable responses = client.describeReportDefinitionsPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{ @code software.amazon.awssdk.services.costandusagereport.paginators.DescribeReportDefinitionsIterable responses = client .describeReportDefinitionsPaginator(request); for (software.amazon.awssdk.services.costandusagereport.model.DescribeReportDefinitionsResponse response : responses) { // do something; } }3) Use iterator directly
software.amazon.awssdk.services.costandusagereport.paginators.DescribeReportDefinitionsIterable responses = client.describeReportDefinitionsPaginator(request);
responses.iterator().forEachRemaining(....);
Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeReportDefinitions(software.amazon.awssdk.services.costandusagereport.model.DescribeReportDefinitionsRequest)
operation.
This is a convenience which creates an instance of the DescribeReportDefinitionsRequest.Builder
avoiding
the need to create one manually via DescribeReportDefinitionsRequest.builder()
describeReportDefinitionsRequest
- A Consumer
that will call methods on DescribeReportDefinitionsRequest.Builder
to create a
request. Requests a list of AWS Cost and Usage reports owned by the account.InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.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.CostAndUsageReportException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default ModifyReportDefinitionResponse modifyReportDefinition(ModifyReportDefinitionRequest modifyReportDefinitionRequest) throws InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException
Allows you to programatically update your report preferences.
modifyReportDefinitionRequest
- InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.ValidationException
- The input fails to satisfy the constraints specified by an AWS service.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.CostAndUsageReportException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default ModifyReportDefinitionResponse modifyReportDefinition(Consumer<ModifyReportDefinitionRequest.Builder> modifyReportDefinitionRequest) throws InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException
Allows you to programatically update your report preferences.
This is a convenience which creates an instance of the ModifyReportDefinitionRequest.Builder
avoiding the
need to create one manually via ModifyReportDefinitionRequest.builder()
modifyReportDefinitionRequest
- A Consumer
that will call methods on ModifyReportDefinitionRequest.Builder
to create a
request.InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.ValidationException
- The input fails to satisfy the constraints specified by an AWS service.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.CostAndUsageReportException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default PutReportDefinitionResponse putReportDefinition(PutReportDefinitionRequest putReportDefinitionRequest) throws DuplicateReportNameException, ReportLimitReachedException, InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException
Creates a new report using the description that you provide.
putReportDefinitionRequest
- Creates a Cost and Usage Report.DuplicateReportNameException
- A report with the specified name already exists in the account. Specify a different report name.ReportLimitReachedException
- This account already has five reports defined. To define a new report, you must delete an existing
report.InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.ValidationException
- The input fails to satisfy the constraints specified by an AWS service.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.CostAndUsageReportException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
default PutReportDefinitionResponse putReportDefinition(Consumer<PutReportDefinitionRequest.Builder> putReportDefinitionRequest) throws DuplicateReportNameException, ReportLimitReachedException, InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException
Creates a new report using the description that you provide.
This is a convenience which creates an instance of the PutReportDefinitionRequest.Builder
avoiding the
need to create one manually via PutReportDefinitionRequest.builder()
putReportDefinitionRequest
- A Consumer
that will call methods on PutReportDefinitionRequest.Builder
to create a
request. Creates a Cost and Usage Report.DuplicateReportNameException
- A report with the specified name already exists in the account. Specify a different report name.ReportLimitReachedException
- This account already has five reports defined. To define a new report, you must delete an existing
report.InternalErrorException
- An error on the server occurred during the processing of your request. Try again later.ValidationException
- The input fails to satisfy the constraints specified by an AWS service.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.CostAndUsageReportException
- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException
static ServiceMetadata serviceMetadata()