createSnapshot method
Creates a snapshot of all databases in a namespace. For more information about snapshots, see Working with snapshots and recovery points.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw TooManyTagsException.
May throw ValidationException.
Parameter namespaceName :
The namespace to create a snapshot for.
Parameter snapshotName :
The name of the snapshot.
Parameter retentionPeriod :
How long to retain the created snapshot.
Parameter tags :
An array of Tag
objects to associate with the snapshot.
Implementation
Future<CreateSnapshotResponse> createSnapshot({
required String namespaceName,
required String snapshotName,
int? retentionPeriod,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'RedshiftServerless.CreateSnapshot'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'namespaceName': namespaceName,
'snapshotName': snapshotName,
if (retentionPeriod != null) 'retentionPeriod': retentionPeriod,
if (tags != null) 'tags': tags,
},
);
return CreateSnapshotResponse.fromJson(jsonResponse.body);
}