81d1028ad78ee4d1342a7dba186ea41aca0b9788
[src/app-framework-binder.git] / 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           "uuid": { "type": "string", "description": "uuid of 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           "session": { "$ref": "#/components/schemas/trace-add-session" },
148           "for": { "$ref": "#/components/schemas/trace-add" }
149         },
150         "examples": [
151           { "tag": "1", "for": [ "common", { "api": "xxx", "request": "*", "daemon": "*", "service": "*" } ] }
152         ]
153       },
154       "trace-add-request": {
155         "anyOf": [
156           { "type": "array", "items": { "$ref": "#/components/schemas/trace-request-names" } },
157           { "$ref": "#/components/schemas/trace-request-names" }
158         ]
159       },
160       "trace-request-names": {
161         "title": "name of traceable items of requests",
162         "enum": [
163           "*",
164           "addref",
165           "all",
166           "args",
167           "begin",
168           "common",
169           "context",
170           "context_get",
171           "context_set",
172           "end",
173           "event",
174           "extra",
175           "fail",
176           "get",
177           "json",
178           "life",
179           "ref",
180           "result",
181           "session",
182           "session_close",
183           "session_set_LOA",
184           "simple",
185           "store",
186           "stores",
187           "subcall",
188           "subcall_result",
189           "subcalls",
190           "subcallsync",
191           "subcallsync_result",
192           "subscribe",
193           "success",
194           "unref",
195           "unstore",
196           "unsubscribe",
197           "vverbose"
198         ]
199       },
200       "trace-add-daemon": {
201         "anyOf": [
202           { "type": "array", "items": { "$ref": "#/components/schemas/trace-daemon-names" } },
203           { "$ref": "#/components/schemas/trace-daemon-names" }
204         ]
205       },
206       "trace-daemon-names": {
207         "title": "name of traceable items of daemons",
208         "enum": [
209           "*",
210           "all",
211           "common",
212           "event_broadcast_after",
213           "event_broadcast_before",
214           "event_make",
215           "extra",
216           "get_event_loop",
217           "get_system_bus",
218           "get_user_bus",
219           "queue_job",
220           "require_api",
221           "require_api_result",
222           "rootdir_get_fd",
223           "rootdir_open_locale",
224           "unstore_req",
225           "vverbose"
226         ]
227       },
228       "trace-add-service": {
229         "anyOf": [
230           { "type": "array", "items": { "$ref": "#/components/schemas/trace-service-names" } },
231           { "$ref": "#/components/schemas/trace-service-names" }
232         ]
233       },
234       "trace-service-names": {
235         "title": "name of traceable items of services",
236         "enum": [
237           "*",
238           "all",
239           "call",
240           "call_result",
241           "callsync",
242           "callsync_result",
243           "on_event_after",
244           "on_event_before",
245           "start_after",
246           "start_before"
247         ]
248       },
249       "trace-add-event": {
250         "anyOf": [
251           { "type": "array", "items": { "$ref": "#/components/schemas/trace-event-names" } },
252           { "$ref": "#/components/schemas/trace-event-names" }
253         ]
254       },
255       "trace-event-names": {
256         "title": "name of traceable items of events",
257         "enum": [
258           "*",
259           "all",
260           "broadcast_after",
261           "broadcast_before",
262           "common",
263           "create",
264           "drop",
265           "extra",
266           "name",
267           "push_after",
268           "push_before"
269         ]
270       },
271       "trace-add-session": {
272         "anyOf": [
273           { "type": "array", "items": { "$ref": "#/components/schemas/trace-session-names" } },
274           { "$ref": "#/components/schemas/trace-session-names" }
275         ]
276       },
277       "trace-session-names": {
278         "title": "name of traceable items for sessions",
279         "enum": [
280           "*",
281           "addref",
282           "all",
283           "close",
284           "common",
285           "create",
286           "destroy",
287           "renew",
288           "unref"
289         ]
290       },
291       "trace-drop": {
292         "anyOf": [
293           { "type": "boolean" },
294           {
295             "type": "object",
296             "properties": {
297               "event": { "anyOf": [  { "type": "string" }, { "type": "array", "items": "string" } ] },
298               "tag": { "anyOf": [  { "type": "string" }, { "type": "array", "items": "string" } ] },
299               "uuid": { "anyOf": [  { "type": "string" }, { "type": "array", "items": "string" } ] }
300             }
301           }
302         ]
303       }
304     },
305     "x-permissions": {
306         "trace": {
307           "permission": "urn:AGL:permission:monitor:public:trace"
308         },
309         "set": {
310           "permission": "urn:AGL:permission:monitor:public:set"
311         },
312         "get": {
313           "permission": "urn:AGL:permission:monitor:public:get"
314         },
315         "get-or-set": {
316           "anyOf": [
317             { "$ref": "#/components/x-permissions/get" },
318             { "$ref": "#/components/x-permissions/set" }
319           ]
320         }
321     }
322   },
323   "paths": {
324     "/get": {
325       "description": "Get monitoring data.",
326       "get": {
327         "x-permissions": {
328           "$ref": "#/components/x-permissions/get-or-set"
329         },
330         "parameters": [
331           {
332             "in": "query",
333             "name": "verbosity",
334             "required": false,
335             "schema": { "$ref": "#/components/schemas/get-verbosity" }
336           },
337           {
338             "in": "query",
339             "name": "apis",
340             "required": false,
341             "schema": { "$ref": "#/components/schemas/get-apis" }
342           }
343         ],
344         "responses": {
345           "200": {
346             "description": "A complex object array response",
347             "content": {
348               "application/json": {
349                 "schema": {
350                   "$ref": "#/components/schemas/afb-reply"
351                 }
352               }
353             }
354           }
355         }
356       }
357     },
358     "/set": {
359       "description": "Set monitoring actions.",
360       "get": {
361         "x-permissions": {
362           "$ref": "#/components/x-permissions/set"
363         },
364         "parameters": [
365           {
366             "in": "query",
367             "name": "verbosity",
368             "required": false,
369             "schema": { "$ref": "#/components/schemas/set-verbosity" }
370           }
371         ],
372         "responses": {
373           "200": {
374             "description": "A complex object array response",
375             "content": {
376               "application/json": {
377                 "schema": {
378                   "$ref": "#/components/schemas/afb-reply"
379                 }
380               }
381             }
382           }
383         }
384       }
385     },
386     "/trace": {
387       "description": "Set monitoring actions.",
388       "get": {
389         "x-permissions": {
390           "$ref": "#/components/x-permissions/trace"
391         },
392         "parameters": [
393           {
394             "in": "query",
395             "name": "add",
396             "required": false,
397             "schema": { "$ref": "#/components/schemas/trace-add" }
398           },
399           {
400             "in": "query",
401             "name": "drop",
402             "required": false,
403             "schema": { "$ref": "#/components/schemas/trace-drop" }
404           }
405         ],
406         "responses": {
407           "200": {
408             "description": "A complex object array response",
409             "content": {
410               "application/json": {
411                 "schema": {
412                   "$ref": "#/components/schemas/afb-reply"
413                 }
414               }
415             }
416           }
417         }
418       }
419     }
420   }
421 }