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