alive
The alive
request returns a fixed-response (i.e. never changes) UUID together with the IP address of the requestor; any error would indicate that MSR is not running/healthy. The response is plain text for easy handling. Any error indicates that Reactor is not functional.
Example (GET): curl -o - 'http://host-ip:8111/api/v1/alive'
fbd4838c-5fdc-11eb-9093-3798dc850515 Hello 192.168.0.16
reload
Causes Reactor to shutdown and restart.
Example (GET): curl -o - 'http://host-ip:8111/api/v1/reload'
system
Returns a structure of system information for the Reactor installation and host runtime environment.
Example (GET): curl -o - 'http://host-ip:8111/api/v1/system'
{
"host": {
"time": 1636055037942,
"timezone": "America/New_York",
"tzoffset": -240,
"name": "rpi4-1",
"lang": "en_US.UTF-8",
"httpapi_version": 21282
},
"loadav": [0.18, 0.19, 0.18],
"uptime": [667, 2088067],
"memory": {
"rss": 80408576,
"heapTotal": 15159296,
"heapUsed": 13865972,
"external": 2612109,
"arrayBuffers": 202398,
"sys_total": 4024152064,
"sys_free": 1945649152
},
"pid": 28297,
"user": {
"uid": 1000,
"gid": 1000,
"username": "pi",
"homedir": "/home/pi",
"shell": "/bin/bash"
},
"engine": true,
"engine_tasks": [],
"locale": "en-US",
"language_name": "US English"
}
systime
Returns the time of the running Reactor engine on the host.
Example (GET): curl -o - 'http://host-ip:8111/api/v1/systime'
{
"time": 1636055110371,
"timezone": "America/New_York",
"tzoffset": -240,
"engine_time": 1636055110372
}
The engine_time
is the time in effect for the engine. If it is significantly different from time
, then Test Time is in effect, and engine_time
is then the current time in the test alternate universe.
structure
Returns a JSON response containing the Structure instance data which is the container for all controllers, entities, and capabilities. It is an "all inclusive" response of considerable breadth and depth, intended to help "bootstrap" API clients (like dashboards) with a full system view at startup.
Example (GET): curl -o - 'http://host-ip:8111/api/v1/structure'
{
"structure": {},
id: 1,
uuid: "7e3e4f14-3daa-11ec-9a33-cf13a0884891",
"startup": 1636054371466,
"controllers": {
/* contains a series of Controller structures as returned
* by controller/:id, except that the entities list is a
* simple array of IDs. The actual entity structures are
* returned separately below
*/
"vera": {
...etc...
}
"entities": {
/* contains a series of Entity structures as returned by
* entity/:id
*/
"vera>system": {
...etc...
}
},
"capabilities": {
/* Returns capabilities as would be returned by the same-
* named API function (capabilities)
*/
"power_switch": {
...etc...
}
},
"since": 1636055333624
}