Skip to main content

query device event

eviewAbout 1 minloctube-api

query device event

url:/api/v1/device/{deviceId}/event/{eventId}/_query
method:POST
produces:application/json
consumes:*/*
Note:

According to the different Object models, the corresponding fields are returned.

If the object model is defined as object type, the corresponding attributes; otherwise, the value field is event data.

Request Example

{
  "terms": [
    {
      "column": "",
      "value": {},
      "type": "",
      "termType": "",
      "options": [],
      "terms": [
        {
          "column": "",
          "value": {},
          "type": "",
          "termType": "",
          "options": [],
          "terms": [
            {}
          ]
        }
      ]
    }
  ],
  "includes": [],
  "excludes": [],
  "paging": true,
  "firstPageIndex": 0,
  "pageIndex": 0,
  "pageSize": 0,
  "sorts": [
    {
      "name": "",
      "order": "",
      "value": {}
    }
  ],
  "context": {},
  "where": "",
  "orderBy": "",
  "total": 0,
  "parallelPager": true
}

Params:

namedescriptioninrequiretypeschema
deviceIdpathtruestring
eventIdpathtruestring
queryParamEntityQueryParamEntitybodytrueQueryParamEntityQueryParamEntity
termsfalsearrayTerm
columncolumnfalsestring
valuevaluefalseobject
typetype,such as:or,andfalsestring
termTypeterm typefalsestring
optionsoptionsfalsearraystring
termstermsfalsearrayTerm
includescolumns to selectfalsearraystring
excludescolumns to excludefalsearraystring
pagingPagination or notfalseboolean
firstPageIndexfirst page indexfalseinteger(int32)
pageIndexpage indexfalseinteger(int32)
pageSizepage sizefalseinteger(int32)
sortsfalsearraySort
namecolumn namefalsestring
orderorder way,such as:asc,descfalsestring
valueSpecify value orderingfalseobject
contextContext informationfalseobject
whereWhere conditional expression cannot coexist with terms parameter. Syntax: name = Zhang San and age > 16.falsestring
orderByOrderBy conditional expression, which cannot coexist with the sorts parameter. Syntax: age asc,createTime desc.falsestring
totalThe total number of count queries that will not be repeated after this value is set.falseinteger(int32)
parallelPagerWhether to do parallel paging?falseboolean

Status-200:
Response Params:

namedescriptiontypeschema
messagemessage contentstring
resultPagerResultDeviceEventPagerResultDeviceEvent
pageIndexpage indexinteger(int32)
pageSizepage sizeinteger(int32)
totaltotal data countinteger(int32)
datadata listarrayDeviceEvent
timestampinteger
statusstatus codeinteger(int32)integer(int32)
codebusiness codestring
timestampTimestamp (ms)integer(int64)integer(int64)

Response Example:

{
	"message": "",
	"result": {
		"pageIndex": 0,
		"pageSize": 0,
		"total": 0,
		"data": [
			{
				"timestamp": 0
			}
		]
	},
	"status": 0,
	"code": "",
	"timestamp": 0
}