28badce8062cc2b5907ba864ee4794e89e2dced3
[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                                         "httpMethod": "POST",
85                                         "summary": "Load an Asterisk module.",
86                                         "nickname": "loadModule",
87                                         "responseClass": "void",
88                                         "parameters": [
89                                                 {
90                                                         "name": "moduleName",
91                                                         "description": "Module's name",
92                                                         "paramType": "path",
93                                                         "required": true,
94                                                         "allowMultiple": false,
95                                                         "dataType": "string"
96                                                 }
97                                         ],
98                                         "errorResponses": [
99                                                 {
100                                                         "code": 409,
101                                                         "reason": "Module could not be loaded."
102                                                 }
103                                         ]
104                                 },
105                                 {
106                                         "httpMethod": "DELETE",
107                                         "summary": "Unload an Asterisk module.",
108                                         "nickname": "unloadModule",
109                                         "responseClass": "void",
110                                         "parameters": [
111                                                 {
112                                                         "name": "moduleName",
113                                                         "description": "Module's name",
114                                                         "paramType": "path",
115                                                         "required": true,
116                                                         "allowMultiple": false,
117                                                         "dataType": "string"
118                                                 }
119                                         ],
120                                         "errorResponses": [
121                                                 {
122                                                         "code": 404,
123                                                         "reason": "Module not found in running modules."
124                                                 },
125                                                 {
126                                                         "code": 409,
127                                                         "reason": "Module could not be unloaded."
128                                                 }
129                                         ]
130                                 }
131                         ]
132                 },
133                 {
134                         "path": "/asterisk/variable",
135                         "description": "Global variables",
136                         "operations": [
137                                 {
138                                         "httpMethod": "GET",
139                                         "summary": "Get the value of a global variable.",
140                                         "nickname": "getGlobalVar",
141                                         "responseClass": "Variable",
142                                         "parameters": [
143                                                 {
144                                                         "name": "variable",
145                                                         "description": "The variable to get",
146                                                         "paramType": "query",
147                                                         "required": true,
148                                                         "allowMultiple": false,
149                                                         "dataType": "string"
150                                                 }
151                                         ],
152                                         "errorResponses": [
153                                                 {
154                                                         "code": 400,
155                                                         "reason": "Missing variable parameter."
156                                                 }
157                                         ]
158                                 },
159                                 {
160                                         "httpMethod": "POST",
161                                         "summary": "Set the value of a global variable.",
162                                         "nickname": "setGlobalVar",
163                                         "responseClass": "void",
164                                         "parameters": [
165                                                 {
166                                                         "name": "variable",
167                                                         "description": "The variable to set",
168                                                         "paramType": "query",
169                                                         "required": true,
170                                                         "allowMultiple": false,
171                                                         "dataType": "string"
172                                                 },
173                                                 {
174                                                         "name": "value",
175                                                         "description": "The value to set the variable to",
176                                                         "paramType": "query",
177                                                         "required": false,
178                                                         "allowMultiple": false,
179                                                         "dataType": "string"
180                                                 }
181                                         ],
182                                         "errorResponses": [
183                                                 {
184                                                         "code": 400,
185                                                         "reason": "Missing variable parameter."
186                                                 }
187                                         ]
188                                 }
189                         ]
190                 }
191         ],
192         "models": {
193                 "BuildInfo": {
194                         "id": "BuildInfo",
195                         "description": "Info about how Asterisk was built",
196                         "properties": {
197                                 "os": {
198                                         "required": true,
199                                         "type": "string",
200                                         "description": "OS Asterisk was built on."
201                                 },
202                                 "kernel": {
203                                         "required": true,
204                                         "type": "string",
205                                         "description": "Kernel version Asterisk was built on."
206                                 },
207                                 "options": {
208                                         "required": true,
209                                         "type": "string",
210                                         "description": "Compile time options, or empty string if default."
211                                 },
212                                 "machine": {
213                                         "required": true,
214                                         "type": "string",
215                                         "description": "Machine architecture (x86_64, i686, ppc, etc.)"
216                                 },
217                                 "date": {
218                                         "required": true,
219                                         "type": "string",
220                                         "description": "Date and time when Asterisk was built."
221                                 },
222                                 "user": {
223                                         "required": true,
224                                         "type": "string",
225                                         "description": "Username that build Asterisk"
226                                 }
227                         }
228                 },
229                 "SystemInfo": {
230                         "id": "SystemInfo",
231                         "description": "Info about Asterisk",
232                         "properties": {
233                                 "version": {
234                                         "required": true,
235                                         "type": "string",
236                                         "description": "Asterisk version."
237                                 },
238                                 "entity_id": {
239                                         "required": true,
240                                         "type": "string",
241                                         "description": ""
242                                 }
243                         }
244                 },
245                 "SetId": {
246                         "id": "SetId",
247                         "description": "Effective user/group id",
248                         "properties": {
249                                 "user": {
250                                         "required": true,
251                                         "type": "string",
252                                         "description": "Effective user id."
253                                 },
254                                 "group": {
255                                         "required": true,
256                                         "type": "string",
257                                         "description": "Effective group id."
258                                 }
259                         }
260                 },
261                 "ConfigInfo": {
262                         "id": "ConfigInfo",
263                         "description": "Info about Asterisk configuration",
264                         "properties": {
265                                 "name": {
266                                         "required": true,
267                                         "type": "string",
268                                         "description": "Asterisk system name."
269                                 },
270                                 "default_language": {
271                                         "required": true,
272                                         "type": "string",
273                                         "description": "Default language for media playback."
274                                 },
275                                 "max_channels": {
276                                         "required": false,
277                                         "type": "int",
278                                         "description": "Maximum number of simultaneous channels."
279                                 },
280                                 "max_open_files": {
281                                         "required": false,
282                                         "type": "int",
283                                         "description": "Maximum number of open file handles (files, sockets)."
284                                 },
285                                 "max_load": {
286                                         "required": false,
287                                         "type": "double",
288                                         "description": "Maximum load avg on system."
289                                 },
290                                 "setid": {
291                                         "required": true,
292                                         "type": "SetId",
293                                         "description": "Effective user/group id for running Asterisk."
294                                 }
295                         }
296                 },
297                 "StatusInfo": {
298                         "id": "StatusInfo",
299                         "description": "Info about Asterisk status",
300                         "properties": {
301                                 "startup_time": {
302                                         "required": true,
303                                         "type": "Date",
304                                         "description": "Time when Asterisk was started."
305                                 },
306                                 "last_reload_time": {
307                                         "required": true,
308                                         "type": "Date",
309                                         "description": "Time when Asterisk was last reloaded."
310                                 }
311                         }
312                 },
313                 "AsteriskInfo": {
314                         "id": "AsteriskInfo",
315                         "description": "Asterisk system information",
316                         "properties": {
317                                 "build": {
318                                         "required": false,
319                                         "type": "BuildInfo",
320                                         "description": "Info about how Asterisk was built"
321                                 },
322                                 "system": {
323                                         "required": false,
324                                         "type": "SystemInfo",
325                                         "description": "Info about the system running Asterisk"
326                                 },
327                                 "config": {
328                                         "required": false,
329                                         "type": "ConfigInfo",
330                                         "description": "Info about Asterisk configuration"
331                                 },
332                                 "status": {
333                                         "required": false,
334                                         "type": "StatusInfo",
335                                         "description": "Info about Asterisk status"
336                                 }
337                         }
338                 },
339                 "Module": {
340                         "id": "Module",
341                         "description": "Details of an Asterisk module",
342                         "properties": {
343                                 "name": {
344                                         "type": "string",
345                                         "description": "The name of this module",
346                                         "required": true
347                                 },
348                                 "description": {
349                                         "type": "string",
350                                         "description": "The description of this module",
351                                         "required": true
352                                 },
353                                 "use_count": {
354                                         "type": "int",
355                                         "description": "The number of times this module is being used",
356                                         "required": true
357                                 },
358                                 "status": {
359                                         "type": "string",
360                                         "description": "The running status of this module",
361                                         "required": true
362                                 },
363                                 "support_level": {
364                                         "type": "string",
365                                         "description": "The support state of this module",
366                                         "required": true
367                                 }
368                         }
369                 },
370                 "Variable": {
371                         "id": "Variable",
372                         "description": "The value of a channel variable",
373                         "properties": {
374                                 "value": {
375                                         "required": true,
376                                         "type": "string",
377                                         "description": "The value of the variable requested"
378                                 }
379                         }
380                 }
381         }
382 }