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

*************************
associate_entity_to_thing
*************************



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

  

  Associates a device with a concrete thing that is in the user's registry.

   

  A thing can be associated with only one device at a time. If you associate a thing with a new device id, its previous association will be removed.

  

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


  **Request Syntax**
  ::

    response = client.associate_entity_to_thing(
        thingName='string',
        entityId='string',
        namespaceVersion=123
    )
    
  :type thingName: string
  :param thingName: **[REQUIRED]** 

    The name of the thing to which the entity is to be associated.

    

  
  :type entityId: string
  :param entityId: **[REQUIRED]** 

    The ID of the device to be associated with the thing.

     

    The ID should be in the following format.

     

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

    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **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`

  