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

*************
search_things
*************



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

  

  Searches for things associated with the specified entity. You can search by both device and device model.

   

  For example, if two different devices, camera1 and camera2, implement the camera device model, the user can associate thing1 to camera1 and thing2 to camera2. ``SearchThings(camera2)`` will return only thing2, but ``SearchThings(camera)`` will return both thing1 and thing2.

   

  This action searches for exact matches and doesn't perform partial text matching.

  

  .. 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/SearchThings>`_  


  **Request Syntax**
  ::

    response = client.search_things(
        entityId='string',
        nextToken='string',
        maxResults=123,
        namespaceVersion=123
    )
    
  :type entityId: string
  :param entityId: **[REQUIRED]** 

    The ID of the entity to which the things are associated.

     

    The IDs should be in the following format.

     

    ``urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME``

    

  
  :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**

    
    ::

      {
          'things': [
              {
                  'thingArn': 'string',
                  'thingName': 'string'
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **things** *(list) --* 

        An array of things in the result set.

        
        

        - *(dict) --* 

          An AWS IoT thing.

          
          

          - **thingArn** *(string) --* 

            The ARN of the thing.

            
          

          - **thingName** *(string) --* 

            The name of the thing.

            
      
    
      

      - **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.ResourceNotFoundException`

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

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

  