c200f74dbd0128e125908dc0aa43401c3b1e43f1
[apps/agl-service-unicens.git] / ucs2-afb / ucs_apidef.json
1 {
2   "openapi": "3.0.0",
3   "$schema": "http:iot.bzh/download/openapi/schema-3.0/default-schema.json",
4   "info": {
5     "description": "",
6     "title": "ucs2",
7     "version": "1.0",
8     "x-binding-c-generator": {
9       "api": "UNICENS",
10       "version": 2,
11       "prefix": "ucs2_",
12       "postfix": "",
13       "start": null ,
14       "onevent": null,
15       "init": null,
16       "scope": "",
17       "private": false
18     }
19   },
20   "servers": [
21     {
22       "url": "ws://{host}:{port}/api/monitor",
23       "description": "Unicens2 API.",
24       "variables": {
25         "host": {
26           "default": "localhost"
27         },
28         "port": {
29           "default": "1234"
30         }
31       },
32       "x-afb-events": [
33         {
34           "$ref": "#/components/schemas/afb-event"
35         }
36       ]
37     }
38   ],
39   "components": {
40     "schemas": {
41       "afb-reply": {
42         "$ref": "#/components/schemas/afb-reply-v2"
43       },
44       "afb-event": {
45         "$ref": "#/components/schemas/afb-event-v2"
46       },
47       "afb-reply-v2": {
48         "title": "Generic response.",
49         "type": "object",
50         "required": [ "jtype", "request" ],
51         "properties": {
52           "jtype": {
53             "type": "string",
54             "const": "afb-reply"
55           },
56           "request": {
57             "type": "object",
58             "required": [ "status" ],
59             "properties": {
60               "status": { "type": "string" },
61               "info": { "type": "string" },
62               "token": { "type": "string" },
63               "uuid": { "type": "string" },
64               "reqid": { "type": "string" }
65             }
66           },
67           "response": { "type": "object" }
68         }
69       },
70       "afb-event-v2": {
71         "type": "object",
72         "required": [ "jtype", "event" ],
73         "properties": {
74           "jtype": {
75             "type": "string",
76             "const": "afb-event"
77           },
78           "event": { "type": "string" },
79           "data": { "type": "object" }
80         }
81       }
82     },
83     "x-permissions": {
84         "config": {
85           "permission": "urn:AGL:permission:UNICENS:public:initialise"
86         },
87         "monitor": {
88           "permission": "urn:AGL:permission:UNICENS:public:monitor"
89         }
90     },
91     "responses": {
92             "200": {
93               "description": "A complex object array response",
94               "content": {
95                 "application/json": {
96                   "schema": {
97                     "$ref": "#/components/schemas/afb-reply"
98                   }
99                 }
100             }
101           }
102     }
103   },
104   "paths": {
105     "/listconfig": {
106       "description": "List Config Files",
107       "get": {
108         "x-permissions": {
109           "$ref": "#/components/x-permissions/config"
110         },
111         "parameters": [
112           {
113             "in": "query",
114             "name": "cfgpath",
115             "required": false,
116             "schema": { "type": "string" }
117           }
118         ],
119         "responses": {
120           "200": {"$ref": "#/components/responses/200"}
121         }
122       }
123     },
124     "/initialise": {
125       "description": "configure Unicens2 lib from NetworkConfig.XML.",
126       "get": {
127         "x-permissions": {
128           "$ref": "#/components/x-permissions/config"
129         },
130         "parameters": [
131           {
132             "in": "query",
133             "name": "filename",
134             "required": true,
135             "schema": { "type": "string" }
136           }
137         ],
138         "responses": {
139           "200": {"$ref": "#/components/responses/200"}
140         }
141       }
142     },
143     "/volume": {
144       "description": "Set Master Volume.",
145       "get": {
146         "x-permissions": {
147           "$ref": "#/components/x-permissions/monitor"
148         },
149         "parameters": [
150           {
151             "in": "query",
152             "name": "value",
153             "required": true,
154             "schema": { "type": "integer" }
155           }
156         ],
157         "responses": {
158           "200": {"$ref": "#/components/responses/200"}
159         }
160       }
161     },
162     "/monitor": {
163       "description": "Subscribe to Unicens Event.",
164       "get": {
165         "x-permissions": {
166           "$ref": "#/components/x-permissions/monitor"
167         },
168         "responses": {
169           "200": {"$ref": "#/components/responses/200"}
170         }
171       }
172     }
173   }
174 }