put_snapshot_block
¶
put_snapshot_block(
snapshot_id: SnapshotId,
block_index: BlockIndex,
block_data: Body[Iterator[bytes]] | Iterator[bytes] | bytes,
data_length: DataLength,
checksum: Checksum,
checksum_algorithm: ChecksumAlgorithm,
*,
config_overrides: Optional[EBSClientConfig] = None,
progress: Optional[Progress] = None,
) -> PutSnapshotBlockResponse
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.
Parameters:
-
snapshot_id(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..
-
block_index(BlockIndex) –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(Body[Iterator[bytes]] | Iterator[bytes] | bytes) –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(DataLength) –The size of the data to write to the block, in bytes. Currently, the only supported size is
524288bytes.Valid values:
524288 -
progress(Optional[Progress], default:None) –The progress of the write process, as a percentage.
-
checksum(Checksum) –A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.
-
checksum_algorithm(ChecksumAlgorithm) –The algorithm used to generate the checksum. Currently, the only supported algorithm is
SHA256.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action.
-
InternalServerException–An internal error has occurred. For more information see Error retries.
-
RequestThrottledException–The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.
-
ResourceNotFoundException–The specified resource does not exist.
-
ServiceQuotaExceededException–Your current service quotas do not allow you to perform this action.
-
ValidationException–The input fails to satisfy the constraints of the EBS direct APIs.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ebs/_services/ebs.py
510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 | |