Query - Execute
在结果页中执行时序查询 - 获取事件、获取序列或聚合序列。
POST https://{environmentFqdn}/timeseries/query?api-version=2020-07-31
POST https://{environmentFqdn}/timeseries/query?api-version=2020-07-31&storeType={storeType}
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
environment
|
path | True |
string |
每个环境 FQDN,例如 10000000-0000-0000-0000-100000000109.env.timeseries.azure.com。 可以从 Get Environments API、Azure 门户或 Azure 资源管理器的响应中获取此域名。 |
api-version
|
query | True |
string |
要用于客户端请求的 API 的版本。 当前支持的版本为“2020-07-31”。 |
store
|
query |
string |
对于启用了暖存储的环境,可以在“WarmStore”或“ColdStore”上执行查询。 查询中的此参数定义应在哪个商店执行查询。 如果未定义,查询将在冷存储上执行。 |
请求头
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
x-ms-continuation |
string |
在支持分页的调用中检索结果的下一页的结果的延续标记。 若要获取第一页结果,请将 null 继续标记指定为参数值。 如果返回了所有结果,则返回的继续标记为 null,并且没有下一页的结果。 |
|
x-ms-client-request-id |
string |
可选的客户端请求 ID。 服务记录此值。 允许服务跨服务跟踪作,并允许客户联系有关特定请求的支持人员。 |
|
x-ms-client-session-id |
string |
可选的客户端会话 ID。 服务记录此值。 允许服务跨服务跟踪一组相关作,并允许客户联系有关特定请求组的支持人员。 |
请求正文
名称 | 类型 | 说明 |
---|---|---|
aggregateSeries |
聚合序列查询。 允许根据给定时序 ID 和搜索范围从事件计算聚合时序。 |
|
getEvents |
获取事件查询。 允许检索给定时序 ID 和搜索范围的原始事件。 |
|
getSeries |
获取序列查询。 允许从给定时序 ID 和搜索范围的事件中检索计算变量值的时序。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
成功查询。 标头 x-ms-request-id: string |
|
Other Status Codes |
意外错误。 标头 x-ms-request-id: string |
安全性
azure_auth
Azure Active Directory OAuth2 Flow
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
示例
ColdStoreQueryAggregateSeriesPage1
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=coldstore
{
"aggregateSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"interval": "PT1M",
"inlineVariables": {
"Count": {
"kind": "aggregate",
"filter": null,
"aggregation": {
"tsx": "count()"
}
},
"MinTemperature": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "min($value)"
}
},
"MaxTemperature": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "max($value)"
}
}
},
"projectedVariables": [
"Count",
"MinTemperature",
"MaxTemperature"
]
}
}
示例响应
{
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}
ColdStoreQueryAggregateSeriesPage2
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=coldstore
{
"aggregateSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"interval": "PT1M",
"inlineVariables": {
"Count": {
"kind": "aggregate",
"filter": null,
"aggregation": {
"tsx": "count()"
}
},
"MinTemperature": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "min($value)"
}
},
"MaxTemperature": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "max($value)"
}
}
},
"projectedVariables": [
"Count",
"MinTemperature",
"MaxTemperature"
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:00Z",
"2016-08-01T00:01:00Z",
"2016-08-01T00:02:00Z",
"2016-08-01T00:03:00Z",
"2016-08-01T00:04:00Z",
"2016-08-01T00:05:00Z",
"2016-08-01T00:06:00Z",
"2016-08-01T00:07:00Z",
"2016-08-01T00:08:00Z",
"2016-08-01T00:09:00Z",
"2016-08-01T00:10:00Z"
],
"properties": [
{
"name": "Count",
"type": "Long",
"values": [
50,
60,
60,
60,
60,
60,
60,
60,
60,
60,
null
]
},
{
"name": "AverageTemperature",
"type": "Double",
"values": [
71.25,
85,
82.5,
80,
89.16666666666667,
75,
90,
75.83333333333333,
85,
82.5,
null
]
},
{
"name": "MinTemperature",
"type": "Double",
"values": [
65.125,
77.625,
65.125,
72.625,
65.125,
67.625,
82.625,
65.125,
77.625,
65.125,
null
]
},
{
"name": "MaxTemperature",
"type": "Double",
"values": [
77.375,
92.375,
99.875,
87.375,
99.875,
82.375,
97.375,
99.875,
92.375,
99.875,
null
]
}
],
"progress": 100
}
ColdStoreQueryGetEventsPage1
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=coldstore
{
"getEvents": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": {
"tsx": "($event.Value.Double != null) OR ($event.Status.String = 'Good')"
},
"projectedProperties": [
{
"name": "Building",
"type": "String"
},
{
"name": "Temperature",
"type": "Double"
}
]
}
}
示例响应
{
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}
ColdStoreQueryGetEventsPage2
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=coldstore
{
"getEvents": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": {
"tsx": "($event.Value.Double != null) OR ($event.Status.String = 'Good')"
},
"projectedProperties": [
{
"name": "Building",
"type": "String"
},
{
"name": "Temperature",
"type": "Double"
}
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:10Z",
"2016-08-01T00:00:11Z",
"2016-08-01T00:00:12Z",
"2016-08-01T00:00:13Z",
"2016-08-01T00:00:14Z",
"2016-08-01T00:00:15Z",
"2016-08-01T00:00:16Z",
"2016-08-01T00:00:17Z",
"2016-08-01T00:00:18Z",
"2016-08-01T00:00:19Z"
],
"properties": [
{
"name": "Building",
"type": "String",
"values": [
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium"
]
},
{
"name": "Temperature",
"type": "Double",
"values": [
65.125,
65.375,
65.625,
65.875,
66.125,
66.375,
66.625,
66.875,
67.125,
67.375
]
}
],
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAxYZwidGFrZSI6MTAwMH0="
}
ColdStoreQueryGetEventsPage3
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=coldstore
{
"getEvents": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": {
"tsx": "($event.Value.Double != null) OR ($event.Status.String = 'Good')"
},
"projectedProperties": [
{
"name": "Building",
"type": "String"
},
{
"name": "Temperature",
"type": "Double"
}
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:20Z"
],
"properties": [
{
"name": "Building",
"type": "String",
"values": [
"Millenium"
]
},
{
"name": "Temperature",
"type": "Double",
"values": [
67.575
]
}
],
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAbCDewidGFrZSI6MTAwMH0="
}
ColdStoreQueryGetEventsPage4
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=coldstore
{
"getEvents": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": {
"tsx": "($event.Value.Double != null) OR ($event.Status.String = 'Good')"
},
"projectedProperties": [
{
"name": "Building",
"type": "String"
},
{
"name": "Temperature",
"type": "Double"
}
]
}
}
示例响应
{
"timestamps": [],
"properties": [],
"progress": 100
}
ColdStoreQueryGetSeriesPage1
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=coldstore
{
"getSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": null,
"inlineVariables": {
"temperatures": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "avg($value)"
}
}
},
"projectedVariables": [
"temperatures"
]
}
}
示例响应
{
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}
ColdStoreQueryGetSeriesPage2
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=coldstore
{
"getSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": null,
"inlineVariables": {
"temperatures": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "avg($value)"
}
}
},
"projectedVariables": [
"temperatures"
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:10Z",
"2016-08-01T00:00:11Z",
"2016-08-01T00:00:12Z",
"2016-08-01T00:00:13Z",
"2016-08-01T00:00:14Z",
"2016-08-01T00:00:15Z",
"2016-08-01T00:00:16Z",
"2016-08-01T00:00:17Z",
"2016-08-01T00:00:18Z",
"2016-08-01T00:00:19Z",
"2016-08-01T00:00:20Z"
],
"properties": [
{
"name": "temperatures",
"type": "Double",
"values": [
65.125,
65.375,
65.625,
65.875,
66.125,
66.375,
66.625,
66.875,
67.125,
67.375,
67.625
]
}
],
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAxYZwidGFrZSI6MTAwMH0="
}
ColdStoreQueryGetSeriesPage3
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=coldstore
{
"getSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": null,
"inlineVariables": {
"temperatures": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "avg($value)"
}
}
},
"projectedVariables": [
"temperatures"
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:21Z"
],
"properties": [
{
"name": "temperatures",
"type": "Double",
"values": [
67.825
]
}
],
"progress": 100
}
QueryAggregateSeriesPage1
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"aggregateSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"interval": "PT1M",
"inlineVariables": {
"Count": {
"kind": "aggregate",
"filter": null,
"aggregation": {
"tsx": "count()"
}
},
"MinTemperature": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "min($value)"
}
},
"MaxTemperature": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "max($value)"
}
}
},
"projectedVariables": [
"Count",
"MinTemperature",
"MaxTemperature"
]
}
}
示例响应
{
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}
QueryAggregateSeriesPage2
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"aggregateSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"interval": "PT1M",
"inlineVariables": {
"Count": {
"kind": "aggregate",
"filter": null,
"aggregation": {
"tsx": "count()"
}
},
"MinTemperature": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "min($value)"
}
},
"MaxTemperature": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "max($value)"
}
}
},
"projectedVariables": [
"Count",
"MinTemperature",
"MaxTemperature"
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:00Z",
"2016-08-01T00:01:00Z",
"2016-08-01T00:02:00Z",
"2016-08-01T00:03:00Z",
"2016-08-01T00:04:00Z",
"2016-08-01T00:05:00Z",
"2016-08-01T00:06:00Z",
"2016-08-01T00:07:00Z",
"2016-08-01T00:08:00Z",
"2016-08-01T00:09:00Z",
"2016-08-01T00:10:00Z"
],
"properties": [
{
"name": "Count",
"type": "Long",
"values": [
50,
60,
60,
60,
60,
60,
60,
60,
60,
60,
null
]
},
{
"name": "AverageTemperature",
"type": "Double",
"values": [
71.25,
85,
82.5,
80,
89.16666666666667,
75,
90,
75.83333333333333,
85,
82.5,
null
]
},
{
"name": "MinTemperature",
"type": "Double",
"values": [
65.125,
77.625,
65.125,
72.625,
65.125,
67.625,
82.625,
65.125,
77.625,
65.125,
null
]
},
{
"name": "MaxTemperature",
"type": "Double",
"values": [
77.375,
92.375,
99.875,
87.375,
99.875,
82.375,
97.375,
99.875,
92.375,
99.875,
null
]
}
],
"progress": 100
}
QueryAggregateSeriesWithCategoricalInterpolatedVariable
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"aggregateSeries": {
"searchSpan": {
"from": "2019-10-10T23:41:04.021Z",
"to": "2019-10-10T23:42:22.846Z"
},
"timeSeriesId": [
"Sensor_58"
],
"interval": "PT2S",
"inlineVariables": {
"Status_String": {
"kind": "categorical",
"value": {
"tsx": "$event.[Status].String"
},
"interpolation": {
"kind": "Step",
"boundary": {
"span": "PT5S"
}
},
"categories": [
{
"label": "Good",
"values": [
"Good",
"Very Good",
"Excellent"
]
},
{
"label": "Bad",
"values": [
"Bad",
"OK"
]
},
{
"label": "Other",
"values": [
"Other"
]
}
],
"defaultCategory": {
"label": "Unknown"
}
},
"Status_Long": {
"kind": "categorical",
"value": {
"tsx": "tolong($event.[Status].Double)"
},
"interpolation": {
"kind": "Step",
"boundary": {
"span": "PT5S"
}
},
"categories": [
{
"label": "Good",
"values": [
0,
1,
2
]
},
{
"label": "Bad",
"values": [
3,
4
]
},
{
"label": "Other",
"values": [
5
]
}
],
"defaultCategory": {
"label": "Unknown"
}
}
},
"projectedVariables": [
"Status_String",
"Status_Long"
]
}
}
示例响应
{
"timestamps": [
"2019-10-10T23:41:04Z",
"2019-10-10T23:41:06Z",
"2019-10-10T23:41:08Z",
"2019-10-10T23:41:10Z",
"2019-10-10T23:41:12Z",
"2019-10-10T23:41:14Z",
"2019-10-10T23:41:16Z",
"2019-10-10T23:41:18Z",
"2019-10-10T23:41:20Z",
"2019-10-10T23:41:22Z"
],
"properties": [
{
"values": [
0.203,
0.141,
0.268,
0.398,
0.402,
0.047,
0.1245,
0.75,
0.206,
0.2635
],
"name": "Status_String[Good]",
"type": "Double"
},
{
"values": [
0.266,
0.1955,
0.242,
0.148,
0.25,
0.055,
0.6295,
0.109,
0.41,
0.2125
],
"name": "Status_String[Bad]",
"type": "Double"
},
{
"values": [
0.5205,
0.6635,
0.49,
0.454,
0.348,
0.898,
0.246,
0.141,
0.384,
0.524
],
"name": "Status_String[Other]",
"type": "Double"
},
{
"values": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"name": "Status_String[Unknown]",
"type": "Double"
},
{
"values": [
0.203,
0.141,
0.268,
0.398,
0.402,
0.047,
0.1245,
0.75,
0.206,
0.2635
],
"name": "Status_Long[Good]",
"type": "Double"
},
{
"values": [
0.266,
0.1955,
0.242,
0.148,
0.25,
0.055,
0.6295,
0.109,
0.41,
0.2125
],
"name": "Status_Long[Bad]",
"type": "Double"
},
{
"values": [
0.5205,
0.6635,
0.49,
0.454,
0.348,
0.898,
0.246,
0.141,
0.384,
0.524
],
"name": "Status_Long[Other]",
"type": "Double"
},
{
"values": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"name": "Status_Long[Unknown]",
"type": "Double"
}
],
"progress": 100
}
QueryAggregateSeriesWithCategoricalVariable
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"aggregateSeries": {
"searchSpan": {
"from": "2019-10-10T23:42:00.000Z",
"to": "2019-10-10T23:42:20.000Z"
},
"timeSeriesId": [
"Sensor_58"
],
"interval": "PT2S",
"inlineVariables": {
"Status_String": {
"kind": "categorical",
"value": {
"tsx": "$event.[Status].String"
},
"categories": [
{
"label": "Good",
"values": [
"Good",
"Very Good",
"Excellent"
]
},
{
"label": "Bad",
"values": [
"Bad",
"OK"
]
},
{
"label": "Other",
"values": [
"Other"
]
}
],
"defaultCategory": {
"label": "Unknown"
}
},
"Status_Long": {
"kind": "categorical",
"value": {
"tsx": "tolong($event.[Status].Double)"
},
"categories": [
{
"label": "Good",
"values": [
0,
1,
2
]
},
{
"label": "Bad",
"values": [
3,
4
]
},
{
"label": "Other",
"values": [
5
]
}
],
"defaultCategory": {
"label": "Unknown"
}
}
},
"projectedVariables": [
"Status_String",
"Status_Long"
]
}
}
示例响应
{
"timestamps": [
"2019-10-10T23:42:00Z",
"2019-10-10T23:42:02Z",
"2019-10-10T23:42:04Z",
"2019-10-10T23:42:06Z",
"2019-10-10T23:42:08Z",
"2019-10-10T23:42:10Z",
"2019-10-10T23:42:12Z",
"2019-10-10T23:42:14Z",
"2019-10-10T23:42:16Z",
"2019-10-10T23:42:18Z"
],
"properties": [
{
"values": [
5,
8,
4,
6,
9,
8,
3,
6,
5,
8
],
"name": "Status_String[Good]",
"type": "Long"
},
{
"values": [
4,
3,
3,
5,
5,
3,
9,
7,
7,
7
],
"name": "Status_String[Bad]",
"type": "Long"
},
{
"values": [
11,
9,
13,
9,
6,
9,
8,
7,
8,
5
],
"name": "Status_String[Other]",
"type": "Long"
},
{
"values": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"name": "Status_String[Unknown]",
"type": "Long"
},
{
"values": [
5,
8,
4,
6,
9,
8,
3,
6,
5,
8
],
"name": "Status_Long[Good]",
"type": "Long"
},
{
"values": [
4,
3,
3,
5,
5,
3,
9,
7,
7,
7
],
"name": "Status_Long[Bad]",
"type": "Long"
},
{
"values": [
11,
9,
13,
9,
6,
9,
8,
7,
8,
5
],
"name": "Status_Long[Other]",
"type": "Long"
},
{
"values": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"name": "Status_Long[Unknown]",
"type": "Long"
}
],
"progress": 100
}
QueryAggregateSeriesWithSampleInterpolation
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"aggregateSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"interval": "PT1M",
"inlineVariables": {
"LinearSampleInterpolation": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"interpolation": {
"kind": "Linear",
"boundary": {
"span": "P1D"
}
},
"aggregation": {
"tsx": "left($value)"
}
},
"StepSampleInterpolation": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"interpolation": {
"kind": "Step",
"boundary": {
"span": "P1D"
}
},
"aggregation": {
"tsx": "left($value)"
}
}
},
"projectedVariables": [
"LinearSampleInterpolation",
"StepSampleInterpolation"
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:00Z",
"2016-08-01T00:01:00Z",
"2016-08-01T00:02:00Z",
"2016-08-01T00:03:00Z",
"2016-08-01T00:04:00Z",
"2016-08-01T00:05:00Z",
"2016-08-01T00:06:00Z",
"2016-08-01T00:07:00Z",
"2016-08-01T00:08:00Z",
"2016-08-01T00:09:00Z",
"2016-08-01T00:10:00Z"
],
"properties": [
{
"name": "LinearSampleInterpolation",
"type": "Double",
"values": [
50,
60,
60,
60,
60,
60,
60,
60,
60,
60,
62
]
},
{
"name": "StepSampleInterpolation",
"type": "Double",
"values": [
71.25,
85,
82.5,
80,
89.16666666666667,
75,
90,
75.83333333333333,
85,
82.5,
84
]
}
],
"progress": 100
}
QueryGetEventsPage1
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"getEvents": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": {
"tsx": "($event.Value.Double != null) OR ($event.Status.String = 'Good')"
},
"projectedProperties": [
{
"name": "Building",
"type": "String"
},
{
"name": "Temperature",
"type": "Double"
}
]
}
}
示例响应
{
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}
QueryGetEventsPage2
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"getEvents": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": {
"tsx": "($event.Value.Double != null) OR ($event.Status.String = 'Good')"
},
"projectedProperties": [
{
"name": "Building",
"type": "String"
},
{
"name": "Temperature",
"type": "Double"
}
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:10Z",
"2016-08-01T00:00:11Z",
"2016-08-01T00:00:12Z",
"2016-08-01T00:00:13Z",
"2016-08-01T00:00:14Z",
"2016-08-01T00:00:15Z",
"2016-08-01T00:00:16Z",
"2016-08-01T00:00:17Z",
"2016-08-01T00:00:18Z",
"2016-08-01T00:00:19Z"
],
"properties": [
{
"name": "Building",
"type": "String",
"values": [
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium"
]
},
{
"name": "Temperature",
"type": "Double",
"values": [
65.125,
65.375,
65.625,
65.875,
66.125,
66.375,
66.625,
66.875,
67.125,
67.375
]
}
],
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAxYZwidGFrZSI6MTAwMH0="
}
QueryGetEventsPage3
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"getEvents": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": {
"tsx": "($event.Value.Double != null) OR ($event.Status.String = 'Good')"
},
"projectedProperties": [
{
"name": "Building",
"type": "String"
},
{
"name": "Temperature",
"type": "Double"
}
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:20Z"
],
"properties": [
{
"name": "Building",
"type": "String",
"values": [
"Millenium"
]
},
{
"name": "Temperature",
"type": "Double",
"values": [
67.575
]
}
],
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAbCDewidGFrZSI6MTAwMH0="
}
QueryGetEventsPage4
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"getEvents": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": {
"tsx": "($event.Value.Double != null) OR ($event.Status.String = 'Good')"
},
"projectedProperties": [
{
"name": "Building",
"type": "String"
},
{
"name": "Temperature",
"type": "Double"
}
]
}
}
示例响应
{
"timestamps": [],
"properties": [],
"progress": 100
}
QueryGetEventsWithTakePage1
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"getEvents": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": {
"tsx": "($event.Value.Double != null) OR ($event.Status.String = 'Good')"
},
"projectedProperties": [
{
"name": "Building",
"type": "String"
},
{
"name": "Temperature",
"type": "Double"
}
],
"take": 10
}
}
示例响应
{
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}
QueryGetEventsWithTakePage2
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"getEvents": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": {
"tsx": "($event.Value.Double != null) OR ($event.Status.String = 'Good')"
},
"projectedProperties": [
{
"name": "Building",
"type": "String"
},
{
"name": "Temperature",
"type": "Double"
}
],
"take": 10
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:10Z",
"2016-08-01T00:00:11Z",
"2016-08-01T00:00:12Z",
"2016-08-01T00:00:13Z",
"2016-08-01T00:00:14Z",
"2016-08-01T00:00:15Z",
"2016-08-01T00:00:16Z",
"2016-08-01T00:00:17Z",
"2016-08-01T00:00:18Z",
"2016-08-01T00:00:19Z"
],
"properties": [
{
"name": "Building",
"type": "String",
"values": [
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium"
]
},
{
"name": "Temperature",
"type": "Double",
"values": [
65.125,
65.375,
65.625,
65.875,
66.125,
66.375,
66.625,
66.875,
67.125,
67.375
]
}
],
"progress": 100
}
QueryGetSeriesPage1
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"getSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": null,
"inlineVariables": {
"temperatures": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "avg($value)"
}
}
},
"projectedVariables": [
"temperatures"
]
}
}
示例响应
{
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}
QueryGetSeriesPage2
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"getSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": null,
"inlineVariables": {
"temperatures": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "avg($value)"
}
}
},
"projectedVariables": [
"temperatures"
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:10Z",
"2016-08-01T00:00:11Z",
"2016-08-01T00:00:12Z",
"2016-08-01T00:00:13Z",
"2016-08-01T00:00:14Z",
"2016-08-01T00:00:15Z",
"2016-08-01T00:00:16Z",
"2016-08-01T00:00:17Z",
"2016-08-01T00:00:18Z",
"2016-08-01T00:00:19Z",
"2016-08-01T00:00:20Z"
],
"properties": [
{
"name": "temperatures",
"type": "Double",
"values": [
65.125,
65.375,
65.625,
65.875,
66.125,
66.375,
66.625,
66.875,
67.125,
67.375,
67.625
]
}
],
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAxYZwidGFrZSI6MTAwMH0="
}
QueryGetSeriesPage3
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"getSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": null,
"inlineVariables": {
"temperatures": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "avg($value)"
}
}
},
"projectedVariables": [
"temperatures"
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:21Z"
],
"properties": [
{
"name": "temperatures",
"type": "Double",
"values": [
67.825
]
}
],
"progress": 100
}
QueryGetSeriesWithTakePage1
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"getSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": null,
"inlineVariables": {
"temperatures": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "avg($value)"
}
}
},
"projectedVariables": [
"temperatures"
],
"take": 10
}
}
示例响应
{
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}
QueryGetSeriesWithTakePage2
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31
{
"getSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": null,
"inlineVariables": {
"temperatures": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "avg($value)"
}
}
},
"projectedVariables": [
"temperatures"
],
"take": 10
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:10Z",
"2016-08-01T00:00:11Z",
"2016-08-01T00:00:12Z",
"2016-08-01T00:00:13Z",
"2016-08-01T00:00:14Z",
"2016-08-01T00:00:15Z",
"2016-08-01T00:00:16Z",
"2016-08-01T00:00:17Z",
"2016-08-01T00:00:18Z",
"2016-08-01T00:00:19Z",
"2016-08-01T00:00:20Z"
],
"properties": [
{
"name": "temperatures",
"type": "Double",
"values": [
65.125,
65.375,
65.625,
65.875,
66.125,
66.375,
66.625,
66.875,
67.125,
67.375,
67.625
]
}
],
"progress": 100
}
WarmStoreQueryAggregateSeriesPage
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=warmstore
{
"aggregateSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"interval": "PT1M",
"inlineVariables": {
"Count": {
"kind": "aggregate",
"filter": null,
"aggregation": {
"tsx": "count()"
}
},
"MinTemperature": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "min($value)"
}
},
"MaxTemperature": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "max($value)"
}
}
},
"projectedVariables": [
"Count",
"MinTemperature",
"MaxTemperature"
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:00Z",
"2016-08-01T00:01:00Z",
"2016-08-01T00:02:00Z",
"2016-08-01T00:03:00Z",
"2016-08-01T00:04:00Z",
"2016-08-01T00:05:00Z",
"2016-08-01T00:06:00Z",
"2016-08-01T00:07:00Z",
"2016-08-01T00:08:00Z",
"2016-08-01T00:09:00Z",
"2016-08-01T00:10:00Z"
],
"properties": [
{
"name": "Count",
"type": "Long",
"values": [
50,
60,
60,
60,
60,
60,
60,
60,
60,
60,
null
]
},
{
"name": "AverageTemperature",
"type": "Double",
"values": [
71.25,
85,
82.5,
80,
89.16666666666667,
75,
90,
75.83333333333333,
85,
82.5,
null
]
},
{
"name": "MinTemperature",
"type": "Double",
"values": [
65.125,
77.625,
65.125,
72.625,
65.125,
67.625,
82.625,
65.125,
77.625,
65.125,
null
]
},
{
"name": "MaxTemperature",
"type": "Double",
"values": [
77.375,
92.375,
99.875,
87.375,
99.875,
82.375,
97.375,
99.875,
92.375,
99.875,
null
]
}
],
"progress": 100
}
WarmStoreQueryGetEventsPage1
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=warmstore
{
"getEvents": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": {
"tsx": "($event.Value.Double != null) OR ($event.Status.String = 'Good')"
},
"projectedProperties": [
{
"name": "Building",
"type": "String"
},
{
"name": "Temperature",
"type": "Double"
}
]
}
}
示例响应
{
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}
WarmStoreQueryGetEventsPage2
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=warmstore
{
"getEvents": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": {
"tsx": "($event.Value.Double != null) OR ($event.Status.String = 'Good')"
},
"projectedProperties": [
{
"name": "Building",
"type": "String"
},
{
"name": "Temperature",
"type": "Double"
}
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:10Z",
"2016-08-01T00:00:11Z",
"2016-08-01T00:00:12Z",
"2016-08-01T00:00:13Z",
"2016-08-01T00:00:14Z",
"2016-08-01T00:00:15Z",
"2016-08-01T00:00:16Z",
"2016-08-01T00:00:17Z",
"2016-08-01T00:00:18Z",
"2016-08-01T00:00:19Z"
],
"properties": [
{
"name": "Building",
"type": "String",
"values": [
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium",
"Millenium"
]
},
{
"name": "Temperature",
"type": "Double",
"values": [
65.125,
65.375,
65.625,
65.875,
66.125,
66.375,
66.625,
66.875,
67.125,
67.375
]
}
],
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAxYZwidGFrZSI6MTAwMH0="
}
WarmStoreQueryGetEventsPage3
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=warmstore
{
"getEvents": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": {
"tsx": "($event.Value.Double != null) OR ($event.Status.String = 'Good')"
},
"projectedProperties": [
{
"name": "Building",
"type": "String"
},
{
"name": "Temperature",
"type": "Double"
}
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:20Z"
],
"properties": [
{
"name": "Building",
"type": "String",
"values": [
"Millenium"
]
},
{
"name": "Temperature",
"type": "Double",
"values": [
67.575
]
}
],
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAbCDewidGFrZSI6MTAwMH0="
}
WarmStoreQueryGetEventsPage4
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=warmstore
{
"getEvents": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": {
"tsx": "($event.Value.Double != null) OR ($event.Status.String = 'Good')"
},
"projectedProperties": [
{
"name": "Building",
"type": "String"
},
{
"name": "Temperature",
"type": "Double"
}
]
}
}
示例响应
{
"timestamps": [],
"properties": [],
"progress": 100
}
WarmStoreQueryGetSeriesPage1
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=warmstore
{
"getSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": null,
"inlineVariables": {
"temperatures": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "avg($value)"
}
}
},
"projectedVariables": [
"temperatures"
]
}
}
示例响应
{
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}
WarmStoreQueryGetSeriesPage2
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=warmstore
{
"getSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": null,
"inlineVariables": {
"temperatures": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "avg($value)"
}
}
},
"projectedVariables": [
"temperatures"
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:10Z",
"2016-08-01T00:00:11Z",
"2016-08-01T00:00:12Z",
"2016-08-01T00:00:13Z",
"2016-08-01T00:00:14Z",
"2016-08-01T00:00:15Z",
"2016-08-01T00:00:16Z",
"2016-08-01T00:00:17Z",
"2016-08-01T00:00:18Z",
"2016-08-01T00:00:19Z",
"2016-08-01T00:00:20Z"
],
"properties": [
{
"name": "temperatures",
"type": "Double",
"values": [
65.125,
65.375,
65.625,
65.875,
66.125,
66.375,
66.625,
66.875,
67.125,
67.375,
67.625
]
}
],
"progress": 50,
"continuationToken": "aXsic2tpcCI6MTAxYZwidGFrZSI6MTAwMH0="
}
WarmStoreQueryGetSeriesPage3
示例请求
POST https://10000000-0000-0000-0000-100000000109.env.timeseries.azure.com/timeseries/query?api-version=2020-07-31&storeType=warmstore
{
"getSeries": {
"timeSeriesId": [
"006dfc2d-0324-4937-998c-d16f3b4f1952",
"T1"
],
"searchSpan": {
"from": "2016-08-01T00:00:00Z",
"to": "2016-08-01T00:16:50Z"
},
"filter": null,
"inlineVariables": {
"temperatures": {
"kind": "numeric",
"value": {
"tsx": "$event.Temperature"
},
"filter": null,
"aggregation": {
"tsx": "avg($value)"
}
}
},
"projectedVariables": [
"temperatures"
]
}
}
示例响应
{
"timestamps": [
"2016-08-01T00:00:21Z"
],
"properties": [
{
"name": "temperatures",
"type": "Double",
"values": [
67.825
]
}
],
"progress": 100
}
定义
名称 | 说明 |
---|---|
Aggregate |
聚合序列查询。 允许根据给定时序 ID 和搜索范围从事件计算聚合时序。 |
Aggregate |
聚合变量表示任何聚合计算。 聚合变量不支持内插。 |
Boundary |
要用于内插的搜索范围的左侧和右侧的时间范围。 这在数据点缺失到输入搜索范围的开始或结束的情况下非常有用。 可以为 null。 |
Categorical |
分类变量表示需要根据有限定义值集发生次数或持续时间进行分析的信号。 |
Date |
时间范围。 不能为 null 或负值。 |
Event |
存储或计算的事件的属性。 属性由名称和类型标识。 不同的事件可以具有具有相同名称但类型不同的属性。 |
Get |
获取事件查询。 允许检索给定时序 ID 和搜索范围的原始事件。 |
Get |
获取序列查询。 允许从给定时序 ID 和搜索范围的事件中检索计算变量值的时序。 |
Interpolation |
要对原始数据点执行的内插作。 目前,仅允许对内插时序进行采样。 允许的聚合函数 - 例如:left($value)。 如果不需要应用内插,可以为 null。 |
Interpolation |
内插技术的类型:“Linear”或“Step”。 |
Numeric |
数值变量表示可以使用内插重新构造的单个连续数值信号。 |
Property |
属性的类型。 |
Property |
对应于时间戳的单个属性的值。 可能包含 null。 值类型与属性的类型匹配。 |
Query |
请求对事件执行时序查询。 必须设置“getEvents”、“getSeries”或“aggregateSeries”之一。 |
Query |
查询结果的单个页。 如果查询尚未完成,则页面将设置继续标记。 在这种情况下,若要获取下一页的结果,请使用继续标记参数再次发送相同的请求。 如果查询已完成,则延续标记为 null。 如果没有计算查询结果,还可以获取仅设置继续标记集的空页。 如果分页已完成(延续标记为 null),则如果没有要返回的数据,时间戳和属性可能为空。 |
Time |
分类变量中使用的类别。 类别由“label”和分配此标签的“values”定义。 |
Time |
表示默认类别。 |
Tsi |
有关 API 错误的信息。 |
Tsi |
具有错误代码和消息的特定 API 错误。 |
Tsi |
其他错误信息。 |
Tsx |
以单个字符串形式编写的时序表达式(TSX)。 示例:“$event。Status.String='Good'“, ”avg($event.温度“。 请参阅有关如何编写时序表达式的文档。 |
AggregateSeries
聚合序列查询。 允许根据给定时序 ID 和搜索范围从事件计算聚合时序。
名称 | 类型 | 说明 |
---|---|---|
filter |
对限制要考虑计算的事件数的事件进行顶级筛选器。 此筛选器是 AND'ed,其中包含每个变量中的筛选器。 示例:“$event。Status.String='Good'”。 可选。 |
|
inlineVariables |
object |
这允许用户选择定义内联变量,除了模型中已定义的变量。 当内联变量名称与模型同名时,内联变量定义优先。 可以为 null。 |
interval |
string (duration) |
间隔大小以 ISO-8601 持续时间格式指定。 所有间隔都具有相同大小。 一个月始终转换为 30 天,一年始终为 365 天。 示例:1 分钟为“PT1M”,1 毫秒为“PT0.001S”。 有关详细信息,请参阅 https://www.w3.org/TR/xmlschema-2/#duration |
projectedVariables |
string[] |
这样,用户可以选择需要投影的变量。 如果为 null 或未设置,则返回内联Variables 和模型中的所有变量。 可以为 null。 |
searchSpan |
执行查询的时间范围。 不能为 null。 |
|
timeSeriesId |
Time |
唯一标识单个时序实例(例如设备)的单个时序 ID 值。 请注意,如果在创建环境时将多个属性指定为时序 ID,则可以组合单个时序 ID。 值的位置和类型必须与在环境中指定的时序 ID 属性匹配,并由“获取模型设置 API”返回。 不能为 null。 |
AggregateVariable
聚合变量表示任何聚合计算。 聚合变量不支持内插。
名称 | 类型 | 说明 |
---|---|---|
aggregation |
当类型为“aggregate”时,聚合时序表达式用于表示需要使用事件属性(如“$event”)直接执行的聚合。温度”。 例如,计算温度变化范围的聚合可以写为:“max($event)。温度)-min($event.温度“。 |
|
filter |
筛选限制要考虑计算的事件数的事件。 示例:“$event。Status.String='Good'”。 可选。 |
|
kind |
string:
aggregate |
允许的“kind”值为 -“numeric”或“aggregate”。 虽然“numeric”允许指定重新构造信号的值和聚合它们的表达式,但“聚合”类型允许你直接聚合事件属性而不指定值。 |
Boundary
要用于内插的搜索范围的左侧和右侧的时间范围。 这在数据点缺失到输入搜索范围的开始或结束的情况下非常有用。 可以为 null。
名称 | 类型 | 说明 |
---|---|---|
span |
string (duration) |
CategoricalVariable
分类变量表示需要根据有限定义值集发生次数或持续时间进行分析的信号。
名称 | 类型 | 说明 |
---|---|---|
categories |
分类变量中使用的类别。 类别由“label”和分配此标签的“values”定义。 |
|
defaultCategory |
表示默认类别。 |
|
filter |
筛选限制要考虑计算的事件数的事件。 示例:“$event。Status.String='Good'”。 可选。 |
|
interpolation |
分类变量仅支持“步骤”内插。 |
|
kind |
string:
categorical |
允许的“kind”值为 -“numeric”或“aggregate”。 虽然“numeric”允许指定重新构造信号的值和聚合它们的表达式,但“聚合”类型允许你直接聚合事件属性而不指定值。 |
value |
值时序表达式用于表示要分类的信号的值。 它只能计算为分类变量的“String”或“Long”类型。 |
DateTimeRange
时间范围。 不能为 null 或负值。
名称 | 类型 | 说明 |
---|---|---|
from |
string (date-time) |
时间范围的开始时间戳。 在时序查询请求中使用开始时间戳是非独占的。 包含此时间戳的事件。 |
to |
string (date-time) |
时间范围的结束时间戳。 在时序查询请求中使用结束时间戳是独占的。 排除与此时间戳匹配的事件。 请注意,Get Availability 返回时结束时间戳是非独占的(这意味着存在具有此确切“to”时间戳的事件)。 |
EventProperty
存储或计算的事件的属性。 属性由名称和类型标识。 不同的事件可以具有具有相同名称但类型不同的属性。
名称 | 类型 | 说明 |
---|---|---|
name |
string |
属性的名称。 |
type |
属性的类型。 |
GetEvents
获取事件查询。 允许检索给定时序 ID 和搜索范围的原始事件。
名称 | 类型 | 说明 |
---|---|---|
filter |
查询的可选顶级筛选器,该筛选器将应用于查询中的所有变量。 示例:“$event。Status.String='Good'”。 可以为 null。 |
|
projectedProperties |
投影属性是要投影的属性数组。 这些属性必须出现在事件中;否则,不会返回它们。 |
|
searchSpan |
执行查询的时间范围。 不能为 null。 |
|
take |
integer (int32) |
整个响应集中属性值的最大数目,而不是每个页面的最大属性值数。 如果未设置,则默认值为 10,000。 最大取值为 250,000。 |
timeSeriesId |
Time |
唯一标识单个时序实例(例如设备)的单个时序 ID 值。 请注意,如果在创建环境时将多个属性指定为时序 ID,则可以组合单个时序 ID。 值的位置和类型必须与在环境中指定的时序 ID 属性匹配,并由“获取模型设置 API”返回。 不能为 null。 |
GetSeries
获取序列查询。 允许从给定时序 ID 和搜索范围的事件中检索计算变量值的时序。
名称 | 类型 | 说明 |
---|---|---|
filter |
对限制要考虑计算的事件数的事件进行顶级筛选器。 此筛选器是 AND'ed,其中包含每个变量中的筛选器。 示例:“$event。Status.String='Good'”。 可选。 |
|
inlineVariables |
object |
除了模型时序类型中已定义的变量之外,可选内联变量。 当内联变量名称与模型中的名称相同时,内联变量定义优先。 可以为 null。 |
projectedVariables |
string[] |
需要在查询结果中投影的选定变量。 如果为 null 或未设置,则返回模型中内联Variables 和时序类型中的所有变量。 可以为 null。 |
searchSpan |
执行查询的时间范围。 不能为 null。 |
|
take |
integer (int32) |
整个响应集中属性值的最大数目,而不是每个页面的最大属性值数。 如果未设置,则默认值为 10,000。 最大取值为 250,000。 |
timeSeriesId |
Time |
唯一标识单个时序实例(例如设备)的单个时序 ID 值。 请注意,如果在创建环境时将多个属性指定为时序 ID,则可以组合单个时序 ID。 值的位置和类型必须与在环境中指定的时序 ID 属性匹配,并由“获取模型设置 API”返回。 不能为 null。 |
Interpolation
要对原始数据点执行的内插作。 目前,仅允许对内插时序进行采样。 允许的聚合函数 - 例如:left($value)。 如果不需要应用内插,可以为 null。
名称 | 类型 | 说明 |
---|---|---|
boundary |
要用于内插的搜索范围的左侧和右侧的时间范围。 这在数据点缺失到输入搜索范围的开始或结束的情况下非常有用。 可以为 null。 |
|
kind |
内插技术的类型:“Linear”或“Step”。 |
InterpolationKind
内插技术的类型:“Linear”或“Step”。
值 | 说明 |
---|---|
Linear | |
Step |
NumericVariable
数值变量表示可以使用内插重新构造的单个连续数值信号。
名称 | 类型 | 说明 |
---|---|---|
aggregation |
当类型为“numeric”时,聚合时序表达式用于表示需要在$value表达式上执行的聚合。 这需要指定$value,并且只能在聚合函数中使用$value。 例如,计算最小$value的聚合写入为:“min($value)”。 |
|
filter |
筛选限制要考虑计算的事件数的事件。 示例:“$event。Status.String='Good'”。 可选。 |
|
interpolation |
要对原始数据点执行的内插作。 目前,仅允许对内插时序进行采样。 允许的聚合函数 - 例如:left($value)。 如果不需要应用内插,可以为 null。 |
|
kind |
string:
numeric |
允许的“kind”值为 -“numeric”或“aggregate”。 虽然“numeric”允许指定重新构造信号的值和聚合它们的表达式,但“聚合”类型允许你直接聚合事件属性而不指定值。 |
value |
值时序表达式用于表示要聚合或内插的信号的值。 例如,事件中的温度值如下所示:“$event。Temperature.Double”。 |
PropertyTypes
属性的类型。
值 | 说明 |
---|---|
Bool | |
DateTime | |
Double | |
Long | |
String | |
TimeSpan |
PropertyValues
对应于时间戳的单个属性的值。 可能包含 null。 值类型与属性的类型匹配。
名称 | 类型 | 说明 |
---|---|---|
name |
string |
属性的名称。 |
type |
属性的类型。 |
|
values |
Values[] |
对应于时间戳的单个属性的值。 可能包含 null。 值类型与属性的类型匹配。 |
QueryRequest
请求对事件执行时序查询。 必须设置“getEvents”、“getSeries”或“aggregateSeries”之一。
名称 | 类型 | 说明 |
---|---|---|
aggregateSeries |
聚合序列查询。 允许根据给定时序 ID 和搜索范围从事件计算聚合时序。 |
|
getEvents |
获取事件查询。 允许检索给定时序 ID 和搜索范围的原始事件。 |
|
getSeries |
获取序列查询。 允许从给定时序 ID 和搜索范围的事件中检索计算变量值的时序。 |
QueryResultPage
查询结果的单个页。 如果查询尚未完成,则页面将设置继续标记。 在这种情况下,若要获取下一页的结果,请使用继续标记参数再次发送相同的请求。 如果查询已完成,则延续标记为 null。 如果没有计算查询结果,还可以获取仅设置继续标记集的空页。 如果分页已完成(延续标记为 null),则如果没有要返回的数据,时间戳和属性可能为空。
名称 | 类型 | 说明 |
---|---|---|
continuationToken |
string |
如果返回,则表示当前结果表示部分结果。 继续标记允许获取下一页的结果。 若要获取下一页查询结果,请在“x-ms-continuation”HTTP 标头中使用延续标记参数发送相同的请求。 |
progress |
number (double) |
查询的大致进度(以百分比表示)。 它可以介于 0 和 100 之间。 当响应中的继续标记为 null 时,进度应为 100。 |
properties |
每个时间戳的时序属性和值的集合。 如果服务器无法在此请求中填充页面,则为 null;如果继续标记为 null,则为空;如果继续标记为 null,则为空。 |
|
timestamps |
string[] (date-time) |
时序值的时间戳。 如果使用了间隔的聚合,则时间戳表示相应间隔的开始。 如果检索事件,时间戳是时间戳$ts事件属性的值。 如果服务器无法在此请求中填充页面,则为 null;如果继续标记为 null,则为空;如果继续标记为 null,则为空。 |
TimeSeriesAggregateCategory
分类变量中使用的类别。 类别由“label”和分配此标签的“values”定义。
名称 | 类型 | 说明 |
---|---|---|
label |
string |
将用于构造输出变量名称的类别的名称。 |
values |
object[] |
类别映射到的值列表。 可以是字符串的唯一列表或长列表。 |
TimeSeriesDefaultCategory
表示默认类别。
名称 | 类型 | 说明 |
---|---|---|
label |
string |
将分配给与“类别”中定义的任何值不匹配的默认类别的名称。 |
TsiError
有关 API 错误的信息。
名称 | 类型 | 说明 |
---|---|---|
error |
具有错误代码和消息的特定 API 错误。 |
TsiErrorBody
具有错误代码和消息的特定 API 错误。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
独立于语言且可读的字符串,用于定义特定于服务的错误代码。 此代码用作响应中指定的 HTTP 错误代码的更具体的指示器。 可用于以编程方式处理特定错误案例。 |
details |
包含其他错误信息。 可以为 null。 |
|
innerError |
包含更具体的错误,可缩小原因范围。 可以为 null。 |
|
message |
string |
人为可读的、与语言无关的错误表示形式。 它旨在帮助开发人员,不适合向最终用户公开。 |
target |
string |
特定错误的目标(例如,错误中属性的名称)。 可以为 null。 |
TsiErrorDetails
其他错误信息。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
独立于语言且可读的字符串,用于定义特定于服务的错误代码。 此代码用作响应中指定的 HTTP 错误代码的更具体的指示器。 可用于以编程方式处理特定错误案例。 |
message |
string |
人为可读的、与语言无关的错误表示形式。 它旨在帮助开发人员,不适合向最终用户公开。 |
Tsx
以单个字符串形式编写的时序表达式(TSX)。 示例:“$event。Status.String='Good'“, ”avg($event.温度“。 请参阅有关如何编写时序表达式的文档。
名称 | 类型 | 说明 |
---|---|---|
tsx |
string |
以单个字符串形式编写的时序表达式(TSX)。 示例:“$event。Status.String='Good'“, ”avg($event.温度“。 请参阅有关如何编写时序表达式的文档。 |