:doc:`EMR <../../emr>` / Paginator / ListInstances

*************
ListInstances
*************



.. py:class:: EMR.Paginator.ListInstances

  ::

    
    paginator = client.get_paginator('list_instances')

  
  

  .. py:method:: paginate(**kwargs)

    Creates an iterator that will paginate through responses from :py:meth:`EMR.Client.list_instances`.

    See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstances>`_    


    **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'
          }
      )
      
    :type ClusterId: string
    :param ClusterId: **[REQUIRED]** 

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

      

    
    :type InstanceGroupId: string
    :param InstanceGroupId: 

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

      

    
    :type InstanceGroupTypes: list
    :param InstanceGroupTypes: 

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

      

    
      - *(string) --* 

      
  
    :type InstanceFleetId: string
    :param InstanceFleetId: 

      The unique identifier of the instance fleet.

      

    
    :type InstanceFleetType: string
    :param InstanceFleetType: 

      The node type of the instance fleet. For example MASTER, CORE, or TASK.

      

    
    :type InstanceStates: list
    :param InstanceStates: 

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

      

    
      - *(string) --* 

      
  
    :type PaginationConfig: dict
    :param PaginationConfig: 

      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.

        

      
    
    
    :rtype: 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 Amazon 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 Amazon EC2 instance belongs.

              
            

            - **Market** *(string) --* 

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

              
            

            - **InstanceType** *(string) --* 

              The Amazon 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 Amazon 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.

          
    