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