EMR / Paginator / ListClusters

ListClusters#

class EMR.Paginator.ListClusters#
paginator = client.get_paginator('list_clusters')
paginate(**kwargs)#

Creates an iterator that will paginate through responses from EMR.Client.list_clusters().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    CreatedAfter=datetime(2015, 1, 1),
    CreatedBefore=datetime(2015, 1, 1),
    ClusterStates=[
        'STARTING'|'BOOTSTRAPPING'|'RUNNING'|'WAITING'|'TERMINATING'|'TERMINATED'|'TERMINATED_WITH_ERRORS',
    ],
    PaginationConfig={
        'MaxItems': 123,
        'StartingToken': 'string'
    }
)
Parameters:
  • CreatedAfter (datetime) – The creation date and time beginning value filter for listing clusters.

  • CreatedBefore (datetime) – The creation date and time end value filter for listing clusters.

  • ClusterStates (list) –

    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.

    • (string) –

  • PaginationConfig (dict) –

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) –

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • StartingToken (string) –

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type:

dict

Returns:

Response Syntax

{
    'Clusters': [
        {
            'Id': 'string',
            'Name': 'string',
            'Status': {
                'State': 'STARTING'|'BOOTSTRAPPING'|'RUNNING'|'WAITING'|'TERMINATING'|'TERMINATED'|'TERMINATED_WITH_ERRORS',
                'StateChangeReason': {
                    'Code': 'INTERNAL_ERROR'|'VALIDATION_ERROR'|'INSTANCE_FAILURE'|'INSTANCE_FLEET_TIMEOUT'|'BOOTSTRAP_FAILURE'|'USER_REQUEST'|'STEP_FAILURE'|'ALL_STEPS_COMPLETED',
                    'Message': 'string'
                },
                'Timeline': {
                    'CreationDateTime': datetime(2015, 1, 1),
                    'ReadyDateTime': datetime(2015, 1, 1),
                    'EndDateTime': datetime(2015, 1, 1)
                },
                'ErrorDetails': [
                    {
                        'ErrorCode': 'string',
                        'ErrorData': [
                            {
                                'string': 'string'
                            },
                        ],
                        'ErrorMessage': 'string'
                    },
                ]
            },
            'NormalizedInstanceHours': 123,
            'ClusterArn': 'string',
            'OutpostArn': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    This contains a ClusterSummaryList with the cluster details; for example, the cluster IDs, names, and status.

    • Clusters (list) –

      The list of clusters for the account based on the given filters.

      • (dict) –

        The summary description of the cluster.

        • Id (string) –

          The unique identifier for the cluster.

        • Name (string) –

          The name of the cluster.

        • Status (dict) –

          The details about the current status of the cluster.

          • State (string) –

            The current state of the cluster.

          • StateChangeReason (dict) –

            The reason for the cluster status change.

            • Code (string) –

              The programmatic code for the state change reason.

            • Message (string) –

              The descriptive message for the state change reason.

          • Timeline (dict) –

            A timeline that represents the status of a cluster over the lifetime of the cluster.

            • CreationDateTime (datetime) –

              The creation date and time of the cluster.

            • ReadyDateTime (datetime) –

              The date and time when the cluster was ready to run steps.

            • EndDateTime (datetime) –

              The date and time when the cluster was terminated.

          • ErrorDetails (list) –

            A list of tuples that provides information about the errors that caused a cluster to terminate. This structure can contain up to 10 different ErrorDetail tuples.

            • (dict) –

              A tuple that provides information about an error that caused a cluster to terminate.

              • ErrorCode (string) –

                The name or code associated with the error.

              • ErrorData (list) –

                A list of key value pairs that provides contextual information about why an error occured.

                • (dict) –

                  • (string) –

                    • (string) –

              • ErrorMessage (string) –

                A message that describes the error.

        • NormalizedInstanceHours (integer) –

          An approximation of the cost of the cluster, represented in m1.small/hours. This value is incremented one time for every hour an m1.small instance runs. Larger instances are weighted more, so an Amazon EC2 instance that is roughly four times more expensive would result in the normalized instance hours being incremented by four. This result is only an approximation and does not reflect the actual billing rate.

        • ClusterArn (string) –

          The Amazon Resource Name of the cluster.

        • OutpostArn (string) –

          The Amazon Resource Name (ARN) of the Outpost where the cluster is launched.

    • NextToken (string) –

      A token to resume pagination.