GetPropertyValueHistory - AWS IoT TwinMaker

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

GetPropertyValueHistory

检索有关组件、组件类型、实体或工作区的时间序列属性值历史记录的信息。

您必须为 workspaceId 指定一个值。对于特定于实体的查询,请为 componentNameentityId 指定值。对于跨实体查询,请为指定一个值。componentTypeId

请求语法

POST /workspaces/workspaceId/entity-properties/history HTTP/1.1 Content-type: application/json { "componentName": "string", "componentPath": "string", "componentTypeId": "string", "endDateTime": number, "endTime": "string", "entityId": "string", "interpolation": { "interpolationType": "string", "intervalInSeconds": number }, "maxResults": number, "nextToken": "string", "orderByTime": "string", "propertyFilters": [ { "operator": "string", "propertyName": "string", "value": { "booleanValue": boolean, "doubleValue": number, "expression": "string", "integerValue": number, "listValue": [ "DataValue" ], "longValue": number, "mapValue": { "string" : "DataValue" }, "relationshipValue": { "targetComponentName": "string", "targetEntityId": "string" }, "stringValue": "string" } } ], "selectedProperties": [ "string" ], "startDateTime": number, "startTime": "string" }

URI 请求参数

请求使用以下 URI 参数。

workspaceId

工作区的 ID。

长度限制:长度下限为 1。长度上限为 128。

模式:[a-zA-Z_0-9][a-zA-Z_\-0-9]*[a-zA-Z0-9]+

必需:是

请求体

请求接受采用 JSON 格式的以下数据。

componentName

组件名称。

类型:字符串

长度限制:最小长度为 1。最大长度为 256。

模式:[a-zA-Z_\-0-9]+

必需:否

componentPath

此字符串指定从顶层组件开始的复合组件路径。

类型:字符串

长度限制:最小长度为 0。最大长度为 2048。

模式:[a-zA-Z_\-0-9/]+

必需:否

componentTypeId

组件类型的 ID。

类型:字符串

长度限制:最小长度为 1。最大长度为 256。

模式:[a-zA-Z_\.\-0-9:]+

必需:否

endDateTime

该参数已弃用

要返回的最新属性值的日期和时间。

类型:时间戳

必需:否

endTime

要返回的最新属性值的 ISO8601 DateTime 。

有关 ISO8601 DateTime 格式的更多信息,请参阅数据类型PropertyValue

类型:字符串

长度约束:最小长度为 20。最大长度为 35。

必需:否

entityId

实体的 ID。

类型:字符串

长度限制:长度下限为 1。长度上限为 128。

模式:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|^[a-zA-Z0-9][a-zA-Z_\-0-9.:]*[a-zA-Z0-9]+

必需:否

interpolation

指定插值类型和插值数据间隔的对象。

类型:InterpolationParameters 对象

必需:否

maxResults

一次性返回的最大结果数。默认值为 25。

有效范围:最小值为 1。最大值为 250。

类型:整数

有效范围:最小值为 0。最大值为 200。

必需:否

nextToken

指定下一页结果的字符串。

类型:字符串

长度约束:最小长度为 0。最大长度为 17880。

模式:.*

必需:否

orderByTime

在结果顺序中使用的时间方向。

类型:字符串

有效值:ASCENDING | DESCENDING

必需:否

propertyFilters

筛选属性值历史请求的对象列表。

类型:PropertyFilter 对象数组

数组成员:最少 1 个物品。最多 10 个物品。

必需:否

selectedProperties

请求检索其值历史记录的属性列表。

类型:字符串数组

数组成员:最少 1 个物品。最多 10 项。

长度限制:最小长度为 1。最大长度为 256。

模式:.*

必需:是

startDateTime

该参数已弃用

要返回的最早的属性值的日期和时间。

类型:时间戳

必需:否

startTime

最早要返回 DateTime 的属性值的 ISO8601。

有关 ISO8601 DateTime 格式的更多信息,请参阅数据类型PropertyValue

类型:字符串

长度约束:最小长度为 20。最大长度为 35。

必需:否

响应语法

HTTP/1.1 200 Content-type: application/json { "nextToken": "string", "propertyValues": [ { "entityPropertyReference": { "componentName": "string", "componentPath": "string", "entityId": "string", "externalIdProperty": { "string" : "string" }, "propertyName": "string" }, "values": [ { "time": "string", "timestamp": number, "value": { "booleanValue": boolean, "doubleValue": number, "expression": "string", "integerValue": number, "listValue": [ "DataValue" ], "longValue": number, "mapValue": { "string" : "DataValue" }, "relationshipValue": { "targetComponentName": "string", "targetEntityId": "string" }, "stringValue": "string" } } ] } ] }

响应元素

如果此操作成功,则该服务将会发送回 HTTP 200 响应。

服务以 JSON 格式返回以下数据。

nextToken

指定下一页结果的字符串。

类型:字符串

长度约束:最小长度为 0。最大长度为 17880。

模式:.*

propertyValues

将字符串映射到组件类型中的属性定义的对象。映射中的每个字符串对于该对象都必须是唯一的。

类型:PropertyValueHistory 对象数组

错误

有关所有操作的常见错误信息,请参阅常见错误

AccessDeniedException

访问被拒绝。

HTTP 状态代码:403

ConnectorFailureException

连接器发生故障。

HTTP 状态代码:424

ConnectorTimeoutException

连接器超时。

HTTP 状态代码:424

InternalServerException

出现意外错误。

HTTP 状态代码:500

ResourceNotFoundException

未找到资源。

HTTP 状态代码:404

ThrottlingException

速率超过限制。

HTTP 状态代码:429

ValidationException

失败

HTTP 状态代码:400

另请参阅

有关在特定语言的 AWS SDK 中使用此 API 的更多信息,请参阅以下内容: