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