ARI: Correct segfault with /variable calls are missing ?variable parameter.
[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": "0.0.1",
6         "swaggerVersion": "1.1",
7         "basePath": "http://localhost:8088/stasis",
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": "getAsteriskInfo",
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                                                                         "version",
31                                                                         "modules",
32                                                                         "uptime"
33                                                                 ]
34                                                         }
35                                                 }
36                                         ]
37                                 }
38                         ]
39                 },
40                 {
41                         "path": "/asterisk/variable",
42                         "description": "Global variables",
43                         "operations": [
44                                 {
45                                         "httpMethod": "GET",
46                                         "summary": "Get the value of a global variable.",
47                                         "nickname": "getGlobalVar",
48                                         "responseClass": "Variable",
49                                         "parameters": [
50                                                 {
51                                                         "name": "variable",
52                                                         "description": "The variable to get",
53                                                         "paramType": "query",
54                                                         "required": true,
55                                                         "allowMultiple": false,
56                                                         "dataType": "string"
57                                                 }
58                                         ],
59                                         "errorResponses": [
60                                                 {
61                                                         "code": 400,
62                                                         "reason": "Missing variable parameter."
63                                                 }
64                                         ]
65                                 },
66                                 {
67                                         "httpMethod": "POST",
68                                         "summary": "Set the value of a global variable.",
69                                         "nickname": "setGlobalVar",
70                                         "responseClass": "void",
71                                         "parameters": [
72                                                 {
73                                                         "name": "variable",
74                                                         "description": "The variable to set",
75                                                         "paramType": "query",
76                                                         "required": true,
77                                                         "allowMultiple": false,
78                                                         "dataType": "string"
79                                                 },
80                                                 {
81                                                         "name": "value",
82                                                         "description": "The value to set the variable to",
83                                                         "paramType": "query",
84                                                         "required": false,
85                                                         "allowMultiple": false,
86                                                         "dataType": "string"
87                                                 }
88                                         ],
89                                         "errorResponses": [
90                                                 {
91                                                         "code": 400,
92                                                         "reason": "Missing variable parameter."
93                                                 }
94                                         ]
95                                 }
96                         ]
97                 }
98         ],
99         "models": {
100                 "BuildInfo": {
101                         "id": "BuildInfo",
102                         "description": "Info about how Asterisk was built",
103                         "properties": {
104                                 "os": {
105                                         "required": true,
106                                         "type": "string",
107                                         "description": "OS Asterisk was built on."
108                                 },
109                                 "kernel": {
110                                         "required": true,
111                                         "type": "string",
112                                         "description": "Kernel version Asterisk was built on."
113                                 },
114                                 "options": {
115                                         "required": true,
116                                         "type": "string",
117                                         "description": "Compile time options, or empty string if default."
118                                 },
119                                 "machine": {
120                                         "required": true,
121                                         "type": "string",
122                                         "description": "Machine architecture (x86_64, i686, ppc, etc.)"
123                                 },
124                                 "date": {
125                                         "required": true,
126                                         "type": "string",
127                                         "description": "Date and time when Asterisk was built."
128                                 },
129                                 "user": {
130                                         "required": true,
131                                         "type": "string",
132                                         "description": "Username that build Asterisk"
133                                 }
134                         }
135                 },
136                 "SystemInfo": {
137                         "id": "SystemInfo",
138                         "description": "Info about Asterisk",
139                         "properties": {
140                                 "version": {
141                                         "required": true,
142                                         "type": "string",
143                                         "description": "Asterisk version."
144                                 },
145                                 "entity_id": {
146                                         "required": true,
147                                         "type": "string",
148                                         "description": ""
149                                 }
150                         }
151                 },
152                 "SetId": {
153                         "id": "SetId",
154                         "description": "Effective user/group id",
155                         "properties": {
156                                 "user": {
157                                         "required": true,
158                                         "type": "string",
159                                         "description": "Effective user id."
160                                 },
161                                 "group": {
162                                         "required": true,
163                                         "type": "string",
164                                         "description": "Effective group id."
165                                 }
166                         }
167                 },
168                 "ConfigInfo": {
169                         "id": "ConfigInfo",
170                         "description": "Info about Asterisk configuration",
171                         "properties": {
172                                 "name": {
173                                         "required": true,
174                                         "type": "string",
175                                         "description": "Asterisk system name."
176                                 },
177                                 "default_language": {
178                                         "required": true,
179                                         "type": "string",
180                                         "description": "Default language for media playback."
181                                 },
182                                 "max_channels": {
183                                         "required": false,
184                                         "type": "int",
185                                         "description": "Maximum number of simultaneous channels."
186                                 },
187                                 "max_open_files": {
188                                         "required": false,
189                                         "type": "int",
190                                         "description": "Maximum number of open file handles (files, sockets)."
191                                 },
192                                 "max_load": {
193                                         "required": false,
194                                         "type": "double",
195                                         "description": "Maximum load avg on system."
196                                 },
197                                 "setid": {
198                                         "required": true,
199                                         "type": "SetId",
200                                         "description": "Effective user/group id for running Asterisk."
201                                 }
202                         }
203                 },
204                 "StatusInfo": {
205                         "id": "StatusInfo",
206                         "description": "Info about Asterisk status",
207                         "properties": {
208                                 "startup_time": {
209                                         "required": true,
210                                         "type": "Date",
211                                         "description": "Time when Asterisk was started."
212                                 },
213                                 "last_reload_time": {
214                                         "required": true,
215                                         "type": "Date",
216                                         "description": "Time when Asterisk was last reloaded."
217                                 }
218                         }
219                 },
220                 "AsteriskInfo": {
221                         "id": "AsteriskInfo",
222                         "description": "Asterisk system information",
223                         "properties": {
224                                 "build": {
225                                         "required": false,
226                                         "type": "BuildInfo",
227                                         "description": "Info about how Asterisk was built"
228                                 },
229                                 "system": {
230                                         "required": false,
231                                         "type": "SystemInfo",
232                                         "description": "Info about the system running Asterisk"
233                                 },
234                                 "config": {
235                                         "required": false,
236                                         "type": "ConfigInfo",
237                                         "description": "Info about Asterisk configuration"
238                                 },
239                                 "status": {
240                                         "required": false,
241                                         "type": "StatusInfo",
242                                         "description": "Info about Asterisk status"
243                                 }
244                         }
245                 },
246                 "Variable": {
247                         "id": "Variable",
248                         "description": "The value of a channel variable",
249                         "properties": {
250                                 "value": {
251                                         "required": true,
252                                         "type": "string",
253                                         "description": "The value of the variable requested"
254                                 }
255                         }
256                 }
257         }
258 }