Interface EbsClient
- All Superinterfaces:
AutoCloseable
,AwsClient
,SdkAutoCloseable
,SdkClient
builder()
method.
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Value for looking up the service's metadata from theServiceMetadataProvider
.static final String
-
Method Summary
Modifier and TypeMethodDescriptionstatic EbsClientBuilder
builder()
Create a builder that can be used to configure and create aEbsClient
.default CompleteSnapshotResponse
completeSnapshot
(Consumer<CompleteSnapshotRequest.Builder> completeSnapshotRequest) Seals and completes the snapshot after all of the required blocks of data have been written to it.default CompleteSnapshotResponse
completeSnapshot
(CompleteSnapshotRequest completeSnapshotRequest) Seals and completes the snapshot after all of the required blocks of data have been written to it.static EbsClient
create()
Create aEbsClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
.getSnapshotBlock
(Consumer<GetSnapshotBlockRequest.Builder> getSnapshotBlockRequest) Returns the data in a block in an Amazon Elastic Block Store snapshot.default GetSnapshotBlockResponse
getSnapshotBlock
(Consumer<GetSnapshotBlockRequest.Builder> getSnapshotBlockRequest, Path destinationPath) Returns the data in a block in an Amazon Elastic Block Store snapshot.default <ReturnT> ReturnT
getSnapshotBlock
(Consumer<GetSnapshotBlockRequest.Builder> getSnapshotBlockRequest, ResponseTransformer<GetSnapshotBlockResponse, ReturnT> responseTransformer) Returns the data in a block in an Amazon Elastic Block Store snapshot.getSnapshotBlock
(GetSnapshotBlockRequest getSnapshotBlockRequest) Returns the data in a block in an Amazon Elastic Block Store snapshot.default GetSnapshotBlockResponse
getSnapshotBlock
(GetSnapshotBlockRequest getSnapshotBlockRequest, Path destinationPath) Returns the data in a block in an Amazon Elastic Block Store snapshot.default <ReturnT> ReturnT
getSnapshotBlock
(GetSnapshotBlockRequest getSnapshotBlockRequest, ResponseTransformer<GetSnapshotBlockResponse, ReturnT> responseTransformer) Returns the data in a block in an Amazon Elastic Block Store snapshot.default ResponseBytes
<GetSnapshotBlockResponse> getSnapshotBlockAsBytes
(Consumer<GetSnapshotBlockRequest.Builder> getSnapshotBlockRequest) Returns the data in a block in an Amazon Elastic Block Store snapshot.default ResponseBytes
<GetSnapshotBlockResponse> getSnapshotBlockAsBytes
(GetSnapshotBlockRequest getSnapshotBlockRequest) Returns the data in a block in an Amazon Elastic Block Store snapshot.default 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.default 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.default ListChangedBlocksIterable
listChangedBlocksPaginator
(Consumer<ListChangedBlocksRequest.Builder> listChangedBlocksRequest) This is a variant oflistChangedBlocks(software.amazon.awssdk.services.ebs.model.ListChangedBlocksRequest)
operation.default ListChangedBlocksIterable
listChangedBlocksPaginator
(ListChangedBlocksRequest listChangedBlocksRequest) This is a variant oflistChangedBlocks(software.amazon.awssdk.services.ebs.model.ListChangedBlocksRequest)
operation.default ListSnapshotBlocksResponse
listSnapshotBlocks
(Consumer<ListSnapshotBlocksRequest.Builder> listSnapshotBlocksRequest) Returns information about the blocks in an Amazon Elastic Block Store snapshot.default ListSnapshotBlocksResponse
listSnapshotBlocks
(ListSnapshotBlocksRequest listSnapshotBlocksRequest) Returns information about the blocks in an Amazon Elastic Block Store snapshot.default ListSnapshotBlocksIterable
listSnapshotBlocksPaginator
(Consumer<ListSnapshotBlocksRequest.Builder> listSnapshotBlocksRequest) This is a variant oflistSnapshotBlocks(software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksRequest)
operation.default ListSnapshotBlocksIterable
listSnapshotBlocksPaginator
(ListSnapshotBlocksRequest listSnapshotBlocksRequest) This is a variant oflistSnapshotBlocks(software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksRequest)
operation.default PutSnapshotBlockResponse
putSnapshotBlock
(Consumer<PutSnapshotBlockRequest.Builder> putSnapshotBlockRequest, Path sourcePath) Writes a block of data to a snapshot.default PutSnapshotBlockResponse
putSnapshotBlock
(Consumer<PutSnapshotBlockRequest.Builder> putSnapshotBlockRequest, RequestBody requestBody) Writes a block of data to a snapshot.default PutSnapshotBlockResponse
putSnapshotBlock
(PutSnapshotBlockRequest putSnapshotBlockRequest, Path sourcePath) Writes a block of data to a snapshot.default PutSnapshotBlockResponse
putSnapshotBlock
(PutSnapshotBlockRequest putSnapshotBlockRequest, RequestBody requestBody) Writes a block of data to a snapshot.default EbsServiceClientConfiguration
The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstatic ServiceMetadata
default StartSnapshotResponse
startSnapshot
(Consumer<StartSnapshotRequest.Builder> startSnapshotRequest) Creates a new Amazon EBS snapshot.default StartSnapshotResponse
startSnapshot
(StartSnapshotRequest startSnapshotRequest) Creates a new Amazon EBS snapshot.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
-
completeSnapshot
default CompleteSnapshotResponse completeSnapshot(CompleteSnapshotRequest completeSnapshotRequest) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException 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, andThrottlingException
andRequestThrottledException
client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.- Parameters:
completeSnapshotRequest
-- Returns:
- Result of the CompleteSnapshot operation returned by the service.
- See Also:
-
completeSnapshot
default CompleteSnapshotResponse completeSnapshot(Consumer<CompleteSnapshotRequest.Builder> completeSnapshotRequest) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException 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, andThrottlingException
andRequestThrottledException
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 viaCompleteSnapshotRequest.builder()
- Parameters:
completeSnapshotRequest
- AConsumer
that will call methods onCompleteSnapshotRequest.Builder
to create a request.- Returns:
- Result of the CompleteSnapshot operation returned by the service.
- See Also:
-
getSnapshotBlock
default <ReturnT> ReturnT getSnapshotBlock(GetSnapshotBlockRequest getSnapshotBlockRequest, ResponseTransformer<GetSnapshotBlockResponse, ReturnT> responseTransformer) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsExceptionReturns the data in a block in an Amazon Elastic Block Store snapshot.
You should always retry requests that receive server (
5xx
) error responses, andThrottlingException
andRequestThrottledException
client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.- Parameters:
getSnapshotBlockRequest
-responseTransformer
- Functional interface for processing the streamed response content. The unmarshalled GetSnapshotBlockResponse and an InputStream to the response content are provided as parameters to the callback. The callback may return a transformed type which will be the return value of this method. SeeResponseTransformer
for details on implementing this interface and for links to pre-canned 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:
- The transformed result of the ResponseTransformer.
- See Also:
-
getSnapshotBlock
default <ReturnT> ReturnT getSnapshotBlock(Consumer<GetSnapshotBlockRequest.Builder> getSnapshotBlockRequest, ResponseTransformer<GetSnapshotBlockResponse, ReturnT> responseTransformer) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsExceptionReturns the data in a block in an Amazon Elastic Block Store snapshot.
You should always retry requests that receive server (
5xx
) error responses, andThrottlingException
andRequestThrottledException
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 viaGetSnapshotBlockRequest.builder()
- Parameters:
getSnapshotBlockRequest
- AConsumer
that will call methods onGetSnapshotBlockRequest.Builder
to create a request.responseTransformer
- Functional interface for processing the streamed response content. The unmarshalled GetSnapshotBlockResponse and an InputStream to the response content are provided as parameters to the callback. The callback may return a transformed type which will be the return value of this method. SeeResponseTransformer
for details on implementing this interface and for links to pre-canned 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:
- The transformed result of the ResponseTransformer.
- See Also:
-
getSnapshotBlock
default GetSnapshotBlockResponse getSnapshotBlock(GetSnapshotBlockRequest getSnapshotBlockRequest, Path destinationPath) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException Returns the data in a block in an Amazon Elastic Block Store snapshot.
You should always retry requests that receive server (
5xx
) error responses, andThrottlingException
andRequestThrottledException
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:
- The transformed result of the ResponseTransformer.
- See Also:
-
getSnapshotBlock
default GetSnapshotBlockResponse getSnapshotBlock(Consumer<GetSnapshotBlockRequest.Builder> getSnapshotBlockRequest, Path destinationPath) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException Returns the data in a block in an Amazon Elastic Block Store snapshot.
You should always retry requests that receive server (
5xx
) error responses, andThrottlingException
andRequestThrottledException
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 viaGetSnapshotBlockRequest.builder()
- Parameters:
getSnapshotBlockRequest
- AConsumer
that will call methods onGetSnapshotBlockRequest.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:
- The transformed result of the ResponseTransformer.
- See Also:
-
getSnapshotBlock
default ResponseInputStream<GetSnapshotBlockResponse> getSnapshotBlock(GetSnapshotBlockRequest getSnapshotBlockRequest) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException Returns the data in a block in an Amazon Elastic Block Store snapshot.
You should always retry requests that receive server (
5xx
) error responses, andThrottlingException
andRequestThrottledException
client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.- Parameters:
getSnapshotBlockRequest
-- Returns:
- A
ResponseInputStream
containing data streamed from service. Note that this is an unmanaged reference to the underlying HTTP connection so great care must be taken to ensure all data if fully read from the input stream and that it is properly closed. Failure to do so may result in sub-optimal behavior and exhausting connections in the connection pool. The unmarshalled response object can be obtained viaResponseInputStream.response()
. The service documentation for the response content is as follows 'The data content of the block.
'. - See Also:
-
getSnapshotBlock
default ResponseInputStream<GetSnapshotBlockResponse> getSnapshotBlock(Consumer<GetSnapshotBlockRequest.Builder> getSnapshotBlockRequest) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException Returns the data in a block in an Amazon Elastic Block Store snapshot.
You should always retry requests that receive server (
5xx
) error responses, andThrottlingException
andRequestThrottledException
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 viaGetSnapshotBlockRequest.builder()
- Parameters:
getSnapshotBlockRequest
- AConsumer
that will call methods onGetSnapshotBlockRequest.Builder
to create a request.- Returns:
- A
ResponseInputStream
containing data streamed from service. Note that this is an unmanaged reference to the underlying HTTP connection so great care must be taken to ensure all data if fully read from the input stream and that it is properly closed. Failure to do so may result in sub-optimal behavior and exhausting connections in the connection pool. The unmarshalled response object can be obtained viaResponseInputStream.response()
. The service documentation for the response content is as follows 'The data content of the block.
'. - See Also:
-
getSnapshotBlockAsBytes
default ResponseBytes<GetSnapshotBlockResponse> getSnapshotBlockAsBytes(GetSnapshotBlockRequest getSnapshotBlockRequest) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException Returns the data in a block in an Amazon Elastic Block Store snapshot.
You should always retry requests that receive server (
5xx
) error responses, andThrottlingException
andRequestThrottledException
client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.- Parameters:
getSnapshotBlockRequest
-- Returns:
- A
ResponseBytes
that loads the data streamed from the service into memory and exposes it in convenient in-memory representations like a byte buffer or string. The unmarshalled response object can be obtained viaResponseBytes.response()
. The service documentation for the response content is as follows 'The data content of the block.
'. - See Also:
-
getSnapshotBlockAsBytes
default ResponseBytes<GetSnapshotBlockResponse> getSnapshotBlockAsBytes(Consumer<GetSnapshotBlockRequest.Builder> getSnapshotBlockRequest) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException Returns the data in a block in an Amazon Elastic Block Store snapshot.
You should always retry requests that receive server (
5xx
) error responses, andThrottlingException
andRequestThrottledException
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 viaGetSnapshotBlockRequest.builder()
- Parameters:
getSnapshotBlockRequest
- AConsumer
that will call methods onGetSnapshotBlockRequest.Builder
to create a request.- Returns:
- A
ResponseBytes
that loads the data streamed from the service into memory and exposes it in convenient in-memory representations like a byte buffer or string. The unmarshalled response object can be obtained viaResponseBytes.response()
. The service documentation for the response content is as follows 'The data content of the block.
'. - See Also:
-
listChangedBlocks
default ListChangedBlocksResponse listChangedBlocks(ListChangedBlocksRequest listChangedBlocksRequest) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException 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, andThrottlingException
andRequestThrottledException
client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.- Parameters:
listChangedBlocksRequest
-- Returns:
- Result of the ListChangedBlocks operation returned by the service.
- See Also:
-
listChangedBlocks
default ListChangedBlocksResponse listChangedBlocks(Consumer<ListChangedBlocksRequest.Builder> listChangedBlocksRequest) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException 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, andThrottlingException
andRequestThrottledException
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 viaListChangedBlocksRequest.builder()
- Parameters:
listChangedBlocksRequest
- AConsumer
that will call methods onListChangedBlocksRequest.Builder
to create a request.- Returns:
- Result of the ListChangedBlocks operation returned by the service.
- See Also:
-
listChangedBlocksPaginator
default ListChangedBlocksIterable listChangedBlocksPaginator(ListChangedBlocksRequest listChangedBlocksRequest) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException This is a variant of
listChangedBlocks(software.amazon.awssdk.services.ebs.model.ListChangedBlocksRequest)
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.ebs.paginators.ListChangedBlocksIterable responses = client.listChangedBlocksPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.ebs.paginators.ListChangedBlocksIterable responses = client .listChangedBlocksPaginator(request); for (software.amazon.awssdk.services.ebs.model.ListChangedBlocksResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.ebs.paginators.ListChangedBlocksIterable responses = client.listChangedBlocksPaginator(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
listChangedBlocks(software.amazon.awssdk.services.ebs.model.ListChangedBlocksRequest)
operation.- Parameters:
listChangedBlocksRequest
-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listChangedBlocksPaginator
default ListChangedBlocksIterable listChangedBlocksPaginator(Consumer<ListChangedBlocksRequest.Builder> listChangedBlocksRequest) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException This is a variant of
listChangedBlocks(software.amazon.awssdk.services.ebs.model.ListChangedBlocksRequest)
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.ebs.paginators.ListChangedBlocksIterable responses = client.listChangedBlocksPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.ebs.paginators.ListChangedBlocksIterable responses = client .listChangedBlocksPaginator(request); for (software.amazon.awssdk.services.ebs.model.ListChangedBlocksResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.ebs.paginators.ListChangedBlocksIterable responses = client.listChangedBlocksPaginator(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
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 viaListChangedBlocksRequest.builder()
- Parameters:
listChangedBlocksRequest
- AConsumer
that will call methods onListChangedBlocksRequest.Builder
to create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listSnapshotBlocks
default ListSnapshotBlocksResponse listSnapshotBlocks(ListSnapshotBlocksRequest listSnapshotBlocksRequest) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException Returns information about the blocks in an Amazon Elastic Block Store snapshot.
You should always retry requests that receive server (
5xx
) error responses, andThrottlingException
andRequestThrottledException
client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.- Parameters:
listSnapshotBlocksRequest
-- Returns:
- Result of the ListSnapshotBlocks operation returned by the service.
- See Also:
-
listSnapshotBlocks
default ListSnapshotBlocksResponse listSnapshotBlocks(Consumer<ListSnapshotBlocksRequest.Builder> listSnapshotBlocksRequest) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException Returns information about the blocks in an Amazon Elastic Block Store snapshot.
You should always retry requests that receive server (
5xx
) error responses, andThrottlingException
andRequestThrottledException
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 viaListSnapshotBlocksRequest.builder()
- Parameters:
listSnapshotBlocksRequest
- AConsumer
that will call methods onListSnapshotBlocksRequest.Builder
to create a request.- Returns:
- Result of the ListSnapshotBlocks operation returned by the service.
- See Also:
-
listSnapshotBlocksPaginator
default ListSnapshotBlocksIterable listSnapshotBlocksPaginator(ListSnapshotBlocksRequest listSnapshotBlocksRequest) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException This is a variant of
listSnapshotBlocks(software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksRequest)
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.ebs.paginators.ListSnapshotBlocksIterable responses = client.listSnapshotBlocksPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.ebs.paginators.ListSnapshotBlocksIterable responses = client .listSnapshotBlocksPaginator(request); for (software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.ebs.paginators.ListSnapshotBlocksIterable responses = client.listSnapshotBlocksPaginator(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
listSnapshotBlocks(software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksRequest)
operation.- Parameters:
listSnapshotBlocksRequest
-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listSnapshotBlocksPaginator
default ListSnapshotBlocksIterable listSnapshotBlocksPaginator(Consumer<ListSnapshotBlocksRequest.Builder> listSnapshotBlocksRequest) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException This is a variant of
listSnapshotBlocks(software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksRequest)
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.ebs.paginators.ListSnapshotBlocksIterable responses = client.listSnapshotBlocksPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.ebs.paginators.ListSnapshotBlocksIterable responses = client .listSnapshotBlocksPaginator(request); for (software.amazon.awssdk.services.ebs.model.ListSnapshotBlocksResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.ebs.paginators.ListSnapshotBlocksIterable responses = client.listSnapshotBlocksPaginator(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
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 viaListSnapshotBlocksRequest.builder()
- Parameters:
listSnapshotBlocksRequest
- AConsumer
that will call methods onListSnapshotBlocksRequest.Builder
to create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
putSnapshotBlock
default PutSnapshotBlockResponse putSnapshotBlock(PutSnapshotBlockRequest putSnapshotBlockRequest, RequestBody requestBody) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException 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, andThrottlingException
andRequestThrottledException
client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.- Parameters:
putSnapshotBlockRequest
-requestBody
- The content to send to the service. ARequestBody
can be created using one of several factory methods for various sources of data. For example, to create a request body from a file you can do the following.RequestBody.fromFile(new File("myfile.txt"))
RequestBody
for additional details and which sources of data are supported. 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:
- Result of the PutSnapshotBlock operation returned by the service.
- See Also:
-
putSnapshotBlock
default PutSnapshotBlockResponse putSnapshotBlock(Consumer<PutSnapshotBlockRequest.Builder> putSnapshotBlockRequest, RequestBody requestBody) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException 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, andThrottlingException
andRequestThrottledException
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 viaPutSnapshotBlockRequest.builder()
- Parameters:
putSnapshotBlockRequest
- AConsumer
that will call methods onPutSnapshotBlockRequest.Builder
to create a request.requestBody
- The content to send to the service. ARequestBody
can be created using one of several factory methods for various sources of data. For example, to create a request body from a file you can do the following.RequestBody.fromFile(new File("myfile.txt"))
RequestBody
for additional details and which sources of data are supported. 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:
- Result of the PutSnapshotBlock operation returned by the service.
- See Also:
-
putSnapshotBlock
default PutSnapshotBlockResponse putSnapshotBlock(PutSnapshotBlockRequest putSnapshotBlockRequest, Path sourcePath) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException 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, andThrottlingException
andRequestThrottledException
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:
- Result of the PutSnapshotBlock operation returned by the service.
- See Also:
-
putSnapshotBlock
default PutSnapshotBlockResponse putSnapshotBlock(Consumer<PutSnapshotBlockRequest.Builder> putSnapshotBlockRequest, Path sourcePath) throws AccessDeniedException, ValidationException, ResourceNotFoundException, RequestThrottledException, ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, EbsException 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, andThrottlingException
andRequestThrottledException
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 viaPutSnapshotBlockRequest.builder()
- Parameters:
putSnapshotBlockRequest
- AConsumer
that will call methods onPutSnapshotBlockRequest.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:
- Result of the PutSnapshotBlock operation returned by the service.
- See Also:
-
startSnapshot
default StartSnapshotResponse startSnapshot(StartSnapshotRequest startSnapshotRequest) throws AccessDeniedException, ValidationException, RequestThrottledException, ResourceNotFoundException, ServiceQuotaExceededException, InternalServerException, ConcurrentLimitExceededException, ConflictException, AwsServiceException, SdkClientException, EbsException 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, andThrottlingException
andRequestThrottledException
client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.- Parameters:
startSnapshotRequest
-- Returns:
- Result of the StartSnapshot operation returned by the service.
- See Also:
-
startSnapshot
default StartSnapshotResponse startSnapshot(Consumer<StartSnapshotRequest.Builder> startSnapshotRequest) throws AccessDeniedException, ValidationException, RequestThrottledException, ResourceNotFoundException, ServiceQuotaExceededException, InternalServerException, ConcurrentLimitExceededException, ConflictException, AwsServiceException, SdkClientException, EbsException 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, andThrottlingException
andRequestThrottledException
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 viaStartSnapshotRequest.builder()
- Parameters:
startSnapshotRequest
- AConsumer
that will call methods onStartSnapshotRequest.Builder
to create a request.- Returns:
- Result of the StartSnapshot operation returned by the service.
- See Also:
-
create
Create aEbsClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
. -
builder
Create a builder that can be used to configure and create aEbsClient
. -
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
-