describeClusters method

Future<DescribeClustersResponse> describeClusters({
  1. String? clusterName,
  2. int? maxResults,
  3. String? nextToken,
  4. bool? showShardDetails,
})

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

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

Parameter clusterName : The name of the cluster.

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

Parameter nextToken : An optional argument to pass in case the total number of records exceeds the value of MaxResults. If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged.

Parameter showShardDetails : An optional flag that can be included in the request to retrieve information about the individual shard(s).

Implementation

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

  return DescribeClustersResponse.fromJson(jsonResponse.body);
}