restoreFromSnapshot method
Restores a namespace from a snapshot.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ValidationException.
Parameter namespaceName :
The name of the namespace to restore the snapshot to.
Parameter workgroupName :
The name of the workgroup used to restore the snapshot.
Parameter adminPasswordSecretKmsKeyId :
The ID of the Key Management Service (KMS) key used to encrypt and store
the namespace's admin credentials secret.
Parameter manageAdminPassword :
If true, Amazon Redshift uses Secrets Manager to manage the
restored snapshot's admin credentials. If
MmanageAdminPassword is false or not set, Amazon Redshift
uses the admin credentials that the namespace or cluster had at the time
the snapshot was taken.
Parameter ownerAccount :
The Amazon Web Services account that owns the snapshot.
Parameter snapshotArn :
The Amazon Resource Name (ARN) of the snapshot to restore from. Required
if restoring from a provisioned cluster to Amazon Redshift Serverless.
Must not be specified at the same time as snapshotName.
The format of the ARN is arn:aws:redshift:<region>:<account_id>:snapshot:<cluster_identifier>/<snapshot_identifier>.
Parameter snapshotName :
The name of the snapshot to restore from. Must not be specified at the
same time as snapshotArn.
Implementation
Future<RestoreFromSnapshotResponse> restoreFromSnapshot({
required String namespaceName,
required String workgroupName,
String? adminPasswordSecretKmsKeyId,
bool? manageAdminPassword,
String? ownerAccount,
String? snapshotArn,
String? snapshotName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'RedshiftServerless.RestoreFromSnapshot'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'namespaceName': namespaceName,
'workgroupName': workgroupName,
if (adminPasswordSecretKmsKeyId != null)
'adminPasswordSecretKmsKeyId': adminPasswordSecretKmsKeyId,
if (manageAdminPassword != null)
'manageAdminPassword': manageAdminPassword,
if (ownerAccount != null) 'ownerAccount': ownerAccount,
if (snapshotArn != null) 'snapshotArn': snapshotArn,
if (snapshotName != null) 'snapshotName': snapshotName,
},
);
return RestoreFromSnapshotResponse.fromJson(jsonResponse.body);
}