/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the ebs-2019-11-02.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
namespace Amazon.EBS.Model
{
///
/// Container for the parameters to the PutSnapshotBlock operation.
/// 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.
///
///
///
public partial class PutSnapshotBlockRequest : AmazonEBSRequest
{
private Stream _blockData;
private int? _blockIndex;
private string _checksum;
private ChecksumAlgorithm _checksumAlgorithm;
private int? _dataLength;
private int? _progress;
private string _snapshotId;
///
/// Gets and sets the property BlockData.
///
/// 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.
///
///
[AWSProperty(Required=true, Sensitive=true)]
public Stream BlockData
{
get { return this._blockData; }
set { this._blockData = value; }
}
// Check to see if BlockData property is set
internal bool IsSetBlockData()
{
return this._blockData != null;
}
///
/// Gets and sets the property BlockIndex.
///
/// 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 be 512
/// KiB aligned.
///
///
[AWSProperty(Required=true, Min=0)]
public int BlockIndex
{
get { return this._blockIndex.GetValueOrDefault(); }
set { this._blockIndex = value; }
}
// Check to see if BlockIndex property is set
internal bool IsSetBlockIndex()
{
return this._blockIndex.HasValue;
}
///
/// Gets and sets the property Checksum.
///
/// A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.
///
///
[AWSProperty(Required=true, Max=64)]
public string Checksum
{
get { return this._checksum; }
set { this._checksum = value; }
}
// Check to see if Checksum property is set
internal bool IsSetChecksum()
{
return this._checksum != null;
}
///
/// Gets and sets the property ChecksumAlgorithm.
///
/// The algorithm used to generate the checksum. Currently, the only supported algorithm
/// is SHA256
.
///
///
[AWSProperty(Required=true, Max=32)]
public ChecksumAlgorithm ChecksumAlgorithm
{
get { return this._checksumAlgorithm; }
set { this._checksumAlgorithm = value; }
}
// Check to see if ChecksumAlgorithm property is set
internal bool IsSetChecksumAlgorithm()
{
return this._checksumAlgorithm != null;
}
///
/// Gets and sets the property DataLength.
///
/// The size of the data to write to the block, in bytes. Currently, the only supported
/// size is 524288
bytes.
///
///
///
/// Valid values: 524288
///
///
[AWSProperty(Required=true)]
public int DataLength
{
get { return this._dataLength.GetValueOrDefault(); }
set { this._dataLength = value; }
}
// Check to see if DataLength property is set
internal bool IsSetDataLength()
{
return this._dataLength.HasValue;
}
///
/// Gets and sets the property Progress.
///
/// The progress of the write process, as a percentage.
///
///
[AWSProperty(Min=0, Max=100)]
public int Progress
{
get { return this._progress.GetValueOrDefault(); }
set { this._progress = value; }
}
// Check to see if Progress property is set
internal bool IsSetProgress()
{
return this._progress.HasValue;
}
///
/// Gets and sets the property SnapshotId.
///
/// 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..
///
///
///
[AWSProperty(Required=true, Min=1, Max=64)]
public string SnapshotId
{
get { return this._snapshotId; }
set { this._snapshotId = value; }
}
// Check to see if SnapshotId property is set
internal bool IsSetSnapshotId()
{
return this._snapshotId != null;
}
///
/// Get the signer to use for this request.
///
/// A signer for this request.
override protected AbstractAWSSigner CreateSigner()
{
return new AWS4Signer(false);
}
}
}