Skip to content

list_changed_blocks async

list_changed_blocks(
    second_snapshot_id: SnapshotId,
    *,
    config_overrides: Optional[AsyncEBSClientConfig] = None,
    first_snapshot_id: Optional[SnapshotId] = None,
    next_token: Optional[PageToken] = None,
    max_results: Optional[MaxResults] = None,
    starting_block_index: Optional[BlockIndex] = None,
) -> ListChangedBlocksResponse

Returns information about the blocks that are different between two Amazon Elastic Block Store snapshots of the same volume/snapshot lineage.

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:

  • first_snapshot_id (Optional[SnapshotId], default: None ) –

    The ID of the first snapshot to use for the comparison.

    The FirstSnapshotID parameter must be specified with a SecondSnapshotId parameter; otherwise, an error occurs.

  • second_snapshot_id (SnapshotId) –

    The ID of the second snapshot to use for the comparison.

    The SecondSnapshotId parameter must be specified with a FirstSnapshotID parameter; otherwise, an error occurs.

  • next_token (Optional[PageToken], default: None ) –

    The token to request the next page of results.

    If you specify NextToken, then StartingBlockIndex is ignored.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of blocks to be returned by the request.

    Even if additional blocks can be retrieved from the snapshot, the request can return less blocks than MaxResults or an empty array of blocks.

    To retrieve the next set of blocks from the snapshot, make another request with the returned NextToken value. The value of NextToken is null when there are no more blocks to return.

  • starting_block_index (Optional[BlockIndex], default: None ) –

    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.

    If you specify NextToken, then StartingBlockIndex is ignored.

Raises:

Source code in docs_src/capo_ebs/_services/async_ebs.py
async def list_changed_blocks(
    self,
    second_snapshot_id: "capo_ebs.types.snapshot_id.SnapshotId",
    *,
    config_overrides: Optional[AsyncEBSClientConfig] = None,
    first_snapshot_id: Optional["capo_ebs.types.snapshot_id.SnapshotId"] = None,
    next_token: Optional["capo_ebs.types.page_token.PageToken"] = None,
    max_results: Optional["capo_ebs.types.max_results.MaxResults"] = None,
    starting_block_index: Optional["capo_ebs.types.block_index.BlockIndex"] = None,
) -> "capo_ebs.types.list_changed_blocks_response.ListChangedBlocksResponse":
    """<p>Returns information about the blocks that are different between two Amazon Elastic Block Store snapshots of the same volume/snapshot lineage.</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:
        first_snapshot_id: <p>The ID of the first snapshot to use for the comparison.</p> <important> <p>The <code>FirstSnapshotID</code> parameter must be specified with a <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p> </important>
        second_snapshot_id: <p>The ID of the second snapshot to use for the comparison.</p> <important> <p>The <code>SecondSnapshotId</code> parameter must be specified with a <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p> </important>
        next_token: <p>The token to request the next page of results.</p> <p>If you specify <b>NextToken</b>, then <b>StartingBlockIndex</b> is ignored.</p>
        max_results: <p>The maximum number of blocks to be returned by the request.</p> <p>Even if additional blocks can be retrieved from the snapshot, the request can return less blocks than <b>MaxResults</b> or an empty array of blocks.</p> <p>To retrieve the next set of blocks from the snapshot, make another request with the returned <b>NextToken</b> value. The value of <b>NextToken</b> is <code>null</code> when there are no more blocks to return.</p>
        starting_block_index: <p>The block index from which the comparison should start.</p> <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p> <p>If you specify <b>NextToken</b>, then <b>StartingBlockIndex</b> is ignored.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ebs.types.list_changed_blocks_request.ListChangedBlocksRequest]",
    ) -> AsyncOperationResponse[
        "capo_ebs.types.list_changed_blocks_response.ListChangedBlocksResponse"
    ]:
        import capo_ebs._operations.ebs.list_changed_blocks

        (
            output,
            http_response,
        ) = await capo_ebs._operations.ebs.list_changed_blocks.async_list_changed_blocks(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_ebs.types.list_changed_blocks_response.ListChangedBlocksResponse",
    ) -> dict[str, Any]:
        import capo_ebs.types.list_changed_blocks_response

        return capo_ebs.types.list_changed_blocks_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListChangedBlocks", redact_output=_redact_output),
    )
    input_: capo_ebs.types.list_changed_blocks_request.ListChangedBlocksRequest = {
        "second_snapshot_id": second_snapshot_id
    }
    if first_snapshot_id is not None:
        input_["first_snapshot_id"] = first_snapshot_id
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if starting_block_index is not None:
        input_["starting_block_index"] = starting_block_index

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output