increaseReplicaCount method
Dynamically increases the number of replicas in a Valkey or Redis OSS (cluster mode disabled) replication group or the number of replica nodes in one or more node groups (shards) of a Valkey or Redis OSS (cluster mode enabled) replication group. This operation is performed with no cluster down time.
May throw ClusterQuotaForCustomerExceededFault.
May throw InsufficientCacheClusterCapacityFault.
May throw InvalidCacheClusterStateFault.
May throw InvalidKMSKeyFault.
May throw InvalidParameterCombinationException.
May throw InvalidParameterValueException.
May throw InvalidReplicationGroupStateFault.
May throw InvalidVPCNetworkStateFault.
May throw NodeGroupsPerReplicationGroupQuotaExceededFault.
May throw NodeQuotaForCustomerExceededFault.
May throw NoOperationFault.
May throw ReplicationGroupNotFoundFault.
Parameter applyImmediately :
If True, the number of replica nodes is increased
immediately. ApplyImmediately=False is not currently
supported.
Parameter replicationGroupId :
The id of the replication group to which you want to add replica nodes.
Parameter newReplicaCount :
The number of read replica nodes you want at the completion of this
operation. For Valkey or Redis OSS (cluster mode disabled) replication
groups, this is the number of replica nodes in the replication group. For
Valkey or Redis OSS (cluster mode enabled) replication groups, this is the
number of replica nodes in each of the replication group's node groups.
Parameter replicaConfiguration :
A list of ConfigureShard objects that can be used to
configure each shard in a Valkey or Redis OSS (cluster mode enabled)
replication group. The ConfigureShard has three members:
NewReplicaCount, NodeGroupId, and
PreferredAvailabilityZones.
Implementation
Future<IncreaseReplicaCountResult> increaseReplicaCount({
required bool applyImmediately,
required String replicationGroupId,
int? newReplicaCount,
List<ConfigureShard>? replicaConfiguration,
}) async {
final $request = <String, String>{
'ApplyImmediately': applyImmediately.toString(),
'ReplicationGroupId': replicationGroupId,
if (newReplicaCount != null)
'NewReplicaCount': newReplicaCount.toString(),
if (replicaConfiguration != null)
if (replicaConfiguration.isEmpty)
'ReplicaConfiguration': ''
else
for (var i1 = 0; i1 < replicaConfiguration.length; i1++)
for (var e3 in replicaConfiguration[i1].toQueryMap().entries)
'ReplicaConfiguration.ConfigureShard.${i1 + 1}.${e3.key}':
e3.value,
};
final $result = await _protocol.send(
$request,
action: 'IncreaseReplicaCount',
version: '2015-02-02',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'IncreaseReplicaCountResult',
);
return IncreaseReplicaCountResult.fromXml($result);
}