| 
									
										
										
										
											2013-10-04 19:31:35 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 	"_copyright": "Copyright (C) 2013, Digium, Inc.", | 
					
						
							|  |  |  | 	"_author": "David M. Lee, II <dlee@digium.com>", | 
					
						
							|  |  |  | 	"_svn_revision": "$Revision$", | 
					
						
							| 
									
										
										
										
											2014-03-28 17:35:48 +00:00
										 |  |  | 	"apiVersion": "1.2.0", | 
					
						
							| 
									
										
										
										
											2013-10-04 19:31:35 +00:00
										 |  |  | 	"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.", | 
					
						
							| 
									
										
										
										
											2013-11-07 21:09:18 +00:00
										 |  |  | 					"nickname": "list", | 
					
						
							| 
									
										
										
										
											2013-10-04 19:31:35 +00:00
										 |  |  | 					"responseClass": "List[Application]" | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			] | 
					
						
							|  |  |  | 		}, | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 			"path": "/applications/{applicationName}", | 
					
						
							|  |  |  | 			"description": "Stasis application", | 
					
						
							|  |  |  | 			"operations": [ | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					"httpMethod": "GET", | 
					
						
							|  |  |  | 					"summary": "Get details of an application.", | 
					
						
							| 
									
										
										
										
											2013-11-07 21:09:18 +00:00
										 |  |  | 					"nickname": "get", | 
					
						
							| 
									
										
										
										
											2013-10-04 19:31:35 +00:00
										 |  |  | 					"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", | 
					
						
							| 
									
										
										
										
											2013-11-07 21:09:18 +00:00
										 |  |  | 					"nickname": "subscribe", | 
					
						
							| 
									
										
										
										
											2013-10-04 19:31:35 +00:00
										 |  |  | 					"responseClass": "Application", | 
					
						
							|  |  |  | 					"parameters": [ | 
					
						
							|  |  |  | 						{ | 
					
						
							|  |  |  | 							"name": "applicationName", | 
					
						
							|  |  |  | 							"description": "Application's name", | 
					
						
							|  |  |  | 							"paramType": "path", | 
					
						
							|  |  |  | 							"required": true, | 
					
						
							|  |  |  | 							"allowMultiple": false, | 
					
						
							|  |  |  | 							"dataType": "string" | 
					
						
							|  |  |  | 						}, | 
					
						
							|  |  |  | 						{ | 
					
						
							|  |  |  | 							"name": "eventSource", | 
					
						
							| 
									
										
										
										
											2013-11-23 17:38:29 +00:00
										 |  |  | 							"description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", | 
					
						
							| 
									
										
										
										
											2013-10-04 19:31:35 +00:00
										 |  |  | 							"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", | 
					
						
							| 
									
										
										
										
											2013-11-07 21:09:18 +00:00
										 |  |  | 					"nickname": "unsubscribe", | 
					
						
							| 
									
										
										
										
											2013-10-04 19:31:35 +00:00
										 |  |  | 					"responseClass": "Application", | 
					
						
							|  |  |  | 					"parameters": [ | 
					
						
							|  |  |  | 						{ | 
					
						
							|  |  |  | 							"name": "applicationName", | 
					
						
							|  |  |  | 							"description": "Application's name", | 
					
						
							|  |  |  | 							"paramType": "path", | 
					
						
							|  |  |  | 							"required": true, | 
					
						
							|  |  |  | 							"allowMultiple": false, | 
					
						
							|  |  |  | 							"dataType": "string" | 
					
						
							|  |  |  | 						}, | 
					
						
							|  |  |  | 						{ | 
					
						
							|  |  |  | 							"name": "eventSource", | 
					
						
							| 
									
										
										
										
											2013-12-20 22:02:11 +00:00
										 |  |  | 							"description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", | 
					
						
							| 
									
										
										
										
											2013-10-04 19:31:35 +00:00
										 |  |  | 							"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 | 
					
						
							| 
									
										
										
										
											2013-11-23 17:38:29 +00:00
										 |  |  | 				}, | 
					
						
							|  |  |  | 				"device_names": { | 
					
						
							|  |  |  | 					"type": "List[string]", | 
					
						
							|  |  |  | 					"description": "Names of the devices subscribed to.", | 
					
						
							|  |  |  | 					"required": true | 
					
						
							| 
									
										
										
										
											2013-10-04 19:31:35 +00:00
										 |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } |