

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

# 导出元数据示例
<a name="bulk-operations-export-filter-examples"></a>

将 AWS IoT SiteWise 内容批量导出到 Amazon S3 时，您可以指定*筛选条件*来限制要导出的特定资产模型和资产。

您在请求正文 `sources` 部分内的 `iotSiteWiseConfiguration` 部分中指定筛选条件。

**注意**  
您可以包含多个筛选条件。批量操作将导出与任何筛选条件匹配的任何资产模型或资产。  
如果您未提供任何筛选条件，则该操作将导出所有资产模型和资产。

```
{
    "metadataTransferJobId": "your-transfer-job-id",
    "sources": [{
        "type": "iotsitewise",
        "iotSiteWiseConfiguration": {
            "filters": [{
                list of filters
            }]
        }
    }],
    "destination": {
        "type": "s3",
        "s3Configuration": {
            "location": "arn:aws:s3:::amzn-s3-demo-bucket"
        }
    }
}
```



## 按资产模型筛选
<a name="bulk-export-filter-asset-model"></a>

您可以筛选特定的资产模型。您还可以使用该模型的所有资产或其层次结构中的所有资产模型。不能同时包含资产和层次结构。

有关层次结构的更多信息，请参阅[定义资产模型层次结构](define-asset-hierarchies.md)。

------
#### [ Asset model ]

此筛选条件包括指定的资产模型：

```
"filterByAssetModel": {
    "assetModelId": "asset model ID"
}
```

------
#### [ Asset model and its assets ]

此筛选条件包括指定的资产模型，以及使用该资产模型的所有资产：

```
"filterByAssetModel": {
    "assetModelId": "asset model ID",
    "includeAssets": true
}
```

------
#### [ Asset model and its hierarchy ]

此筛选条件包括指定的资产模型，以及其层次结构中的所有关联资产模型：

```
"filterByAssetModel": {
    "assetModelId": "asset model ID",
    "includeOffspring": true
}
```

------

## 按资产筛选
<a name="bulk-export-filter-asset"></a>

您可以筛选特定的资产。您还可以包含其资产模型或其层次结构中的所有关联资产。不能同时包含资产模型和层次结构。

有关层次结构的更多信息，请参阅[定义资产模型层次结构](define-asset-hierarchies.md)。

------
#### [ Asset ]

此筛选条件包括指定的资产：

```
"filterByAsset": {
    "assetId": "asset ID"
}
```

------
#### [ Asset and its asset model ]

此筛选条件包括指定的资产，以及其使用的资产模型：

```
"filterByAsset": {
    "assetId": "asset ID",
    "includeAssetModel": true
}
```

------
#### [ Asset and its hierarchy ]

此筛选条件包括指定的资产，以及其层次结构中的所有关联资产：

```
"filterByAsset": {
    "assetId": "asset ID",
    "includeOffspring": true
}
```

------