:doc:`IoTSiteWise <../../iotsitewise>` / Client / associate_assets

****************
associate_assets
****************



.. py:method:: IoTSiteWise.Client.associate_assets(**kwargs)

  

  Associates a child asset with the given parent asset through a hierarchy defined in the parent asset's model. For more information, see `Associating assets <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/add-associated-assets.html>`__ in the *IoT SiteWise User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iotsitewise-2019-12-02/AssociateAssets>`_  


  **Request Syntax**
  ::

    response = client.associate_assets(
        assetId='string',
        hierarchyId='string',
        childAssetId='string',
        clientToken='string'
    )
    
  :type assetId: string
  :param assetId: **[REQUIRED]** 

    The ID of the parent asset. This can be either the actual ID in UUID format, or else ``externalId:`` followed by the external ID, if it has one. For more information, see `Referencing objects with external IDs <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references>`__ in the *IoT SiteWise User Guide*.

    

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

    The ID of a hierarchy in the parent asset's model. (This can be either the actual ID in UUID format, or else ``externalId:`` followed by the external ID, if it has one. For more information, see `Referencing objects with external IDs <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references>`__ in the *IoT SiteWise User Guide*.) Hierarchies allow different groupings of assets to be formed that all come from the same asset model. For more information, see `Asset hierarchies <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html>`__ in the *IoT SiteWise User Guide*.

    

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

    The ID of the child asset to be associated. This can be either the actual ID in UUID format, or else ``externalId:`` followed by the external ID, if it has one. For more information, see `Referencing objects with external IDs <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references>`__ in the *IoT SiteWise User Guide*.

    

  
  :type clientToken: string
  :param clientToken: 

    A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.

    This field is autopopulated if not provided.

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`IoTSiteWise.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`IoTSiteWise.Client.exceptions.ResourceAlreadyExistsException`

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

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

  
  *   :py:class:`IoTSiteWise.Client.exceptions.LimitExceededException`

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

  
  *   :py:class:`IoTSiteWise.Client.exceptions.ConflictingOperationException`

  