Seals and completes the snapshot after all of the required blocks of data have been written to it. Completing the snapshot changes the status to completed. You cannot write new blocks to a snapshot after it has been completed.
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)
–
-
changed_blocks_count
(ChangedBlocksCount)
–
The number of blocks that were written to the snapshot.
-
checksum
(Optional[Checksum], default:
None
)
–
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
(Optional[ChecksumAlgorithm], default:
None
)
–
The algorithm used to generate the checksum. Currently, the only supported algorithm is SHA256.
-
checksum_aggregation_method
(Optional[ChecksumAggregationMethod], default:
None
)
–
The aggregation method used to generate the checksum. Currently, the only supported aggregation method is LINEAR.
Raises:
Source code in docs_src/capo_ebs/_services/ebs.py
| def complete_snapshot(
self,
snapshot_id: "capo_ebs.types.snapshot_id.SnapshotId",
changed_blocks_count: "capo_ebs.types.changed_blocks_count.ChangedBlocksCount",
*,
config_overrides: Optional[EBSClientConfig] = None,
checksum: Optional["capo_ebs.types.checksum.Checksum"] = None,
checksum_algorithm: Optional[
"capo_ebs.types.checksum_algorithm.ChecksumAlgorithm"
] = None,
checksum_aggregation_method: Optional[
"capo_ebs.types.checksum_aggregation_method.ChecksumAggregationMethod"
] = None,
) -> "capo_ebs.types.complete_snapshot_response.CompleteSnapshotResponse":
"""<p>Seals and completes the snapshot after all of the required blocks of data have been written to it. Completing the snapshot changes the status to <code>completed</code>. You cannot write new blocks to a snapshot after it has been completed.</p> <note> <p>You should always retry requests that receive server (<code>5xx</code>) error responses, and <code>ThrottlingException</code> and <code>RequestThrottledException</code> client error responses. For more information see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/error-retries.html">Error retries</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p> </note>
Args:
snapshot_id: <p>The ID of the snapshot.</p>
changed_blocks_count: <p>The number of blocks that were written to the snapshot.</p>
checksum: <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p> <p>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.</p>
checksum_algorithm: <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
checksum_aggregation_method: <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
Raises:
capo_ebs.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_ebs.errors.internal_server_exception.InternalServerException: <p>An internal error has occurred. For more information see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/error-retries.html">Error retries</a>.</p>
capo_ebs.errors.request_throttled_exception.RequestThrottledException: <p>The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/error-retries.html">Error retries</a>.</p>
capo_ebs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
capo_ebs.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Your current service quotas do not allow you to perform this action.</p>
capo_ebs.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints of the EBS direct APIs.</p>
capo_ebs.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_ebs.types.complete_snapshot_request.CompleteSnapshotRequest]",
) -> OperationResponse[
"capo_ebs.types.complete_snapshot_response.CompleteSnapshotResponse"
]:
import capo_ebs._operations.ebs.complete_snapshot
output, http_response = (
capo_ebs._operations.ebs.complete_snapshot.complete_snapshot(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CompleteSnapshot")
)
input_: capo_ebs.types.complete_snapshot_request.CompleteSnapshotRequest = {
"snapshot_id": snapshot_id,
"changed_blocks_count": changed_blocks_count,
}
if checksum is not None:
input_["checksum"] = checksum
if checksum_algorithm is not None:
input_["checksum_algorithm"] = checksum_algorithm
if checksum_aggregation_method is not None:
input_["checksum_aggregation_method"] = checksum_aggregation_method
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|