EMR / Paginator / ListInstances

ListInstances#

class EMR.Paginator.ListInstances#
paginator = client.get_paginator('list_instances')
paginate(**kwargs)#

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

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    ClusterId='string',
    InstanceGroupId='string',
    InstanceGroupTypes=[
        'MASTER'|'CORE'|'TASK',
    ],
    InstanceFleetId='string',
    InstanceFleetType='MASTER'|'CORE'|'TASK',
    InstanceStates=[
        'AWAITING_FULFILLMENT'|'PROVISIONING'|'BOOTSTRAPPING'|'RUNNING'|'TERMINATED',
    ],
    PaginationConfig={
        'MaxItems': 123,
        'StartingToken': 'string'
    }
)
Parameters:
  • ClusterId (string) –

    [REQUIRED]

    The identifier of the cluster for which to list the instances.

  • InstanceGroupId (string) – The identifier of the instance group for which to list the instances.

  • InstanceGroupTypes (list) –

    The type of instance group for which to list the instances.

    • (string) –

  • InstanceFleetId (string) – The unique identifier of the instance fleet.

  • InstanceFleetType (string) – The node type of the instance fleet. For example MASTER, CORE, or TASK.

  • InstanceStates (list) –

    A list of instance states that will filter the instances returned with this request.

    • (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

{
    'Instances': [
        {
            'Id': 'string',
            'Ec2InstanceId': 'string',
            'PublicDnsName': 'string',
            'PublicIpAddress': 'string',
            'PrivateDnsName': 'string',
            'PrivateIpAddress': 'string',
            'Status': {
                'State': 'AWAITING_FULFILLMENT'|'PROVISIONING'|'BOOTSTRAPPING'|'RUNNING'|'TERMINATED',
                'StateChangeReason': {
                    'Code': 'INTERNAL_ERROR'|'VALIDATION_ERROR'|'INSTANCE_FAILURE'|'BOOTSTRAP_FAILURE'|'CLUSTER_TERMINATED',
                    'Message': 'string'
                },
                'Timeline': {
                    'CreationDateTime': datetime(2015, 1, 1),
                    'ReadyDateTime': datetime(2015, 1, 1),
                    'EndDateTime': datetime(2015, 1, 1)
                }
            },
            'InstanceGroupId': 'string',
            'InstanceFleetId': 'string',
            'Market': 'ON_DEMAND'|'SPOT',
            'InstanceType': 'string',
            'EbsVolumes': [
                {
                    'Device': 'string',
                    'VolumeId': 'string'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    This output contains the list of instances.

    • Instances (list) –

      The list of instances for the cluster and given filters.

      • (dict) –

        Represents an EC2 instance provisioned as part of cluster.

        • Id (string) –

          The unique identifier for the instance in Amazon EMR.

        • Ec2InstanceId (string) –

          The unique identifier of the instance in Amazon EC2.

        • PublicDnsName (string) –

          The public DNS name of the instance.

        • PublicIpAddress (string) –

          The public IP address of the instance.

        • PrivateDnsName (string) –

          The private DNS name of the instance.

        • PrivateIpAddress (string) –

          The private IP address of the instance.

        • Status (dict) –

          The current status of the instance.

          • State (string) –

            The current state of the instance.

          • StateChangeReason (dict) –

            The details of the status change reason for the instance.

            • Code (string) –

              The programmable code for the state change reason.

            • Message (string) –

              The status change reason description.

          • Timeline (dict) –

            The timeline of the instance status over time.

            • CreationDateTime (datetime) –

              The creation date and time of the instance.

            • ReadyDateTime (datetime) –

              The date and time when the instance was ready to perform tasks.

            • EndDateTime (datetime) –

              The date and time when the instance was terminated.

        • InstanceGroupId (string) –

          The identifier of the instance group to which this instance belongs.

        • InstanceFleetId (string) –

          The unique identifier of the instance fleet to which an EC2 instance belongs.

        • Market (string) –

          The instance purchasing option. Valid values are ON_DEMAND or SPOT.

        • InstanceType (string) –

          The EC2 instance type, for example m3.xlarge.

        • EbsVolumes (list) –

          The list of Amazon EBS volumes that are attached to this instance.

          • (dict) –

            EBS block device that’s attached to an EC2 instance.

            • Device (string) –

              The device name that is exposed to the instance, such as /dev/sdh.

            • VolumeId (string) –

              The volume identifier of the EBS volume.

    • NextToken (string) –

      A token to resume pagination.