updateCluster method

Future<UpdateClusterResponse> updateCluster({
  1. required String clusterName,
  2. String? description,
  3. String? notificationTopicArn,
  4. String? notificationTopicStatus,
  5. String? parameterGroupName,
  6. String? preferredMaintenanceWindow,
  7. List<String>? securityGroupIds,
})

Modifies the settings for a DAX cluster. You can use this action to change one or more cluster configuration parameters by specifying the parameters and the new values.

May throw InvalidClusterStateFault. May throw ClusterNotFoundFault. May throw InvalidParameterGroupStateFault. May throw ParameterGroupNotFoundFault. May throw ServiceLinkedRoleNotFoundFault. May throw InvalidParameterValueException. May throw InvalidParameterCombinationException.

Parameter clusterName : The name of the DAX cluster to be modified.

Parameter description : A description of the changes being made to the cluster.

Parameter notificationTopicArn : The Amazon Resource Name (ARN) that identifies the topic.

Parameter notificationTopicStatus : The current state of the topic.

Parameter parameterGroupName : The name of a parameter group for this cluster.

Parameter preferredMaintenanceWindow : A range of time when maintenance of DAX cluster software will be performed. For example: sun:01:00-sun:09:00. Cluster maintenance normally takes less than 30 minutes, and is performed automatically within the maintenance window.

Parameter securityGroupIds : A list of user-specified security group IDs to be assigned to each node in the DAX cluster. If this parameter is not specified, DAX assigns the default VPC security group to each node.

Implementation

Future<UpdateClusterResponse> updateCluster({
  required String clusterName,
  String? description,
  String? notificationTopicArn,
  String? notificationTopicStatus,
  String? parameterGroupName,
  String? preferredMaintenanceWindow,
  List<String>? securityGroupIds,
}) async {
  ArgumentError.checkNotNull(clusterName, 'clusterName');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonDAXV3.UpdateCluster'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ClusterName': clusterName,
      if (description != null) 'Description': description,
      if (notificationTopicArn != null)
        'NotificationTopicArn': notificationTopicArn,
      if (notificationTopicStatus != null)
        'NotificationTopicStatus': notificationTopicStatus,
      if (parameterGroupName != null)
        'ParameterGroupName': parameterGroupName,
      if (preferredMaintenanceWindow != null)
        'PreferredMaintenanceWindow': preferredMaintenanceWindow,
      if (securityGroupIds != null) 'SecurityGroupIds': securityGroupIds,
    },
  );

  return UpdateClusterResponse.fromJson(jsonResponse.body);
}