ARI: Creating 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}",
301                         "description": "Asterisk log channel",
302                         "operations": [
303                                 {
304                                         "httpMethod": "POST",
305                                         "summary": "Adds a log channel.",
306                                         "nickname": "addLog",
307                                         "responseClass": "void",
308                                         "parameters": [
309                                                 {
310                                                         "name": "logChannelName",
311                                                         "description": "The log channel to add",
312                                                         "paramType": "path",
313                                                         "required": true,
314                                                         "allowMultiple": false,
315                                                         "dataType": "string"
316                                                 },
317                                                 {
318                                                         "name": "configuration",
319                                                         "description": "levels of the log channel",
320                                                         "paramType": "query",
321                                                         "required": true,
322                                                         "allowMultiple": false,
323                                                         "dataType": "string"
324                                                 }
325                                         ],
326                                         "errorResponses": [
327                                                 {
328                                                         "code": 400,
329                                                         "reason": "Bad request body"
330                                                 },
331                                                 {
332                                                         "code": 409,
333                                                         "reason": "Log channel could not be created."
334                                                 }
335                                         ]
336                                 },
337                                 {
338                                         "httpMethod": "DELETE",
339                                         "summary": "Deletes a log channel.",
340                                         "nickname": "deleteLog",
341                                         "responseClass": "void",
342                                         "parameters": [
343                                                 {
344                                                         "name": "logChannelName",
345                                                         "description": "Log channels name",
346                                                         "paramType": "path",
347                                                         "required": true,
348                                                         "allowMultiple": false,
349                                                         "dataType": "string"
350                                                 }
351                                         ],
352                                         "errorResponses": [
353                                                 {
354                                                         "code": 404,
355                                                         "reason": "Log channel does not exist."
356                                                 }
357                                         ]
358                                 }
359                         ]
360                 },
361                 {
362                         "path": "/asterisk/logging/{logChannelName}/rotate",
363                         "description": "Asterisk log channel",
364                         "operations": [
365                                 {
366                                         "httpMethod": "PUT",
367                                         "summary": "Rotates a log channel.",
368                                         "nickname": "rotateLog",
369                                         "responseClass": "void",
370                                         "parameters": [
371                                                 {
372                                                         "name": "logChannelName",
373                                                         "description": "Log channel's name",
374                                                         "paramType": "path",
375                                                         "required": true,
376                                                         "allowMultiple": false,
377                                                         "dataType": "string"
378                                                 }
379                                         ],
380                                         "errorResponses": [
381                                                 {
382                                                         "code": 404,
383                                                         "reason": "Log channel does not exist."
384                                                 }
385                                         ]
386                                 }
387                         ]
388                 },
389                 {
390                         "path": "/asterisk/variable",
391                         "description": "Global variables",
392                         "operations": [
393                                 {
394                                         "httpMethod": "GET",
395                                         "summary": "Get the value of a global variable.",
396                                         "nickname": "getGlobalVar",
397                                         "responseClass": "Variable",
398                                         "parameters": [
399                                                 {
400                                                         "name": "variable",
401                                                         "description": "The variable to get",
402                                                         "paramType": "query",
403                                                         "required": true,
404                                                         "allowMultiple": false,
405                                                         "dataType": "string"
406                                                 }
407                                         ],
408                                         "errorResponses": [
409                                                 {
410                                                         "code": 400,
411                                                         "reason": "Missing variable parameter."
412                                                 }
413                                         ]
414                                 },
415                                 {
416                                         "httpMethod": "POST",
417                                         "summary": "Set the value of a global variable.",
418                                         "nickname": "setGlobalVar",
419                                         "responseClass": "void",
420                                         "parameters": [
421                                                 {
422                                                         "name": "variable",
423                                                         "description": "The variable to set",
424                                                         "paramType": "query",
425                                                         "required": true,
426                                                         "allowMultiple": false,
427                                                         "dataType": "string"
428                                                 },
429                                                 {
430                                                         "name": "value",
431                                                         "description": "The value to set the variable to",
432                                                         "paramType": "query",
433                                                         "required": false,
434                                                         "allowMultiple": false,
435                                                         "dataType": "string"
436                                                 }
437                                         ],
438                                         "errorResponses": [
439                                                 {
440                                                         "code": 400,
441                                                         "reason": "Missing variable parameter."
442                                                 }
443                                         ]
444                                 }
445                         ]
446                 }
447         ],
448         "models": {
449                 "BuildInfo": {
450                         "id": "BuildInfo",
451                         "description": "Info about how Asterisk was built",
452                         "properties": {
453                                 "os": {
454                                         "required": true,
455                                         "type": "string",
456                                         "description": "OS Asterisk was built on."
457                                 },
458                                 "kernel": {
459                                         "required": true,
460                                         "type": "string",
461                                         "description": "Kernel version Asterisk was built on."
462                                 },
463                                 "options": {
464                                         "required": true,
465                                         "type": "string",
466                                         "description": "Compile time options, or empty string if default."
467                                 },
468                                 "machine": {
469                                         "required": true,
470                                         "type": "string",
471                                         "description": "Machine architecture (x86_64, i686, ppc, etc.)"
472                                 },
473                                 "date": {
474                                         "required": true,
475                                         "type": "string",
476                                         "description": "Date and time when Asterisk was built."
477                                 },
478                                 "user": {
479                                         "required": true,
480                                         "type": "string",
481                                         "description": "Username that build Asterisk"
482                                 }
483                         }
484                 },
485                 "SystemInfo": {
486                         "id": "SystemInfo",
487                         "description": "Info about Asterisk",
488                         "properties": {
489                                 "version": {
490                                         "required": true,
491                                         "type": "string",
492                                         "description": "Asterisk version."
493                                 },
494                                 "entity_id": {
495                                         "required": true,
496                                         "type": "string",
497                                         "description": ""
498                                 }
499                         }
500                 },
501                 "SetId": {
502                         "id": "SetId",
503                         "description": "Effective user/group id",
504                         "properties": {
505                                 "user": {
506                                         "required": true,
507                                         "type": "string",
508                                         "description": "Effective user id."
509                                 },
510                                 "group": {
511                                         "required": true,
512                                         "type": "string",
513                                         "description": "Effective group id."
514                                 }
515                         }
516                 },
517                 "ConfigInfo": {
518                         "id": "ConfigInfo",
519                         "description": "Info about Asterisk configuration",
520                         "properties": {
521                                 "name": {
522                                         "required": true,
523                                         "type": "string",
524                                         "description": "Asterisk system name."
525                                 },
526                                 "default_language": {
527                                         "required": true,
528                                         "type": "string",
529                                         "description": "Default language for media playback."
530                                 },
531                                 "max_channels": {
532                                         "required": false,
533                                         "type": "int",
534                                         "description": "Maximum number of simultaneous channels."
535                                 },
536                                 "max_open_files": {
537                                         "required": false,
538                                         "type": "int",
539                                         "description": "Maximum number of open file handles (files, sockets)."
540                                 },
541                                 "max_load": {
542                                         "required": false,
543                                         "type": "double",
544                                         "description": "Maximum load avg on system."
545                                 },
546                                 "setid": {
547                                         "required": true,
548                                         "type": "SetId",
549                                         "description": "Effective user/group id for running Asterisk."
550                                 }
551                         }
552                 },
553                 "StatusInfo": {
554                         "id": "StatusInfo",
555                         "description": "Info about Asterisk status",
556                         "properties": {
557                                 "startup_time": {
558                                         "required": true,
559                                         "type": "Date",
560                                         "description": "Time when Asterisk was started."
561                                 },
562                                 "last_reload_time": {
563                                         "required": true,
564                                         "type": "Date",
565                                         "description": "Time when Asterisk was last reloaded."
566                                 }
567                         }
568                 },
569                 "AsteriskInfo": {
570                         "id": "AsteriskInfo",
571                         "description": "Asterisk system information",
572                         "properties": {
573                                 "build": {
574                                         "required": false,
575                                         "type": "BuildInfo",
576                                         "description": "Info about how Asterisk was built"
577                                 },
578                                 "system": {
579                                         "required": false,
580                                         "type": "SystemInfo",
581                                         "description": "Info about the system running Asterisk"
582                                 },
583                                 "config": {
584                                         "required": false,
585                                         "type": "ConfigInfo",
586                                         "description": "Info about Asterisk configuration"
587                                 },
588                                 "status": {
589                                         "required": false,
590                                         "type": "StatusInfo",
591                                         "description": "Info about Asterisk status"
592                                 }
593                         }
594                 },
595                 "Module": {
596                         "id": "Module",
597                         "description": "Details of an Asterisk module",
598                         "properties": {
599                                 "name": {
600                                         "type": "string",
601                                         "description": "The name of this module",
602                                         "required": true
603                                 },
604                                 "description": {
605                                         "type": "string",
606                                         "description": "The description of this module",
607                                         "required": true
608                                 },
609                                 "use_count": {
610                                         "type": "int",
611                                         "description": "The number of times this module is being used",
612                                         "required": true
613                                 },
614                                 "status": {
615                                         "type": "string",
616                                         "description": "The running status of this module",
617                                         "required": true
618                                 },
619                                 "support_level": {
620                                         "type": "string",
621                                         "description": "The support state of this module",
622                                         "required": true
623                                 }
624                         }
625                 },
626                 "LogChannel": {
627                         "id": "LogChannel",
628                         "description": "Details of an Asterisk log channel",
629                         "properties": {
630                                 "channel": {
631                                         "type": "string",
632                                         "description": "The log channel path",
633                                         "required": true
634                                 },
635                                 "type": {
636                                         "type": "string",
637                                         "description": "Types of logs for the log channel",
638                                         "required": true
639                                 },
640                                 "status": {
641                                         "type": "string",
642                                         "description": "Whether or not a log type is enabled",
643                                         "required": true
644                                 },
645                                 "configuration": {
646                                         "type": "string",
647                                         "description": "The various log levels",
648                                         "required": true
649                                 }
650                         }
651                 },
652                 "Variable": {
653                         "id": "Variable",
654                         "description": "The value of a channel variable",
655                         "properties": {
656                                 "value": {
657                                         "required": true,
658                                         "type": "string",
659                                         "description": "The value of the variable requested"
660                                 }
661                         }
662                 },
663                 "ConfigTuple": {
664                         "id": "ConfigTuple",
665                         "description": "A key/value pair that makes up part of a configuration object.",
666                         "properties": {
667                                 "attribute": {
668                                         "required": true,
669                                         "type": "string",
670                                         "description": "A configuration object attribute."
671                                 },
672                                 "value": {
673                                         "required": true,
674                                         "type": "string",
675                                         "description": "The value for the attribute."
676                                 }
677                         }
678                 }
679         }
680 }