Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| documentation:api-http-websockets [2014-01-15 12:37] – [HTTP WebSockets Interface] nkukard | documentation:api-http-websockets [2014-01-16 15:36] (current) – [Command: subscribe] nkukard | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== HTTP WebSockets Interface ====== | ====== HTTP WebSockets Interface ====== | ||
| + | ===== JSON Encapsulation ===== | ||
| + | |||
| + | All JSON responses are encapsulated within a status structure. | ||
| + | |||
| + | Success: | ||
| + | < | ||
| + | { | ||
| + | status: ' | ||
| + | data: $data | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Errors: | ||
| + | < | ||
| + | { | ||
| + | status: ' | ||
| + | message: 'error string' | ||
| + | } | ||
| + | </ | ||
| ===== Command Interface ===== | ===== Command Interface ===== | ||
| Line 20: | Line 39: | ||
| ==== Command: subscribe ==== | ==== Command: subscribe ==== | ||
| - | Syntax: | + | The subscribe |
| - | Syntax: subscribe | + | Command format: |
| - | + | <code> | |
| - | Syntax: subscribe | + | $tag SUBSCRIBE |
| + | </code> | ||
| + | The value for tag: | ||
| + | * The value for tag designates the tag of returned data in the above datatype. | ||
| + | Possible values for type: | ||
| + | * pool | ||
| + | * Refers to a $interfaceGroupID: | ||
| + | * class | ||
| + | * Refers to statistics regarding a class. The following is available in the $item field... | ||
| + | * Class: | ||
| + | * basic | ||
| + | * Refers to a basic counter. The following basic counters are available in the $item field... | ||
| + | * Counter: | ||
| + | * Counter: | ||
| + | * Counter: | ||
| + | * Counter: | ||
| ==== Command: unsubscribe ==== | ==== Command: unsubscribe ==== | ||
| - | Syntax: unsubscribe <tag> | + | WIP |
| + | Command format: | ||
| + | < | ||
| + | $tag UNSUBSCRIBE | ||
| + | </ | ||