retrieveTapeArchive method

Future<RetrieveTapeArchiveOutput> retrieveTapeArchive({
  1. required String gatewayARN,
  2. required String tapeARN,
})

Retrieves an archived virtual tape from the virtual tape shelf (VTS) to a tape gateway. Virtual tapes archived in the VTS are not associated with any gateway. However after a tape is retrieved, it is associated with a gateway, even though it is also listed in the VTS, that is, archive. This operation is only supported in the tape gateway type.

Once a tape is successfully retrieved to a gateway, it cannot be retrieved again to another gateway. You must archive the tape again before you can retrieve it to another gateway. This operation is only supported in the tape gateway type.

May throw InvalidGatewayRequestException. May throw InternalServerError.

Parameter gatewayARN : The Amazon Resource Name (ARN) of the gateway you want to retrieve the virtual tape to. Use the ListGateways operation to return a list of gateways for your account and AWS Region.

You retrieve archived virtual tapes to only one gateway and the gateway must be a tape gateway.

Parameter tapeARN : The Amazon Resource Name (ARN) of the virtual tape you want to retrieve from the virtual tape shelf (VTS).

Implementation

Future<RetrieveTapeArchiveOutput> retrieveTapeArchive({
  required String gatewayARN,
  required String tapeARN,
}) async {
  ArgumentError.checkNotNull(gatewayARN, 'gatewayARN');
  _s.validateStringLength(
    'gatewayARN',
    gatewayARN,
    50,
    500,
    isRequired: true,
  );
  ArgumentError.checkNotNull(tapeARN, 'tapeARN');
  _s.validateStringLength(
    'tapeARN',
    tapeARN,
    50,
    500,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StorageGateway_20130630.RetrieveTapeArchive'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'GatewayARN': gatewayARN,
      'TapeARN': tapeARN,
    },
  );

  return RetrieveTapeArchiveOutput.fromJson(jsonResponse.body);
}