Merge "Fix build for native package"
[src/app-framework-binder.git] / src / devtools / monitor-api.json
1 {
2   "openapi": "3.0.0",
3   "info": {
4     "description": "monitoring of bindings and internals",
5     "title": "monitor",
6     "version": "1.0",
7     "x-binding-c-generator": {
8       "api": "monitor",
9       "version": 2,
10       "prefix": "f_",
11       "postfix": "",
12       "preinit": null,
13       "init": null,
14       "onevent": null,
15       "scope": "static",
16       "private": true
17     }
18   },
19   "servers": [
20     {
21       "url": "ws://{host}:{port}/api/monitor",
22       "description": "The API server.",
23       "variables": {
24         "host": {
25           "default": "localhost"
26         },
27         "port": {
28           "default": "1234"
29         }
30       },
31       "x-afb-events": [
32         {
33           "$ref": "#/components/schemas/afb-event"
34         }
35       ]
36     }
37   ],
38   "components": {
39     "schemas": {
40       "afb-reply": {
41         "$ref": "#/components/schemas/afb-reply-v1"
42       },
43       "afb-event": {
44         "$ref": "#/components/schemas/afb-event-v1"
45       },
46       "afb-reply-v1": {
47         "title": "Generic response.",
48         "type": "object",
49         "required": [ "jtype", "request" ],
50         "properties": {
51           "jtype": {
52             "type": "string",
53             "const": "afb-reply"
54           },
55           "request": {
56             "type": "object",
57             "required": [ "status" ],
58             "properties": {
59               "status": { "type": "string" },
60               "info": { "type": "string" },
61               "token": { "type": "string" },
62               "uuid": { "type": "string" },
63               "reqid": { "type": "string" }
64             }
65           },
66           "response": { "type": "object" }
67         }
68       },
69       "afb-event-v1": {
70         "type": "object",
71         "required": [ "jtype", "event" ],
72         "properties": {
73           "jtype": {
74             "type": "string",
75             "const": "afb-event"
76           },
77           "event": { "type": "string" },
78           "data": { "type": "object" }
79         }
80       },
81       "set-verbosity": {
82         "anyOf": [
83           { "$ref": "#/components/schemas/verbosity-map" },
84           { "$ref": "#/components/schemas/verbosity-level" }
85         ]
86       },
87       "get-request": {
88         "type": "object",
89         "properties": {
90           "verbosity": { "$ref": "#/components/schemas/get-verbosity" },
91           "apis": { "$ref": "#/components/schemas/get-apis" }
92         }
93       },
94       "get-response": {
95         "type": "object",
96         "properties": {
97           "verbosity": { "$ref": "#/components/schemas/verbosity-map" },
98           "apis": { "type": "object" }
99         }
100       },
101       "get-verbosity": {
102         "anyOf": [
103           { "type": "boolean" },
104           { "type": "array", "items": { "type": "string" } },
105           { "type": "object" }
106         ]
107       },
108       "get-apis": {
109         "anyOf": [
110           { "type": "boolean" },
111           { "type": "array", "items": { "type": "string" } },
112           { "type": "object" }
113         ]
114       },
115       "verbosity-map": {
116         "type": "object",
117         "patternProperties": { "^.*$": { "$ref": "#/components/schemas/verbosity-level" } }
118       },
119       "verbosity-level": {
120         "enum": [ "debug", 3, "info", 2, "notice", "warning", 1, "error", 0 ]
121       },
122       "trace-add": {
123         "anyOf": [
124           { "type": "array", "items": { "$ref": "#/components/schemas/trace-add-object" } },
125           { "$ref": "#/components/schemas/trace-add-any" }
126         ]
127       },
128       "trace-add-any": {
129         "anyOf": [
130           { "$ref": "#/components/schemas/trace-add-request" },
131           { "$ref": "#/components/schemas/trace-add-object" }
132         ]
133       },
134       "trace-add-object": {
135         "type": "object",
136         "properties": {
137           "name": { "type": "string", "description": "name of the generated event", "default": "trace" },
138           "tag": { "type": "string", "description": "tag for grouping traces", "default": "trace" },
139           "api": { "type": "string", "description": "api for requests, daemons and services" },
140           "verb": { "type": "string", "description": "verb for requests" },
141           "session": { "type": "string", "description": "session for requests" },
142           "pattern": { "type": "string", "description": "pattern for events" },
143           "request": { "$ref": "#/components/schemas/trace-add-request" },
144           "daemon": { "$ref": "#/components/schemas/trace-add-daemon" },
145           "service": { "$ref": "#/components/schemas/trace-add-service" },
146           "event": { "$ref": "#/components/schemas/trace-add-event" },
147           "for": { "$ref": "#/components/schemas/trace-add" }
148         },
149         "examples": [
150           { "tag": "1", "for": [ "common", { "api": "xxx", "request": "*", "daemon": "*", "service": "*" } ] }
151         ]
152       },
153       "trace-add-request": {
154         "anyOf": [
155           { "type": "array", "items": { "$ref": "#/components/schemas/trace-request-names" } },
156           { "$ref": "#/components/schemas/trace-request-names" }
157         ]
158       },
159       "trace-request-names": {
160         "title": "name of traceable items of requests",
161         "enum": [
162           "*",
163           "addref",
164           "all",
165           "args",
166           "begin",
167           "common",
168           "context",
169           "context_get",
170           "context_set",
171           "end",
172           "event",
173           "extra",
174           "fail",
175           "get",
176           "json",
177           "life",
178           "ref",
179           "result",
180           "session",
181           "session_close",
182           "session_set_LOA",
183           "simple",
184           "store",
185           "stores",
186           "subcall",
187           "subcall_result",
188           "subcalls",
189           "subcallsync",
190           "subcallsync_result",
191           "subscribe",
192           "success",
193           "unref",
194           "unstore",
195           "unsubscribe",
196           "vverbose"
197         ]
198       },
199       "trace-add-daemon": {
200         "anyOf": [
201           { "type": "array", "items": { "$ref": "#/components/schemas/trace-daemon-names" } },
202           { "$ref": "#/components/schemas/trace-daemon-names" }
203         ]
204       },
205       "trace-daemon-names": {
206         "title": "name of traceable items of daemons",
207         "enum": [
208           "*",
209           "all",
210           "common",
211           "event_broadcast_after",
212           "event_broadcast_before",
213           "event_make",
214           "extra",
215           "get_event_loop",
216           "get_system_bus",
217           "get_user_bus",
218           "queue_job",
219           "require_api",
220           "require_api_result",
221           "rootdir_get_fd",
222           "rootdir_open_locale",
223           "unstore_req",
224           "vverbose"
225         ]
226       },
227       "trace-add-service": {
228         "anyOf": [
229           { "type": "array", "items": { "$ref": "#/components/schemas/trace-service-names" } },
230           { "$ref": "#/components/schemas/trace-service-names" }
231         ]
232       },
233       "trace-service-names": {
234         "title": "name of traceable items of services",
235         "enum": [
236           "*",
237           "all",
238           "call",
239           "call_result",
240           "callsync",
241           "callsync_result",
242           "on_event_after",
243           "on_event_before",
244           "start_after",
245           "start_before"
246         ]
247       },
248       "trace-add-event": {
249         "anyOf": [
250           { "type": "array", "items": { "$ref": "#/components/schemas/trace-event-names" } },
251           { "$ref": "#/components/schemas/trace-event-names" }
252         ]
253       },
254       "trace-event-names": {
255         "title": "name of traceable items of events",
256         "enum": [
257           "*",
258           "all",
259           "broadcast_after",
260           "broadcast_before",
261           "common",
262           "create",
263           "drop",
264           "extra",
265           "name",
266           "push_after",
267           "push_before"
268         ]
269       },
270       "trace-drop": {
271         "anyOf": [
272           { "type": "boolean" },
273           {
274             "type": "object",
275             "properties": {
276               "event": { "anyOf": [  { "type": "string" }, { "type": "array", "items": "string" } ] },
277               "tag": { "anyOf": [  { "type": "string" }, { "type": "array", "items": "string" } ] },
278               "session": { "anyOf": [  { "type": "string" }, { "type": "array", "items": "string" } ] }
279             }
280           }
281         ]
282       }
283     },
284     "x-permissions": {
285         "trace": {
286           "permission": "urn:AGL:permission:monitor:public:trace"
287         },
288         "set": {
289           "permission": "urn:AGL:permission:monitor:public:set"
290         },
291         "get": {
292           "permission": "urn:AGL:permission:monitor:public:get"
293         },
294         "get-or-set": {
295           "anyOf": [
296             { "$ref": "#/components/x-permissions/get" },
297             { "$ref": "#/components/x-permissions/set" }
298           ]
299         }
300     }
301   },
302   "paths": {
303     "/get": {
304       "description": "Get monitoring data.",
305       "get": {
306         "x-permissions": {
307           "$ref": "#/components/x-permissions/get-or-set"
308         },
309         "parameters": [
310           {
311             "in": "query",
312             "name": "verbosity",
313             "required": false,
314             "schema": { "$ref": "#/components/schemas/get-verbosity" }
315           },
316           {
317             "in": "query",
318             "name": "apis",
319             "required": false,
320             "schema": { "$ref": "#/components/schemas/get-apis" }
321           }
322         ],
323         "responses": {
324           "200": {
325             "description": "A complex object array response",
326             "content": {
327               "application/json": {
328                 "schema": {
329                   "$ref": "#/components/schemas/afb-reply"
330                 }
331               }
332             }
333           }
334         }
335       }
336     },
337     "/set": {
338       "description": "Set monitoring actions.",
339       "get": {
340         "x-permissions": {
341           "$ref": "#/components/x-permissions/set"
342         },
343         "parameters": [
344           {
345             "in": "query",
346             "name": "verbosity",
347             "required": false,
348             "schema": { "$ref": "#/components/schemas/set-verbosity" }
349           }
350         ],
351         "responses": {
352           "200": {
353             "description": "A complex object array response",
354             "content": {
355               "application/json": {
356                 "schema": {
357                   "$ref": "#/components/schemas/afb-reply"
358                 }
359               }
360             }
361           }
362         }
363       }
364     },
365     "/trace": {
366       "description": "Set monitoring actions.",
367       "get": {
368         "x-permissions": {
369           "$ref": "#/components/x-permissions/trace"
370         },
371         "parameters": [
372           {
373             "in": "query",
374             "name": "add",
375             "required": false,
376             "schema": { "$ref": "#/components/schemas/trace-add" }
377           },
378           {
379             "in": "query",
380             "name": "drop",
381             "required": false,
382             "schema": { "$ref": "#/components/schemas/trace-drop" }
383           }
384         ],
385         "responses": {
386           "200": {
387             "description": "A complex object array response",
388             "content": {
389               "application/json": {
390                 "schema": {
391                   "$ref": "#/components/schemas/afb-reply"
392                 }
393               }
394             }
395           }
396         }
397       }
398     }
399   }
400 }