This is an old revision of the document!


Get events from session

When you loaded events into session with events/load and want to get selections please use events/get:

By time:

svc=events/get&params={"selector":{
					"type":<text>,
					"expr":<text>,
					"timeFrom":<uint>,
					"timeTo":<uint>,
					"detalization":<uint>
				    },
				    ...
		      }

By index:

svc=events/get&params={"selector":[
				    {
					"type":<text>,
					"expr":<text>,
					"indexFrom":<uint>,
					"indexTo":<uint>,
					"detalization":<uint>,
					"filter1":<uint>
				    },
				    ...
		      ]}

Parameters

Param Description
type sensor group: lls, trips, ignition, sensors, counters * (all groups)
expr intervals expression, it used instead of "type" param to get custom events intervals
timeFrom interval start, UNIX-time
timeTo interval end, UNIX-time
detalization output flags
indexFrom index of the first event requested
indexTo index of the last event requested
filter1 sensor ID

Output flags

Flag Descrition
0x1 Basic JSON: event start - event end
0x2 Specified detector data
0x4 User parameters (those which user stated for this event)
0x10 Full JSON. Every detector treats it its own way
0x20 Formatted value
0x40 grouping the intersections of intervals with tf и tt
0x80 add summary

Response

Reponse depends on type specified.
Look at events/check_updates response.

Custom events intervals

To get custom events intervals use expression in "expr":<text> param instead type param.

Expression format in "expr" param

OperatorDescriptionExample
& AND trips&ignition
| OR trips|ignition
~ NOT trips&~ignition
[] choise of sensor id sensors[3], default first
() brackets trips&~ignition&(~sensors[3]|sensors[5])
- hyphenated custom interval 1451953325-1451953525&trips&ignition
{} selection intervals by the value of detalization trips{s<20}&ignition

Response

0x40 flag

"selector": [
    {
    "tf": <uint>, /* intersections interval, time from (unix time) */
    "tt": <uint>, /* intersections interval, time to (unix time) */
	"d": {
	    "<type_name>":{
		"<sensor_id>":[
		    { },
		]
	    },
	}
    }, 
]

0x80 flag

"selector":{
    "<type_name>":{
	"<sensor_id>":[
	{ },
	]
    },
},
"summary":{
    "<type_name>":{
	"<sensor_id>":{
	    "<summary_param_value>:<uint>",    /* summary, different for different detectors */
	}
}
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2024 Gurtam