createDBClusterSnapshot method
Creates a snapshot of a cluster.
May throw DBClusterNotFoundFault.
May throw DBClusterSnapshotAlreadyExistsFault.
May throw InvalidDBClusterSnapshotStateFault.
May throw InvalidDBClusterStateFault.
May throw SnapshotQuotaExceededFault.
Parameter dBClusterIdentifier :
The identifier of the cluster to create a snapshot for. This parameter is
not case sensitive.
Constraints:
-
Must match the identifier of an existing
DBCluster.
my-cluster
Parameter dBClusterSnapshotIdentifier :
The identifier of the cluster snapshot. This parameter is stored as a
lowercase string.
Constraints:
- Must contain from 1 to 63 letters, numbers, or hyphens.
- The first character must be a letter.
- Cannot end with a hyphen or contain two consecutive hyphens.
my-cluster-snapshot1
Parameter tags :
The tags to be assigned to the cluster snapshot.
Implementation
Future<CreateDBClusterSnapshotResult> createDBClusterSnapshot({
required String dBClusterIdentifier,
required String dBClusterSnapshotIdentifier,
List<Tag>? tags,
}) async {
final $request = <String, String>{
'DBClusterIdentifier': dBClusterIdentifier,
'DBClusterSnapshotIdentifier': dBClusterSnapshotIdentifier,
if (tags != null)
if (tags.isEmpty)
'Tags': ''
else
for (var i1 = 0; i1 < tags.length; i1++)
for (var e3 in tags[i1].toQueryMap().entries)
'Tags.Tag.${i1 + 1}.${e3.key}': e3.value,
};
final $result = await _protocol.send(
$request,
action: 'CreateDBClusterSnapshot',
version: '2014-10-31',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'CreateDBClusterSnapshotResult',
);
return CreateDBClusterSnapshotResult.fromXml($result);
}