failoverGlobalReplicationGroup method

Future<FailoverGlobalReplicationGroupResult> failoverGlobalReplicationGroup({
  1. required String globalReplicationGroupId,
  2. required String primaryRegion,
  3. required String primaryReplicationGroupId,
})

Used to failover the primary region to a selected secondary region. The selected secondary region will become primary, and all other clusters will become secondary.

May throw GlobalReplicationGroupNotFoundFault. May throw InvalidGlobalReplicationGroupStateFault. May throw InvalidParameterValueException. May throw InvalidParameterCombinationException.

Parameter globalReplicationGroupId : The name of the Global Datastore

Parameter primaryRegion : The AWS region of the primary cluster of the Global Datastore

Parameter primaryReplicationGroupId : The name of the primary replication group

Implementation

Future<FailoverGlobalReplicationGroupResult> failoverGlobalReplicationGroup({
  required String globalReplicationGroupId,
  required String primaryRegion,
  required String primaryReplicationGroupId,
}) async {
  ArgumentError.checkNotNull(
      globalReplicationGroupId, 'globalReplicationGroupId');
  ArgumentError.checkNotNull(primaryRegion, 'primaryRegion');
  ArgumentError.checkNotNull(
      primaryReplicationGroupId, 'primaryReplicationGroupId');
  final $request = <String, dynamic>{};
  $request['GlobalReplicationGroupId'] = globalReplicationGroupId;
  $request['PrimaryRegion'] = primaryRegion;
  $request['PrimaryReplicationGroupId'] = primaryReplicationGroupId;
  final $result = await _protocol.send(
    $request,
    action: 'FailoverGlobalReplicationGroup',
    version: '2015-02-02',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['FailoverGlobalReplicationGroupMessage'],
    shapes: shapes,
    resultWrapper: 'FailoverGlobalReplicationGroupResult',
  );
  return FailoverGlobalReplicationGroupResult.fromXml($result);
}