rebalanceSlotsInGlobalReplicationGroup method

Future<RebalanceSlotsInGlobalReplicationGroupResult> rebalanceSlotsInGlobalReplicationGroup({
  1. required bool applyImmediately,
  2. required String globalReplicationGroupId,
})

Redistribute slots to ensure uniform distribution across existing shards in the cluster.

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

Parameter applyImmediately : If True, redistribution is applied immediately.

Parameter globalReplicationGroupId : The name of the Global Datastore

Implementation

Future<RebalanceSlotsInGlobalReplicationGroupResult>
    rebalanceSlotsInGlobalReplicationGroup({
  required bool applyImmediately,
  required String globalReplicationGroupId,
}) async {
  ArgumentError.checkNotNull(applyImmediately, 'applyImmediately');
  ArgumentError.checkNotNull(
      globalReplicationGroupId, 'globalReplicationGroupId');
  final $request = <String, dynamic>{};
  $request['ApplyImmediately'] = applyImmediately;
  $request['GlobalReplicationGroupId'] = globalReplicationGroupId;
  final $result = await _protocol.send(
    $request,
    action: 'RebalanceSlotsInGlobalReplicationGroup',
    version: '2015-02-02',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['RebalanceSlotsInGlobalReplicationGroupMessage'],
    shapes: shapes,
    resultWrapper: 'RebalanceSlotsInGlobalReplicationGroupResult',
  );
  return RebalanceSlotsInGlobalReplicationGroupResult.fromXml($result);
}