- Newest
- Most votes
- Most comments
Hi rePost-User-6825629
Correct, most of the AWS IoT SiteWise APIs require the assetID and propertyID and there is no API call to find IDs using a property or asset name. But you can start from the AWS IoT SiteWise data stream view to simplify your workflow:
Using the CLI it could look like this :
- Fetch all properties that don't have an alias atttached:
aws iotsitewise list-time-series --query 'TimeSeriesSummaries[?!alias]'
[
{
"assetId": "4cd2ea29-8b35-4f94-aeb9-1446bcb90fae",
"propertyId": "503b3aa0-75ec-4d42-a294-cd85ee863da2",
"timeSeriesId": "43a0fede-c0d0-4c3a-84b5-1d575214784c",
"dataType": "DOUBLE",
"timeSeriesCreationDate": "2021-10-25T09:42:45+01:00",
"timeSeriesLastUpdateDate": "2022-03-30T15:57:59+01:00"
},
...
Iterate to the list and optionally fetch the asset and property names:
aws iotsitewise describe-asset-property --asset-id 4cd2ea29-8b35-4f94-aeb9-1446bcb90fae --property-id 503b3aa0-75ec-4d42-a294-cd85ee863da2 --query '[assetName, assetProperty.name]'
[
"Furnace002",
"HighTemperature"
]
Update the property alias:
aws iotsitewise update-asset-property --asset-id 4cd2ea29-8b35-4f94-aeb9-1446bcb90fae --property-id 503b3aa0-75ec-4d42-a294-cd85ee863da2 --property-alias "myAlias"
or as an alternative, if you already ingested data into SiteWise for this alias. You can attach the Data stream directly to the property:
aws iotsitewise associate-time-series-to-asset-property --asset-id 4cd2ea29-8b35-4f94-aeb9-1446bcb90fae --property-id 503b3aa0-75ec-4d42-a294-cd85ee863da2 --alias 'myalias'
Thank you Jan;
That is along the similar lines I've been playing with since I made the post. I'd gone from unassigned data streams backwards to find the asset. But that nearly runs as it, rather than trial and error with other API commands.
Much appreciated;
Relevant content
- asked 2 years ago
- asked 6 months ago
- AWS OFFICIALUpdated 2 years ago