associated_assets
Creates, updates, deletes, gets or lists an associated_assets resource.
Overview
| Name | associated_assets |
| Type | Resource |
| Id | aws.iotsitewise.associated_assets |
Fields
The following fields are returned by SELECT queries:
- list_associated_assets
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the asset, in UUID format. (pattern: <code>^(?!00000000-0000-0000-0000-000000000000)[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$</code>) |
name | string | The name of the asset. (pattern: <code>[^\u0000-\u001F\u007F]+</code>) |
arn | string | The ARN of the asset, which has the following format. arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId} (pattern: <code>^arn:aws(-cn|-us-gov)?:[a-zA-Z0-9-:/_.]+$</code>) |
asset_model_id | string | The ID of the asset model used to create the asset. (pattern: <code>^(?!00000000-0000-0000-0000-000000000000)[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$</code>) |
creation_date | string (date-time) | The date the asset was created, in Unix epoch time. |
description | string | A description for the asset. (pattern: <code>[^\u0000-\u001F\u007F]+</code>) |
external_id | string | The external ID of the asset. For more information, see Using external IDs in the IoT SiteWise User Guide. (pattern: <code>[a-zA-Z0-9_][a-zA-Z_-0-9.:]*[a-zA-Z0-9_]+</code>) |
hierarchies | array | A list of asset hierarchies that each contain a hierarchyId. A hierarchy specifies allowed parent/child asset relationships. |
last_update_date | string (date-time) | The date the asset was last updated, in Unix epoch time. |
status | object | The current status of the asset. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_associated_assets | select | asset_id, region | hierarchyId, traversalDirection, nextToken, maxResults | Retrieves a paginated list of associated assets. You can use this operation to do the following: CHILD - List all child assets associated to the asset. PARENT - List the asset's parent asset. |
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 to query. 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) |
hierarchyId | string | (Optional) If you don't provide a hierarchyId, all the immediate assets in the traversalDirection will be returned. The ID of the hierarchy by which child assets are associated to 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.) For more information, see Asset hierarchies in the IoT SiteWise User Guide. |
maxResults | integer | The maximum number of results to return for each paginated request. Default: 50 |
nextToken | string | The token to be used for the next set of paginated results. |
traversalDirection | string | The direction to list associated assets. Choose one of the following options: CHILD – The list includes all child assets associated to the asset. PARENT – The list includes the asset's parent asset. Default: CHILD |
SELECT examples
- list_associated_assets
Retrieves a paginated list of associated assets. You can use this operation to do the following: CHILD - List all child assets associated to the asset. PARENT - List the asset's parent asset.
SELECT
id,
name,
arn,
asset_model_id,
creation_date,
description,
external_id,
hierarchies,
last_update_date,
status
FROM aws.iotsitewise.associated_assets
WHERE asset_id = '{{ asset_id }}' -- required
AND region = '{{ region }}' -- required
AND hierarchyId = '{{ hierarchyId }}'
AND traversalDirection = '{{ traversalDirection }}'
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;