Skip to main content

asset_relationships

Creates, updates, deletes, gets or lists an asset_relationships resource.

Overview

Nameasset_relationships
TypeResource
Idaws.iotsitewise.asset_relationships

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
hierarchy_infoobjectThe assets that are related through an asset hierarchy. This object is present if the relationshipType is HIERARCHY.
relationship_typestringThe 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. (HIERARCHY)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_asset_relationshipsselectasset_id, traversalType, regionnextToken, maxResultsRetrieves 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.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
asset_idstringThe 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.
regionstringAWS region (default: us-east-1)
traversalTypestringThe 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.
maxResultsintegerThe maximum number of results to return for each paginated request.
nextTokenstringThe token to be used for the next set of paginated results.

SELECT examples

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.

SELECT
hierarchy_info,
relationship_type
FROM aws.iotsitewise.asset_relationships
WHERE asset_id = '{{ asset_id }}' -- required
AND traversalType = '{{ traversalType }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;