Interface EbsAsyncClient

All Superinterfaces:
AutoCloseable, AwsClient, SdkAutoCloseable, SdkClient

@Generated("software.amazon.awssdk:codegen") @ThreadSafe public interface EbsAsyncClient extends AwsClient
Service client for accessing Amazon EBS asynchronously. This can be created using the static builder() method.The asynchronous client performs non-blocking I/O when configured with any SdkAsyncHttpClient supported in the SDK. However, full non-blocking is not guaranteed as the async client may perform blocking calls in some cases such as credentials retrieval and endpoint discovery as part of the async API call.

You can use the Amazon Elastic Block Store (Amazon EBS) direct APIs to create Amazon EBS snapshots, write data directly to your snapshots, read data on your snapshots, and identify the differences or changes between two snapshots. If you’re an independent software vendor (ISV) who offers backup services for Amazon EBS, the EBS direct APIs make it more efficient and cost-effective to track incremental changes on your Amazon EBS volumes through snapshots. This can be done without having to create new volumes from snapshots, and then use Amazon Elastic Compute Cloud (Amazon EC2) instances to compare the differences.

You can create incremental snapshots directly from data on-premises into volumes and the cloud to use for quick disaster recovery. With the ability to write and read snapshots, you can write your on-premises data to an snapshot during a disaster. Then after recovery, you can restore it back to Amazon Web Services or on-premises from the snapshot. You no longer need to build and maintain complex mechanisms to copy data to and from Amazon EBS.

