ARI: Added new functionality to get information on a single module.
[asterisk/asterisk.git] / rest-api / api-docs / asterisk.json
1 {
2         "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.",
3         "_author": "David M. Lee, II <dlee@digium.com>",
4         "_svn_revision": "$Revision$",
5         "apiVersion": "1.7.0",
6         "swaggerVersion": "1.1",
7         "basePath": "http://localhost:8088/ari",
8         "resourcePath": "/api-docs/asterisk.{format}",
9         "apis": [
10                 {
11                         "path": "/asterisk/info",
12                         "description": "Asterisk system information (similar to core show settings)",
13                         "operations": [
14                                 {
15                                         "httpMethod": "GET",
16                                         "summary": "Gets Asterisk system information.",
17                                         "nickname": "getInfo",
18                                         "responseClass": "AsteriskInfo",
19                                         "parameters": [
20                                                 {
21                                                         "name": "only",
22                                                         "description": "Filter information returned",
23                                                         "paramType": "query",
24                                                         "required": false,
25                                                         "allowMultiple": true,
26                                                         "dataType": "string",
27                                                         "allowableValues": {
28                                                                 "valueType": "LIST",
29                                                                 "values": [
30                                                                         "build",
31                                                                         "system",
32                                                                         "config",
33                                                                         "status"
34                                                                 ]
35                                                         }
36                                                 }
37                                         ]
38                                 }
39                         ]
40                 },
41                 {
42                         "path": "/asterisk/modules",
43                         "description": "Asterisk modules",
44                         "operations": [
45                                 {
46                                         "httpMethod": "GET",
47                                         "summary": "List Asterisk modules.",
48                                         "nickname": "listModules",
49                                         "responseClass": "List[Module]"
50                                 }
51                         ]
52                 },
53                 {
54                         "path": "/asterisk/modules/{moduleName}",
55                         "description": "Asterisk module",
56                         "operations": [
57                                 {
58                                         "httpMethod": "GET",
59                                         "summary": "Get Asterisk module information.",
60                                         "nickname": "getModule",
61                                         "responseClass": "Module",
62                                         "parameters": [
63                                                 {
64                                                         "name": "moduleName",
65                                                         "description": "Module's name",
66                                                         "paramType": "path",
67                                                         "required": true,
68                                                         "allowMultiple": false,
69                                                         "dataType": "string"
70                                                 }
71                                         ],
72                                         "errorResponses": [
73                                                 {
74                                                         "code": 404,
75                                                         "reason": "Module could not be found in running modules."
76                                                 },
77                                                 {
78                                                         "code": 409,
79                                                         "reason": "Module information could not be retrieved."
80                                                 }
81                                         ]
82                                 }
83                         ]
84                 },
85                 {
86                         "path": "/asterisk/variable",
87                         "description": "Global variables",
88                         "operations": [
89                                 {
90                                         "httpMethod": "GET",
91                                         "summary": "Get the value of a global variable.",
92                                         "nickname": "getGlobalVar",
93                                         "responseClass": "Variable",
94                                         "parameters": [
95                                                 {
96                                                         "name": "variable",
97                                                         "description": "The variable to get",
98                                                         "paramType": "query",
99                                                         "required": true,
100                                                         "allowMultiple": false,
101                                                         "dataType": "string"
102                                                 }
103                                         ],
104                                         "errorResponses": [
105                                                 {
106                                                         "code": 400,
107                                                         "reason": "Missing variable parameter."
108                                                 }
109                                         ]
110                                 },
111                                 {
112                                         "httpMethod": "POST",
113                                         "summary": "Set the value of a global variable.",
114                                         "nickname": "setGlobalVar",
115                                         "responseClass": "void",
116                                         "parameters": [
117                                                 {
118                                                         "name": "variable",
119                                                         "description": "The variable to set",
120                                                         "paramType": "query",
121                                                         "required": true,
122                                                         "allowMultiple": false,
123                                                         "dataType": "string"
124                                                 },
125                                                 {
126                                                         "name": "value",
127                                                         "description": "The value to set the variable to",
128                                                         "paramType": "query",
129                                                         "required": false,
130                                                         "allowMultiple": false,
131                                                         "dataType": "string"
132                                                 }
133                                         ],
134                                         "errorResponses": [
135                                                 {
136                                                         "code": 400,
137                                                         "reason": "Missing variable parameter."
138                                                 }
139                                         ]
140                                 }
141                         ]
142                 }
143         ],
144         "models": {
145                 "BuildInfo": {
146                         "id": "BuildInfo",
147                         "description": "Info about how Asterisk was built",
148                         "properties": {
149                                 "os": {
150                                         "required": true,
151                                         "type": "string",
152                                         "description": "OS Asterisk was built on."
153                                 },
154                                 "kernel": {
155                                         "required": true,
156                                         "type": "string",
157                                         "description": "Kernel version Asterisk was built on."
158                                 },
159                                 "options": {
160                                         "required": true,
161                                         "type": "string",
162                                         "description": "Compile time options, or empty string if default."
163                                 },
164                                 "machine": {
165                                         "required": true,
166                                         "type": "string",
167                                         "description": "Machine architecture (x86_64, i686, ppc, etc.)"
168                                 },
169                                 "date": {
170                                         "required": true,
171                                         "type": "string",
172                                         "description": "Date and time when Asterisk was built."
173                                 },
174                                 "user": {
175                                         "required": true,
176                                         "type": "string",
177                                         "description": "Username that build Asterisk"
178                                 }
179                         }
180                 },
181                 "SystemInfo": {
182                         "id": "SystemInfo",
183                         "description": "Info about Asterisk",
184                         "properties": {
185                                 "version": {
186                                         "required": true,
187                                         "type": "string",
188                                         "description": "Asterisk version."
189                                 },
190                                 "entity_id": {
191                                         "required": true,
192                                         "type": "string",
193                                         "description": ""
194                                 }
195                         }
196                 },
197                 "SetId": {
198                         "id": "SetId",
199                         "description": "Effective user/group id",
200                         "properties": {
201                                 "user": {
202                                         "required": true,
203                                         "type": "string",
204                                         "description": "Effective user id."
205                                 },
206                                 "group": {
207                                         "required": true,
208                                         "type": "string",
209                                         "description": "Effective group id."
210                                 }
211                         }
212                 },
213                 "ConfigInfo": {
214                         "id": "ConfigInfo",
215                         "description": "Info about Asterisk configuration",
216                         "properties": {
217                                 "name": {
218                                         "required": true,
219                                         "type": "string",
220                                         "description": "Asterisk system name."
221                                 },
222                                 "default_language": {
223                                         "required": true,
224                                         "type": "string",
225                                         "description": "Default language for media playback."
226                                 },
227                                 "max_channels": {
228                                         "required": false,
229                                         "type": "int",
230                                         "description": "Maximum number of simultaneous channels."
231                                 },
232                                 "max_open_files": {
233                                         "required": false,
234                                         "type": "int",
235                                         "description": "Maximum number of open file handles (files, sockets)."
236                                 },
237                                 "max_load": {
238                                         "required": false,
239                                         "type": "double",
240                                         "description": "Maximum load avg on system."
241                                 },
242                                 "setid": {
243                                         "required": true,
244                                         "type": "SetId",
245                                         "description": "Effective user/group id for running Asterisk."
246                                 }
247                         }
248                 },
249                 "StatusInfo": {
250                         "id": "StatusInfo",
251                         "description": "Info about Asterisk status",
252                         "properties": {
253                                 "startup_time": {
254                                         "required": true,
255                                         "type": "Date",
256                                         "description": "Time when Asterisk was started."
257                                 },
258                                 "last_reload_time": {
259                                         "required": true,
260                                         "type": "Date",
261                                         "description": "Time when Asterisk was last reloaded."
262                                 }
263                         }
264                 },
265                 "AsteriskInfo": {
266                         "id": "AsteriskInfo",
267                         "description": "Asterisk system information",
268                         "properties": {
269                                 "build": {
270                                         "required": false,
271                                         "type": "BuildInfo",
272                                         "description": "Info about how Asterisk was built"
273                                 },
274                                 "system": {
275                                         "required": false,
276                                         "type": "SystemInfo",
277                                         "description": "Info about the system running Asterisk"
278                                 },
279                                 "config": {
280                                         "required": false,
281                                         "type": "ConfigInfo",
282                                         "description": "Info about Asterisk configuration"
283                                 },
284                                 "status": {
285                                         "required": false,
286                                         "type": "StatusInfo",
287                                         "description": "Info about Asterisk status"
288                                 }
289                         }
290                 },
291                 "Module": {
292                         "id": "Module",
293                         "description": "Details of an Asterisk module",
294                         "properties": {
295                                 "name": {
296                                         "type": "string",
297                                         "description": "The name of this module",
298                                         "required": true
299                                 },
300                                 "description": {
301                                         "type": "string",
302                                         "description": "The description of this module",
303                                         "required": true
304                                 },
305                                 "use_count": {
306                                         "type": "int",
307                                         "description": "The number of times this module is being used",
308                                         "required": true
309                                 },
310                                 "status": {
311                                         "type": "string",
312                                         "description": "The running status of this module",
313                                         "required": true
314                                 },
315                                 "support_level": {
316                                         "type": "string",
317                                         "description": "The support state of this module",
318                                         "required": true
319                                 }
320                         }
321                 },
322                 "Variable": {
323                         "id": "Variable",
324                         "description": "The value of a channel variable",
325                         "properties": {
326                                 "value": {
327                                         "required": true,
328                                         "type": "string",
329                                         "description": "The value of the variable requested"
330                                 }
331                         }
332                 }
333         }
334 }