deleteGlobalReplicationGroup method
Deleting a Global Datastore is a two-step process:
- First, you must DisassociateGlobalReplicationGroup to remove the secondary clusters in the Global Datastore.
- Once the Global Datastore contains only the primary cluster, you can use DeleteGlobalReplicationGroup API to delete the Global Datastore while retainining the primary cluster using Retain…= true.
RetainPrimaryCluster=true
.
When you receive a successful response from this operation, Amazon ElastiCache immediately begins deleting the selected resources; you cannot cancel or revert this operation.
May throw GlobalReplicationGroupNotFoundFault. May throw InvalidGlobalReplicationGroupStateFault. May throw InvalidParameterValueException.
Parameter globalReplicationGroupId
:
The name of the Global Datastore
Parameter retainPrimaryReplicationGroup
:
The primary replication group is retained as a standalone replication
group.
Implementation
Future<DeleteGlobalReplicationGroupResult> deleteGlobalReplicationGroup({
required String globalReplicationGroupId,
required bool retainPrimaryReplicationGroup,
}) async {
ArgumentError.checkNotNull(
globalReplicationGroupId, 'globalReplicationGroupId');
ArgumentError.checkNotNull(
retainPrimaryReplicationGroup, 'retainPrimaryReplicationGroup');
final $request = <String, dynamic>{};
$request['GlobalReplicationGroupId'] = globalReplicationGroupId;
$request['RetainPrimaryReplicationGroup'] = retainPrimaryReplicationGroup;
final $result = await _protocol.send(
$request,
action: 'DeleteGlobalReplicationGroup',
version: '2015-02-02',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['DeleteGlobalReplicationGroupMessage'],
shapes: shapes,
resultWrapper: 'DeleteGlobalReplicationGroupResult',
);
return DeleteGlobalReplicationGroupResult.fromXml($result);
}