This API reference provides detailed information about the actions, data types, parameters, and errors of the EBS direct APIs. For more information about the elements that make up the EBS direct APIs, and examples of how to use them effectively, see Accessing the Contents of an Amazon EBS Snapshot in the Amazon Elastic Compute Cloud User Guide. For more information about the supported Amazon Web Services Regions, endpoints, and service quotas for the EBS direct APIs, see Amazon Elastic Block Store Endpoints and Quotas in the Amazon Web Services General Reference.

  • Field Details

  • Method Details

    • completeSnapshot

      default CompletableFuture<CompleteSnapshotResponse> completeSnapshot(CompleteSnapshotRequest completeSnapshotRequest)

      Seals and completes the snapshot after all of the required blocks of data have been written to it. Completing the snapshot changes the status to completed. You cannot write new blocks to a snapshot after it has been completed.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.

      Parameters:
      completeSnapshotRequest -
      Returns:
      A Java Future containing the result of the CompleteSnapshot operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • completeSnapshot

      default CompletableFuture<CompleteSnapshotResponse> completeSnapshot(Consumer<CompleteSnapshotRequest.Builder> completeSnapshotRequest)

      Seals and completes the snapshot after all of the required blocks of data have been written to it. Completing the snapshot changes the status to completed. You cannot write new blocks to a snapshot after it has been completed.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.


      This is a convenience which creates an instance of the CompleteSnapshotRequest.Builder avoiding the need to create one manually via CompleteSnapshotRequest.builder()

      Parameters:
      completeSnapshotRequest - A Consumer that will call methods on CompleteSnapshotRequest.Builder to create a request.
      Returns:
      A Java Future containing the result of the CompleteSnapshot operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • getSnapshotBlock

      default <ReturnT> CompletableFuture<ReturnT> getSnapshotBlock(GetSnapshotBlockRequest getSnapshotBlockRequest, AsyncResponseTransformer<GetSnapshotBlockResponse,ReturnT> asyncResponseTransformer)

      Returns the data in a block in an Amazon Elastic Block Store snapshot.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.

      Parameters:
      getSnapshotBlockRequest -
      asyncResponseTransformer - The response transformer for processing the streaming response in a non-blocking manner. See AsyncResponseTransformer for details on how this callback should be implemented and for links to precanned implementations for common scenarios like downloading to a file. The service documentation for the response content is as follows '

      The data content of the block.

      '.
      Returns:
      A future to the transformed result of the AsyncResponseTransformer.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • getSnapshotBlock

      default <ReturnT> CompletableFuture<ReturnT> getSnapshotBlock(Consumer<GetSnapshotBlockRequest.Builder> getSnapshotBlockRequest, AsyncResponseTransformer<GetSnapshotBlockResponse,ReturnT> asyncResponseTransformer)

      Returns the data in a block in an Amazon Elastic Block Store snapshot.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.


      This is a convenience which creates an instance of the GetSnapshotBlockRequest.Builder avoiding the need to create one manually via GetSnapshotBlockRequest.builder()

      Parameters:
      getSnapshotBlockRequest - A Consumer that will call methods on GetSnapshotBlockRequest.Builder to create a request.
      asyncResponseTransformer - The response transformer for processing the streaming response in a non-blocking manner. See AsyncResponseTransformer for details on how this callback should be implemented and for links to precanned implementations for common scenarios like downloading to a file. The service documentation for the response content is as follows '

      The data content of the block.

      '.
      Returns:
      A future to the transformed result of the AsyncResponseTransformer.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • getSnapshotBlock

      default CompletableFuture<GetSnapshotBlockResponse> getSnapshotBlock(GetSnapshotBlockRequest getSnapshotBlockRequest, Path destinationPath)

      Returns the data in a block in an Amazon Elastic Block Store snapshot.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.

      Parameters:
      getSnapshotBlockRequest -
      destinationPath - Path to file that response contents will be written to. The file must not exist or this method will throw an exception. If the file is not writable by the current user then an exception will be thrown. The service documentation for the response content is as follows '

      The data content of the block.

      '.
      Returns:
      A future to the transformed result of the AsyncResponseTransformer.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • getSnapshotBlock

      default CompletableFuture<GetSnapshotBlockResponse> getSnapshotBlock(Consumer<GetSnapshotBlockRequest.Builder> getSnapshotBlockRequest, Path destinationPath)

      Returns the data in a block in an Amazon Elastic Block Store snapshot.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.


      This is a convenience which creates an instance of the GetSnapshotBlockRequest.Builder avoiding the need to create one manually via GetSnapshotBlockRequest.builder()

      Parameters:
      getSnapshotBlockRequest - A Consumer that will call methods on GetSnapshotBlockRequest.Builder to create a request.
      destinationPath - Path to file that response contents will be written to. The file must not exist or this method will throw an exception. If the file is not writable by the current user then an exception will be thrown. The service documentation for the response content is as follows '

      The data content of the block.

      '.
      Returns:
      A future to the transformed result of the AsyncResponseTransformer.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • listChangedBlocks

      default CompletableFuture<ListChangedBlocksResponse> listChangedBlocks(ListChangedBlocksRequest listChangedBlocksRequest)

      Returns information about the blocks that are different between two Amazon Elastic Block Store snapshots of the same volume/snapshot lineage.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.

      Parameters:
      listChangedBlocksRequest -
      Returns:
      A Java Future containing the result of the ListChangedBlocks operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • listChangedBlocks

      default CompletableFuture<ListChangedBlocksResponse> listChangedBlocks(Consumer<ListChangedBlocksRequest.Builder> listChangedBlocksRequest)

      Returns information about the blocks that are different between two Amazon Elastic Block Store snapshots of the same volume/snapshot lineage.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.


      This is a convenience which creates an instance of the ListChangedBlocksRequest.Builder avoiding the need to create one manually via ListChangedBlocksRequest.builder()

      Parameters:
      listChangedBlocksRequest - A Consumer that will call methods on ListChangedBlocksRequest.Builder to create a request.
      Returns:
      A Java Future containing the result of the ListChangedBlocks operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • listChangedBlocksPaginator

      default ListChangedBlocksPublisher listChangedBlocksPaginator(ListChangedBlocksRequest listChangedBlocksRequest)

      This is a variant of listChangedBlocks(software.amazon.awssdk.services.ebs.model.ListChangedBlocksRequest) operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.

      When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a new Subscription i.e., a new contract to stream data from the starting request.

      The following are few ways to use the response class:

      1) Using the subscribe helper method
       
       software.amazon.awssdk.services.ebs.paginators.ListChangedBlocksPublisher publisher = client.listChangedBlocksPaginator(request);
       CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
       future.get();
       
       
      2) Using a custom subscriber
       
       software.amazon.awssdk.services.ebs.paginators.ListChangedBlocksPublisher publisher = client.listChangedBlocksPaginator(request);
       publisher.subscribe(new Subscriber<software.amazon.awssdk.services.ebs.model.ListChangedBlocksResponse>() {
       
       public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
       
       
       public void onNext(software.amazon.awssdk.services.ebs.model.ListChangedBlocksResponse response) { //... };
       });
       
      As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.

      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 listChangedBlocks(software.amazon.awssdk.services.ebs.model.ListChangedBlocksRequest) operation.

      Parameters:
      listChangedBlocksRequest -
      Returns:
      A custom publisher that can be subscribed to request a stream of response pages.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • listChangedBlocksPaginator

      default ListChangedBlocksPublisher listChangedBlocksPaginator(Consumer<ListChangedBlocksRequest.Builder> listChangedBlocksRequest)

      This is a variant of listChangedBlocks(software.amazon.awssdk.services.ebs.model.ListChangedBlocksRequest) operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.

      When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a new Subscription i.e., a new contract to stream data from the starting request.

      The following are few ways to use the response class:

      1) Using the subscribe helper method
       
       software.amazon.awssdk.services.ebs.paginators.ListChangedBlocksPublisher publisher = client.listChangedBlocksPaginator(request);
       CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
       future.get();
       
       
      2) Using a custom subscriber
       
       software.amazon.awssdk.services.ebs.paginators.ListChangedBlocksPublisher publisher = client.listChangedBlocksPaginator(request);
       publisher.subscribe(new Subscriber<software.amazon.awssdk.services.ebs.model.ListChangedBlocksResponse>() {
       
       public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
       
       
       public void onNext(software.amazon.awssdk.services.ebs.model.ListChangedBlocksResponse response) { //... };
       });
       
      As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.

      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 listChangedBlocks(software.amazon.awssdk.services.ebs.model.ListChangedBlocksRequest) operation.


      This is a convenience which creates an instance of the ListChangedBlocksRequest.Builder avoiding the need to create one manually via ListChangedBlocksRequest.builder()

      Parameters:
      listChangedBlocksRequest - A Consumer that will call methods on ListChangedBlocksRequest.Builder to create a request.
      Returns:
      A custom publisher that can be subscribed to request a stream of response pages.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • listSnapshotBlocks

      default CompletableFuture<ListSnapshotBlocksResponse> listSnapshotBlocks(ListSnapshotBlocksRequest listSnapshotBlocksRequest)

      Returns information about the blocks in an Amazon Elastic Block Store snapshot.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.

      Parameters:
      listSnapshotBlocksRequest -
      Returns:
      A Java Future containing the result of the ListSnapshotBlocks operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • listSnapshotBlocks

      default CompletableFuture<ListSnapshotBlocksResponse> listSnapshotBlocks(Consumer<ListSnapshotBlocksRequest.Builder> listSnapshotBlocksRequest)

      Returns information about the blocks in an Amazon Elastic Block Store snapshot.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.


      This is a convenience which creates an instance of the ListSnapshotBlocksRequest.Builder avoiding the need to create one manually via ListSnapshotBlocksRequest.builder()

      Parameters:
      listSnapshotBlocksRequest - A Consumer that will call methods on ListSnapshotBlocksRequest.Builder to create a request.
      Returns:
      A Java Future containing the result of the ListSnapshotBlocks operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • listSnapshotBlocksPaginator

      default ListSnapshotBlocksPublisher listSnapshotBlocksPaginator(ListSnapshotBlocksRequest listSnapshotBlocksRequest)

      This is a variant of listSnapshotBlocks(software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksRequest) operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.

      When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a new Subscription i.e., a new contract to stream data from the starting request.

      The following are few ways to use the response class:

      1) Using the subscribe helper method
       
       software.amazon.awssdk.services.ebs.paginators.ListSnapshotBlocksPublisher publisher = client.listSnapshotBlocksPaginator(request);
       CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
       future.get();
       
       
      2) Using a custom subscriber
       
       software.amazon.awssdk.services.ebs.paginators.ListSnapshotBlocksPublisher publisher = client.listSnapshotBlocksPaginator(request);
       publisher.subscribe(new Subscriber<software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksResponse>() {
       
       public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
       
       
       public void onNext(software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksResponse response) { //... };
       });
       
      As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.

      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 listSnapshotBlocks(software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksRequest) operation.

      Parameters:
      listSnapshotBlocksRequest -
      Returns:
      A custom publisher that can be subscribed to request a stream of response pages.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • listSnapshotBlocksPaginator

      default ListSnapshotBlocksPublisher listSnapshotBlocksPaginator(Consumer<ListSnapshotBlocksRequest.Builder> listSnapshotBlocksRequest)

      This is a variant of listSnapshotBlocks(software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksRequest) operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.

      When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a new Subscription i.e., a new contract to stream data from the starting request.

      The following are few ways to use the response class:

      1) Using the subscribe helper method
       
       software.amazon.awssdk.services.ebs.paginators.ListSnapshotBlocksPublisher publisher = client.listSnapshotBlocksPaginator(request);
       CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
       future.get();
       
       
      2) Using a custom subscriber
       
       software.amazon.awssdk.services.ebs.paginators.ListSnapshotBlocksPublisher publisher = client.listSnapshotBlocksPaginator(request);
       publisher.subscribe(new Subscriber<software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksResponse>() {
       
       public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
       
       
       public void onNext(software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksResponse response) { //... };
       });
       
      As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.

      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 listSnapshotBlocks(software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksRequest) operation.


      This is a convenience which creates an instance of the ListSnapshotBlocksRequest.Builder avoiding the need to create one manually via ListSnapshotBlocksRequest.builder()

      Parameters:
      listSnapshotBlocksRequest - A Consumer that will call methods on ListSnapshotBlocksRequest.Builder to create a request.
      Returns:
      A custom publisher that can be subscribed to request a stream of response pages.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • putSnapshotBlock

      default CompletableFuture<PutSnapshotBlockResponse> putSnapshotBlock(PutSnapshotBlockRequest putSnapshotBlockRequest, AsyncRequestBody requestBody)

      Writes a block of data to a snapshot. If the specified block contains data, the existing data is overwritten. The target snapshot must be in the pending state.

      Data written to a snapshot must be aligned with 512-KiB sectors.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.

      Parameters:
      putSnapshotBlockRequest -
      requestBody - Functional interface that can be implemented to produce the request content in a non-blocking manner. The size of the content is expected to be known up front. See AsyncRequestBody for specific details on implementing this interface as well as links to precanned implementations for common scenarios like uploading from a file. The service documentation for the request content is as follows '

      The data to write to the block.

      The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the x-amz-Checksum header. Also, you must specify the checksum algorithm using the x-amz-Checksum-Algorithm header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see Using checksums with the EBS direct APIs in the Amazon Elastic Compute Cloud User Guide.

      '
      Returns:
      A Java Future containing the result of the PutSnapshotBlock operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • putSnapshotBlock

      default CompletableFuture<PutSnapshotBlockResponse> putSnapshotBlock(Consumer<PutSnapshotBlockRequest.Builder> putSnapshotBlockRequest, AsyncRequestBody requestBody)

      Writes a block of data to a snapshot. If the specified block contains data, the existing data is overwritten. The target snapshot must be in the pending state.

      Data written to a snapshot must be aligned with 512-KiB sectors.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.


      This is a convenience which creates an instance of the PutSnapshotBlockRequest.Builder avoiding the need to create one manually via PutSnapshotBlockRequest.builder()

      Parameters:
      putSnapshotBlockRequest - A Consumer that will call methods on PutSnapshotBlockRequest.Builder to create a request.
      requestBody - Functional interface that can be implemented to produce the request content in a non-blocking manner. The size of the content is expected to be known up front. See AsyncRequestBody for specific details on implementing this interface as well as links to precanned implementations for common scenarios like uploading from a file. The service documentation for the request content is as follows '

      The data to write to the block.

      The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the x-amz-Checksum header. Also, you must specify the checksum algorithm using the x-amz-Checksum-Algorithm header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see Using checksums with the EBS direct APIs in the Amazon Elastic Compute Cloud User Guide.

      '
      Returns:
      A Java Future containing the result of the PutSnapshotBlock operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • putSnapshotBlock

      default CompletableFuture<PutSnapshotBlockResponse> putSnapshotBlock(PutSnapshotBlockRequest putSnapshotBlockRequest, Path sourcePath)

      Writes a block of data to a snapshot. If the specified block contains data, the existing data is overwritten. The target snapshot must be in the pending state.

      Data written to a snapshot must be aligned with 512-KiB sectors.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.

      Parameters:
      putSnapshotBlockRequest -
      sourcePath - Path to file containing data to send to the service. File will be read entirely and may be read multiple times in the event of a retry. If the file does not exist or the current user does not have access to read it then an exception will be thrown. The service documentation for the request content is as follows '

      The data to write to the block.

      The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the x-amz-Checksum header. Also, you must specify the checksum algorithm using the x-amz-Checksum-Algorithm header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see Using checksums with the EBS direct APIs in the Amazon Elastic Compute Cloud User Guide.

      '
      Returns:
      A Java Future containing the result of the PutSnapshotBlock operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • putSnapshotBlock

      default CompletableFuture<PutSnapshotBlockResponse> putSnapshotBlock(Consumer<PutSnapshotBlockRequest.Builder> putSnapshotBlockRequest, Path sourcePath)

      Writes a block of data to a snapshot. If the specified block contains data, the existing data is overwritten. The target snapshot must be in the pending state.

      Data written to a snapshot must be aligned with 512-KiB sectors.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.


      This is a convenience which creates an instance of the PutSnapshotBlockRequest.Builder avoiding the need to create one manually via PutSnapshotBlockRequest.builder()

      Parameters:
      putSnapshotBlockRequest - A Consumer that will call methods on PutSnapshotBlockRequest.Builder to create a request.
      sourcePath - Path to file containing data to send to the service. File will be read entirely and may be read multiple times in the event of a retry. If the file does not exist or the current user does not have access to read it then an exception will be thrown. The service documentation for the request content is as follows '

      The data to write to the block.

      The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the x-amz-Checksum header. Also, you must specify the checksum algorithm using the x-amz-Checksum-Algorithm header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see Using checksums with the EBS direct APIs in the Amazon Elastic Compute Cloud User Guide.

      '
      Returns:
      A Java Future containing the result of the PutSnapshotBlock operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • ResourceNotFoundException The specified resource does not exist.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • startSnapshot

      default CompletableFuture<StartSnapshotResponse> startSnapshot(StartSnapshotRequest startSnapshotRequest)

      Creates a new Amazon EBS snapshot. The new snapshot enters the pending state after the request completes.

      After creating the snapshot, use PutSnapshotBlock to write blocks of data to the snapshot.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.

      Parameters:
      startSnapshotRequest -
      Returns:
      A Java Future containing the result of the StartSnapshot operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ResourceNotFoundException The specified resource does not exist.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • ConcurrentLimitExceededException You have reached the limit for concurrent API requests. For more information, see Optimizing performance of the EBS direct APIs in the Amazon Elastic Compute Cloud User Guide.
      • ConflictException The request uses the same client token as a previous, but non-identical request.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • startSnapshot

      default CompletableFuture<StartSnapshotResponse> startSnapshot(Consumer<StartSnapshotRequest.Builder> startSnapshotRequest)

      Creates a new Amazon EBS snapshot. The new snapshot enters the pending state after the request completes.

      After creating the snapshot, use PutSnapshotBlock to write blocks of data to the snapshot.

      You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.


      This is a convenience which creates an instance of the StartSnapshotRequest.Builder avoiding the need to create one manually via StartSnapshotRequest.builder()

      Parameters:
      startSnapshotRequest - A Consumer that will call methods on StartSnapshotRequest.Builder to create a request.
      Returns:
      A Java Future containing the result of the StartSnapshot operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invoke Throwable.getCause() to retrieve the underlying exception.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • ValidationException The input fails to satisfy the constraints of the EBS direct APIs.
      • RequestThrottledException The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
      • ResourceNotFoundException The specified resource does not exist.
      • ServiceQuotaExceededException Your current service quotas do not allow you to perform this action.
      • InternalServerException An internal error has occurred. For more information see Error retries.
      • ConcurrentLimitExceededException You have reached the limit for concurrent API requests. For more information, see Optimizing performance of the EBS direct APIs in the Amazon Elastic Compute Cloud User Guide.
      • ConflictException The request uses the same client token as a previous, but non-identical request.
      • 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.
      • EbsException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • serviceClientConfiguration

      default EbsServiceClientConfiguration serviceClientConfiguration()
      Description copied from interface: SdkClient
      The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration
      Specified by:
      serviceClientConfiguration in interface AwsClient
      Specified by:
      serviceClientConfiguration in interface SdkClient
      Returns:
      SdkServiceClientConfiguration
    • create

      static EbsAsyncClient create()
      Create a EbsAsyncClient with the region loaded from the DefaultAwsRegionProviderChain and credentials loaded from the DefaultCredentialsProvider.
    • builder

      static EbsAsyncClientBuilder builder()
      Create a builder that can be used to configure and create a EbsAsyncClient.