Constructor
new Events()
- Source:
Methods
(async) getTripwireEvents(documentDb, input) → {Promise.<Object>}
- Description:
- returns an object containing an array of tripwire events.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let input = {sensorId: "abc", fromTimestamp: "2023-01-12T11:20:10.000Z", toTimestamp: "2023-01-12T14:20:10.000Z"};
let tripwireMetadata = new mdx.Services.Events();
let tripwireEvents = await tripwireMetadata.getTripwireEvents(elastic,input);
Parameters:
Name |
Type |
Description |
documentDb |
Database
|
Database Object |
input |
Object
|
Input object.
Properties
Name |
Type |
Attributes |
Default |
Description |
sensorId |
string
|
<optional>
|
|
Either sensorId or place should be present. |
place |
string
|
<optional>
|
|
Either sensorId or place should be present. |
tripwireId |
string
|
<optional>
<nullable>
|
null
|
tripwireId can be present only if sensorId is present in the input. |
fromTimestamp |
string
|
|
|
|
toTimestamp |
string
|
|
|
|
maxResultSize |
number
|
<optional>
|
25
|
maxResultSize must be an integer. |
objectType |
string
|
<optional>
|
"Person"
|
|
effective |
boolean
|
<optional>
|
true
|
If effective is true, then the result returned will contain only the latest tripwire events of each object. |
|
Returns:
An object containing an array of tripwire events is returned
-
Type
-
Promise.<Object>