ARI: Rotate log channels.
[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/config/dynamic/{configClass}/{objectType}/{id}",
12                         "description": "Asterisk dynamic configuration",
13                         "operations": [
14                                 {
15                                         "httpMethod": "GET",
16                                         "summary": "Retrieve a dynamic configuration object.",
17                                         "nickname": "getObject",
18                                         "responseClass": "List[ConfigTuple]",
19                                         "parameters": [
20                                                 {
21                                                         "name": "configClass",
22                                                         "description": "The configuration class containing dynamic configuration objects.",
23                                                         "paramType": "path",
24                                                         "required": true,
25                                                         "allowMultiple": false,
26                                                         "dataType": "string"
27                                                 },
28                                                 {
29                                                         "name": "objectType",
30                                                         "description": "The type of configuration object to retrieve.",
31                                                         "paramType": "path",
32                                                         "required": true,
33                                                         "allowMultiple": false,
34                                                         "dataType": "string"
35                                                 },
36                                                 {
37                                                         "name": "id",
38                                                         "description": "The unique identifier of the object to retrieve.",
39                                                         "paramType": "path",
40                                                         "required": true,
41                                                         "allowMultiple": false,
42                                                         "dataType": "string"
43                                                 }
44                                         ],
45                                         "errorResponses": [
46                                                 {
47                                                         "code": 404,
48                                                         "reason": "{configClass|objectType|id} not found"
49                                                 }
50                                         ]
51                                 },
52                                 {
53                                         "httpMethod": "PUT",
54                                         "summary": "Create or update a dynamic configuration object.",
55                                         "nickname": "updateObject",
56                                         "responseClass": "List[ConfigTuple]",
57                                         "parameters": [
58                                                 {
59                                                         "name": "configClass",
60                                                         "description": "The configuration class containing dynamic configuration objects.",
61                                                         "paramType": "path",
62                                                         "required": true,
63                                                         "allowMultiple": false,
64                                                         "dataType": "string"
65                                                 },
66                                                 {
67                                                         "name": "objectType",
68                                                         "description": "The type of configuration object to create or update.",
69                                                         "paramType": "path",
70                                                         "required": true,
71                                                         "allowMultiple": false,
72                                                         "dataType": "string"
73                                                 },
74                                                 {
75                                                         "name": "id",
76                                                         "description": "The unique identifier of the object to create or update.",
77                                                         "paramType": "path",
78                                                         "required": true,
79                                                         "allowMultiple": false,
80                                                         "dataType": "string"
81                                                 },
82                                                 {
83                                                         "name": "fields",
84                                                         "description": "The body object should have a value that is a list of ConfigTuples, which provide the fields to update. Ex. [ { \"attribute\": \"directmedia\", \"value\": \"false\" } ]",
85                                                         "paramType": "body",
86                                                         "required": false,
87                                                         "dataType": "containers",
88                                                         "allowMultiple": false
89                                                 }
90                                         ],
91                                         "errorResponses": [
92                                                 {
93                                                         "code": 400,
94                                                         "reason": "Bad request body"
95                                                 },
96                                                 {
97                                                         "code": 403,
98                                                         "reason": "Could not create or update object"
99                                                 },
100                                                 {
101                                                         "code": 404,
102                                                         "reason": "{configClass|objectType} not found"
103                                                 }
104                                         ]
105                                 },
106                                 {
107                                         "httpMethod": "DELETE",
108                                         "summary": "Delete a dynamic configuration object.",
109                                         "nickname": "deleteObject",
110                                         "responseClass": "void",
111                                         "parameters": [
112                                                 {
113                                                         "name": "configClass",
114                                                         "description": "The configuration class containing dynamic configuration objects.",
115                                                         "paramType": "path",
116                                                         "required": true,
117                                                         "allowMultiple": false,
118                                                         "dataType": "string"
119                                                 },
120                                                 {
121                                                         "name": "objectType",
122                                                         "description": "The type of configuration object to delete.",
123                                                         "paramType": "path",
124                                                         "required": true,
125                                                         "allowMultiple": false,
126                                                         "dataType": "string"
127                                                 },
128                                                 {
129                                                         "name": "id",
130                                                         "description": "The unique identifier of the object to delete.",
131                                                         "paramType": "path",
132                                                         "required": true,
133                                                         "allowMultiple": false,
134                                                         "dataType": "string"
135                                                 }
136                                         ],
137                                         "errorResponses": [
138                                                 {
139                                                         "code": 403,
140                                                         "reason": "Could not delete object"
141                                                 },
142                                                 {
143                                                         "code": 404,
144                                                         "reason": "{configClass|objectType|id} not found"
145                                                 }
146                                         ]
147                                 }
148                         ]
149                 },
150                 {
151                         "path": "/asterisk/info",
152                         "description": "Asterisk system information (similar to core show settings)",
153                         "operations": [
154                                 {
155                                         "httpMethod": "GET",
156                                         "summary": "Gets Asterisk system information.",
157                                         "nickname": "getInfo",
158                                         "responseClass": "AsteriskInfo",
159                                         "parameters": [
160                                                 {
161                                                         "name": "only",
162                                                         "description": "Filter information returned",
163                                                         "paramType": "query",
164                                                         "required": false,
165                                                         "allowMultiple": true,
166                                                         "dataType": "string",
167                                                         "allowableValues": {
168                                                                 "valueType": "LIST",
169                                                                 "values": [
170                                                                         "build",
171                                                                         "system",
172                                                                         "config",
173                                                                         "status"
174                                                                 ]
175                                                         }
176                                                 }
177                                         ]
178                                 }
179                         ]
180                 },
181                 {
182                         "path": "/asterisk/modules",
183                         "description": "Asterisk modules",
184                         "operations": [
185                                 {
186                                         "httpMethod": "GET",
187                                         "summary": "List Asterisk modules.",
188                                         "nickname": "listModules",
189                                         "responseClass": "List[Module]"
190                                 }
191                         ]
192                 },
193                 {
194                         "path": "/asterisk/modules/{moduleName}",
195                         "description": "Asterisk module",
196                         "operations": [
197                                 {
198                                         "httpMethod": "GET",
199                                         "summary": "Get Asterisk module information.",
200                                         "nickname": "getModule",
201                                         "responseClass": "Module",
202                                         "parameters": [
203                                                 {
204                                                         "name": "moduleName",
205                                                         "description": "Module's name",
206                                                         "paramType": "path",
207                                                         "required": true,
208                                                         "allowMultiple": false,
209                                                         "dataType": "string"
210                                                 }
211                                         ],
212                                         "errorResponses": [
213                                                 {
214                                                         "code": 404,
215                                                         "reason": "Module could not be found in running modules."
216                                                 },
217                                                 {
218                                                         "code": 409,
219                                                         "reason": "Module information could not be retrieved."
220                                                 }
221                                         ]
222                                 },
223                                 {
224                                         "httpMethod": "POST",
225                                         "summary": "Load an Asterisk module.",
226                                         "nickname": "loadModule",
227                                         "responseClass": "void",
228                                         "parameters": [
229                                                 {
230                                                         "name": "moduleName",
231                                                         "description": "Module's name",
232                                                         "paramType": "path",
233                                                         "required": true,
234                                                         "allowMultiple": false,
235                                                         "dataType": "string"
236                                                 }
237                                         ],
238                                         "errorResponses": [
239                                                 {
240                                                         "code": 409,
241                                                         "reason": "Module could not be loaded."
242                                                 }
243                                         ]
244                                 },
245                                 {
246                                         "httpMethod": "DELETE",
247                                         "summary": "Unload an Asterisk module.",
248                                         "nickname": "unloadModule",
249                                         "responseClass": "void",
250                                         "parameters": [
251                                                 {
252                                                         "name": "moduleName",
253                                                         "description": "Module's name",
254                                                         "paramType": "path",
255                                                         "required": true,
256                                                         "allowMultiple": false,
257                                                         "dataType": "string"
258                                                 }
259                                         ],
260                                         "errorResponses": [
261                                                 {
262                                                         "code": 404,
263                                                         "reason": "Module not found in running modules."
264                                                 },
265                                                 {
266                                                         "code": 409,
267                                                         "reason": "Module could not be unloaded."
268                                                 }
269                                         ]
270                                 },
271                                 {
272                                         "httpMethod": "PUT",
273                                         "summary": "Reload an Asterisk module.",
274                                         "nickname": "reloadModule",
275                                         "responseClass": "void",
276                                         "parameters": [
277                                                 {
278                                                         "name": "moduleName",
279                                                         "description": "Module's name",
280                                                         "paramType": "path",
281                                                         "required": true,
282                                                         "allowMultiple": false,
283                                                         "dataType": "string"
284                                                 }
285                                         ],
286                                         "errorResponses": [
287                                                 {
288                                                         "code": 404,
289                                                         "reason": "Module not found in running modules."
290                                                 },
291                                                 {
292                                                         "code": 409,
293                                                         "reason": "Module could not be reloaded."
294                                                 }
295                                         ]
296                                 }
297                         ]
298                 },
299                 {
300                         "path": "/asterisk/logging/{logChannelName}/rotate",
301                         "description": "Asterisk log channel",
302                         "operations": [
303                                 {
304                                         "httpMethod": "PUT",
305                                         "summary": "Rotates a log channel.",
306                                         "nickname": "rotateLog",
307                                         "responseClass": "void",
308                                         "parameters": [
309                                                 {
310                                                         "name": "logChannelName",
311                                                         "description": "Log channel's name",
312                                                         "paramType": "path",
313                                                         "required": true,
314                                                         "allowMultiple": false,
315                                                         "dataType": "string"
316                                                 }
317                                         ],
318                                         "errorResponses": [
319                                                 {
320                                                         "code": 404,
321                                                         "reason": "Log channel does not exist."
322                                                 }
323                                         ]
324                                 }
325                         ]
326                 },
327                 {
328                         "path": "/asterisk/variable",
329                         "description": "Global variables",
330                         "operations": [
331                                 {
332                                         "httpMethod": "GET",
333                                         "summary": "Get the value of a global variable.",
334                                         "nickname": "getGlobalVar",
335                                         "responseClass": "Variable",
336                                         "parameters": [
337                                                 {
338                                                         "name": "variable",
339                                                         "description": "The variable to get",
340                                                         "paramType": "query",
341                                                         "required": true,
342                                                         "allowMultiple": false,
343                                                         "dataType": "string"
344                                                 }
345                                         ],
346                                         "errorResponses": [
347                                                 {
348                                                         "code": 400,
349                                                         "reason": "Missing variable parameter."
350                                                 }
351                                         ]
352                                 },
353                                 {
354                                         "httpMethod": "POST",
355                                         "summary": "Set the value of a global variable.",
356                                         "nickname": "setGlobalVar",
357                                         "responseClass": "void",
358                                         "parameters": [
359                                                 {
360                                                         "name": "variable",
361                                                         "description": "The variable to set",
362                                                         "paramType": "query",
363                                                         "required": true,
364                                                         "allowMultiple": false,
365                                                         "dataType": "string"
366                                                 },
367                                                 {
368                                                         "name": "value",
369                                                         "description": "The value to set the variable to",
370                                                         "paramType": "query",
371                                                         "required": false,
372                                                         "allowMultiple": false,
373                                                         "dataType": "string"
374                                                 }
375                                         ],
376                                         "errorResponses": [
377                                                 {
378                                                         "code": 400,
379                                                         "reason": "Missing variable parameter."
380                                                 }
381                                         ]
382                                 }
383                         ]
384                 }
385         ],
386         "models": {
387                 "BuildInfo": {
388                         "id": "BuildInfo",
389                         "description": "Info about how Asterisk was built",
390                         "properties": {
391                                 "os": {
392                                         "required": true,
393                                         "type": "string",
394                                         "description": "OS Asterisk was built on."
395                                 },
396                                 "kernel": {
397                                         "required": true,
398                                         "type": "string",
399                                         "description": "Kernel version Asterisk was built on."
400                                 },
401                                 "options": {
402                                         "required": true,
403                                         "type": "string",
404                                         "description": "Compile time options, or empty string if default."
405                                 },
406                                 "machine": {
407                                         "required": true,
408                                         "type": "string",
409                                         "description": "Machine architecture (x86_64, i686, ppc, etc.)"
410                                 },
411                                 "date": {
412                                         "required": true,
413                                         "type": "string",
414                                         "description": "Date and time when Asterisk was built."
415                                 },
416                                 "user": {
417                                         "required": true,
418                                         "type": "string",
419                                         "description": "Username that build Asterisk"
420                                 }
421                         }
422                 },
423                 "SystemInfo": {
424                         "id": "SystemInfo",
425                         "description": "Info about Asterisk",
426                         "properties": {
427                                 "version": {
428                                         "required": true,
429                                         "type": "string",
430                                         "description": "Asterisk version."
431                                 },
432                                 "entity_id": {
433                                         "required": true,
434                                         "type": "string",
435                                         "description": ""
436                                 }
437                         }
438                 },
439                 "SetId": {
440                         "id": "SetId",
441                         "description": "Effective user/group id",
442                         "properties": {
443                                 "user": {
444                                         "required": true,
445                                         "type": "string",
446                                         "description": "Effective user id."
447                                 },
448                                 "group": {
449                                         "required": true,
450                                         "type": "string",
451                                         "description": "Effective group id."
452                                 }
453                         }
454                 },
455                 "ConfigInfo": {
456                         "id": "ConfigInfo",
457                         "description": "Info about Asterisk configuration",
458                         "properties": {
459                                 "name": {
460                                         "required": true,
461                                         "type": "string",
462                                         "description": "Asterisk system name."
463                                 },
464                                 "default_language": {
465                                         "required": true,
466                                         "type": "string",
467                                         "description": "Default language for media playback."
468                                 },
469                                 "max_channels": {
470                                         "required": false,
471                                         "type": "int",
472                                         "description": "Maximum number of simultaneous channels."
473                                 },
474                                 "max_open_files": {
475                                         "required": false,
476                                         "type": "int",
477                                         "description": "Maximum number of open file handles (files, sockets)."
478                                 },
479                                 "max_load": {
480                                         "required": false,
481                                         "type": "double",
482                                         "description": "Maximum load avg on system."
483                                 },
484                                 "setid": {
485                                         "required": true,
486                                         "type": "SetId",
487                                         "description": "Effective user/group id for running Asterisk."
488                                 }
489                         }
490                 },
491                 "StatusInfo": {
492                         "id": "StatusInfo",
493                         "description": "Info about Asterisk status",
494                         "properties": {
495                                 "startup_time": {
496                                         "required": true,
497                                         "type": "Date",
498                                         "description": "Time when Asterisk was started."
499                                 },
500                                 "last_reload_time": {
501                                         "required": true,
502                                         "type": "Date",
503                                         "description": "Time when Asterisk was last reloaded."
504                                 }
505                         }
506                 },
507                 "AsteriskInfo": {
508                         "id": "AsteriskInfo",
509                         "description": "Asterisk system information",
510                         "properties": {
511                                 "build": {
512                                         "required": false,
513                                         "type": "BuildInfo",
514                                         "description": "Info about how Asterisk was built"
515                                 },
516                                 "system": {
517                                         "required": false,
518                                         "type": "SystemInfo",
519                                         "description": "Info about the system running Asterisk"
520                                 },
521                                 "config": {
522                                         "required": false,
523                                         "type": "ConfigInfo",
524                                         "description": "Info about Asterisk configuration"
525                                 },
526                                 "status": {
527                                         "required": false,
528                                         "type": "StatusInfo",
529                                         "description": "Info about Asterisk status"
530                                 }
531                         }
532                 },
533                 "Module": {
534                         "id": "Module",
535                         "description": "Details of an Asterisk module",
536                         "properties": {
537                                 "name": {
538                                         "type": "string",
539                                         "description": "The name of this module",
540                                         "required": true
541                                 },
542                                 "description": {
543                                         "type": "string",
544                                         "description": "The description of this module",
545                                         "required": true
546                                 },
547                                 "use_count": {
548                                         "type": "int",
549                                         "description": "The number of times this module is being used",
550                                         "required": true
551                                 },
552                                 "status": {
553                                         "type": "string",
554                                         "description": "The running status of this module",
555                                         "required": true
556                                 },
557                                 "support_level": {
558                                         "type": "string",
559                                         "description": "The support state of this module",
560                                         "required": true
561                                 }
562                         }
563                 },
564                 "LogChannel": {
565                         "id": "LogChannel",
566                         "description": "Details of an Asterisk log channel",
567                         "properties": {
568                                 "name": {
569                                         "type": "string",
570                                         "description": "The log channel path",
571                                         "required": true
572                                 },
573                                 "type": {
574                                         "type": "string",
575                                         "description": "Types of logs for the log channel",
576                                         "required": true
577                                 },
578                                 "status": {
579                                         "type": "string",
580                                         "description": "Whether or not a log type is enabled",
581                                         "required": true
582                                 },
583                                 "configuration": {
584                                         "type": "string",
585                                         "description": "The various log levels",
586                                         "required": true
587                                 }
588                         }
589                 },
590                 "Variable": {
591                         "id": "Variable",
592                         "description": "The value of a channel variable",
593                         "properties": {
594                                 "value": {
595                                         "required": true,
596                                         "type": "string",
597                                         "description": "The value of the variable requested"
598                                 }
599                         }
600                 },
601                 "ConfigTuple": {
602                         "id": "ConfigTuple",
603                         "description": "A key/value pair that makes up part of a configuration object.",
604                         "properties": {
605                                 "attribute": {
606                                         "required": true,
607                                         "type": "string",
608                                         "description": "A configuration object attribute."
609                                 },
610                                 "value": {
611                                         "required": true,
612                                         "type": "string",
613                                         "description": "The value for the attribute."
614                                 }
615                         }
616                 }
617         }
618 }