Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
documentation:api-http-websockets [2014-01-15 12:37] – [HTTP WebSockets Interface] nkukarddocumentation: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:
 +<code>
 +{
 +  status: 'success',
 +  data: $data
 +}
 +</code>
 +
 +Errors:
 +<code>
 +{
 +  status: 'error',
 +  message: 'error string'
 +}
 +</code>
 ===== Command Interface ===== ===== Command Interface =====
  
Line 20: Line 39:
 ==== Command: subscribe ==== ==== Command: subscribe ====
  
-Syntax: subscribe <tag> pool=<InterfaceGroupID:PoolName>+The subscribe command subscribes a WebSocket to receive periodic statistical updates. The $tag value will be used while streaming statistics (see [[api-data-types#typeotsjsonstats|OTSJsonStats]]).
  
-Syntaxsubscribe <tag> class=<InterfaceGroupID:ClassID+Command format: 
- +<code
-Syntax: subscribe <tagbasic=<BasicStatName>+$tag SUBSCRIBE <$type=$item[$type2=$item2] [$typeX=$itemX] 
 +</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:$poolName pair, this is specified as the $item field
 +  * class
 +    * Refers to statistics regarding a class. The following is available in the $item field...
 +      * Class:$interfaceGroupID:$classID
 +  * basic
 +    * Refers to a basic counter. The following basic counters are available in the $item field...
 +      * Counter:ConfigManager:TotalPools
 +      * Counter:ConfigManager:TotalPoolMembers
 +      * Counter:ConfigManager:ClassPools:$interfaceGroupID,$classID
 +      * Counter:ConfigManager:TotalClassPools:$classID
 ==== Command: unsubscribe ==== ==== Command: unsubscribe ====
  
-Syntax: unsubscribe <tag>+WIP
  
 +Command format:
 +<code>
 +$tag UNSUBSCRIBE
 +</code>