Skip to content

list_clusters

list_clusters(
    *,
    config_overrides: Optional[DSQLClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListClustersOutput

Retrieves information about a list of clusters.

Parameters:

  • max_results (Optional[MaxResults], default: None ) –

    An optional parameter that specifies the maximum number of results to return. You can use nextToken to display the next page of results.

  • next_token (Optional[NextToken], default: None ) –

    If your initial ListClusters operation returns a nextToken, you can include the returned nextToken in following ListClusters operations, which returns results in the next page.

Raises:

Examples:

List Clusters

>>> client.list_clusters(max_results=20)
Source code in docs_src/capo_dsql/_services/dsql.py
def list_clusters(
    self,
    *,
    config_overrides: Optional[DSQLClientConfig] = None,
    max_results: Optional["capo_dsql.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_dsql.types.next_token.NextToken"] = None,
) -> "capo_dsql.types.list_clusters_output.ListClustersOutput":
    """<p>Retrieves information about a list of clusters.</p>

    Args:
        max_results: <p>An optional parameter that specifies the maximum number of results to return. You can use nextToken to display the next page of results.</p>
        next_token: <p>If your initial ListClusters operation returns a nextToken, you can include the returned nextToken in following ListClusters operations, which returns results in the next page.</p>

    Raises:
        capo_dsql.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_dsql.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_dsql.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_dsql.errors.validation_exception.ValidationException: <p>The input failed to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_dsql.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_dsql.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List Clusters

        >>> client.list_clusters(max_results=20)
    """

    def _handler(
        req: "OperationRequest[capo_dsql.types.list_clusters_input.ListClustersInput]",
    ) -> OperationResponse[
        "capo_dsql.types.list_clusters_output.ListClustersOutput"
    ]:
        import capo_dsql._operations.dsql.list_clusters

        output, http_response = (
            capo_dsql._operations.dsql.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_dsql.types.list_clusters_input.ListClustersInput = {}
    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