Skip to content

list_clusters async

list_clusters(
    *,
    config_overrides: Optional[AsyncEMRClientConfig] = None,
    created_after: Optional[Date] = None,
    created_before: Optional[Date] = None,
    cluster_states: Optional[ClusterStateList] = None,
    marker: Optional[Marker] = None,
) -> ListClustersOutput

Provides the status of all clusters visible to this Amazon Web Services account. Allows you to filter the list of clusters based on certain criteria; for example, filtering by cluster creation date and time or by status. This call returns a maximum of 50 clusters in unsorted order per call, but returns a marker to track the paging of the cluster list across multiple ListClusters calls.

Parameters:

  • created_after (Optional[Date], default: None ) –

    The creation date and time beginning value filter for listing clusters.

  • created_before (Optional[Date], default: None ) –

    The creation date and time end value filter for listing clusters.

  • cluster_states (Optional[ClusterStateList], default: None ) –

    The cluster state filters to apply when listing clusters. Clusters that change state while this action runs may be not be returned as expected in the list of clusters.

  • marker (Optional[Marker], default: None ) –

    The pagination token that indicates the next set of results to retrieve.

Raises:

Source code in docs_src/capo_emr/_services/async_emr.py
async def list_clusters(
    self,
    *,
    config_overrides: Optional[AsyncEMRClientConfig] = None,
    created_after: Optional["capo_emr.types.date.Date"] = None,
    created_before: Optional["capo_emr.types.date.Date"] = None,
    cluster_states: Optional[
        "capo_emr.types.cluster_state_list.ClusterStateList"
    ] = None,
    marker: Optional["capo_emr.types.marker.Marker"] = None,
) -> "capo_emr.types.list_clusters_output.ListClustersOutput":
    """<p>Provides the status of all clusters visible to this Amazon Web Services account. Allows you to filter the list of clusters based on certain criteria; for example, filtering by cluster creation date and time or by status. This call returns a maximum of 50 clusters in unsorted order per call, but returns a marker to track the paging of the cluster list across multiple ListClusters calls.</p>

    Args:
        created_after: <p>The creation date and time beginning value filter for listing clusters.</p>
        created_before: <p>The creation date and time end value filter for listing clusters.</p>
        cluster_states: <p>The cluster state filters to apply when listing clusters. Clusters that change state while this action runs may be not be returned as expected in the list of clusters.</p>
        marker: <p>The pagination token that indicates the next set of results to retrieve.</p>

    Raises:
        capo_emr.errors.internal_server_exception.InternalServerException: <p>This exception occurs when there is an internal failure in the Amazon EMR service.</p>
        capo_emr.errors.invalid_request_exception.InvalidRequestException: <p>This exception occurs when there is something wrong with user input.</p>
        capo_emr.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_emr.types.list_clusters_input.ListClustersInput]",
    ) -> AsyncOperationResponse[
        "capo_emr.types.list_clusters_output.ListClustersOutput"
    ]:
        import capo_emr._operations.elastic_map_reduce.list_clusters

        (
            output,
            http_response,
        ) = await capo_emr._operations.elastic_map_reduce.list_clusters.async_list_clusters(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListClusters")
    )
    input_: capo_emr.types.list_clusters_input.ListClustersInput = {}
    if created_after is not None:
        input_["created_after"] = created_after
    if created_before is not None:
        input_["created_before"] = created_before
    if cluster_states is not None:
        input_["cluster_states"] = cluster_states
    if marker is not None:
        input_["marker"] = marker

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output