Struct aws_sdk_ebs::client::Client
source · [−]pub struct Client<C = DynConnector, M = DefaultMiddleware, R = Standard> { /* 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::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
impl<C, M, R> Client<C, M, R> where
C: SmithyConnector,
M: SmithyMiddleware<C>,
R: NewRequestPolicy,
impl<C, M, R> Client<C, M, R> where
C: SmithyConnector,
M: SmithyMiddleware<C>,
R: NewRequestPolicy,
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
CompleteSnapshotOutput
with field(s):status(Option<Status>)
:The status of the snapshot.
- On failure, responds with
SdkError<CompleteSnapshotError>
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.
block_index(i32)
/set_block_index(Option<i32>)
:The block index of the block from which to get data.
Obtain the
BlockIndex
by running theListChangedBlocks
orListSnapshotBlocks
operations.block_token(impl Into<String>)
/set_block_token(Option<String>)
:The block token of the block from which to get data.
Obtain the
BlockToken
by running theListChangedBlocks
orListSnapshotBlocks
operations.
- On success, responds with
GetSnapshotBlockOutput
with field(s):data_length(Option<i32>)
:The size of the data in the block.
block_data(byte_stream::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>
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
FirstSnapshotID
parameter must be specified with aSecondSnapshotId
parameter; 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
SecondSnapshotId
parameter must be specified with aFirstSnapshotID
parameter; otherwise, an error occurs.next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token to request the next page of results.
max_results(i32)
/set_max_results(Option<i32>)
:The number of results 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.
- On success, responds with
ListChangedBlocksOutput
with 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
BlockToken
expires.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>
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.
max_results(i32)
/set_max_results(Option<i32>)
:The number of results 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.
- On success, responds with
ListSnapshotBlocksOutput
with field(s):blocks(Option<Vec<Block>>)
:An array of objects containing information about the blocks.
expiry_time(Option<DateTime>)
:The time when the
BlockToken
expires.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>
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.
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
512
KiB 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 be512
KiB aligned.block_data(byte_stream::ByteStream)
/set_block_data(byte_stream::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
524288
bytes.Valid values:
524288
progress(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
PutSnapshotBlockOutput
with 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>
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
65536
GiB (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.
If your account is enabled for encryption by default, you cannot use an unencrypted snapshot as a parent snapshot. You must first create an encrypted copy of the parent snapshot using CopySnapshot.
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. To create an encrypted snapshot, specify
true
. To create an unencrypted snapshot, omit this parameter.If you specify a value for ParentSnapshotId, omit this parameter.
If you specify
true
, the snapshot is encrypted using the KMS key specified using the KmsKeyArn parameter. If no value is specified for KmsKeyArn, the default KMS key for your account is used. If no default KMS key has been specified for your account, the Amazon Web Services managed KMS key is used. To set a default KMS key for your account, use ModifyEbsDefaultKmsKeyId.If your account is enabled for encryption by default, you cannot set this parameter to
false
. In this case, you can omit this parameter.For more information, see Using encryption 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. If you do not specify a KMS key, the default Amazon Web Services managed KMS key is used.
If you specify a ParentSnapshotId, omit this parameter; the snapshot will be encrypted using the same KMS key that was used to encrypt the parent snapshot.
If Encrypted is set to
true
, you must specify a KMS key ARN.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
60
minutes.-
- On success, responds with
StartSnapshotOutput
with 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>
Creates a client with the given service config and connector override.
Trait Implementations
Auto Trait Implementations
impl<C = DynConnector, M = DefaultMiddleware, R = Standard> !RefUnwindSafe for Client<C, M, R>
impl<C = DynConnector, M = DefaultMiddleware, R = Standard> !UnwindSafe for Client<C, M, R>
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more