你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

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 参数

名称 必需 类型 说明
environmentFqdn
path True

string

按环境 FQDN,例如 10000000-0000-0000-0000-100000000109.env.timeseries.azure.com。 可以从获取环境 API、Azure 门户或 Azure 资源管理器的响应中获取此域名。

api-version
query True

string

要与客户端请求一起使用的 API 的版本。 当前支持的版本为“2020-07-31”。

storeType
query

string

对于启用了暖存储的环境,可以在“WarmStore”或“ColdStore”上执行查询。 查询中的此参数定义应对哪个存储执行查询。 如果未定义,将对 Cold 存储区执行查询。

请求头

名称 必需 类型 说明
x-ms-continuation

string

上一页结果中的延续标记,用于在支持分页的调用中检索结果的下一页。 若要获取第一页结果,请将 null 延续标记指定为参数值。 如果已返回所有结果,则返回的延续标记为 null,并且没有下一页的结果。

x-ms-client-request-id

string

可选的客户端请求 ID。 服务记录此值。 允许服务跨服务跟踪操作,并允许客户就特定请求联系支持人员。

x-ms-client-session-id

string

可选的客户端会话 ID。 服务记录此值。 允许服务跨服务跟踪一组相关操作,并允许客户就特定请求组联系支持人员。

请求正文

名称 类型 说明
aggregateSeries

AggregateSeries

聚合序列查询。 允许根据给定时序 ID 和搜索范围的事件计算聚合时序。

getEvents

GetEvents

获取事件查询。 允许检索给定时序 ID 和搜索范围的原始事件。

getSeries

GetSeries

获取序列查询。 允许从给定时序 ID 和搜索范围的事件中检索计算变量值的时序。

响应

名称 类型 说明
200 OK

QueryResultPage

查询成功。

Headers

x-ms-request-id: string

Other Status Codes

TsiError

意外错误。

Headers

x-ms-request-id: string

安全性

azure_auth

Azure Active Directory OAuth2 流

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

ColdStoreQueryAggregateSeriesPage1
ColdStoreQueryAggregateSeriesPage2
ColdStoreQueryGetEventsPage1
ColdStoreQueryGetEventsPage2
ColdStoreQueryGetEventsPage3
ColdStoreQueryGetEventsPage4
ColdStoreQueryGetSeriesPage1
ColdStoreQueryGetSeriesPage2
ColdStoreQueryGetSeriesPage3
QueryAggregateSeriesPage1
QueryAggregateSeriesPage2
QueryAggregateSeriesWithCategoricalInterpolatedVariable
QueryAggregateSeriesWithCategoricalVariable
QueryAggregateSeriesWithSampleInterpolation
QueryGetEventsPage1
QueryGetEventsPage2
QueryGetEventsPage3
QueryGetEventsPage4
QueryGetEventsWithTakePage1
QueryGetEventsWithTakePage2
QueryGetSeriesPage1
QueryGetSeriesPage2
QueryGetSeriesPage3
QueryGetSeriesWithTakePage1
QueryGetSeriesWithTakePage2
WarmStoreQueryAggregateSeriesPage
WarmStoreQueryGetEventsPage1
WarmStoreQueryGetEventsPage2
WarmStoreQueryGetEventsPage3
WarmStoreQueryGetEventsPage4
WarmStoreQueryGetSeriesPage1
WarmStoreQueryGetSeriesPage2
WarmStoreQueryGetSeriesPage3

ColdStoreQueryAggregateSeriesPage1

Sample Request

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"
    ]
  }
}

Sample Response

{
  "progress": 50,
  "continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}

ColdStoreQueryAggregateSeriesPage2

Sample Request

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"
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
      }
    ]
  }
}

Sample Response

{
  "progress": 50,
  "continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}

ColdStoreQueryGetEventsPage2

Sample Request

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"
      }
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
      }
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
      }
    ]
  }
}

Sample Response

{
  "timestamps": [],
  "properties": [],
  "progress": 100
}

ColdStoreQueryGetSeriesPage1

Sample Request

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"
    ]
  }
}

Sample Response

{
  "progress": 50,
  "continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}

ColdStoreQueryGetSeriesPage2

Sample Request

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"
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
    ]
  }
}

Sample Response

{
  "timestamps": [
    "2016-08-01T00:00:21Z"
  ],
  "properties": [
    {
      "name": "temperatures",
      "type": "Double",
      "values": [
        67.825
      ]
    }
  ],
  "progress": 100
}

QueryAggregateSeriesPage1

Sample Request

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"
    ]
  }
}

Sample Response

{
  "progress": 50,
  "continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}

QueryAggregateSeriesPage2

Sample Request

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"
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
      }
    ]
  }
}

Sample Response

{
  "progress": 50,
  "continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}

QueryGetEventsPage2

Sample Request

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"
      }
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
      }
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
      }
    ]
  }
}

Sample Response

{
  "timestamps": [],
  "properties": [],
  "progress": 100
}

QueryGetEventsWithTakePage1

Sample Request

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
  }
}

Sample Response

{
  "progress": 50,
  "continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}

QueryGetEventsWithTakePage2

Sample Request

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
  }
}

Sample Response

{
  "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

Sample Request

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"
    ]
  }
}

Sample Response

{
  "progress": 50,
  "continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}

QueryGetSeriesPage2

Sample Request

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"
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
    ]
  }
}

Sample Response

{
  "timestamps": [
    "2016-08-01T00:00:21Z"
  ],
  "properties": [
    {
      "name": "temperatures",
      "type": "Double",
      "values": [
        67.825
      ]
    }
  ],
  "progress": 100
}

QueryGetSeriesWithTakePage1

Sample Request

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
  }
}

Sample Response

{
  "progress": 50,
  "continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}

QueryGetSeriesWithTakePage2

Sample Request

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
  }
}

Sample Response

{
  "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

Sample Request

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"
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
      }
    ]
  }
}

Sample Response

{
  "progress": 50,
  "continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}

WarmStoreQueryGetEventsPage2

Sample Request

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"
      }
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
      }
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
      }
    ]
  }
}

Sample Response

{
  "timestamps": [],
  "properties": [],
  "progress": 100
}

WarmStoreQueryGetSeriesPage1

Sample Request

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"
    ]
  }
}

Sample Response

{
  "progress": 50,
  "continuationToken": "aXsic2tpcCI6MTAwMCwidGFrZSI6MTAwMH0="
}

WarmStoreQueryGetSeriesPage2

Sample Request

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"
    ]
  }
}

Sample Response

{
  "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

Sample Request

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"
    ]
  }
}

Sample Response

{
  "timestamps": [
    "2016-08-01T00:00:21Z"
  ],
  "properties": [
    {
      "name": "temperatures",
      "type": "Double",
      "values": [
        67.825
      ]
    }
  ],
  "progress": 100
}

定义

名称 说明
AggregateSeries

聚合序列查询。 允许根据给定时序 ID 和搜索范围的事件计算聚合时序。

AggregateVariable

聚合变量表示任何聚合计算。 聚合变量不支持内插。

Boundary

要用于内插的搜索范围左侧和右侧的时间范围。 这在输入搜索范围的开始或结尾附近缺少数据点的情况下非常有用。 可以为 null。

CategoricalVariable

分类变量表示需要根据有限一组定义值的出现次数或持续时间进行分析的信号。

DateTimeRange

时间范围。 不能为 null 或负数。

EventProperty

存储或计算的事件的属性。 属性由名称和类型标识。 不同的事件可以具有具有相同名称但类型不同的属性。

GetEvents

获取事件查询。 允许检索给定时序 ID 和搜索范围的原始事件。

GetSeries

获取序列查询。 允许从给定时序 ID 和搜索范围的事件中检索计算变量值的时序。

Interpolation

要对原始数据点执行的内插操作。 目前,仅允许对内插时序进行采样。 允许的聚合函数 - 例如:左 ($value) 。 如果不需要应用内插,可以为 null。

InterpolationKind

内插技术的类型:“Linear”或“Step”。

NumericVariable

数值变量表示可以使用内插重建的单个连续数值信号。

PropertyTypes

属性的类型。

PropertyValues

对应于时间戳的单个属性的值。 可能包含 null。 值的类型与属性的类型匹配。

QueryRequest

请求对事件执行时序查询。 必须设置“getEvents”、“getSeries”或“aggregateSeries”之一。

QueryResultPage

查询结果的单页。 如果查询尚未完成,页面将设置继续标记。 在这种情况下,若要获取下一页结果,请使用继续标记参数再次发送相同的请求。 如果查询已完成,则继续标记为 null。 当尚未计算查询结果时,还可以获取仅设置了继续标记的空页。 如果分页已完成 (延续标记为 null) ,则时间戳和属性可能为空(如果没有要返回的数据)。

TimeSeriesAggregateCategory

分类变量中使用的类别。 类别由分配有此标签的“label”和“values”定义。

TimeSeriesDefaultCategory

表示默认类别。

TsiError

有关 API 错误的信息。

TsiErrorBody

包含错误代码和消息的特定 API 错误。

TsiErrorDetails

其他错误信息。

Tsx

时序表达式 (TSX) 编写为单个字符串。 示例:“$event。Status.String='Good'“, ”avg ($event.温度) ”。 请参阅有关如何编写时序表达式的文档。

AggregateSeries

聚合序列查询。 允许根据给定时序 ID 和搜索范围的事件计算聚合时序。

名称 类型 说明
filter

Tsx

对限制要考虑用于计算的事件数的事件的顶级筛选器。 此筛选器在每个变量中使用筛选器进行 AND 处理。 示例:“$event.Status.String='Good'”。 可选。

inlineVariables

object

这允许用户选择性地定义内联变量,除了已在模型中定义的变量之外。 当内联变量名称与模型同名时,内联变量定义优先。 可以为 null。

interval

string

间隔大小以 ISO-8601 持续时间格式指定。 所有间隔的大小相同。 一个月始终转换为 30 天,一年始终转换为 365 天。 示例:1 分钟为“PT1M”,1 毫秒为“PT0.001S”。 有关详细信息,请参阅 https://www.w3.org/TR/xmlschema-2/#duration

projectedVariables

string[]

这允许用户选择需要投影的变量。 当该值为 null 或未设置时,将返回 inlineVariables 和 model 中的所有变量。 可以为 null。

searchSpan

DateTimeRange

执行查询的时间范围。 不能为 null。

timeSeriesId

TimeSeriesId[]

单个时序 ID 值,用于唯一标识单个时序实例 (例如设备) 。 请注意,如果在创建环境时将多个属性指定为时序 ID,则可以组合单个时序 ID。 值的位置和类型必须与环境中指定并由获取模型设置 API 返回的时序 ID 属性匹配。 不能为 null。

AggregateVariable

聚合变量表示任何聚合计算。 聚合变量不支持内插。

名称 类型 说明
aggregation

Tsx

类型为“aggregate”的聚合时序表达式用于表示需要使用事件属性(如“$event”)直接执行的聚合。Temperature”。 例如,计算温度变化范围的聚合可以写为:“max ($event。温度) 分钟 ($event。温度) ”。

filter

Tsx

筛选限制用于计算的事件数的事件。 示例:“$event。Status.String='Good'”。 可选。

kind string:

aggregate

允许的“kind”值为 -“numeric”或“aggregate”。 虽然“numeric”允许指定重建信号的值和表达式来聚合它们,但“聚合”类型允许你直接聚合事件属性,而无需指定值。

Boundary

要用于内插的搜索范围左侧和右侧的时间范围。 这在输入搜索范围的开始或结尾附近缺少数据点的情况下非常有用。 可以为 null。

名称 类型 说明
span

string

CategoricalVariable

分类变量表示需要根据有限一组定义值的出现次数或持续时间进行分析的信号。

名称 类型 说明
categories

TimeSeriesAggregateCategory[]

分类变量中使用的类别。 类别由分配有此标签的“label”和“values”定义。

defaultCategory

TimeSeriesDefaultCategory

表示默认类别。

filter

Tsx

筛选限制用于计算的事件数的事件。 示例:“$event。Status.String='Good'”。 可选。

interpolation

Interpolation

分类变量仅支持“步骤”内插。

kind string:

categorical

允许的“kind”值为 -“numeric”或“aggregate”。 虽然“numeric”允许指定重建信号的值和表达式来聚合它们,但“聚合”类型允许你直接聚合事件属性,而无需指定值。

