createTapePool method
Creates a new custom tape pool. You can use custom tape pool to enable tape retention lock on tapes that are archived in the custom pool.
May throw InternalServerError.
May throw InvalidGatewayRequestException.
Parameter poolName :
The name of the new custom tape pool.
Parameter storageClass :
The storage class that is associated with the new custom pool. When you
use your backup application to eject the tape, the tape is archived
directly into the storage class (S3 Glacier or S3 Glacier Deep Archive)
that corresponds to the pool.
Parameter retentionLockTimeInDays :
Tape retention lock time is set in days. Tape retention lock can be
enabled for up to 100 years (36,500 days).
Parameter retentionLockType :
Tape retention lock can be configured in two modes. When configured in
governance mode, Amazon Web Services accounts with specific IAM
permissions are authorized to remove the tape retention lock from archived
virtual tapes. When configured in compliance mode, the tape retention lock
cannot be removed by any user, including the root Amazon Web Services
account.
Parameter tags :
A list of up to 50 tags that can be assigned to tape pool. Each tag is a
key-value pair.
Implementation
Future<CreateTapePoolOutput> createTapePool({
required String poolName,
required TapeStorageClass storageClass,
int? retentionLockTimeInDays,
RetentionLockType? retentionLockType,
List<Tag>? tags,
}) async {
_s.validateNumRange(
'retentionLockTimeInDays',
retentionLockTimeInDays,
0,
36500,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'StorageGateway_20130630.CreateTapePool'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'PoolName': poolName,
'StorageClass': storageClass.value,
if (retentionLockTimeInDays != null)
'RetentionLockTimeInDays': retentionLockTimeInDays,
if (retentionLockType != null)
'RetentionLockType': retentionLockType.value,
if (tags != null) 'Tags': tags,
},
);
return CreateTapePoolOutput.fromJson(jsonResponse.body);
}