Update API versions and UPGRADE/CHANGES for 12.2.0
[asterisk/asterisk.git] / rest-api / api-docs / deviceStates.json
1 {
2         "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.",
3         "_author": "Kevin Harwell <kharwell@digium.com>",
4         "_svn_revision": "$Revision$",
5         "apiVersion": "1.2.0",
6         "swaggerVersion": "1.1",
7         "basePath": "http://localhost:8088/stasis",
8         "resourcePath": "/api-docs/deviceStates.{format}",
9         "apis": [
10                 {
11                         "path": "/deviceStates",
12                         "description": "Device states",
13                         "operations": [
14                                 {
15                                         "httpMethod": "GET",
16                                         "summary": "List all ARI controlled device states.",
17                                         "nickname": "list",
18                                         "responseClass": "List[DeviceState]"
19                                 }
20                         ]
21                 },
22                 {
23                         "path": "/deviceStates/{deviceName}",
24                         "description": "Device state",
25                         "operations": [
26                                 {
27                                         "httpMethod": "GET",
28                                         "summary": "Retrieve the current state of a device.",
29                                         "nickname": "get",
30                                         "responseClass": "DeviceState",
31                                         "parameters": [
32                                                 {
33                                                         "name": "deviceName",
34                                                         "description": "Name of the device",
35                                                         "paramType": "path",
36                                                         "required": true,
37                                                         "allowMultiple": false,
38                                                         "dataType": "string"
39                                                 }
40                                         ]
41                                 },
42                                 {
43                                         "httpMethod": "PUT",
44                                         "summary": "Change the state of a device controlled by ARI. (Note - implicitly creates the device state).",
45                                         "nickname": "update",
46                                         "responseClass": "void",
47                                         "parameters": [
48                                                 {
49                                                         "name": "deviceName",
50                                                         "description": "Name of the device",
51                                                         "paramType": "path",
52                                                         "required": true,
53                                                         "allowMultiple": false,
54                                                         "dataType": "string"
55                                                 },
56                                                 {
57                                                         "name": "deviceState",
58                                                         "description": "Device state value",
59                                                         "paramType": "query",
60                                                         "required": true,
61                                                         "allowMultiple": false,
62                                                         "dataType": "string",
63                                                         "allowableValues": {
64                                                                  "valueType": "LIST",
65                                                                   "values": [
66                                                                           "NOT_INUSE",
67                                                                           "INUSE",
68                                                                           "BUSY",
69                                                                           "INVALID",
70                                                                           "UNAVAILABLE",
71                                                                           "RINGING",
72                                                                           "RINGINUSE",
73                                                                           "ONHOLD"
74                                                                   ]
75                                                     }
76
77                                                 }
78                                         ],
79                                         "errorResponses": [
80                                                 {
81                                                         "code": 404,
82                                                         "reason": "Device name is missing"
83                                                 },
84                                                 {
85                                                         "code": 409,
86                                                         "reason": "Uncontrolled device specified"
87                                                 }
88                                         ]
89                                 },
90                                 {
91                                         "httpMethod": "DELETE",
92                                         "summary": "Destroy a device-state controlled by ARI.",
93                                         "nickname": "delete",
94                                         "responseClass": "void",
95                                         "parameters": [
96                                                 {
97                                                         "name": "deviceName",
98                                                         "description": "Name of the device",
99                                                         "paramType": "path",
100                                                         "required": true,
101                                                         "allowMultiple": false,
102                                                         "dataType": "string"
103                                                 }
104                                         ],
105                                         "errorResponses": [
106                                                 {
107                                                         "code": 404,
108                                                         "reason": "Device name is missing"
109                                                 },
110                                                 {
111                                                         "code": 409,
112                                                         "reason": "Uncontrolled device specified"
113                                                 }
114                                         ]
115                                 }
116                         ]
117                 }
118         ],
119         "models": {
120                 "DeviceState": {
121                         "id": "DeviceState",
122                         "description": "Represents the state of a device.",
123                         "properties": {
124                                 "name": {
125                                         "type": "string",
126                                         "description": "Name of the device.",
127                                         "required": true
128                                 },
129                                 "state": {
130                                         "type": "string",
131                                         "description": "Device's state",
132                                         "required": true,
133                                         "allowableValues": {
134                                                 "valueType": "LIST",
135                                                 "values": [
136                                                         "UNKNOWN",
137                                                         "NOT_INUSE",
138                                                         "INUSE",
139                                                         "BUSY",
140                                                         "INVALID",
141                                                         "UNAVAILABLE",
142                                                         "RINGING",
143                                                         "RINGINUSE",
144                                                         "ONHOLD"
145                                                 ]
146                                         }
147                                 }
148                         }
149                 }
150         }
151 }