value

Tsx

值时序表达式用于表示要分类的信号的值。 对于分类变量,它只能计算为“String”或“Long”类型。

DateTimeRange

时间范围。 不能为 null 或负数。

名称 类型 说明
from

string

时间范围的开始时间戳。 在时序查询请求中使用时,起始时间戳是非独占的。 包含此时间戳的事件。

to

string

时间范围的结束时间戳。 在时序查询请求中使用时,结束时间戳是独占的。 排除与此时间戳匹配的事件。 请注意,当获取可用性 (返回时,结束时间戳是包含的,这意味着) 具有此确切的“到”时间戳的事件。

EventProperty

存储或计算的事件的属性。 属性由名称和类型标识。 不同的事件可以具有具有相同名称但类型不同的属性。

名称 类型 说明
name

string

属性的名称。

type

PropertyTypes

属性的类型。

GetEvents

获取事件查询。 允许检索给定时序 ID 和搜索范围的原始事件。

名称 类型 说明
filter

Tsx

将应用于查询中的所有变量的查询的可选顶级筛选器。 示例:“$event.Status.String='Good'”。 可以为 null。

projectedProperties

EventProperty[]

投影属性是要投影的属性数组。 这些属性必须出现在事件中;否则,不会返回它们。

searchSpan

DateTimeRange

执行查询的时间范围。 不能为 null。

take

integer

整个响应集中的属性值的最大数目,而不是每页的最大属性值数。 如果未设置,则默认为 10,000。 take 的最大值可以为 250,000。

timeSeriesId

TimeSeriesId[]

单个时序 ID 值,用于唯一标识单个时序实例 (例如设备) 。 请注意,如果在创建环境时将多个属性指定为时序 ID,则可以组合单个时序 ID。 值的位置和类型必须与环境中指定并由获取模型设置 API 返回的时序 ID 属性匹配。 不能为 null。

GetSeries

获取序列查询。 允许从给定时序 ID 和搜索范围的事件中检索计算变量值的时序。

名称 类型 说明
filter

Tsx

对限制要考虑用于计算的事件数的事件的顶级筛选器。 此筛选器在每个变量中使用筛选器进行 AND 处理。 示例:“$event.Status.String='Good'”。 可选。

inlineVariables

object

可选的内联变量,除了已在模型中的时序类型中定义的变量之外。 当内联变量名称与模型中的名称相同时,内联变量定义优先。 可以为 null。

projectedVariables

string[]

需要在查询结果中投影的所选变量。 当它为 null 或未设置时,将返回模型中 inlineVariables 和时序类型的所有变量。 可以为 null。

searchSpan

DateTimeRange

执行查询的时间范围。 不能为 null。

take

integer

整个响应集中的属性值的最大数目,而不是每页的最大属性值数。 如果未设置,则默认为 10,000。 take 的最大值可以为 250,000。

timeSeriesId

TimeSeriesId[]

单个时序 ID 值,用于唯一标识单个时序实例 (例如设备) 。 请注意,如果在创建环境时将多个属性指定为时序 ID,则可以组合单个时序 ID。 值的位置和类型必须与环境中指定并由获取模型设置 API 返回的时序 ID 属性匹配。 不能为 null。

Interpolation

要对原始数据点执行的内插操作。 目前,仅允许对内插时序进行采样。 允许的聚合函数 - 例如:左 ($value) 。 如果不需要应用内插,可以为 null。

名称 类型 说明
boundary

Boundary

要用于内插的搜索范围左侧和右侧的时间范围。 这在输入搜索范围的开始或结尾附近缺少数据点的情况下非常有用。 可以为 null。

kind

InterpolationKind

内插技术的类型:“Linear”或“Step”。

InterpolationKind

内插技术的类型:“Linear”或“Step”。

名称 类型 说明
Linear

string

Step

string

NumericVariable

数值变量表示可以使用内插重建的单个连续数值信号。

名称 类型 说明
aggregation

Tsx

类型为“numeric”的聚合时序表达式用于表示需要在$value表达式上执行的聚合。 这需要指定$value,并且只能在聚合函数中使用$value。 例如,计算最小$value的聚合编写为“min ($value) ”。

