increaseReplicaCount method

Future<IncreaseReplicaCountResult> increaseReplicaCount({
  1. required bool applyImmediately,
  2. required String replicationGroupId,
  3. int? newReplicaCount,
  4. List<ConfigureShard>? replicaConfiguration,
})

Dynamically increases the number of replics in a Redis (cluster mode disabled) replication group or the number of replica nodes in one or more node groups (shards) of a Redis (cluster mode enabled) replication group. This operation is performed with no cluster down time.

May throw ReplicationGroupNotFoundFault. May throw InvalidReplicationGroupStateFault. May throw InvalidCacheClusterStateFault. May throw InvalidVPCNetworkStateFault. May throw InsufficientCacheClusterCapacityFault. May throw ClusterQuotaForCustomerExceededFault. May throw NodeGroupsPerReplicationGroupQuotaExceededFault. May throw NodeQuotaForCustomerExceededFault. May throw NoOperationFault. May throw InvalidKMSKeyFault. May throw InvalidParameterValueException. May throw InvalidParameterCombinationException.

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 Redis (cluster mode disabled) replication groups, this is the number of replica nodes in the replication group. For Redis (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 Redis (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 {
  ArgumentError.checkNotNull(applyImmediately, 'applyImmediately');
  ArgumentError.checkNotNull(replicationGroupId, 'replicationGroupId');
  final $request = <String, dynamic>{};
  $request['ApplyImmediately'] = applyImmediately;
  $request['ReplicationGroupId'] = replicationGroupId;
  newReplicaCount?.also((arg) => $request['NewReplicaCount'] = arg);
  replicaConfiguration?.also((arg) => $request['ReplicaConfiguration'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'IncreaseReplicaCount',
    version: '2015-02-02',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['IncreaseReplicaCountMessage'],
    shapes: shapes,
    resultWrapper: 'IncreaseReplicaCountResult',
  );
  return IncreaseReplicaCountResult.fromXml($result);
}