asset_relationships
Creates, updates, deletes, gets or lists an asset_relationships resource.
Overview
| Name | asset_relationships |
| Type | Resource |
| Id | aws.iotsitewise.asset_relationships |
Fields
The following fields are returned by SELECT queries:
- list_asset_relationships
| Name | Datatype | Description |
|---|---|---|
hierarchy_info | object | The assets that are related through an asset hierarchy. This object is present if the relationshipType is HIERARCHY. |
relationship_type | 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. (HIERARCHY) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_asset_relationships | select | asset_id, traversalType, region | nextToken, maxResults | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
asset_id | string | 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. |
region | string | AWS region (default: us-east-1) |
traversalType | string | 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. |
maxResults | integer | The maximum number of results to return for each paginated request. |
nextToken | string | The token to be used for the next set of paginated results. |
SELECT examples
- list_asset_relationships
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 }}'
;