Interface BcmRecommendedActionsClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder() method.
You can use the Billing and Cost Management Recommended Actions API to programmatically query your best practices and recommendations to optimize your costs.
The Billing and Cost Management Recommended Actions API provides the following endpoint:
-
https://bcm-recommended-actions.us-east-1.api.aws
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringValue 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 aBcmRecommendedActionsClient.static BcmRecommendedActionsClientcreate()Create aBcmRecommendedActionsClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default ListRecommendedActionsResponselistRecommendedActions(Consumer<ListRecommendedActionsRequest.Builder> listRecommendedActionsRequest) Returns a list of recommended actions that match the filter criteria.default ListRecommendedActionsResponselistRecommendedActions(ListRecommendedActionsRequest listRecommendedActionsRequest) Returns a list of recommended actions that match the filter criteria.default ListRecommendedActionsIterablelistRecommendedActionsPaginator(Consumer<ListRecommendedActionsRequest.Builder> listRecommendedActionsRequest) This is a variant oflistRecommendedActions(software.amazon.awssdk.services.bcmrecommendedactions.model.ListRecommendedActionsRequest)operation.default ListRecommendedActionsIterablelistRecommendedActionsPaginator(ListRecommendedActionsRequest listRecommendedActionsRequest) This is a variant oflistRecommendedActions(software.amazon.awssdk.services.bcmrecommendedactions.model.ListRecommendedActionsRequest)operation.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstatic ServiceMetadataMethods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
closeMethods 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
-
listRecommendedActions
default ListRecommendedActionsResponse listRecommendedActions(ListRecommendedActionsRequest listRecommendedActionsRequest) throws AccessDeniedException, InternalServerException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, BcmRecommendedActionsException Returns a list of recommended actions that match the filter criteria.
- Parameters:
listRecommendedActionsRequest-- Returns:
- Result of the ListRecommendedActions operation returned by the service.
- See Also:
-
listRecommendedActions
default ListRecommendedActionsResponse listRecommendedActions(Consumer<ListRecommendedActionsRequest.Builder> listRecommendedActionsRequest) throws AccessDeniedException, InternalServerException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, BcmRecommendedActionsException Returns a list of recommended actions that match the filter criteria.
This is a convenience which creates an instance of the
ListRecommendedActionsRequest.Builderavoiding the need to create one manually viaListRecommendedActionsRequest.builder()- Parameters:
listRecommendedActionsRequest- AConsumerthat will call methods onListRecommendedActionsRequest.Builderto create a request.- Returns:
- Result of the ListRecommendedActions operation returned by the service.
- See Also:
-
listRecommendedActionsPaginator
default ListRecommendedActionsIterable listRecommendedActionsPaginator(ListRecommendedActionsRequest listRecommendedActionsRequest) throws AccessDeniedException, InternalServerException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, BcmRecommendedActionsException This is a variant of
listRecommendedActions(software.amazon.awssdk.services.bcmrecommendedactions.model.ListRecommendedActionsRequest)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
2) Using For loopsoftware.amazon.awssdk.services.bcmrecommendedactions.paginators.ListRecommendedActionsIterable responses = client.listRecommendedActionsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.bcmrecommendedactions.paginators.ListRecommendedActionsIterable responses = client .listRecommendedActionsPaginator(request); for (software.amazon.awssdk.services.bcmrecommendedactions.model.ListRecommendedActionsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.bcmrecommendedactions.paginators.ListRecommendedActionsIterable responses = client.listRecommendedActionsPaginator(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
listRecommendedActions(software.amazon.awssdk.services.bcmrecommendedactions.model.ListRecommendedActionsRequest)operation.- Parameters:
listRecommendedActionsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listRecommendedActionsPaginator
default ListRecommendedActionsIterable listRecommendedActionsPaginator(Consumer<ListRecommendedActionsRequest.Builder> listRecommendedActionsRequest) throws AccessDeniedException, InternalServerException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, BcmRecommendedActionsException This is a variant of
listRecommendedActions(software.amazon.awssdk.services.bcmrecommendedactions.model.ListRecommendedActionsRequest)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
2) Using For loopsoftware.amazon.awssdk.services.bcmrecommendedactions.paginators.ListRecommendedActionsIterable responses = client.listRecommendedActionsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.bcmrecommendedactions.paginators.ListRecommendedActionsIterable responses = client .listRecommendedActionsPaginator(request); for (software.amazon.awssdk.services.bcmrecommendedactions.model.ListRecommendedActionsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.bcmrecommendedactions.paginators.ListRecommendedActionsIterable responses = client.listRecommendedActionsPaginator(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
listRecommendedActions(software.amazon.awssdk.services.bcmrecommendedactions.model.ListRecommendedActionsRequest)operation.
This is a convenience which creates an instance of the
ListRecommendedActionsRequest.Builderavoiding the need to create one manually viaListRecommendedActionsRequest.builder()- Parameters:
listRecommendedActionsRequest- AConsumerthat will call methods onListRecommendedActionsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
create
Create aBcmRecommendedActionsClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aBcmRecommendedActionsClient. -
serviceMetadata
-
serviceClientConfiguration
Description copied from interface:SdkClientThe SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient- Returns:
- SdkServiceClientConfiguration
-