createDBSnapshot method
Creates a snapshot of a DB instance. The source DB instance must be in the
available
or storage-optimization
state.
May throw DBSnapshotAlreadyExistsFault. May throw InvalidDBInstanceStateFault. May throw DBInstanceNotFoundFault. May throw SnapshotQuotaExceededFault.
Parameter dBInstanceIdentifier
:
The identifier of the DB instance that you want to create the snapshot of.
Constraints:
- Must match the identifier of an existing DBInstance.
Parameter dBSnapshotIdentifier
:
The identifier for the DB snapshot.
Constraints:
- Can't be null, empty, or blank
- Must contain from 1 to 255 letters, numbers, or hyphens
- First character must be a letter
- Can't end with a hyphen or contain two consecutive hyphens
my-snapshot-id
Implementation
Future<CreateDBSnapshotResult> createDBSnapshot({
required String dBInstanceIdentifier,
required String dBSnapshotIdentifier,
List<Tag>? tags,
}) async {
ArgumentError.checkNotNull(dBInstanceIdentifier, 'dBInstanceIdentifier');
ArgumentError.checkNotNull(dBSnapshotIdentifier, 'dBSnapshotIdentifier');
final $request = <String, dynamic>{};
$request['DBInstanceIdentifier'] = dBInstanceIdentifier;
$request['DBSnapshotIdentifier'] = dBSnapshotIdentifier;
tags?.also((arg) => $request['Tags'] = arg);
final $result = await _protocol.send(
$request,
action: 'CreateDBSnapshot',
version: '2014-10-31',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['CreateDBSnapshotMessage'],
shapes: shapes,
resultWrapper: 'CreateDBSnapshotResult',
);
return CreateDBSnapshotResult.fromXml($result);
}