aws_sdk_ebs/client/
put_snapshot_block.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`PutSnapshotBlock`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`snapshot_id(impl Into<String>)`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::snapshot_id) / [`set_snapshot_id(Option<String>)`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::set_snapshot_id):<br>required: **true**<br><p>The ID of the snapshot.</p><important>  <p>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 <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebsapis-using-encryption.html"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>..</p> </important><br>
7    ///   - [`block_index(i32)`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::block_index) / [`set_block_index(Option<i32>)`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::set_block_index):<br>required: **true**<br><p>The block index of the block in which to write the data. A block index is a logical index in units of <code>512</code> 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/<code>524288</code>). The logical offset of the data must be <code>512</code> KiB aligned.</p><br>
8    ///   - [`block_data(ByteStream)`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::block_data) / [`set_block_data(ByteStream)`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::set_block_data):<br>required: **true**<br><p>The data to write to the block.</p> <p>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 <b>x-amz-Checksum</b> header. Also, you must specify the checksum algorithm using the <b>x-amz-Checksum-Algorithm</b> 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 <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums"> Using checksums with the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p><br>
9    ///   - [`data_length(i32)`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::data_length) / [`set_data_length(Option<i32>)`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::set_data_length):<br>required: **true**<br><p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code> bytes.</p> <p>Valid values: <code>524288</code></p><br>
10    ///   - [`progress(i32)`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::progress) / [`set_progress(Option<i32>)`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::set_progress):<br>required: **false**<br><p>The progress of the write process, as a percentage.</p><br>
11    ///   - [`checksum(impl Into<String>)`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::checksum) / [`set_checksum(Option<String>)`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::set_checksum):<br>required: **true**<br><p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p><br>
12    ///   - [`checksum_algorithm(ChecksumAlgorithm)`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::checksum_algorithm) / [`set_checksum_algorithm(Option<ChecksumAlgorithm>)`](crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::set_checksum_algorithm):<br>required: **true**<br><p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p><br>
13    /// - On success, responds with [`PutSnapshotBlockOutput`](crate::operation::put_snapshot_block::PutSnapshotBlockOutput) with field(s):
14    ///   - [`checksum(Option<String>)`](crate::operation::put_snapshot_block::PutSnapshotBlockOutput::checksum): <p>The SHA256 checksum generated for the block data by Amazon EBS.</p>
15    ///   - [`checksum_algorithm(Option<ChecksumAlgorithm>)`](crate::operation::put_snapshot_block::PutSnapshotBlockOutput::checksum_algorithm): <p>The algorithm used by Amazon EBS to generate the checksum.</p>
16    /// - On failure, responds with [`SdkError<PutSnapshotBlockError>`](crate::operation::put_snapshot_block::PutSnapshotBlockError)
17    pub fn put_snapshot_block(&self) -> crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder {
18        crate::operation::put_snapshot_block::builders::PutSnapshotBlockFluentBuilder::new(self.handle.clone())
19    }
20}