AssetModel
Source:
src/AWS/IoTSiteWise/AssetModel.ts
An AWS IoT SiteWise asset model — a standardized definition of properties (attributes, measurements, transforms, metrics) and hierarchies from which industrial assets are created.
Asset model creation and updates are asynchronous
(CREATING/UPDATING → ACTIVE); the provider waits for the model to
converge to ACTIVE before returning.
Creating Asset Models
Section titled “Creating Asset Models”import * as AWS from "alchemy/AWS";
const model = yield* AWS.IoTSiteWise.AssetModel("PumpModel", { assetModelDescription: "A pump on the factory floor", assetModelProperties: [ { name: "SerialNumber", dataType: "STRING", type: { attribute: { defaultValue: "unknown" } }, }, { name: "Temperature", dataType: "DOUBLE", unit: "Celsius", type: { measurement: {} }, }, ],});Hierarchies
Section titled “Hierarchies”const pump = yield* AWS.IoTSiteWise.AssetModel("PumpModel", { assetModelProperties: [ { name: "Temperature", dataType: "DOUBLE", type: { measurement: {} } }, ],});
const site = yield* AWS.IoTSiteWise.AssetModel("SiteModel", { assetModelHierarchies: [ { name: "Pumps", childAssetModelId: pump.assetModelId }, ],});