Skip to content

list_clusters

list_clusters(
    *,
    config_overrides: Optional[SnowballClientConfig] = None,
    max_results: Optional[ListLimit] = None,
    next_token: Optional[String] = None,
) -> ListClustersResult

Returns an array of ClusterListEntry objects of the specified length. Each ClusterListEntry object contains a cluster's state, a cluster's ID, and other important status information.

Parameters:

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

    The number of ClusterListEntry objects to return.

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

    HTTP requests are stateless. To identify what object comes "next" in the list of ClusterListEntry objects, you have the option of specifying NextToken as the starting point for your returned list.

Raises:

  • InvalidNextTokenException –

    The NextToken string was altered unexpectedly, and the operation has stopped. Run the operation without changing the NextToken string, and try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_snowball/_services/snowball.py
def list_clusters(
    self,
    *,
    config_overrides: Optional[SnowballClientConfig] = None,
    max_results: Optional["capo_snowball.types.list_limit.ListLimit"] = None,
    next_token: Optional["capo_snowball.types.string.String"] = None,
) -> "capo_snowball.types.list_clusters_result.ListClustersResult":
    """<p>Returns an array of <code>ClusterListEntry</code> objects of the specified length. Each <code>ClusterListEntry</code> object contains a cluster's state, a cluster's ID, and other important status information.</p>

    Args:
        max_results: <p>The number of <code>ClusterListEntry</code> objects to return.</p>
        next_token: <p>HTTP requests are stateless. To identify what object comes "next" in the list of <code>ClusterListEntry</code> objects, you have the option of specifying <code>NextToken</code> as the starting point for your returned list.</p>

    Raises:
        capo_snowball.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The <code>NextToken</code> string was altered unexpectedly, and the operation has stopped. Run the operation without changing the <code>NextToken</code> string, and try again.</p>
        capo_snowball.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_snowball.types.list_clusters_request.ListClustersRequest]",
    ) -> OperationResponse[
        "capo_snowball.types.list_clusters_result.ListClustersResult"
    ]:
        import capo_snowball._operations.awsie_snowball_job_management_service.list_clusters

        output, http_response = (
            capo_snowball._operations.awsie_snowball_job_management_service.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_snowball.types.list_clusters_request.ListClustersRequest = {}
    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