Files
asterisk/rest-api/api-docs/recordings.json
David M. Lee eae2405dff ARI: Implement /recordings/stored API's
his patch implements the ARI API's for stored recordings. While the
original task only specified deleting a recording, it was simple
enough to implement the GET for all recordings, and for an individual
recording.

The recording playback operation was modified to use the same code for
accessing the recording as the REST API, so that they will behave
consistently.

There were several problems with the api-docs that were also fixed,
bringing the ARI spec in line with the implementation. There were some
'wishful thinking' fields on the stored recording model (duration and
timestamp) that were removed, because I ended up not implementing a
metadata file to go along with the recording to store such information.

The GET /recordings/live operation was removed, since it's not really
that useful to get a list of all recordings that are currently going
on in the system. (At least, if we did that, we'd probably want to
also list all of the current playbacks. Which seems weird.)

(closes issue ASTERISK-21582)
Review: https://reviewboard.asterisk.org/r/2693/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 13:17:12 +00:00

330 lines
7.3 KiB
JSON

{
"_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.",
"_author": "David M. Lee, II <dlee@digium.com>",
"_svn_revision": "$Revision$",
"apiVersion": "0.0.1",
"swaggerVersion": "1.1",
"basePath": "http://localhost:8088/stasis",
"resourcePath": "/api-docs/recordings.{format}",
"apis": [
{
"path": "/recordings/stored",
"description": "Recordings",
"operations": [
{
"httpMethod": "GET",
"summary": "List recordings that are complete.",
"nickname": "getStoredRecordings",
"responseClass": "List[StoredRecording]"
}
]
},
{
"path": "/recordings/stored/{recordingName}",
"description": "Individual recording",
"operations": [
{
"httpMethod": "GET",
"summary": "Get a stored recording's details.",
"nickname": "getStoredRecording",
"responseClass": "StoredRecording",
"parameters": [
{
"name": "recordingName",
"description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
"dataType": "string"
}
],
"errorResponses": [
{
"code": 404,
"reason": "Recording not found"
}
]
},
{
"httpMethod": "DELETE",
"summary": "Delete a stored recording.",
"nickname": "deleteStoredRecording",
"responseClass": "void",
"parameters": [
{
"name": "recordingName",
"description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
"dataType": "string"
}
],
"errorResponses": [
{
"code": 404,
"reason": "Recording not found"
}
]
}
]
},
{
"path": "/recordings/live/{recordingName}",
"description": "A recording that is in progress",
"operations": [
{
"httpMethod": "GET",
"summary": "List live recordings.",
"nickname": "getLiveRecording",
"responseClass": "LiveRecording",
"parameters": [
{
"name": "recordingName",
"description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
"dataType": "string"
}
],
"errorResponses": [
{
"code": 404,
"reason": "Recording not found"
}
]
},
{
"httpMethod": "DELETE",
"summary": "Stop a live recording and discard it.",
"nickname": "cancelRecording",
"responseClass": "void",
"parameters": [
{
"name": "recordingName",
"description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
"dataType": "string"
}
],
"errorResponses": [
{
"code": 404,
"reason": "Recording not found"
}
]
}
]
},
{
"path": "/recordings/live/{recordingName}/stop",
"operations": [
{
"httpMethod": "POST",
"summary": "Stop a live recording and store it.",
"nickname": "stopRecording",
"responseClass": "void",
"parameters": [
{
"name": "recordingName",
"description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
"dataType": "string"
}
],
"errorResponses": [
{
"code": 404,
"reason": "Recording not found"
}
]
}
]
},
{
"path": "/recordings/live/{recordingName}/pause",
"operations": [
{
"httpMethod": "POST",
"summary": "Pause a live recording.",
"notes": "Pausing a recording suspends silence detection, which will be restarted when the recording is unpaused. Paused time is not included in the accounting for maxDurationSeconds.",
"nickname": "pauseRecording",
"responseClass": "void",
"parameters": [
{
"name": "recordingName",
"description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
"dataType": "string"
}
],
"errorResponses": [
{
"code": 404,
"reason": "Recording not found"
},
{
"code": 409,
"reason": "Recording not in session"
}
]
}
]
},
{
"path": "/recordings/live/{recordingName}/unpause",
"operations": [
{
"httpMethod": "POST",
"summary": "Unpause a live recording.",
"nickname": "unpauseRecording",
"responseClass": "void",
"parameters": [
{
"name": "recordingName",
"description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
"dataType": "string"
}
],
"errorResponses": [
{
"code": 404,
"reason": "Recording not found"
},
{
"code": 409,
"reason": "Recording not in session"
}
]
}
]
},
{
"path": "/recordings/live/{recordingName}/mute",
"operations": [
{
"httpMethod": "POST",
"summary": "Mute a live recording.",
"notes": "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.",
"nickname": "muteRecording",
"responseClass": "void",
"parameters": [
{
"name": "recordingName",
"description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
"dataType": "string"
}
],
"errorResponses": [
{
"code": 404,
"reason": "Recording not found"
},
{
"code": 409,
"reason": "Recording not in session"
}
]
}
]
},
{
"path": "/recordings/live/{recordingName}/unmute",
"operations": [
{
"httpMethod": "POST",
"summary": "Unmute a live recording.",
"nickname": "unmuteRecording",
"responseClass": "void",
"parameters": [
{
"name": "recordingName",
"description": "The name of the recording",
"paramType": "path",
"required": true,
"allowMultiple": false,
"dataType": "string"
}
],
"errorResponses": [
{
"code": 404,
"reason": "Recording not found"
},
{
"code": 409,
"reason": "Recording not in session"
}
]
}
]
}
],
"models": {
"StoredRecording": {
"id": "StoredRecording",
"description": "A past recording that may be played back.",
"properties": {
"name": {
"required": true,
"type": "string"
},
"format": {
"required": true,
"type": "string"
}
}
},
"LiveRecording": {
"id": "LiveRecording",
"description": "A recording that is in progress",
"properties": {
"name": {
"required": true,
"type": "string",
"description": "Base name for the recording"
},
"format": {
"required": true,
"type": "string",
"description": "Recording format (wav, gsm, etc.)"
},
"state": {
"required": false,
"type": "string",
"allowableValues": {
"valueType": "LIST",
"values": [
"queued",
"playing",
"paused",
"done"
]
}
},
"state": {
"required": true,
"type": "string"
},
"format": {
"required": true,
"type": "string"
}
}
}
}
}