This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:api_def [2017/02/21 14:58] admin [Alarms] |
en:api_def [2017/03/07 16:09] (current) admin [Alarms] |
||
---|---|---|---|
Line 129: | Line 129: | ||
</code> | </code> | ||
- | The "response" object contains the "responseType" field that specify if the content is complete (full) or partial. If case of "partial" response, only the first 50 alarms will be fully provided; for the remaining alarms will be provided only the **eventId** field and the client have to call other **alarmGet** requests to obtain complete information. | + | The "response" object contains the "responseType" field that specify if the content is complete (full) or partial. In case of "partial" response, only the first API_ALARM_MULTIGET_MAXEVENT alarms will be fully provided (if API_ALARM_MULTIGET_MAXEVENT is equal to 0 all messages will be provided in a single response); for the remaining alarms will be provided only the **eventId** field and the client have to call other **alarmGet** or **alarmMultiget** requests to obtain complete information. |
The format for each event elements, is the same as that contained in the [[#alarmGet|alarmGet]] command. | The format for each event elements, is the same as that contained in the [[#alarmGet|alarmGet]] command. | ||
Line 207: | Line 207: | ||
</code> | </code> | ||
+ | Response: | ||
+ | |||
+ | <code> | ||
+ | { | ||
+ | "success": true, | ||
+ | "request": | ||
+ | { | ||
+ | "cmd": "alarmMultiget", | ||
+ | "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJ...." | ||
+ | "param": { | ||
+ | "eventIds": [123,234,345,456,567,678,.....] | ||
+ | } | ||
+ | }, | ||
+ | "response": { | ||
+ | "responseType": "full", //valid options: "full", "partial" | ||
+ | "data": [ | ||
+ | {....}, | ||
+ | {....} | ||
+ | ] | ||
+ | } | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | The "response" object contains the "responseType" field that specify if the content is complete (full) or partial. In case of "partial" response, only the first API_ALARM_MULTIGET_MAXEVENT alarms will be fully provided (if API_ALARM_MULTIGET_MAXEVENT is equal to 0 all messages will be provided in a single response); for the remaining alarms will be provided only the **eventId** field and the client have to call other **alarmGet** or **alarmMultiget** requests to obtain complete information. | ||
+ | The format for each event elements, is the same as that contained in the [[#alarmGet|alarmGet]] command. | ||
+ | |||
+ | |||
+ | |||
+ | ==== Queue ==== | ||
+ | |||
+ | These are the command to use in order to manipulate queues. | ||
+ | |||
+ | * [[#queueLength|queueLength]] | ||
+ | * [[#queuePurge|queuePurge]] | ||
+ | |||
+ | |||
+ | === queueLength === | ||
+ | |||
+ | Request the number of message in a specific queue. | ||
+ | |||
+ | Request: | ||
+ | |||
+ | <code> | ||
+ | { | ||
+ | "cmd": "queueLength", | ||
+ | "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJ...." | ||
+ | "param": { | ||
+ | "queueName": "fooQueue" | ||
+ | } | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | Response: | ||
+ | |||
+ | <code> | ||
+ | { | ||
+ | "success": true, | ||
+ | "request": | ||
+ | { | ||
+ | "cmd": "queueLength", | ||
+ | "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJ...." | ||
+ | "param": { | ||
+ | "queueName": "fooQueue" | ||
+ | } | ||
+ | }, | ||
+ | "response": { | ||
+ | "length": 25 | ||
+ | } | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | |||
+ | === queuePurge === | ||
+ | |||
+ | Purge the specified queue. | ||
+ | |||
+ | Request: | ||
+ | |||
+ | <code> | ||
+ | { | ||
+ | "cmd": "queuePurge", | ||
+ | "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJ...." | ||
+ | "param": { | ||
+ | "queueName": "fooQueue" | ||
+ | } | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | Response: | ||
+ | |||
+ | <code> | ||
+ | { | ||
+ | "success": true, | ||
+ | "request": | ||
+ | { | ||
+ | "cmd": "queuePurge", | ||
+ | "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJ...." | ||
+ | "param": { | ||
+ | "queueName": "fooQueue" | ||
+ | } | ||
+ | }, | ||
+ | "response": {} | ||
+ | } | ||
+ | </code> | ||