filter

Tsx

筛选限制用于计算的事件数的事件。 示例:“$event。Status.String='Good'”。 可选。

interpolation

Interpolation

要对原始数据点执行的内插操作。 目前,仅允许对内插时序进行采样。 允许的聚合函数 - 例如:左 ($value) 。 如果不需要应用内插,可以为 null。

kind string:

numeric

允许的“kind”值为 -“numeric”或“aggregate”。 虽然“numeric”允许指定重建信号的值和表达式来聚合它们,但“聚合”类型允许你直接聚合事件属性,而无需指定值。

value

Tsx

值时序表达式用于表示要聚合或内插的信号的值。 例如,事件中的温度值表示如下:“$event。Temperature.Double”。

PropertyTypes

属性的类型。

名称 类型 说明
Bool

string

DateTime

string

Double

string

Long

string

String

string

TimeSpan

string

PropertyValues

对应于时间戳的单个属性的值。 可能包含 null。 值的类型与属性的类型匹配。

名称 类型 说明
name

string

属性的名称。

type

PropertyTypes

属性的类型。

values

Values[]

对应于时间戳的单个属性的值。 可能包含 null。 值的类型与属性的类型匹配。

QueryRequest

请求对事件执行时序查询。 必须设置“getEvents”、“getSeries”或“aggregateSeries”之一。

名称 类型 说明
aggregateSeries

AggregateSeries

聚合序列查询。 允许根据给定时序 ID 和搜索范围的事件计算聚合时序。

getEvents

GetEvents

获取事件查询。 允许检索给定时序 ID 和搜索范围的原始事件。

getSeries

GetSeries

获取序列查询。 允许从给定时序 ID 和搜索范围的事件中检索计算变量值的时序。

QueryResultPage

查询结果的单页。 如果查询尚未完成,页面将设置继续标记。 在这种情况下,若要获取下一页结果,请使用继续标记参数再次发送相同的请求。 如果查询已完成,则继续标记为 null。 当尚未计算查询结果时,还可以获取仅设置了继续标记的空页。 如果分页已完成 (延续标记为 null) ,则时间戳和属性可能为空(如果没有要返回的数据)。

名称 类型 说明
continuationToken

string

如果返回,则表示当前结果表示部分结果。 继续标记允许获取下一页的结果。 若要获取查询结果的下一页,请在“x-ms-continuation”HTTP 标头中使用延续令牌参数发送相同的请求。

progress

number

查询的大致进度(百分比)。 它可以介于 0 和 100 之间。 当响应中的继续标记为 null 时,进度应为 100。

properties

PropertyValues[]

每个时间戳的时序属性和值的集合。 如果服务器无法填充此请求中的页面,可以为 null;如果继续标记为 null,则可为空。

timestamps

string[]

时序值的时间戳。 如果使用间隔聚合,时间戳表示相应间隔的开始时间。 如果检索到事件,timestamps 是事件的 timestamp $ts 属性的值。 如果服务器无法填充此请求中的页面,可以为 null;如果继续标记为 null,则可为空。

TimeSeriesAggregateCategory

分类变量中使用的类别。 类别由分配有此标签的“label”和“values”定义。

名称 类型 说明
label

string

将用于构造输出变量名称的类别的名称。

values

object[]

类别映射到的值列表。 可以是唯一的字符串列表,也可以是长列表。

TimeSeriesDefaultCategory

表示默认类别。

名称 类型 说明
label

string

将分配给与“categories”中定义的任何值不匹配的默认类别的名称。

TsiError

有关 API 错误的信息。

名称 类型 说明
error

TsiErrorBody

包含错误代码和消息的特定 API 错误。

TsiErrorBody

包含错误代码和消息的特定 API 错误。

名称 类型 说明
code

string

与语言无关、可读的字符串,用于定义特定于服务的错误代码。 此代码用作响应中指定的 HTTP 错误代码的更具体指示符。 可用于以编程方式处理特定错误情况。

details

TsiErrorDetails[]

包含其他错误信息。 可能为 null。

innerError

TsiErrorBody

包含更具体的错误,可缩小原因范围。 可能为 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。温度) ”。 请参阅有关如何编写时序表达式的文档。