Returns a list of all the MSK clusters in the current Region.
Parameters:
-
cluster_name_filter
(Optional[__string], default:
None
)
–
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.
-
max_results
(Optional[MaxResults], default:
None
)
–
The maximum number of results to return in the response. If there are more results, the response includes a NextToken parameter.
-
next_token
(Optional[__string], default:
None
)
–
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.
Raises:
Source code in docs_src/capo_kafka/_services/kafka.py
| def list_clusters(
self,
*,
config_overrides: Optional[KafkaClientConfig] = None,
cluster_name_filter: Optional["capo_kafka.types.__string.__string"] = None,
max_results: Optional["capo_kafka.types.max_results.MaxResults"] = None,
next_token: Optional["capo_kafka.types.__string.__string"] = None,
) -> "capo_kafka.types.list_clusters_response.ListClustersResponse":
"""<p>Returns a list of all the MSK clusters in the current Region.</p>
Args:
cluster_name_filter: <p>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.</p>
max_results: <p>The maximum number of results to return in the response. If there are more results, the response includes a NextToken parameter.</p>
next_token: <p>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.</p>
Raises:
capo_kafka.errors.bad_request_exception.BadRequestException: <p>Returns information about an error.</p>
capo_kafka.errors.forbidden_exception.ForbiddenException: <p>Returns information about an error.</p>
capo_kafka.errors.internal_server_error_exception.InternalServerErrorException: <p>Returns information about an error.</p>
capo_kafka.errors.unauthorized_exception.UnauthorizedException: <p>Returns information about an error.</p>
capo_kafka.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_kafka.types.list_clusters_request.ListClustersRequest]",
) -> OperationResponse[
"capo_kafka.types.list_clusters_response.ListClustersResponse"
]:
import capo_kafka._operations.kafka.list_clusters
output, http_response = (
capo_kafka._operations.kafka.list_clusters.list_clusters(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListClusters")
)
input_: capo_kafka.types.list_clusters_request.ListClustersRequest = {}
if cluster_name_filter is not None:
input_["cluster_name_filter"] = cluster_name_filter
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|