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
the
DeleteGlobalReplicationGroupAPI to delete the Global datastore while retainining the primary cluster usingRetainPrimaryReplicationGroup=true.
RetainPrimaryReplicationGroup=true. The primary cluster is
never deleted when deleting a Global Datastore. It can only be deleted
when it no longer is associated with any Global Datastore.
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 {
final $request = <String, String>{
'GlobalReplicationGroupId': globalReplicationGroupId,
'RetainPrimaryReplicationGroup': retainPrimaryReplicationGroup.toString(),
};
final $result = await _protocol.send(
$request,
action: 'DeleteGlobalReplicationGroup',
version: '2015-02-02',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'DeleteGlobalReplicationGroupResult',
);
return DeleteGlobalReplicationGroupResult.fromXml($result);
}