listSnapshotBlocks method

Future<ListSnapshotBlocksResponse> listSnapshotBlocks({
  1. required String snapshotId,
  2. int? maxResults,
  3. String? nextToken,
  4. int? startingBlockIndex,
})

Returns information about the blocks in an Amazon Elastic Block Store snapshot.

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

Parameter snapshotId : The ID of the snapshot from which to get block indexes and block tokens.

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 list should start. The list in the response will start from this block index or the next valid block index in the snapshot.

Implementation

Future<ListSnapshotBlocksResponse> listSnapshotBlocks({
  required String snapshotId,
  int? maxResults,
  String? nextToken,
  int? startingBlockIndex,
}) async {
  ArgumentError.checkNotNull(snapshotId, 'snapshotId');
  _s.validateStringLength(
    'snapshotId',
    snapshotId,
    1,
    64,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    100,
    10000,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    256,
  );
  _s.validateNumRange(
    'startingBlockIndex',
    startingBlockIndex,
    0,
    1152921504606846976,
  );
  final $query = <String, List<String>>{
    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(snapshotId)}/blocks',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListSnapshotBlocksResponse.fromJson(response);
}