IoTSiteWise / Client / list_asset_relationships

list_asset_relationships#

IoTSiteWise.Client.list_asset_relationships(**kwargs)#

Retrieves a paginated list of asset relationships for an asset. You can use this operation to identify an asset’s root asset and all associated assets between that asset and its root.

See also: AWS API Documentation

Request Syntax

response = client.list_asset_relationships(
    assetId='string',
    traversalType='PATH_TO_ROOT',
    nextToken='string',
    maxResults=123
)
Parameters:
  • assetId (string) –

    [REQUIRED]

    The ID of the 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 in the IoT SiteWise User Guide.

  • traversalType (string) –

    [REQUIRED]

    The type of traversal to use to identify asset relationships. Choose the following option:

    • PATH_TO_ROOT – Identify the asset’s parent assets up to the root asset. The asset that you specify in assetId is the first result in the list of assetRelationshipSummaries, and the root asset is the last result.

  • nextToken (string) – The token to be used for the next set of paginated results.

  • maxResults (integer) – The maximum number of results to return for each paginated request.

Return type:

dict

Returns:

Response Syntax

{
    'assetRelationshipSummaries': [
        {
            'hierarchyInfo': {
                'parentAssetId': 'string',
                'childAssetId': 'string'
            },
            'relationshipType': 'HIERARCHY'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • assetRelationshipSummaries (list) –

      A list that summarizes each asset relationship.

      • (dict) –

        Contains information about assets that are related to one another.

        • hierarchyInfo (dict) –

          The assets that are related through an asset hierarchy.

          This object is present if the relationshipType is HIERARCHY.

          • parentAssetId (string) –

            The ID of the parent asset in this asset relationship.

          • childAssetId (string) –

            The ID of the child asset in this asset relationship.

        • relationshipType (string) –

          The relationship type of the assets in this relationship. This value is one of the following:

          • HIERARCHY – The assets are related through an asset hierarchy. If you specify this relationship type, this asset relationship includes the hierarchyInfo object.

    • nextToken (string) –

      The token for the next set of results, or null if there are no additional results.

Exceptions