Table of Contents

HTTP WebSockets Interface

JSON Encapsulation

All JSON responses are encapsulated within a status structure.

Success:

{
  status: 'success',
  data: $data
}

Errors:

{
  status: 'error',
  message: 'error string'
}

Command Interface

The WebSocket command interface is based on a tag system.

The format of a command is:

$tag COMMAND [optional=parameters, ...]

URI's and Commands

Once a connection is upgraded to a websocket, the following text based commands are available.

/statistics/graphdata

The graphdata URI allows streaming and retrieval of statistics over a single websockets connection.

Command: subscribe

The subscribe command subscribes a WebSocket to receive periodic statistical updates. The $tag value will be used while streaming statistics (see OTSJsonStats).

Command format:

$tag SUBSCRIBE <$type=$item> [$type2=$item2] [$typeX=$itemX]

The value for tag:

Possible values for type:

Command: unsubscribe

WIP

Command format:

$tag UNSUBSCRIBE