-
Notifications
You must be signed in to change notification settings - Fork 4
Usage
From a command prompt in the repository working directory:
$ node server.js [port={port}] [sender={sender}] [devices={devices}]
The optional port parameter will be interpreted as the port on which the server should listen. The optional sender parameter will be used as the 'sender' string sent in the document headers. The optional devices parameter will be interpreted as the name of the file to load for Devices XML data.
The server will listen on port 8080 by default.
Data items may be stored in the agent using the store resource: http://localhost:8080/store?id={dataItemId}×tamp={timestamp}&value={value}&condition={condition}
Parameters should be provided as follows:
-
dataItemId- the id of the data item. -
timestamp- the UTC timestamp in ISO8601 format e.g. 2012-08-19T21:21:00Z. -
value- the value of the data item. -
condition- (optional) for a CONDITION data item, the condition: one of UNAVAILABLE, NORMAL, WARNING, FAULT.
Multiple data items may be updated in a single request by adding a numeric suffix to the parameters, starting with 1, e.g.: http://localhost:8080/store?id={dataItemId}×tamp={timestamp}&value={value}&condition={condition}&id1={dataItemId}×tamp1={timestamp}&value1={value}&condition1={condition}&.... However, the URL should not exceed 2000 characters.
Other parameters will be ignored. Parameters are validated to make sure that the dataItemId exist and that the timestamp is a proper date, but no validation is yet performed to verify that the values are valid, or that a condition is being provided for a condition DataItem.