summaryrefslogtreecommitdiff
path: root/rest-api
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-10-04 19:32:29 +0000
committerDavid M. Lee <dlee@digium.com>2013-10-04 19:32:29 +0000
commit21902bf9647823049358cdf386150d4b9b15e75e (patch)
treef6348a9c7ba20b1c1f4ea046ac8cb413e3997892 /rest-api
parentf4ebdca52a004b7aef89783dff300b08cf4f49ca (diff)
Added missing file from r400522
........ Merged revisions 400552 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'rest-api')
-rw-r--r--rest-api/api-docs/applications.json167
1 files changed, 167 insertions, 0 deletions
diff --git a/rest-api/api-docs/applications.json b/rest-api/api-docs/applications.json
new file mode 100644
index 000000000..182f1e0c3
--- /dev/null
+++ b/rest-api/api-docs/applications.json
@@ -0,0 +1,167 @@
+{
+ "_copyright": "Copyright (C) 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/applications.{format}",
+ "apis": [
+ {
+ "path": "/applications",
+ "description": "Stasis applications",
+ "operations": [
+ {
+ "httpMethod": "GET",
+ "summary": "List all applications.",
+ "nickname": "getApplications",
+ "responseClass": "List[Application]"
+ }
+ ]
+ },
+ {
+ "path": "/applications/{applicationName}",
+ "description": "Stasis application",
+ "operations": [
+ {
+ "httpMethod": "GET",
+ "summary": "Get details of an application.",
+ "nickname": "getApplication",
+ "responseClass": "Application",
+ "parameters": [
+ {
+ "name": "applicationName",
+ "description": "Application's name",
+ "paramType": "path",
+ "required": true,
+ "allowMultiple": false,
+ "dataType": "string"
+ }
+ ],
+ "errorResponses": [
+ {
+ "code": 404,
+ "reason": "Application does not exist."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "/applications/{applicationName}/subscription",
+ "description": "Stasis application",
+ "operations": [
+ {
+ "httpMethod": "POST",
+ "summary": "Subscribe an application to a event source.",
+ "notes": "Returns the state of the application after the subscriptions have changed",
+ "nickname": "applicationSubscribe",
+ "responseClass": "Application",
+ "parameters": [
+ {
+ "name": "applicationName",
+ "description": "Application's name",
+ "paramType": "path",
+ "required": true,
+ "allowMultiple": false,
+ "dataType": "string"
+ },
+ {
+ "name": "eventSource",
+ "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}",
+ "paramType": "query",
+ "required": true,
+ "allowMultiple": true,
+ "dataType": "string"
+ }
+ ],
+ "errorResponses": [
+ {
+ "code": 400,
+ "reason": "Missing parameter."
+ },
+ {
+ "code": 404,
+ "reason": "Application does not exist."
+ },
+ {
+ "code": 422,
+ "reason": "Event source does not exist."
+ }
+ ]
+ },
+ {
+ "httpMethod": "DELETE",
+ "summary": "Unsubscribe an application from an event source.",
+ "notes": "Returns the state of the application after the subscriptions have changed",
+ "nickname": "applicationUnsubscribe",
+ "responseClass": "Application",
+ "parameters": [
+ {
+ "name": "applicationName",
+ "description": "Application's name",
+ "paramType": "path",
+ "required": true,
+ "allowMultiple": false,
+ "dataType": "string"
+ },
+ {
+ "name": "eventSource",
+ "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}",
+ "paramType": "query",
+ "required": true,
+ "allowMultiple": true,
+ "dataType": "string"
+ }
+ ],
+ "errorResponses": [
+ {
+ "code": 400,
+ "reason": "Missing parameter; event source scheme not recognized."
+ },
+ {
+ "code": 404,
+ "reason": "Application does not exist."
+ },
+ {
+ "code": 409,
+ "reason": "Application not subscribed to event source."
+ },
+ {
+ "code": 422,
+ "reason": "Event source does not exist."
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "models": {
+ "Application": {
+ "id": "Application",
+ "description": "Details of a Stasis application",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of this application",
+ "required": true
+ },
+ "channel_ids": {
+ "type": "List[string]",
+ "description": "Id's for channels subscribed to.",
+ "required": true
+ },
+ "bridge_ids": {
+ "type": "List[string]",
+ "description": "Id's for bridges subscribed to.",
+ "required": true
+ },
+ "endpoint_ids": {
+ "type": "List[string]",
+ "description": "{tech}/{resource} for endpoints subscribed to.",
+ "required": true
+ }
+ }
+ }
+ }
+}