Skip to content

Commit 10bd434

Browse files
author
Michael Walton
committed
Add deviceStates.json and playbacks.json for Asterisk 12.0.0-beta2
1 parent 441a648 commit 10bd434

2 files changed

Lines changed: 306 additions & 0 deletions

File tree

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
{
2+
"_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.",
3+
"_author": "Kevin Harwell <kharwell@digium.com>",
4+
"_svn_revision": "$Revision: 403134 $",
5+
"apiVersion": "0.0.1",
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+
}
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
{
2+
"_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.",
3+
"_author": "David M. Lee, II <dlee@digium.com>",
4+
"_svn_revision": "$Revision: 402560 $",
5+
"apiVersion": "0.0.1",
6+
"swaggerVersion": "1.1",
7+
"basePath": "http://localhost:8088/stasis",
8+
"resourcePath": "/api-docs/playbacks.{format}",
9+
"apis": [
10+
{
11+
"path": "/playbacks/{playbackId}",
12+
"description": "Control object for a playback operation.",
13+
"operations": [
14+
{
15+
"httpMethod": "GET",
16+
"summary": "Get a playback's details.",
17+
"nickname": "get",
18+
"responseClass": "Playback",
19+
"parameters": [
20+
{
21+
"name": "playbackId",
22+
"description": "Playback's id",
23+
"paramType": "path",
24+
"required": true,
25+
"allowMultiple": false,
26+
"dataType": "string"
27+
}
28+
],
29+
"errorResponses": [
30+
{
31+
"code": 404,
32+
"reason": "The playback cannot be found"
33+
}
34+
]
35+
},
36+
{
37+
"httpMethod": "DELETE",
38+
"summary": "Stop a playback.",
39+
"nickname": "stop",
40+
"responseClass": "void",
41+
"parameters": [
42+
{
43+
"name": "playbackId",
44+
"description": "Playback's id",
45+
"paramType": "path",
46+
"required": true,
47+
"allowMultiple": false,
48+
"dataType": "string"
49+
}
50+
],
51+
"errorResponses": [
52+
{
53+
"code": 404,
54+
"reason": "The playback cannot be found"
55+
}
56+
]
57+
}
58+
]
59+
},
60+
{
61+
"path": "/playbacks/{playbackId}/control",
62+
"description": "Control object for a playback operation.",
63+
"operations": [
64+
{
65+
"httpMethod": "POST",
66+
"summary": "Control a playback.",
67+
"nickname": "control",
68+
"responseClass": "void",
69+
"parameters": [
70+
{
71+
"name": "playbackId",
72+
"description": "Playback's id",
73+
"paramType": "path",
74+
"required": true,
75+
"allowMultiple": false,
76+
"dataType": "string"
77+
},
78+
{
79+
"name": "operation",
80+
"description": "Operation to perform on the playback.",
81+
"paramType": "query",
82+
"required": true,
83+
"allowMultiple": false,
84+
"dataType": "string",
85+
"allowableValues": {
86+
"valueType": "LIST",
87+
"values": [
88+
"restart",
89+
"pause",
90+
"unpause",
91+
"reverse",
92+
"forward"
93+
]
94+
}
95+
}
96+
],
97+
"errorResponses": [
98+
{
99+
"code": 400,
100+
"reason": "The provided operation parameter was invalid"
101+
},
102+
{
103+
"code": 404,
104+
"reason": "The playback cannot be found"
105+
},
106+
{
107+
"code": 409,
108+
"reason": "The operation cannot be performed in the playback's current state"
109+
}
110+
]
111+
}
112+
]
113+
}
114+
],
115+
"models": {
116+
"Playback": {
117+
"id": "Playback",
118+
"description": "Object representing the playback of media to a channel",
119+
"properties": {
120+
"id": {
121+
"type": "string",
122+
"description": "ID for this playback operation",
123+
"required": true
124+
},
125+
"media_uri": {
126+
"type": "string",
127+
"description": "URI for the media to play back.",
128+
"required": true
129+
},
130+
"target_uri": {
131+
"type": "string",
132+
"description": "URI for the channel or bridge to play the media on",
133+
"required": true
134+
},
135+
"language": {
136+
"type": "string",
137+
"description": "For media types that support multiple languages, the language requested for playback."
138+
},
139+
"state": {
140+
"type": "string",
141+
"description": "Current state of the playback operation.",
142+
"required": true,
143+
"allowableValues": {
144+
"valueType": "LIST",
145+
"values": [
146+
"queued",
147+
"playing",
148+
"complete"
149+
]
150+
}
151+
}
152+
}
153+
}
154+
}
155+
}

0 commit comments

Comments
 (0)