describeTapes method

Future<DescribeTapesOutput> describeTapes({
  1. required String gatewayARN,
  2. int? limit,
  3. String? marker,
  4. List<String>? tapeARNs,
})

Returns a description of virtual tapes that correspond to the specified Amazon Resource Names (ARNs). If TapeARN is not specified, returns a description of the virtual tapes associated with the specified gateway. This operation is only supported for the tape gateway type.

The operation supports pagination. By default, the operation returns a maximum of up to 100 tapes. You can optionally specify the Limit field in the body to limit the number of tapes in the response. If the number of tapes returned in the response is truncated, the response includes a Marker field. You can use this Marker value in your subsequent request to retrieve the next set of tapes.

May throw InternalServerError. May throw InvalidGatewayRequestException.

Parameter limit : Specifies that the number of virtual tapes described be limited to the specified number.

Parameter marker : A marker value, obtained in a previous call to DescribeTapes. This marker indicates which page of results to retrieve.

If not specified, the first page of results is retrieved.

Parameter tapeARNs : Specifies one or more unique Amazon Resource Names (ARNs) that represent the virtual tapes you want to describe. If this parameter is not specified, Tape gateway returns a description of all virtual tapes associated with the specified gateway.

Implementation

Future<DescribeTapesOutput> describeTapes({
  required String gatewayARN,
  int? limit,
  String? marker,
  List<String>? tapeARNs,
}) async {
  _s.validateNumRange(
    'limit',
    limit,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StorageGateway_20130630.DescribeTapes'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'GatewayARN': gatewayARN,
      if (limit != null) 'Limit': limit,
      if (marker != null) 'Marker': marker,
      if (tapeARNs != null) 'TapeARNs': tapeARNs,
    },
  );

  return DescribeTapesOutput.fromJson(jsonResponse.body);
}