increaseReplicationFactor method

Future<IncreaseReplicationFactorResponse> increaseReplicationFactor({
  1. required String clusterName,
  2. required int newReplicationFactor,
  3. List<String>? availabilityZones,
})

Adds one or more nodes to a DAX cluster.

May throw ClusterNotFoundFault. May throw InvalidClusterStateFault. May throw InsufficientClusterCapacityFault. May throw InvalidVPCNetworkStateFault. May throw NodeQuotaForClusterExceededFault. May throw NodeQuotaForCustomerExceededFault. May throw ServiceLinkedRoleNotFoundFault. May throw InvalidParameterValueException. May throw InvalidParameterCombinationException.

Parameter clusterName : The name of the DAX cluster that will receive additional nodes.

Parameter newReplicationFactor : The new number of nodes for the DAX cluster.

Parameter availabilityZones : The Availability Zones (AZs) in which the cluster nodes will be created. All nodes belonging to the cluster are placed in these Availability Zones. Use this parameter if you want to distribute the nodes across multiple AZs.

Implementation

Future<IncreaseReplicationFactorResponse> increaseReplicationFactor({
  required String clusterName,
  required int newReplicationFactor,
  List<String>? availabilityZones,
}) async {
  ArgumentError.checkNotNull(clusterName, 'clusterName');
  ArgumentError.checkNotNull(newReplicationFactor, 'newReplicationFactor');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonDAXV3.IncreaseReplicationFactor'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ClusterName': clusterName,
      'NewReplicationFactor': newReplicationFactor,
      if (availabilityZones != null) 'AvailabilityZones': availabilityZones,
    },
  );

  return IncreaseReplicationFactorResponse.fromJson(jsonResponse.body);
}