Struct aws_sdk_ebs::Client
source · [−]pub struct Client { /* private fields */ }Expand description
Client for Amazon Elastic Block Store
Client for invoking operations on Amazon Elastic Block Store. Each operation on Amazon Elastic Block Store is a method on this
this struct. .send() MUST be invoked on the generated operations to dispatch the request to the service.
Examples
Constructing a client and invoking an operation
// create a shared configuration. This can be used & shared between multiple service clients.
let shared_config = aws_config::load_from_env().await;
let client = aws_sdk_ebs::Client::new(&shared_config);
// invoke an operation
/* let rsp = client
.<operation_name>().
.<param>("some value")
.send().await; */Constructing a client with custom configuration
use aws_config::retry::RetryConfig;
let shared_config = aws_config::load_from_env().await;
let config = aws_sdk_ebs::config::Builder::from(&shared_config)
.retry_config(RetryConfig::disabled())
.build();
let client = aws_sdk_ebs::Client::from_conf(config);Implementations
sourceimpl Client
impl Client
sourcepub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
pub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
Creates a client with the given service configuration.
sourceimpl Client
impl Client
sourcepub fn complete_snapshot(&self) -> CompleteSnapshot
pub fn complete_snapshot(&self) -> CompleteSnapshot
Constructs a fluent builder for the CompleteSnapshot operation.
- The fluent builder is configurable:
snapshot_id(impl Into<String>)/set_snapshot_id(Option<String>):The ID of the snapshot.
changed_blocks_count(i32)/set_changed_blocks_count(Option<i32>):The number of blocks that were written to the snapshot.
checksum(impl Into<String>)/set_checksum(Option<String>):An aggregated Base-64 SHA256 checksum based on the checksums of each written block.
To generate the aggregated checksum using the linear aggregation method, arrange the checksums for each written block in ascending order of their block index, concatenate them to form a single string, and then generate the checksum on the entire string using the SHA256 algorithm.
checksum_algorithm(ChecksumAlgorithm)/set_checksum_algorithm(Option<ChecksumAlgorithm>):The algorithm used to generate the checksum. Currently, the only supported algorithm is
SHA256.checksum_aggregation_method(ChecksumAggregationMethod)/set_checksum_aggregation_method(Option<ChecksumAggregationMethod>):The aggregation method used to generate the checksum. Currently, the only supported aggregation method is
LINEAR.
- On success, responds with
CompleteSnapshotOutputwith field(s):status(Option<Status>):The status of the snapshot.
- On failure, responds with
SdkError<CompleteSnapshotError>
sourcepub fn get_snapshot_block(&self) -> GetSnapshotBlock
pub fn get_snapshot_block(&self) -> GetSnapshotBlock
Constructs a fluent builder for the GetSnapshotBlock operation.
- The fluent builder is configurable:
snapshot_id(impl Into<String>)/set_snapshot_id(Option<String>):The ID of the snapshot containing the block from which to get data.
If the specified snapshot is encrypted, you must have permission to use the KMS key that was used to encrypt the snapshot. For more information, see Using encryption in the Amazon Elastic Compute Cloud User Guide.
block_index(i32)/set_block_index(Option<i32>):The block index of the block in which to read the data. A block index is a logical index in units of
512KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/524288). The logical offset of the data must be512KiB aligned.block_token(impl Into<String>)/set_block_token(Option<String>):The block token of the block from which to get data. You can obtain the
BlockTokenby running theListChangedBlocksorListSnapshotBlocksoperations.
- On success, responds with
GetSnapshotBlockOutputwith field(s):data_length(Option<i32>):The size of the data in the block.
block_data(ByteStream):The data content of the block.
checksum(Option<String>):The checksum generated for the block, which is Base64 encoded.
checksum_algorithm(Option<ChecksumAlgorithm>):The algorithm used to generate the checksum for the block, such as SHA256.
- On failure, responds with
SdkError<GetSnapshotBlockError>
sourcepub fn list_changed_blocks(&self) -> ListChangedBlocks
pub fn list_changed_blocks(&self) -> ListChangedBlocks
Constructs a fluent builder for the ListChangedBlocks operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
first_snapshot_id(impl Into<String>)/set_first_snapshot_id(Option<String>):The ID of the first snapshot to use for the comparison.
The
FirstSnapshotIDparameter must be specified with aSecondSnapshotIdparameter; otherwise, an error occurs.second_snapshot_id(impl Into<String>)/set_second_snapshot_id(Option<String>):The ID of the second snapshot to use for the comparison.
The
SecondSnapshotIdparameter must be specified with aFirstSnapshotIDparameter; otherwise, an error occurs.next_token(impl Into<String>)/set_next_token(Option<String>):The token to request the next page of results.
If you specify NextToken, then StartingBlockIndex is ignored.
max_results(i32)/set_max_results(Option<i32>):The maximum number of blocks to be returned by the request.
Even if additional blocks can be retrieved from the snapshot, the request can return less blocks than MaxResults or an empty array of blocks.
To retrieve the next set of blocks from the snapshot, make another request with the returned NextToken value. The value of NextToken is
nullwhen there are no more blocks to return.starting_block_index(i32)/set_starting_block_index(Option<i32>):The block index from which the comparison should start.
The list in the response will start from this block index or the next valid block index in the snapshots.
If you specify NextToken, then StartingBlockIndex is ignored.
- On success, responds with
ListChangedBlocksOutputwith field(s):changed_blocks(Option<Vec<ChangedBlock>>):An array of objects containing information about the changed blocks.
expiry_time(Option<DateTime>):The time when the
BlockTokenexpires.volume_size(Option<i64>):The size of the volume in GB.
block_size(Option<i32>):The size of the blocks in the snapshot, in bytes.
next_token(Option<String>):The token to use to retrieve the next page of results. This value is null when there are no more results to return.
- On failure, responds with
SdkError<ListChangedBlocksError>
sourcepub fn list_snapshot_blocks(&self) -> ListSnapshotBlocks
pub fn list_snapshot_blocks(&self) -> ListSnapshotBlocks
Constructs a fluent builder for the ListSnapshotBlocks operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
snapshot_id(impl Into<String>)/set_snapshot_id(Option<String>):The ID of the snapshot from which to get block indexes and block tokens.
next_token(impl Into<String>)/set_next_token(Option<String>):The token to request the next page of results.
If you specify NextToken, then StartingBlockIndex is ignored.
max_results(i32)/set_max_results(Option<i32>):The maximum number of blocks to be returned by the request.
Even if additional blocks can be retrieved from the snapshot, the request can return less blocks than MaxResults or an empty array of blocks.
To retrieve the next set of blocks from the snapshot, make another request with the returned NextToken value. The value of NextToken is
nullwhen there are no more blocks to return.starting_block_index(i32)/set_starting_block_index(Option<i32>):The block index from which the list should start. The list in the response will start from this block index or the next valid block index in the snapshot.
If you specify NextToken, then StartingBlockIndex is ignored.
- On success, responds with
ListSnapshotBlocksOutputwith field(s):blocks(Option<Vec<Block>>):An array of objects containing information about the blocks.
expiry_time(Option<DateTime>):The time when the
BlockTokenexpires.volume_size(Option<i64>):The size of the volume in GB.
block_size(Option<i32>):The size of the blocks in the snapshot, in bytes.
next_token(Option<String>):The token to use to retrieve the next page of results. This value is null when there are no more results to return.
- On failure, responds with
SdkError<ListSnapshotBlocksError>
sourcepub fn put_snapshot_block(&self) -> PutSnapshotBlock
pub fn put_snapshot_block(&self) -> PutSnapshotBlock
Constructs a fluent builder for the PutSnapshotBlock operation.
- The fluent builder is configurable:
snapshot_id(impl Into<String>)/set_snapshot_id(Option<String>):The ID of the snapshot.
If the specified snapshot is encrypted, you must have permission to use the KMS key that was used to encrypt the snapshot. For more information, see Using encryption in the Amazon Elastic Compute Cloud User Guide..
block_index(i32)/set_block_index(Option<i32>):The block index of the block in which to write the data. A block index is a logical index in units of
512KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/524288). The logical offset of the data must be512KiB aligned.block_data(ByteStream)/set_block_data(ByteStream):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.
data_length(i32)/set_data_length(Option<i32>):The size of the data to write to the block, in bytes. Currently, the only supported size is
524288bytes.Valid values:
524288progress(i32)/set_progress(Option<i32>):The progress of the write process, as a percentage.
checksum(impl Into<String>)/set_checksum(Option<String>):A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.
checksum_algorithm(ChecksumAlgorithm)/set_checksum_algorithm(Option<ChecksumAlgorithm>):The algorithm used to generate the checksum. Currently, the only supported algorithm is
SHA256.
- On success, responds with
PutSnapshotBlockOutputwith field(s):checksum(Option<String>):The SHA256 checksum generated for the block data by Amazon EBS.
checksum_algorithm(Option<ChecksumAlgorithm>):The algorithm used by Amazon EBS to generate the checksum.
- On failure, responds with
SdkError<PutSnapshotBlockError>
sourcepub fn start_snapshot(&self) -> StartSnapshot
pub fn start_snapshot(&self) -> StartSnapshot
Constructs a fluent builder for the StartSnapshot operation.
- The fluent builder is configurable:
volume_size(i64)/set_volume_size(Option<i64>):The size of the volume, in GiB. The maximum size is
65536GiB (64 TiB).parent_snapshot_id(impl Into<String>)/set_parent_snapshot_id(Option<String>):The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.
You can’t specify ParentSnapshotId and Encrypted in the same request. If you specify both parameters, the request fails with
ValidationException.The encryption status of the snapshot depends on the values that you specify for Encrypted, KmsKeyArn, and ParentSnapshotId, and whether your Amazon Web Services account is enabled for encryption by default. For more information, see Using encryption in the Amazon Elastic Compute Cloud User Guide.
If you specify an encrypted parent snapshot, you must have permission to use the KMS key that was used to encrypt the parent snapshot. For more information, see Permissions to use Key Management Service keys in the Amazon Elastic Compute Cloud User Guide.
tags(Vec<Tag>)/set_tags(Option<Vec<Tag>>):The tags to apply to the snapshot.
description(impl Into<String>)/set_description(Option<String>):A description for the snapshot.
client_token(impl Into<String>)/set_client_token(Option<String>):A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.
If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.
For more information, see Idempotency for StartSnapshot API in the Amazon Elastic Compute Cloud User Guide.
encrypted(bool)/set_encrypted(Option<bool>):Indicates whether to encrypt the snapshot.
You can’t specify Encrypted and ParentSnapshotId in the same request. If you specify both parameters, the request fails with
ValidationException.The encryption status of the snapshot depends on the values that you specify for Encrypted, KmsKeyArn, and ParentSnapshotId, and whether your Amazon Web Services account is enabled for encryption by default. For more information, see Using encryption in the Amazon Elastic Compute Cloud User Guide.
To create an encrypted snapshot, you must have permission to use the KMS key. For more information, see Permissions to use Key Management Service keys in the Amazon Elastic Compute Cloud User Guide.
kms_key_arn(impl Into<String>)/set_kms_key_arn(Option<String>):The Amazon Resource Name (ARN) of the Key Management Service (KMS) key to be used to encrypt the snapshot.
The encryption status of the snapshot depends on the values that you specify for Encrypted, KmsKeyArn, and ParentSnapshotId, and whether your Amazon Web Services account is enabled for encryption by default. For more information, see Using encryption in the Amazon Elastic Compute Cloud User Guide.
To create an encrypted snapshot, you must have permission to use the KMS key. For more information, see Permissions to use Key Management Service keys in the Amazon Elastic Compute Cloud User Guide.
timeout(i32)/set_timeout(Option<i32>):The amount of time (in minutes) after which the snapshot is automatically cancelled if:
-
No blocks are written to the snapshot.
-
The snapshot is not completed after writing the last block of data.
If no value is specified, the timeout defaults to
60minutes.-
- On success, responds with
StartSnapshotOutputwith field(s):description(Option<String>):The description of the snapshot.
snapshot_id(Option<String>):The ID of the snapshot.
owner_id(Option<String>):The Amazon Web Services account ID of the snapshot owner.
status(Option<Status>):The status of the snapshot.
start_time(Option<DateTime>):The timestamp when the snapshot was created.
volume_size(Option<i64>):The size of the volume, in GiB.
block_size(Option<i32>):The size of the blocks in the snapshot, in bytes.
tags(Option<Vec<Tag>>):The tags applied to the snapshot. You can specify up to 50 tags per snapshot. For more information, see Tagging your Amazon EC2 resources in the Amazon Elastic Compute Cloud User Guide.
parent_snapshot_id(Option<String>):The ID of the parent snapshot.
kms_key_arn(Option<String>):The Amazon Resource Name (ARN) of the Key Management Service (KMS) key used to encrypt the snapshot.
- On failure, responds with
SdkError<StartSnapshotError>
sourceimpl Client
impl Client
sourcepub fn from_conf_conn<C, E>(conf: Config, conn: C) -> Selfwhere
C: SmithyConnector<Error = E> + Send + 'static,
E: Into<ConnectorError>,
pub fn from_conf_conn<C, E>(conf: Config, conn: C) -> Selfwhere
C: SmithyConnector<Error = E> + Send + 'static,
E: Into<ConnectorError>,
Creates a client with the given service config and connector override.