listChangedBlocks method
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 InternalServerException.
May throw RequestThrottledException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ValidationException.
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 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.
Parameter nextToken :
The token to request the next page of results.
If you specify NextToken, then StartingBlockIndex is ignored.
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.
If you specify NextToken, then StartingBlockIndex is ignored.
Implementation
Future<ListChangedBlocksResponse> listChangedBlocks({
required String secondSnapshotId,
String? firstSnapshotId,
int? maxResults,
String? nextToken,
int? startingBlockIndex,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
100,
10000,
);
_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);
}