Interface CostAndUsageReportClient
- All Superinterfaces:
AutoCloseable
,AwsClient
,SdkAutoCloseable
,SdkClient
builder()
method.
You can use the Amazon Web Services Cost and Usage Report API to programmatically create, query, and delete Amazon Web Services Cost and Usage Report definitions.
Amazon Web Services Cost and Usage Report track the monthly Amazon Web Services costs and usage associated with your Amazon Web Services account. The report contains line items for each unique combination of Amazon Web Services product, usage type, and operation that your Amazon Web Services account uses. You can configure the Amazon Web Services Cost and Usage Report to show only the data that you want, using the Amazon Web Services Cost and Usage Report API.
Service Endpoint
The Amazon Web Services Cost and Usage Report API provides the following endpoint:
-
cur.us-east-1.amazonaws.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Value for looking up the service's metadata from theServiceMetadataProvider
.static final String
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Create a builder that can be used to configure and create aCostAndUsageReportClient
.static CostAndUsageReportClient
create()
Create aCostAndUsageReportClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
.default DeleteReportDefinitionResponse
deleteReportDefinition
(Consumer<DeleteReportDefinitionRequest.Builder> deleteReportDefinitionRequest) Deletes the specified report.default DeleteReportDefinitionResponse
deleteReportDefinition
(DeleteReportDefinitionRequest deleteReportDefinitionRequest) Deletes the specified report.Lists the Amazon Web Services Cost and Usage Report available to this account.describeReportDefinitions
(Consumer<DescribeReportDefinitionsRequest.Builder> describeReportDefinitionsRequest) Lists the Amazon Web Services Cost and Usage Report available to this account.describeReportDefinitions
(DescribeReportDefinitionsRequest describeReportDefinitionsRequest) Lists the Amazon Web Services Cost and Usage Report available to this account.This is a variant ofdescribeReportDefinitions(software.amazon.awssdk.services.costandusagereport.model.DescribeReportDefinitionsRequest)
operation.describeReportDefinitionsPaginator
(Consumer<DescribeReportDefinitionsRequest.Builder> describeReportDefinitionsRequest) This is a variant ofdescribeReportDefinitions(software.amazon.awssdk.services.costandusagereport.model.DescribeReportDefinitionsRequest)
operation.describeReportDefinitionsPaginator
(DescribeReportDefinitionsRequest describeReportDefinitionsRequest) This is a variant ofdescribeReportDefinitions(software.amazon.awssdk.services.costandusagereport.model.DescribeReportDefinitionsRequest)
operation.default ListTagsForResourceResponse
listTagsForResource
(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) Lists the tags associated with the specified report definition.default ListTagsForResourceResponse
listTagsForResource
(ListTagsForResourceRequest listTagsForResourceRequest) Lists the tags associated with the specified report definition.default ModifyReportDefinitionResponse
modifyReportDefinition
(Consumer<ModifyReportDefinitionRequest.Builder> modifyReportDefinitionRequest) Allows you to programmatically update your report preferences.default ModifyReportDefinitionResponse
modifyReportDefinition
(ModifyReportDefinitionRequest modifyReportDefinitionRequest) Allows you to programmatically 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.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstatic ServiceMetadata
default TagResourceResponse
tagResource
(Consumer<TagResourceRequest.Builder> tagResourceRequest) Associates a set of tags with a report definition.default TagResourceResponse
tagResource
(TagResourceRequest tagResourceRequest) Associates a set of tags with a report definition.default UntagResourceResponse
untagResource
(Consumer<UntagResourceRequest.Builder> untagResourceRequest) Disassociates a set of tags from a report definition.default UntagResourceResponse
untagResource
(UntagResourceRequest untagResourceRequest) Disassociates a set of tags from a report definition.Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
Methods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider
.- See Also:
-
-
Method Details
-
deleteReportDefinition
default DeleteReportDefinitionResponse deleteReportDefinition(DeleteReportDefinitionRequest deleteReportDefinitionRequest) throws InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException Deletes the specified report. Any tags associated with the report are also deleted.
- Parameters:
deleteReportDefinitionRequest
- Deletes the specified report.- Returns:
- Result of the DeleteReportDefinition operation returned by the service.
- See Also:
-
deleteReportDefinition
default DeleteReportDefinitionResponse deleteReportDefinition(Consumer<DeleteReportDefinitionRequest.Builder> deleteReportDefinitionRequest) throws InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException Deletes the specified report. Any tags associated with the report are also deleted.
This is a convenience which creates an instance of the
DeleteReportDefinitionRequest.Builder
avoiding the need to create one manually viaDeleteReportDefinitionRequest.builder()
- Parameters:
deleteReportDefinitionRequest
- AConsumer
that will call methods onDeleteReportDefinitionRequest.Builder
to create a request. Deletes the specified report.- Returns:
- Result of the DeleteReportDefinition operation returned by the service.
- See Also:
-
describeReportDefinitions
default DescribeReportDefinitionsResponse describeReportDefinitions(DescribeReportDefinitionsRequest describeReportDefinitionsRequest) throws InternalErrorException, AwsServiceException, SdkClientException, CostAndUsageReportException Lists the Amazon Web Services Cost and Usage Report available to this account.
- Parameters:
describeReportDefinitionsRequest
- Requests a Amazon Web Services Cost and Usage Report list owned by the account.- Returns:
- Result of the DescribeReportDefinitions operation returned by the service.
- See Also:
-
describeReportDefinitions
default DescribeReportDefinitionsResponse describeReportDefinitions(Consumer<DescribeReportDefinitionsRequest.Builder> describeReportDefinitionsRequest) throws InternalErrorException, AwsServiceException, SdkClientException, CostAndUsageReportException Lists the Amazon Web Services Cost and Usage Report available to this account.
This is a convenience which creates an instance of the
DescribeReportDefinitionsRequest.Builder
avoiding the need to create one manually viaDescribeReportDefinitionsRequest.builder()
- Parameters:
describeReportDefinitionsRequest
- AConsumer
that will call methods onDescribeReportDefinitionsRequest.Builder
to create a request. Requests a Amazon Web Services Cost and Usage Report list owned by the account.- Returns:
- Result of the DescribeReportDefinitions operation returned by the service.
- See Also:
-
describeReportDefinitions
default DescribeReportDefinitionsResponse describeReportDefinitions() throws InternalErrorException, AwsServiceException, SdkClientException, CostAndUsageReportExceptionLists the Amazon Web Services Cost and Usage Report available to this account.
- Returns:
- Result of the DescribeReportDefinitions operation returned by the service.
- See Also:
-
describeReportDefinitionsPaginator
default DescribeReportDefinitionsIterable describeReportDefinitionsPaginator() throws InternalErrorException, AwsServiceException, SdkClientException, CostAndUsageReportExceptionThis 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 Streamsoftware.amazon.awssdk.services.costandusagereport.paginators.DescribeReportDefinitionsIterable responses = client.describeReportDefinitionsPaginator(request); responses.stream().forEach(....);
{ @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 directlysoftware.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.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeReportDefinitionsPaginator
default DescribeReportDefinitionsIterable describeReportDefinitionsPaginator(DescribeReportDefinitionsRequest describeReportDefinitionsRequest) throws InternalErrorException, AwsServiceException, SdkClientException, CostAndUsageReportException 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 Streamsoftware.amazon.awssdk.services.costandusagereport.paginators.DescribeReportDefinitionsIterable responses = client.describeReportDefinitionsPaginator(request); responses.stream().forEach(....);
{ @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 directlysoftware.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.- Parameters:
describeReportDefinitionsRequest
- Requests a Amazon Web Services Cost and Usage Report list owned by the account.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeReportDefinitionsPaginator
default DescribeReportDefinitionsIterable describeReportDefinitionsPaginator(Consumer<DescribeReportDefinitionsRequest.Builder> describeReportDefinitionsRequest) throws InternalErrorException, AwsServiceException, SdkClientException, CostAndUsageReportException 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 Streamsoftware.amazon.awssdk.services.costandusagereport.paginators.DescribeReportDefinitionsIterable responses = client.describeReportDefinitionsPaginator(request); responses.stream().forEach(....);
{ @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 directlysoftware.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 viaDescribeReportDefinitionsRequest.builder()
- Parameters:
describeReportDefinitionsRequest
- AConsumer
that will call methods onDescribeReportDefinitionsRequest.Builder
to create a request. Requests a Amazon Web Services Cost and Usage Report list owned by the account.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listTagsForResource
default ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws ResourceNotFoundException, InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException Lists the tags associated with the specified report definition.
- Parameters:
listTagsForResourceRequest
-- Returns:
- Result of the ListTagsForResource operation returned by the service.
- See Also:
-
listTagsForResource
default ListTagsForResourceResponse listTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) throws ResourceNotFoundException, InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException Lists the tags associated with the specified report definition.
This is a convenience which creates an instance of the
ListTagsForResourceRequest.Builder
avoiding the need to create one manually viaListTagsForResourceRequest.builder()
- Parameters:
listTagsForResourceRequest
- AConsumer
that will call methods onListTagsForResourceRequest.Builder
to create a request.- Returns:
- Result of the ListTagsForResource operation returned by the service.
- See Also:
-
modifyReportDefinition
default ModifyReportDefinitionResponse modifyReportDefinition(ModifyReportDefinitionRequest modifyReportDefinitionRequest) throws InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException Allows you to programmatically update your report preferences.
- Parameters:
modifyReportDefinitionRequest
-- Returns:
- Result of the ModifyReportDefinition operation returned by the service.
- See Also:
-
modifyReportDefinition
default ModifyReportDefinitionResponse modifyReportDefinition(Consumer<ModifyReportDefinitionRequest.Builder> modifyReportDefinitionRequest) throws InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException Allows you to programmatically update your report preferences.
This is a convenience which creates an instance of the
ModifyReportDefinitionRequest.Builder
avoiding the need to create one manually viaModifyReportDefinitionRequest.builder()
- Parameters:
modifyReportDefinitionRequest
- AConsumer
that will call methods onModifyReportDefinitionRequest.Builder
to create a request.- Returns:
- Result of the ModifyReportDefinition operation returned by the service.
- See Also:
-
putReportDefinition
default PutReportDefinitionResponse putReportDefinition(PutReportDefinitionRequest putReportDefinitionRequest) throws DuplicateReportNameException, ReportLimitReachedException, InternalErrorException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, CostAndUsageReportException Creates a new report using the description that you provide.
- Parameters:
putReportDefinitionRequest
- Creates a Cost and Usage Report.- Returns:
- Result of the PutReportDefinition operation returned by the service.
- See Also:
-
putReportDefinition
default PutReportDefinitionResponse putReportDefinition(Consumer<PutReportDefinitionRequest.Builder> putReportDefinitionRequest) throws DuplicateReportNameException, ReportLimitReachedException, InternalErrorException, ValidationException, ResourceNotFoundException, 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 viaPutReportDefinitionRequest.builder()
- Parameters:
putReportDefinitionRequest
- AConsumer
that will call methods onPutReportDefinitionRequest.Builder
to create a request. Creates a Cost and Usage Report.- Returns:
- Result of the PutReportDefinition operation returned by the service.
- See Also:
-
tagResource
default TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws ResourceNotFoundException, InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException Associates a set of tags with a report definition.
- Parameters:
tagResourceRequest
-- Returns:
- Result of the TagResource operation returned by the service.
- See Also:
-
tagResource
default TagResourceResponse tagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest) throws ResourceNotFoundException, InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException Associates a set of tags with a report definition.
This is a convenience which creates an instance of the
TagResourceRequest.Builder
avoiding the need to create one manually viaTagResourceRequest.builder()
- Parameters:
tagResourceRequest
- AConsumer
that will call methods onTagResourceRequest.Builder
to create a request.- Returns:
- Result of the TagResource operation returned by the service.
- See Also:
-
untagResource
default UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ResourceNotFoundException, InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException Disassociates a set of tags from a report definition.
- Parameters:
untagResourceRequest
-- Returns:
- Result of the UntagResource operation returned by the service.
- See Also:
-
untagResource
default UntagResourceResponse untagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest) throws ResourceNotFoundException, InternalErrorException, ValidationException, AwsServiceException, SdkClientException, CostAndUsageReportException Disassociates a set of tags from a report definition.
This is a convenience which creates an instance of the
UntagResourceRequest.Builder
avoiding the need to create one manually viaUntagResourceRequest.builder()
- Parameters:
untagResourceRequest
- AConsumer
that will call methods onUntagResourceRequest.Builder
to create a request.- Returns:
- Result of the UntagResource operation returned by the service.
- See Also:
-
create
Create aCostAndUsageReportClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
. -
builder
Create a builder that can be used to configure and create aCostAndUsageReportClient
. -
serviceMetadata
-
serviceClientConfiguration
Description copied from interface:SdkClient
The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfiguration
in interfaceAwsClient
- Specified by:
serviceClientConfiguration
in interfaceSdkClient
- Returns:
- SdkServiceClientConfiguration
-