describeClusters method

Future<DescribeClustersResponse> describeClusters({
  1. List<String>? clusterNames,
  2. int? maxResults,
  3. String? nextToken,
})

Returns information about all provisioned DAX clusters if no cluster identifier is specified, or about a specific DAX cluster if a cluster identifier is supplied.

If the cluster is in the CREATING state, only cluster level information will be displayed until all of the nodes are successfully provisioned.

If the cluster is in the DELETING state, only cluster level information will be displayed.

If nodes are currently being added to the DAX cluster, node endpoint information and creation time for the additional nodes will not be displayed until they are completely provisioned. When the DAX cluster state is available, the cluster is ready for use.

If nodes are currently being removed from the DAX cluster, no endpoint information for the removed nodes is displayed.

May throw ClusterNotFoundFault. May throw ServiceLinkedRoleNotFoundFault. May throw InvalidParameterValueException. May throw InvalidParameterCombinationException.

Parameter clusterNames : The names of the DAX clusters being described.

Parameter maxResults : The maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

The value for MaxResults must be between 20 and 100.

Parameter nextToken : An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

Implementation

Future<DescribeClustersResponse> describeClusters({
  List<String>? clusterNames,
  int? maxResults,
  String? nextToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonDAXV3.DescribeClusters'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (clusterNames != null) 'ClusterNames': clusterNames,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeClustersResponse.fromJson(jsonResponse.body);
}