deleteTape method
Deletes the specified virtual tape. This operation is only supported in the tape gateway type.
May throw InvalidGatewayRequestException. May throw InternalServerError.
Parameter gatewayARN
:
The unique Amazon Resource Name (ARN) of the gateway that the virtual tape
to delete is associated with. Use the ListGateways operation to
return a list of gateways for your account and AWS Region.
Parameter tapeARN
:
The Amazon Resource Name (ARN) of the virtual tape to delete.
Parameter bypassGovernanceRetention
:
Set to TRUE
to delete an archived tape that belongs to a
custom pool with tape retention lock. Only archived tapes with tape
retention lock set to governance
can be deleted. Archived
tapes with tape retention lock set to compliance
can't be
deleted.
Implementation
Future<DeleteTapeOutput> deleteTape({
required String gatewayARN,
required String tapeARN,
bool? bypassGovernanceRetention,
}) 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.DeleteTape'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'GatewayARN': gatewayARN,
'TapeARN': tapeARN,
if (bypassGovernanceRetention != null)
'BypassGovernanceRetention': bypassGovernanceRetention,
},
);
return DeleteTapeOutput.fromJson(jsonResponse.body);
}