Update events to use Swagger 1.3 subtyping, and related aftermath
[asterisk/asterisk.git] / rest-api / api-docs / bridges.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/bridges.{format}",
9         "apis": [
10                 {
11                         "path": "/bridges",
12                         "description": "Active bridges",
13                         "operations": [
14                                 {
15                                         "httpMethod": "GET",
16                                         "summary": "List active bridges.",
17                                         "nickname": "getBridges",
18                                         "responseClass": "List[Bridge]"
19                                 },
20                                 {
21                                         "httpMethod": "POST",
22                                         "summary": "Create a new bridge.",
23                                         "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.",
24                                         "nickname": "newBridge",
25                                         "responseClass": "Bridge",
26                                         "parameters": [
27                                                 {
28                                                         "name": "type",
29                                                         "description": "Type of bridge to create.",
30                                                         "paramType": "query",
31                                                         "required": false,
32                                                         "allowMultiple": false,
33                                                         "dataType": "string",
34                                                         "allowableValues": {
35                                                                 "valueType": "LIST",
36                                                                 "values": [
37                                                                         "mixing",
38                                                                         "holding"
39                                                                 ]
40                                                         }
41                                                 }
42                                         ]
43                                 }
44                         ]
45                 },
46                 {
47                         "path": "/bridges/{bridgeId}",
48                         "description": "Individual bridge",
49                         "operations": [
50                                 {
51                                         "httpMethod": "GET",
52                                         "summary": "Get bridge details.",
53                                         "nickname": "getBridge",
54                                         "responseClass": "Bridge",
55                                         "parameters": [
56                                                 {
57                                                         "name": "bridgeId",
58                                                         "description": "Bridge's id",
59                                                         "paramType": "path",
60                                                         "required": true,
61                                                         "allowMultiple": false,
62                                                         "dataType": "string"
63                                                 }
64                                         ],
65                                         "errorResponses": [
66                                                 {
67                                                         "code": 404,
68                                                         "reason": "Bridge not found"
69                                                 }
70                                         ]
71                                 },
72                                 {
73                                         "httpMethod": "DELETE",
74                                         "summary": "Shut down a bridge.",
75                                         "notes": "If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.",
76                                         "nickname": "deleteBridge",
77                                         "responseClass": "void",
78                                         "parameters": [
79                                                 {
80                                                         "name": "bridgeId",
81                                                         "description": "Bridge's id",
82                                                         "paramType": "path",
83                                                         "required": true,
84                                                         "allowMultiple": false,
85                                                         "dataType": "string"
86                                                 }
87                                         ],
88                                         "errorResponses": [
89                                                 {
90                                                         "code": 404,
91                                                         "reason": "Bridge not found"
92                                                 }
93                                         ]
94                                 }
95                         ]
96                 },
97                 {
98                         "path": "/bridges/{bridgeId}/addChannel",
99                         "description": "Add a channel to a bridge",
100                         "operations": [
101                                 {
102                                         "httpMethod": "POST",
103                                         "summary": "Add a channel to a bridge.",
104                                         "nickname": "addChannelToBridge",
105                                         "responseClass": "void",
106                                         "parameters": [
107                                                 {
108                                                         "name": "bridgeId",
109                                                         "description": "Bridge's id",
110                                                         "paramType": "path",
111                                                         "required": true,
112                                                         "allowMultiple": false,
113                                                         "dataType": "string"
114                                                 },
115                                                 {
116                                                         "name": "channel",
117                                                         "description": "Channel's id",
118                                                         "paramType": "query",
119                                                         "required": true,
120                                                         "allowMultiple": true,
121                                                         "dataType": "string"
122                                                 }
123                                         ],
124                                         "errorResponses": [
125                                                 {
126                                                         "code": 404,
127                                                         "reason": "Bridge not found"
128                                                 },
129                                                 {
130                                                         "code": 409,
131                                                         "reason": "Bridge not in Stasis application"
132                                                 },
133                                                 {
134                                                         "code": 422,
135                                                         "reason": "Channel not found, or not in Stasis application"
136                                                 }
137                                         ]
138                                 }
139                         ]
140                 },
141                 {
142                         "path": "/bridges/{bridgeId}/removeChannel",
143                         "description": "Remove a channel from a bridge",
144                         "operations": [
145                                 {
146                                         "httpMethod": "POST",
147                                         "summary": "Remove a channel from a bridge.",
148                                         "nickname": "removeChannelFromBridge",
149                                         "responseClass": "void",
150                                         "parameters": [
151                                                 {
152                                                         "name": "bridgeId",
153                                                         "description": "Bridge's id",
154                                                         "paramType": "path",
155                                                         "required": true,
156                                                         "allowMultiple": false,
157                                                         "dataType": "string"
158                                                 },
159                                                 {
160                                                         "name": "channel",
161                                                         "description": "Channel's id",
162                                                         "paramType": "query",
163                                                         "required": true,
164                                                         "allowMultiple": true,
165                                                         "dataType": "string"
166                                                 }
167                                         ]
168                                 }
169                         ]
170                 },
171                 {
172                         "path": "/bridges/{bridgeId}/record",
173                         "description": "Record audio on a bridge",
174                         "operations": [
175                                 {
176                                         "httpMethod": "POST",
177                                         "summary": "Start a recording.",
178                                         "notes": "This records the mixed audio from all channels participating in this bridge.",
179                                         "nickname": "recordBridge",
180                                         "responseClass": "LiveRecording",
181                                         "parameters": [
182                                                 {
183                                                         "name": "bridgeId",
184                                                         "description": "Bridge's id",
185                                                         "paramType": "path",
186                                                         "required": true,
187                                                         "allowMultiple": false,
188                                                         "dataType": "string"
189                                                 },
190                                                 {
191                                                         "name": "name",
192                                                         "description": "Recording's filename",
193                                                         "paramType": "query",
194                                                         "required": true,
195                                                         "allowMultiple": false,
196                                                         "dataType": "string"
197                                                 },
198                                                 {
199                                                         "name": "maxDurationSeconds",
200                                                         "description": "Maximum duration of the recording, in seconds. 0 for no limit.",
201                                                         "paramType": "query",
202                                                         "required": false,
203                                                         "allowMultiple": false,
204                                                         "dataType": "int",
205                                                         "defaultValue": 0
206                                                 },
207                                                 {
208                                                         "name": "maxSilenceSeconds",
209                                                         "description": "Maximum duration of silence, in seconds. 0 for no limit.",
210                                                         "paramType": "query",
211                                                         "required": false,
212                                                         "allowMultiple": false,
213                                                         "dataType": "int",
214                                                         "defaultValue": 0
215                                                 },
216                                                 {
217                                                         "name": "append",
218                                                         "description": "If true, and recording already exists, append to recording.",
219                                                         "paramType": "query",
220                                                         "required": false,
221                                                         "allowMultiple": false,
222                                                         "dataType": "boolean",
223                                                         "defaultValue": false
224                                                 },
225                                                 {
226                                                         "name": "beep",
227                                                         "description": "Play beep when recording begins",
228                                                         "paramType": "query",
229                                                         "required": false,
230                                                         "allowMultiple": false,
231                                                         "dataType": "boolean",
232                                                         "defaultValue": false
233                                                 },
234                                                 {
235                                                         "name": "terminateOn",
236                                                         "description": "DTMF input to terminate recording.",
237                                                         "paramType": "query",
238                                                         "required": false,
239                                                         "allowMultiple": false,
240                                                         "dataType": "string",
241                                                         "defaultValue": "none",
242                                                         "allowableValues": {
243                                                                 "valueType": "LIST",
244                                                                 "values": [
245                                                                         "none",
246                                                                         "any",
247                                                                         "*",
248                                                                         "#"
249                                                                 ]
250                                                         }
251                                                 }
252                                         ]
253                                 }
254                         ]
255                 }
256         ],
257         "models": {
258                 "Bridge": {
259                         "id": "Bridge",
260                         "description": "The merging of media from one or more channels.\n\nEveryone on the bridge receives the same audio.",
261                         "properties": {
262                                 "id": {
263                                         "type": "string",
264                                         "description": "Unique identifier for this bridge",
265                                         "required": true
266                                 },
267                                 "technology": {
268                                         "type": "string",
269                                         "description": "Name of the current bridging technology",
270                                         "required": true
271                                 },
272                                 "bridge_type": {
273                                         "type": "string",
274                                         "description": "Type of bridge technology",
275                                         "required": true,
276                                         "allowableValues": {
277                                                 "valueType": "LIST",
278                                                 "values": [
279                                                         "mixing",
280                                                         "holding"
281                                                 ]
282                                         }
283                                 },
284                                 "bridge_class": {
285                                         "type": "string",
286                                         "description": "Bridging class",
287                                         "required": true
288                                 },
289                                 "channels": {
290                                         "type": "List[string]",
291                                         "description": "Id's of channels participating in this bridge",
292                                         "required": true
293                                 }
294                         }
295                 }
296         }
297 }