

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 管理接口、关联资产模型和属性
<a name="interfaces-manage"></a>

创建接口并将其链接到资产模型后，您可以通过控制台或... 管理关系、编辑和删除接口 AWS CLI。

## 修改接口和资产模型关系
<a name="interface-edit"></a>

要更改接口与资产模型的关系，请在 AWS IoT SiteWise 控制台中或通过以下方式执行以下操作 AWS CLI：

------
#### [ Console ]

1. 导航到[AWS IoT SiteWise 控制台](https://console.aws.amazon.com/iotsitewise/)并**从导航窗格中选择**模型。

1. 选择要修改的接口。

1. 选择资产模型进行修改和编辑。

   您可以按照[将接口应用于资产模型](interfaces-link-asset-model.md)说明链接不同的资产模型。

1. 选择 “**应用接口” ** 以保存您的更改。

------
#### [ AWS CLI ]

要编辑接口和资产模型关系，请使用`PutAssetModelInterfaceRelationship`操作。将 {{your-asset-model-id}} 和 {{your-interface-asset-model-id}} 替换为您自己的值。有关更多信息，请参阅《AWS IoT SiteWise API Reference》**中的 [PutAssetModelInterfaceRelationship](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_PutAssetModelInterfaceRelationship.html)。

```
aws iotsitewise put-asset-model-interface-relationship \
    --asset-model-id {{your-asset-model-id}} \
    --interface-asset-model-id {{your-interface-asset-model-id}}
```

------

## 修改接口属性映射
<a name="interface-edit-property"></a>

要更改接口的属性，请在 AWS IoT SiteWise 控制台中或通过以下方式执行以下操作 AWS CLI：

------
#### [ Console ]

1. 导航到[AWS IoT SiteWise 控制台](https://console.aws.amazon.com/iotsitewise/)并**从导航窗格中选择**模型。

1. 选择要修改属性映射的接口。将出现 ** “编辑属性映射**” 页面。

1. 在 “**属性映射**” 部分中，筛选列表以查找相应的属性映射。

1. 使用**模型属性**列更改属性。

------
#### [ AWS CLI ]

要编辑接口和资产模型关系，请使用`PutAssetModelInterfaceRelationship`操作。将 {{your-asset-model-id}} 和 {{your-interface-asset-model-id}} 替换为您自己的值。有关更多信息，请参阅《AWS IoT SiteWise API Reference》**中的 [PutAssetModelInterfaceRelationship](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_PutAssetModelInterfaceRelationship.html)。

```
aws iotsitewise put-asset-model-interface-relationship \
    --asset-model-id {{your-asset-model-id}} \
    --interface-asset-model-id {{your-interface-asset-model-id}} \
```

------

## 列出链接到资产模型的接口
<a name="interface-list"></a>

要获取应用于资产模型的接口列表，请在 AWS IoT SiteWise 控制台中或通过以下方式执行以下操作 AWS CLI：

------
#### [ Console ]

1. 导航到[AWS IoT SiteWise 控制台](https://console.aws.amazon.com/iotsitewise/)并**从导航窗格中选择**模型。

1. 在**模型**部分中，选择相应的资产模型或接口。您可以在模型的相应详细信息页面上查看应用接口或关联资产模型的列表。
   + 查看特定界面时，请参阅**关联资产模型**部分。
   + 查看特定资产模型时，请参阅 “**应用接口**” 部分。

------
#### [ AWS CLI ]

要列出接口，可以使用该`ListInterfaceRelationships`操作。将 {{your-interface-asset-model-id}} 替换为您自己的值。有关更多信息，请参阅《AWS IoT SiteWise API Reference》**中的 [ListInterfaceRelationships](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_ListInterfaceRelationships.html)。

```
aws iotsitewise list-interface-relationships \
    --interface-asset-model-id {{your-interface-asset-model-id}} \
    [--next-token {{your-next-token}}] \
    [--max-results {{20}}]
```

------

## 查看接口和资产模型关系的详细信息
<a name="interface-view-details"></a>

要查看应用于资产模型的接口的详细信息，请在 AWS IoT SiteWise 控制台中或通过以下方式执行以下操作 AWS CLI：

------
#### [ Console ]

查看应用接口和关联资产模型的详细信息。

1. 导航到[AWS IoT SiteWise 控制台](https://console.aws.amazon.com/iotsitewise/)并**从导航窗格中选择**模型。

1. 在**模型**部分中，搜索相应的资产模型或界面。选择型号或接口的**名称**以打开包含更多详细信息的页面。

------
#### [ AWS CLI ]

要查看接口和资产模型关系的接口详细信息，请使用`DescribeAssetModelInterfaceRelationship`操作。将 {{your-asset-model-id}} 和 {{your-interface-asset-model-id}} 替换为您自己的值。有关更多信息，请参阅《AWS IoT SiteWise API Reference》**中的 [DescribeAssetModelInterfaceRelationship](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeAssetModelInterfaceRelationship.html)。

```
aws iotsitewise describe-asset-model-interface-relationship \
    --asset-model-id {{your-asset-model-id}} \
    --interface-asset-model-id {{your-interface-asset-model-id}}
```

------

## 移除应用于资产模型的接口
<a name="interface-remove"></a>

要删除应用于资产模型的接口，请在 AWS IoT SiteWise 控制台中或通过以下方式执行以下操作 AWS CLI：

------
#### [ Console ]

我们建议通过资产模型删除接口。您还可以通过特定接口的页面删除接口或取消接口的链接。

1. 导航到[AWS IoT SiteWise 控制台](https://console.aws.amazon.com/iotsitewise/)并**从导航窗格中选择**模型。

1. 选择相应的资产模型以从中移除接口关系。

1. 选择 “**取消关联资产模型**”。

------
#### [ AWS CLI ]

要从资产模型中移除接口关系，可以使用`DeleteAssetModelInterfaceRelationship`操作。将 {{your-interface-asset-model-id}} 替换为您自己的值。有关更多信息，请参阅《AWS IoT SiteWise API Reference》**中的 [DeleteAssetModelInterfaceRelationship](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DeleteAssetModelInterfaceRelationship.html)。

```
aws iotsitewise delete-asset-model-interface-relationship \
    --asset-model-id {{your-asset-model-id}} \
    --interface-asset-model-id {{your-interface-asset-model-id}}
```

------