listClustersV2 method
Returns a list of all the MSK clusters in the current Region.
May throw BadRequestException.
May throw ForbiddenException.
May throw InternalServerErrorException.
May throw UnauthorizedException.
Parameter clusterNameFilter :
Specify a prefix of the names of the clusters that you want to list. The
service lists all the clusters whose names start with this prefix.
Parameter clusterTypeFilter :
Specify either PROVISIONED or SERVERLESS.
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<ListClustersV2Response> listClustersV2({
String? clusterNameFilter,
String? clusterTypeFilter,
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final $query = <String, List<String>>{
if (clusterNameFilter != null) 'clusterNameFilter': [clusterNameFilter],
if (clusterTypeFilter != null) 'clusterTypeFilter': [clusterTypeFilter],
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/api/v2/clusters',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListClustersV2Response.fromJson(response);
}