JSON API » machines » machines/statistics/get
Gets statistics for machines.
Input parameters
Requires authentication and the commerce role privilege.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
name | String | Name of statistic to get. "calls", "channels", "channels_dadhi", "channels_g729", "channels_sip", or "channels_zap". | Yes | |
start | Integer | Start Unix timestamp. | Recommended | 0 |
end | Integer | End Unix timestamp. | Recommended | Now. |
machine | Integer | ID of machine. 0 for all machines in cluster. | No | 0 |
Failure to specify the start and end may put a heavy load on the database.
Responses
Code | Description |
---|---|
200 | Success. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
Data returned
Fields of statistics.
Example: With required and recommended parameters
http://enswitch.example.com/api/json/machines/statistics/get/?auth_username=user;auth_password=password;name=calls;start=1230000000;end=1240000000{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "minimum":0, "maximum":10, ... } }
Change history
Version | Changes |
---|---|
3.13 | Function added. |