5aa33a24a1d19af5bd1e8379aa342c842ab73df2
[apps/agl-service-unicens.git] / ucs2-afb / ucs_apidef.json
1 {
2   "openapi": "3.0.0",
3   "$schema": "file:///home/fulup/Workspace/AGL-AppFW/unicens2rc-afb/etc/openapi-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": "static",
17       "private": true
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-v1"
43       },
44       "afb-event": {
45         "$ref": "#/components/schemas/afb-event-v1"
46       },
47       "afb-reply-v1": {
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-v1": {
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     "/initialise": {
106       "description": "Initialise Unicens2 lib from NetworkConfig.XML.",
107       "get": {
108         "x-permissions": {
109           "$ref": "#/components/x-permissions/config"
110         },
111         "parameters": [
112           {
113             "in": "query",
114             "name": "filename",
115             "required": true,
116             "schema": { "type": "string" }
117           }
118         ],
119         "responses": {
120           "200": {"$ref": "#/components/responses/200"}
121         }
122       }
123     },
124     "/monitor": {
125       "description": "Subscribe to Unicens2 Events.",
126       "get": {
127         "x-permissions": {
128           "$ref": "#/components/x-permissions/monitor"
129         },
130         "responses": {
131           "200": {"$ref": "#/components/responses/200"}
132         }
133       }
134     }
135   }
136 }