本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
将接口应用于资产模型
将接口应用于资产模型时,您可以将资产模型属性和层次结构映射到它们的接口对应物。对于未映射的接口属性,将在资产模型中自动创建相应的属性。关联后,该服务可防止对资产模型进行可能违反接口标准的更改。
一次可以向界面添加一个资产模型。但是,可以将多个资产模型链接到单个接口。
- Console
-
-
导航到AWS IoT SiteWise 控制台
并从导航窗格中选择模型。 -
选择要应用接口的资产模型。
-
在 “链接资产模型” 部分中选择 “关联资产模型”。这将打开链接界面页面。
-
在资产模型和接口部分中,从选择要链接的模型下拉菜单中选择资产模型。
-
在属性映射部分中,将每个接口属性映射到现有资产模型属性或创建新属性。 AWS IoT SiteWise 在资产模型和界面中自动将属性与匹配名称关联起来。
-
查看属性映射并选择链接接口。
-
- AWS CLI
-
要将接口应用于资产模型,请使用以下
PutAssetModelInterfaceRelationship操作:aws iotsitewise put-asset-model-interface-relationship \ --asset-model-id "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE" \ --interface-asset-model-id "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE" \ --property-mapping-configuration '{ "createMissingProperty": true, "matchByPropertyName": true, "overrides": [ { "assetModelPropertyId": "a1b2c3d4-5678-90ab-cdef-44444EXAMPLE", "interfaceAssetModelPropertyId": "a1b2c3d4-5678-90ab-cdef-33333EXAMPLE" } ] }'要检索有关接口关系的信息,请使用以下
DescribeAssetModelInterfaceRelationship操作:aws iotsitewise describe-asset-model-interface-relationship \ --asset-model-id "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE" \ --interface-asset-model-id "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE"要列出应用了特定接口的所有资产模型,请使用以下
ListInterfaceRelationships操作:aws iotsitewise list-interface-relationships \ --interface-asset-model-id "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE" \ --max-results 10要删除接口关系,请使用以下
DeleteAssetModelInterfaceRelationship操作:aws iotsitewise delete-asset-model-interface-relationship \ --asset-model-id "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE" \ --interface-asset-model-id "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE"
创建接口
管理接口