:doc:`IoTThingsGraph <../../iotthingsgraph>` / Client / search_entities

***************
search_entities
***************



.. py:method:: IoTThingsGraph.Client.search_entities(**kwargs)

  

  Searches for entities of the specified type. You can search for entities in your namespace and the public namespace that you're tracking.

  

  .. danger::

        This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.


  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iotthingsgraph-2018-09-06/SearchEntities>`_  


  **Request Syntax**
  ::

    response = client.search_entities(
        entityTypes=[
            'DEVICE'|'SERVICE'|'DEVICE_MODEL'|'CAPABILITY'|'STATE'|'ACTION'|'EVENT'|'PROPERTY'|'MAPPING'|'ENUM',
        ],
        filters=[
            {
                'name': 'NAME'|'NAMESPACE'|'SEMANTIC_TYPE_PATH'|'REFERENCED_ENTITY_ID',
                'value': [
                    'string',
                ]
            },
        ],
        nextToken='string',
        maxResults=123,
        namespaceVersion=123
    )
    
  :type entityTypes: list
  :param entityTypes: **[REQUIRED]** 

    The entity types for which to search.

    

  
    - *(string) --* 

    

  :type filters: list
  :param filters: 

    Optional filter to apply to the search. Valid filters are ``NAME`` ``NAMESPACE``, ``SEMANTIC_TYPE_PATH`` and ``REFERENCED_ENTITY_ID``. ``REFERENCED_ENTITY_ID`` filters on entities that are used by the entity in the result set. For example, you can filter on the ID of a property that is used in a state.

     

    Multiple filters function as OR criteria in the query. Multiple values passed inside the filter function as AND criteria.

    

  
    - *(dict) --* 

      An object that filters an entity search. Multiple filters function as OR criteria in the search. For example a search that includes a ``NAMESPACE`` and a ``REFERENCED_ENTITY_ID`` filter searches for entities in the specified namespace that use the entity specified by the value of ``REFERENCED_ENTITY_ID``.

      

    
      - **name** *(string) --* 

        The name of the entity search filter field. ``REFERENCED_ENTITY_ID`` filters on entities that are used by the entity in the result set. For example, you can filter on the ID of a property that is used in a state.

        

      
      - **value** *(list) --* 

        An array of string values for the search filter field. Multiple values function as AND criteria in the search.

        

      
        - *(string) --* 

        
    
    

  :type nextToken: string
  :param nextToken: 

    The string that specifies the next page of results. Use this when you're paginating results.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of results to return in the response.

    

  
  :type namespaceVersion: integer
  :param namespaceVersion: 

    The version of the user's namespace. Defaults to the latest version of the user's namespace.

    

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

    
    ::

      {
          'descriptions': [
              {
                  'id': 'string',
                  'arn': 'string',
                  'type': 'DEVICE'|'SERVICE'|'DEVICE_MODEL'|'CAPABILITY'|'STATE'|'ACTION'|'EVENT'|'PROPERTY'|'MAPPING'|'ENUM',
                  'createdAt': datetime(2015, 1, 1),
                  'definition': {
                      'language': 'GRAPHQL',
                      'text': 'string'
                  }
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **descriptions** *(list) --* 

        An array of descriptions for each entity returned in the search result.

        
        

        - *(dict) --* 

          Describes the properties of an entity.

          
          

          - **id** *(string) --* 

            The entity ID.

            
          

          - **arn** *(string) --* 

            The entity ARN.

            
          

          - **type** *(string) --* 

            The entity type.

            
          

          - **createdAt** *(datetime) --* 

            The time at which the entity was created.

            
          

          - **definition** *(dict) --* 

            The definition document of the entity.

            
            

            - **language** *(string) --* 

              The language used to define the entity. ``GRAPHQL`` is the only valid value.

              
            

            - **text** *(string) --* 

              The GraphQL text that defines the entity.

              
        
      
    
      

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

        The string to specify as ``nextToken`` when you request the next page of results.

        
  
  **Exceptions**
  
  *   :py:class:`IoTThingsGraph.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`IoTThingsGraph.Client.exceptions.InternalFailureException`

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

  