IoT TS Aggregates Java 客户端
简介
IoT TS Aggregates Java 客户端允许用户查询聚合的时间序列数据。有关该服务的更多信息,请参见 IoT TS Aggregates
提示
在 IoT 环境中,assets 指 entity
,aspects 指 propertyset
。
TS Aggregates 操作
客户端名称:AggregatesClient
读取聚合的时间序列
本节显示两个选项,用于从指定的时间范围读取 asset 特定 aspect 的聚合时间序列数据。只有在 aspect 数据在指定的时间范围内可用时,此功能才可用。
说明
查询在一个响应中最多只能返回 200 个聚合时间间隔。
聚合只能从最多 5,000 个原始时间序列条目创建。
// Construct the AggregatesClient object
AggregatesClient aggregate_client = AggregatesClient.builder()
.mindsphereCredentials(<credentials>)
.restClientConfig(<config>)
.build();
List<Aggregates> aggregate_list = null;
try {
aggregate_list = aggregate_client.getAggregateTimeseries(<entity_id>, <property_set>, <from>, <to>, <interval_value>, <interval_unit>, <select>);
} catch (MindsphereException e) {
// Exception handling
}
或者,使用 GetAggregateTimeseriesRequest
模型。
// Construct the AggregatesClient object as shown above
GetAggregateTimeseriesRequest request_object = new GetAggregateTimeseriesRequest();
request_object.setEntity(<entity_id>);
request_object.setPropertyset(<property_set>);
request_object.setFrom(<from>);
request_object.setTo(<to>);
request_object.setIntervalValue(<interval_value>);
request_object.setIntervalUnit(<interval_unit>);
request_object.setSelect(<select>);
List<Aggregates> aggregate_list = null;
try {
aggregate_list = aggregate_client.getAggregateTimeseries(request_object);
} catch (MindsphereException e) {
// Exception handling
}
还有问题?
除非另行声明,该网站内容遵循MindSphere开发许可协议.
Last update: June 26, 2019