resizeCluster method

Future<ResizeClusterResult> resizeCluster({
  1. required String clusterIdentifier,
  2. bool? classic,
  3. String? clusterType,
  4. String? nodeType,
  5. int? numberOfNodes,
})

Changes the size of the cluster. You can change the cluster's type, or change the number or type of nodes. The default behavior is to use the elastic resize method. With an elastic resize, your cluster is available for read and write operations more quickly than with the classic resize method.

Elastic resize operations have the following restrictions:

  • You can only resize clusters of the following types:
    • dc1.large (if your cluster is in a VPC)
    • dc1.8xlarge (if your cluster is in a VPC)
    • dc2.large
    • dc2.8xlarge
    • ds2.xlarge
    • ds2.8xlarge
    • ra3.xlplus
    • ra3.4xlarge
    • ra3.16xlarge
  • The type of nodes that you add must match the node type for the cluster.

May throw InvalidClusterStateFault. May throw ClusterNotFoundFault. May throw NumberOfNodesQuotaExceededFault. May throw NumberOfNodesPerClusterLimitExceededFault. May throw InsufficientClusterCapacityFault. May throw UnsupportedOptionFault. May throw UnsupportedOperationFault. May throw UnauthorizedOperation. May throw LimitExceededFault.

Parameter clusterIdentifier : The unique identifier for the cluster to resize.

Parameter classic : A boolean value indicating whether the resize operation is using the classic resize process. If you don't provide this parameter or set the value to false, the resize type is elastic.

Parameter clusterType : The new cluster type for the specified cluster.

Parameter nodeType : The new node type for the nodes you are adding. If not specified, the cluster's current node type is used.

Parameter numberOfNodes : The new number of nodes for the cluster. If not specified, the cluster's current number of nodes is used.

Implementation

Future<ResizeClusterResult> resizeCluster({
  required String clusterIdentifier,
  bool? classic,
  String? clusterType,
  String? nodeType,
  int? numberOfNodes,
}) async {
  ArgumentError.checkNotNull(clusterIdentifier, 'clusterIdentifier');
  _s.validateStringLength(
    'clusterIdentifier',
    clusterIdentifier,
    0,
    2147483647,
    isRequired: true,
  );
  _s.validateStringLength(
    'clusterType',
    clusterType,
    0,
    2147483647,
  );
  _s.validateStringLength(
    'nodeType',
    nodeType,
    0,
    2147483647,
  );
  final $request = <String, dynamic>{};
  $request['ClusterIdentifier'] = clusterIdentifier;
  classic?.also((arg) => $request['Classic'] = arg);
  clusterType?.also((arg) => $request['ClusterType'] = arg);
  nodeType?.also((arg) => $request['NodeType'] = arg);
  numberOfNodes?.also((arg) => $request['NumberOfNodes'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'ResizeCluster',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['ResizeClusterMessage'],
    shapes: shapes,
    resultWrapper: 'ResizeClusterResult',
  );
  return ResizeClusterResult.fromXml($result);
}