:doc:`SupplyChain <../../supplychain>` / Client / list_instances

**************
list_instances
**************



.. py:method:: SupplyChain.Client.list_instances(**kwargs)

  

  List all Amazon Web Services Supply Chain instances for a specific account. Enables you to programmatically list all Amazon Web Services Supply Chain instances based on their account ID, instance name, and state of the instance (active or delete).

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/supplychain-2024-01-01/ListInstances>`_  


  **Request Syntax**
  ::

    response = client.list_instances(
        nextToken='string',
        maxResults=123,
        instanceNameFilter=[
            'string',
        ],
        instanceStateFilter=[
            'Initializing'|'Active'|'CreateFailed'|'DeleteFailed'|'Deleting'|'Deleted',
        ]
    )
    
  :type nextToken: string
  :param nextToken: 

    The pagination token to fetch the next page of instances.

    

  
  :type maxResults: integer
  :param maxResults: 

    Specify the maximum number of instances to fetch in this paginated request.

    

  
  :type instanceNameFilter: list
  :param instanceNameFilter: 

    The filter to ListInstances based on their names.

    

  
    - *(string) --* 

    

  :type instanceStateFilter: list
  :param instanceStateFilter: 

    The filter to ListInstances based on their state.

    

  
    - *(string) --* 

    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'instances': [
              {
                  'instanceId': 'string',
                  'awsAccountId': 'string',
                  'state': 'Initializing'|'Active'|'CreateFailed'|'DeleteFailed'|'Deleting'|'Deleted',
                  'errorMessage': 'string',
                  'webAppDnsDomain': 'string',
                  'createdTime': datetime(2015, 1, 1),
                  'lastModifiedTime': datetime(2015, 1, 1),
                  'instanceName': 'string',
                  'instanceDescription': 'string',
                  'kmsKeyArn': 'string',
                  'versionNumber': 123.0
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      The response parameters for ListInstances.

      
      

      - **instances** *(list) --* 

        The list of instances resource data details.

        
        

        - *(dict) --* 

          The details of the instance.

          
          

          - **instanceId** *(string) --* 

            The Amazon Web Services Supply Chain instance identifier.

            
          

          - **awsAccountId** *(string) --* 

            The Amazon Web Services account ID that owns the instance.

            
          

          - **state** *(string) --* 

            The state of the instance.

            
          

          - **errorMessage** *(string) --* 

            The Amazon Web Services Supply Chain instance error message. If the instance results in an unhealthy state, customers need to check the error message, delete the current instance, and recreate a new one based on the mitigation from the error message.

            
          

          - **webAppDnsDomain** *(string) --* 

            The WebApp DNS domain name of the instance.

            
          

          - **createdTime** *(datetime) --* 

            The instance creation timestamp.

            
          

          - **lastModifiedTime** *(datetime) --* 

            The instance last modified timestamp.

            
          

          - **instanceName** *(string) --* 

            The Amazon Web Services Supply Chain instance name.

            
          

          - **instanceDescription** *(string) --* 

            The Amazon Web Services Supply Chain instance description.

            
          

          - **kmsKeyArn** *(string) --* 

            The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you optionally provided for encryption. If you did not provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key and nothing is returned.

            
          

          - **versionNumber** *(float) --* 

            The version number of the instance.

            
      
    
      

      - **nextToken** *(string) --* 

        The pagination token to fetch the next page of instances.

        
  
  **Exceptions**
  
  *   :py:class:`SupplyChain.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`SupplyChain.Client.exceptions.ThrottlingException`

  
  *   :py:class:`SupplyChain.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`SupplyChain.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`SupplyChain.Client.exceptions.ValidationException`

  
  *   :py:class:`SupplyChain.Client.exceptions.InternalServerException`

  
  *   :py:class:`SupplyChain.Client.exceptions.ConflictException`

  