Files
asterisk/rest-api/api-docs/applications.json
David M. Lee 7d0d1a1efb ari: User better nicknames for ARI operations
While working on building client libraries from the Swagger API, I
noticed a problem with the nicknames.

    channel.deleteChannel()
    channel.answerChannel()
    channel.muteChannel()

Etc. We put the object name in the nickname (since we were generating C
code), but it makes OO generators redundant.

This patch makes the nicknames more OO friendly. This resulted in a lot
of name changing within the res_ari_*.so modules, but not much else.

There were a couple of other fixed I made in the process.

 * When reversible operations (POST /hold, POST /unhold) were made more
   RESTful (POST /hold, DELETE /unhold), the path for the second operation
   was left in the API declaration. This worked, but really the two
   operations should have been on the same API.
 * The POST /unmute operation had still not been REST-ified.

Review: https://reviewboard.asterisk.org/r/2940/
........

Merged revisions 402528 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-07 21:10:31 +00:00

168 lines
4.1 KiB
JSON

{
"_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": "list",
"responseClass": "List[Application]"
}
]
},
{
"path": "/applications/{applicationName}",
"description": "Stasis application",
"operations": [
{
"httpMethod": "GET",
"summary": "Get details of an application.",
"nickname": "get",
"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": "subscribe",
"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": "unsubscribe",
"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
}
}
}
}
}