listClusters method

Future<ListClustersResponse> listClusters({
  1. String? clusterNameFilter,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a list of all the MSK clusters in the current Region.

May throw BadRequestException. May throw InternalServerErrorException. May throw UnauthorizedException. May throw ForbiddenException.

Parameter clusterNameFilter :

Specify a prefix of the name of the clusters that you want to list. The service lists all the clusters whose names start with this prefix.

Parameter maxResults :

The maximum number of results to return in the response. If there are more results, the response includes a NextToken parameter.

Parameter nextToken :

The paginated results marker. When the result of the operation is truncated, the call returns NextToken in the response. To get the next batch, provide this token in your next request.

Implementation

Future<ListClustersResponse> listClusters({
  String? clusterNameFilter,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (clusterNameFilter != null) 'clusterNameFilter': [clusterNameFilter],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/v1/clusters',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListClustersResponse.fromJson(response);
}