decreaseNodeGroupsInGlobalReplicationGroup method
Decreases the number of node groups in a Global Datastore
May throw GlobalReplicationGroupNotFoundFault. May throw InvalidGlobalReplicationGroupStateFault. May throw InvalidParameterValueException. May throw InvalidParameterCombinationException.
Parameter applyImmediately
:
Indicates that the shard reconfiguration process begins immediately. At
present, the only permitted value for this parameter is true.
Parameter globalReplicationGroupId
:
The name of the Global Datastore
Parameter nodeGroupCount
:
The number of node groups (shards) that results from the modification of
the shard configuration
Parameter globalNodeGroupsToRemove
:
If the value of NodeGroupCount is less than the current number of node
groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is
required. NodeGroupsToRemove is a list of NodeGroupIds to remove from the
cluster. ElastiCache for Redis will attempt to remove all node groups
listed by NodeGroupsToRemove from the cluster.
Parameter globalNodeGroupsToRetain
:
If the value of NodeGroupCount is less than the current number of node
groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is
required. NodeGroupsToRemove is a list of NodeGroupIds to remove from the
cluster. ElastiCache for Redis will attempt to remove all node groups
listed by NodeGroupsToRemove from the cluster.
Implementation
Future<DecreaseNodeGroupsInGlobalReplicationGroupResult>
decreaseNodeGroupsInGlobalReplicationGroup({
required bool applyImmediately,
required String globalReplicationGroupId,
required int nodeGroupCount,
List<String>? globalNodeGroupsToRemove,
List<String>? globalNodeGroupsToRetain,
}) async {
ArgumentError.checkNotNull(applyImmediately, 'applyImmediately');
ArgumentError.checkNotNull(
globalReplicationGroupId, 'globalReplicationGroupId');
ArgumentError.checkNotNull(nodeGroupCount, 'nodeGroupCount');
final $request = <String, dynamic>{};
$request['ApplyImmediately'] = applyImmediately;
$request['GlobalReplicationGroupId'] = globalReplicationGroupId;
$request['NodeGroupCount'] = nodeGroupCount;
globalNodeGroupsToRemove
?.also((arg) => $request['GlobalNodeGroupsToRemove'] = arg);
globalNodeGroupsToRetain
?.also((arg) => $request['GlobalNodeGroupsToRetain'] = arg);
final $result = await _protocol.send(
$request,
action: 'DecreaseNodeGroupsInGlobalReplicationGroup',
version: '2015-02-02',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['DecreaseNodeGroupsInGlobalReplicationGroupMessage'],
shapes: shapes,
resultWrapper: 'DecreaseNodeGroupsInGlobalReplicationGroupResult',
);
return DecreaseNodeGroupsInGlobalReplicationGroupResult.fromXml($result);
}