listChangedBlocks method

Future<ListChangedBlocksResponse> listChangedBlocks({
  1. required String secondSnapshotId,
  2. String? firstSnapshotId,
  3. int? maxResults,
  4. String? nextToken,
  5. int? startingBlockIndex,
})

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

May throw AccessDeniedException. May throw ValidationException. May throw ResourceNotFoundException. May throw RequestThrottledException. May throw ServiceQuotaExceededException. May throw InternalServerException.

Parameter secondSnapshotId : The ID of the second snapshot to use for the comparison.

Parameter firstSnapshotId : The ID of the first snapshot to use for the comparison.

Parameter maxResults : The number of results to return.

Parameter nextToken : The token to request the next page of results.

Parameter startingBlockIndex : 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.

Implementation

Future<ListChangedBlocksResponse> listChangedBlocks({
  required String secondSnapshotId,
  String? firstSnapshotId,
  int? maxResults,
  String? nextToken,
  int? startingBlockIndex,
}) async {
  ArgumentError.checkNotNull(secondSnapshotId, 'secondSnapshotId');
  _s.validateStringLength(
    'secondSnapshotId',
    secondSnapshotId,
    1,
    64,
    isRequired: true,
  );
  _s.validateStringLength(
    'firstSnapshotId',
    firstSnapshotId,
    1,
    64,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    100,
    10000,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    256,
  );
  _s.validateNumRange(
    'startingBlockIndex',
    startingBlockIndex,
    0,
    1152921504606846976,
  );
  final $query = <String, List<String>>{
    if (firstSnapshotId != null) 'firstSnapshotId': [firstSnapshotId],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'pageToken': [nextToken],
    if (startingBlockIndex != null)
      'startingBlockIndex': [startingBlockIndex.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/snapshots/${Uri.encodeComponent(secondSnapshotId)}/changedblocks',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListChangedBlocksResponse.fromJson(response);
}