master
json 656 lines 21.5 KB
Raw
1 {
2 "$schema": "http://json-schema.org/draft-07/schema#",
3 "title": "Netdata Functions UI Response",
4 "type": "object",
5 "required": ["status"],
6 "properties": {
7 "status": {
8 "type": "integer"
9 }
10 },
11 "oneOf": [
12 { "$ref": "#/definitions/info_response" },
13 { "$ref": "#/definitions/data_response" },
14 { "$ref": "#/definitions/topology_response" },
15 { "$ref": "#/definitions/flows_response" },
16 { "$ref": "#/definitions/error_response" },
17 { "$ref": "#/definitions/not_modified_response" }
18 ],
19 "definitions": {
20 "field_type": {
21 "type": "string",
22 "enum": [
23 "none",
24 "integer",
25 "float",
26 "boolean",
27 "string",
28 "detail-string",
29 "bar-with-integer",
30 "duration",
31 "timestamp",
32 "array",
33 "feedTemplate"
34 ]
35 },
36 "field_visual": {
37 "type": "string",
38 "enum": [
39 "value",
40 "bar",
41 "pill",
42 "richValue",
43 "rowOptions",
44 "feedTemplate"
45 ]
46 },
47 "field_transform": {
48 "type": "string",
49 "enum": [
50 "none",
51 "number",
52 "duration",
53 "datetime",
54 "datetime_usec",
55 "xml",
56 "text"
57 ]
58 },
59 "field_sort": {
60 "type": "string",
61 "enum": ["ascending", "descending"]
62 },
63 "field_summary": {
64 "type": "string",
65 "enum": ["count", "uniqueCount", "sum", "min", "max", "mean", "median"]
66 },
67 "field_filter": {
68 "type": "string",
69 "enum": ["none", "range", "multiselect", "facet"]
70 },
71 "facet_value": {
72 "type": "object",
73 "required": ["value"],
74 "properties": {
75 "value": { "type": ["string", "number", "boolean"] },
76 "name": { "type": "string" }
77 },
78 "additionalProperties": true
79 },
80 "facet_field": {
81 "type": "object",
82 "required": ["field"],
83 "properties": {
84 "field": { "type": "string" },
85 "name": { "type": "string" },
86 "total_values": { "type": "integer", "minimum": 0 },
87 "truncated": { "type": "boolean" },
88 "autocomplete": { "type": "boolean" },
89 "overflowed": { "type": "boolean" },
90 "overflow_records": { "type": "integer", "minimum": 0 },
91 "values": {
92 "type": "array",
93 "items": { "$ref": "#/definitions/facet_value" }
94 }
95 },
96 "additionalProperties": true
97 },
98 "facets": {
99 "type": "object",
100 "properties": {
101 "value_limit": { "type": "integer" },
102 "excluded_fields": { "type": "array", "items": { "type": "string" } },
103 "overflowed_fields": { "type": "integer" },
104 "overflowed_records": { "type": "integer" },
105 "fields": {
106 "type": "array",
107 "items": { "$ref": "#/definitions/facet_field" }
108 },
109 "auto": { "type": "object" }
110 },
111 "additionalProperties": true
112 },
113 "value_options": {
114 "type": "object",
115 "properties": {
116 "units": { "type": ["string", "null"] },
117 "transform": { "$ref": "#/definitions/field_transform" },
118 "decimal_points": { "type": "integer", "minimum": 0 },
119 "default_value": { "type": ["string", "number", "boolean", "null"] }
120 },
121 "additionalProperties": true
122 },
123 "column": {
124 "type": "object",
125 "required": ["index", "name", "type"],
126 "properties": {
127 "index": { "type": "integer", "minimum": 0 },
128 "unique_key": { "type": "boolean" },
129 "name": { "type": "string" },
130 "type": { "$ref": "#/definitions/field_type" },
131 "units": { "type": ["string", "null"] },
132 "visualization": { "$ref": "#/definitions/field_visual" },
133 "value_options": { "$ref": "#/definitions/value_options" },
134 "max": { "type": "number" },
135 "pointer_to": { "type": ["string", "null"] },
136 "sort": { "$ref": "#/definitions/field_sort" },
137 "sortable": { "type": "boolean" },
138 "sticky": { "type": "boolean" },
139 "summary": { "$ref": "#/definitions/field_summary" },
140 "filter": { "$ref": "#/definitions/field_filter" },
141 "full_width": { "type": "boolean" },
142 "wrap": { "type": "boolean" },
143 "default_expanded_filter": { "type": "boolean" },
144 "dummy": { "type": "boolean" }
145 },
146 "additionalProperties": true
147 },
148 "columns": {
149 "type": "object",
150 "additionalProperties": { "$ref": "#/definitions/column" }
151 },
152 "required_param_option": {
153 "type": "object",
154 "required": ["id", "name"],
155 "properties": {
156 "id": { "type": "string" },
157 "name": { "type": "string" },
158 "defaultSelected": { "type": "boolean" },
159 "disabled": { "type": "boolean" },
160 "sort": { "$ref": "#/definitions/field_sort" }
161 },
162 "additionalProperties": true
163 },
164 "required_param": {
165 "type": "object",
166 "required": ["id", "name", "type", "options"],
167 "properties": {
168 "id": { "type": "string" },
169 "name": { "type": "string" },
170 "type": { "enum": ["select", "multiselect"] },
171 "options": {
172 "type": "array",
173 "items": { "$ref": "#/definitions/required_param_option" }
174 },
175 "help": { "type": "string" },
176 "unique_view": { "type": "boolean" }
177 },
178 "additionalProperties": true
179 },
180 "accepted_params": {
181 "type": "array",
182 "items": { "type": "string" }
183 },
184 "required_params": {
185 "type": "array",
186 "items": { "$ref": "#/definitions/required_param" }
187 },
188 "chart_config": {
189 "type": "object",
190 "required": ["name", "type", "columns"],
191 "properties": {
192 "name": { "type": "string" },
193 "type": { "type": "string" },
194 "columns": {
195 "type": "array",
196 "items": { "type": "string" }
197 }
198 },
199 "additionalProperties": true
200 },
201 "group_by_config": {
202 "type": "object",
203 "required": ["name", "columns"],
204 "properties": {
205 "name": { "type": "string" },
206 "columns": {
207 "type": "array",
208 "items": { "type": "string" }
209 }
210 },
211 "additionalProperties": true
212 },
213 "info_response": {
214 "type": "object",
215 "required": ["status", "type", "has_history", "accepted_params", "required_params", "v"],
216 "properties": {
217 "status": { "type": "integer" },
218 "type": { "type": "string" },
219 "has_history": { "type": "boolean" },
220 "accepted_params": { "$ref": "#/definitions/accepted_params" },
221 "required_params": { "$ref": "#/definitions/required_params" },
222 "v": { "type": "integer" },
223 "help": { "type": "string" },
224 "update_every": { "type": "integer" },
225 "expires": { "type": "integer" },
226 "presentation": { "$ref": "#/definitions/topology_presentation" }
227 },
228 "allOf": [
229 { "not": { "required": ["columns"] } },
230 { "not": { "required": ["data"] } }
231 ],
232 "additionalProperties": true
233 },
234 "data_response": {
235 "type": "object",
236 "required": ["status", "type", "columns", "data"],
237 "properties": {
238 "status": { "type": "integer" },
239 "type": { "type": "string", "enum": ["table", "log"] },
240 "columns": { "$ref": "#/definitions/columns" },
241 "data": {
242 "type": "array",
243 "items": {
244 "type": "array",
245 "items": {}
246 }
247 },
248 "has_history": { "type": "boolean" },
249 "accepted_params": { "$ref": "#/definitions/accepted_params" },
250 "required_params": { "$ref": "#/definitions/required_params" },
251 "help": { "type": "string" },
252 "update_every": { "type": "integer" },
253 "expires": { "type": "integer" },
254 "default_sort_column": { "type": "string" },
255 "group_by": {
256 "type": "object",
257 "additionalProperties": { "$ref": "#/definitions/group_by_config" }
258 },
259 "charts": {
260 "type": "object",
261 "additionalProperties": { "$ref": "#/definitions/chart_config" }
262 },
263 "default_charts": {
264 "type": "array",
265 "items": {
266 "type": "array",
267 "items": { "type": "string" }
268 }
269 },
270 "facets": { "$ref": "#/definitions/facets" },
271 "histogram": { "type": "object" },
272 "items": { "type": "object" },
273 "pagination": { "type": "object" }
274 },
275 "additionalProperties": true
276 },
277 "topology_presentation_actor_type": {
278 "type": "object",
279 "required": ["label", "color_slot"],
280 "properties": {
281 "label": { "type": "string" },
282 "color_slot": { "type": "string" },
283 "opacity": { "type": "number", "minimum": 0, "maximum": 1 },
284 "border": { "type": "boolean" },
285 "role": { "type": "string", "enum": ["actor", "endpoint"] },
286 "size_by_links": { "type": "boolean" },
287 "show_port_bullets": { "type": "boolean" },
288 "icon_svg": { "type": "string" },
289 "summary_fields": {
290 "type": "array",
291 "items": { "$ref": "#/definitions/topology_presentation_summary_field" }
292 },
293 "tables": {
294 "type": "object",
295 "additionalProperties": { "$ref": "#/definitions/topology_presentation_table" }
296 },
297 "modal_tabs": {
298 "type": "array",
299 "items": { "$ref": "#/definitions/topology_presentation_modal_tab" }
300 }
301 },
302 "additionalProperties": true
303 },
304 "topology_presentation_link_type": {
305 "type": "object",
306 "required": ["label", "color_slot"],
307 "properties": {
308 "label": { "type": "string" },
309 "color_slot": { "type": "string" },
310 "opacity": { "type": "number", "minimum": 0, "maximum": 1 },
311 "width": { "type": "number", "minimum": 0 },
312 "dash": { "type": "boolean" }
313 },
314 "additionalProperties": true
315 },
316 "topology_presentation_port_type": {
317 "type": "object",
318 "required": ["label", "color_slot"],
319 "properties": {
320 "label": { "type": "string" },
321 "color_slot": { "type": "string" },
322 "opacity": { "type": "number", "minimum": 0, "maximum": 1 }
323 },
324 "additionalProperties": true
325 },
326 "topology_presentation_summary_field": {
327 "type": "object",
328 "required": ["key", "label", "sources"],
329 "properties": {
330 "key": { "type": "string" },
331 "label": { "type": "string" },
332 "sources": {
333 "type": "array",
334 "items": { "type": "string" }
335 }
336 },
337 "additionalProperties": true
338 },
339 "topology_presentation_table_column": {
340 "type": "object",
341 "required": ["key", "label"],
342 "properties": {
343 "key": { "type": "string" },
344 "label": { "type": "string" },
345 "type": { "type": "string" }
346 },
347 "additionalProperties": true
348 },
349 "topology_presentation_table": {
350 "type": "object",
351 "required": ["label", "source", "columns"],
352 "properties": {
353 "label": { "type": "string" },
354 "source": {
355 "type": "string",
356 "enum": ["data", "links"]
357 },
358 "bullet_source": { "type": "boolean" },
359 "columns": {
360 "type": "array",
361 "items": { "$ref": "#/definitions/topology_presentation_table_column" }
362 }
363 },
364 "additionalProperties": true
365 },
366 "topology_presentation_modal_tab": {
367 "type": "object",
368 "required": ["id", "label"],
369 "properties": {
370 "id": { "type": "string" },
371 "label": { "type": "string" },
372 "type": { "type": "string" }
373 },
374 "additionalProperties": true
375 },
376 "topology_presentation_legend_entry": {
377 "type": "object",
378 "required": ["type", "label"],
379 "properties": {
380 "type": { "type": "string" },
381 "label": { "type": "string" }
382 },
383 "additionalProperties": true
384 },
385 "topology_presentation_legend": {
386 "type": "object",
387 "required": ["actors", "links"],
388 "properties": {
389 "actors": {
390 "type": "array",
391 "items": { "$ref": "#/definitions/topology_presentation_legend_entry" }
392 },
393 "links": {
394 "type": "array",
395 "items": { "$ref": "#/definitions/topology_presentation_legend_entry" }
396 },
397 "ports": {
398 "type": "array",
399 "items": { "$ref": "#/definitions/topology_presentation_legend_entry" }
400 }
401 },
402 "additionalProperties": true
403 },
404 "topology_presentation": {
405 "type": "object",
406 "required": ["actor_types", "link_types", "legend", "actor_click_behavior"],
407 "properties": {
408 "actor_types": {
409 "type": "object",
410 "additionalProperties": { "$ref": "#/definitions/topology_presentation_actor_type" }
411 },
412 "link_types": {
413 "type": "object",
414 "additionalProperties": { "$ref": "#/definitions/topology_presentation_link_type" }
415 },
416 "port_types": {
417 "type": "object",
418 "additionalProperties": { "$ref": "#/definitions/topology_presentation_port_type" }
419 },
420 "legend": { "$ref": "#/definitions/topology_presentation_legend" },
421 "actor_click_behavior": {
422 "type": "string",
423 "enum": ["highlight_connections", "highlight_path"]
424 }
425 },
426 "additionalProperties": true
427 },
428 "topology_match": {
429 "type": "object",
430 "properties": {
431 "chassis_ids": { "type": "array", "items": { "type": "string" } },
432 "mac_addresses": { "type": "array", "items": { "type": "string" } },
433 "ip_addresses": { "type": "array", "items": { "type": "string" } },
434 "hostnames": { "type": "array", "items": { "type": "string" } },
435 "dns_names": { "type": "array", "items": { "type": "string" } },
436 "sys_object_id": { "type": "string" },
437 "sys_name": { "type": "string" },
438 "netdata_node_id": { "type": "string" },
439 "netdata_machine_guid": { "type": "string" },
440 "cloud_instance_id": { "type": "string" },
441 "cloud_account_id": { "type": "string" },
442 "container_ids": { "type": "array", "items": { "type": "string" } },
443 "pod_names": { "type": "array", "items": { "type": "string" } },
444 "namespace_ids": { "type": "array", "items": { "type": "string" } }
445 },
446 "additionalProperties": true
447 },
448 "topology_actor": {
449 "type": "object",
450 "required": ["actor_type", "layer", "source", "match"],
451 "properties": {
452 "actor_id": { "type": "string" },
453 "actor_type": { "type": "string" },
454 "layer": { "type": "string" },
455 "source": { "type": "string" },
456 "match": { "$ref": "#/definitions/topology_match" },
457 "parent_match": { "$ref": "#/definitions/topology_match" },
458 "attributes": { "type": "object" },
459 "derived": { "type": "object" },
460 "labels": { "type": "object" },
461 "tables": {
462 "type": "object",
463 "additionalProperties": {
464 "type": "array",
465 "items": { "type": "object" }
466 }
467 }
468 },
469 "additionalProperties": true
470 },
471 "topology_link_endpoint": {
472 "type": "object",
473 "properties": {
474 "match": { "$ref": "#/definitions/topology_match" },
475 "attributes": { "type": "object" }
476 },
477 "additionalProperties": true
478 },
479 "topology_link": {
480 "type": "object",
481 "required": ["layer", "protocol", "src", "dst"],
482 "properties": {
483 "layer": { "type": "string" },
484 "protocol": { "type": "string" },
485 "link_type": { "type": "string" },
486 "direction": { "type": "string" },
487 "state": { "type": "string" },
488 "src_actor_id": { "type": "string" },
489 "dst_actor_id": { "type": "string" },
490 "src": { "$ref": "#/definitions/topology_link_endpoint" },
491 "dst": { "$ref": "#/definitions/topology_link_endpoint" },
492 "discovered_at": { "type": "string", "format": "date-time" },
493 "last_seen": { "type": "string", "format": "date-time" },
494 "metrics": { "type": "object" }
495 },
496 "additionalProperties": true
497 },
498 "topology_flow_exporter": {
499 "type": "object",
500 "properties": {
501 "ip": { "type": "string" },
502 "name": { "type": "string" },
503 "sampling_rate": { "type": "integer" },
504 "flow_version": { "type": "string" }
505 },
506 "additionalProperties": true
507 },
508 "topology_flow": {
509 "type": "object",
510 "properties": {
511 "timestamp": { "type": "string", "format": "date-time" },
512 "duration_sec": { "type": "integer" },
513 "exporter": { "$ref": "#/definitions/topology_flow_exporter" },
514 "src": { "$ref": "#/definitions/topology_link_endpoint" },
515 "dst": { "$ref": "#/definitions/topology_link_endpoint" },
516 "key": { "type": "object" },
517 "metrics": { "type": "object" }
518 },
519 "additionalProperties": true
520 },
521 "topology_ip_policy": {
522 "type": "object",
523 "properties": {
524 "public_allowlist": { "type": "array", "items": { "type": "string" } },
525 "live_top_n": {
526 "type": "object",
527 "properties": {
528 "enabled": { "type": "boolean" },
529 "limit": { "type": "integer" },
530 "sort_by": { "type": "string" }
531 },
532 "additionalProperties": true
533 }
534 },
535 "additionalProperties": true
536 },
537 "topology_response": {
538 "type": "object",
539 "required": ["status", "type", "data"],
540 "properties": {
541 "status": { "type": "integer" },
542 "type": { "const": "topology" },
543 "data": {
544 "type": "object",
545 "required": ["schema_version", "agent_id", "collected_at", "actors", "links"],
546 "properties": {
547 "schema_version": { "type": "string" },
548 "source": { "type": "string" },
549 "layer": { "type": "string" },
550 "agent_id": { "type": "string" },
551 "collected_at": { "type": "string", "format": "date-time" },
552 "view": { "type": "string" },
553 "group_by": {
554 "type": "array",
555 "items": { "type": "string" }
556 },
557 "columns": { "$ref": "#/definitions/columns" },
558 "metric": { "type": "string" },
559 "chart": { "type": "object" },
560 "ip_policy": { "$ref": "#/definitions/topology_ip_policy" },
561 "actors": {
562 "type": "array",
563 "items": { "$ref": "#/definitions/topology_actor" }
564 },
565 "links": {
566 "type": "array",
567 "items": { "$ref": "#/definitions/topology_link" }
568 },
569 "flows": {
570 "type": "array",
571 "items": { "$ref": "#/definitions/topology_flow" }
572 },
573 "stats": { "type": "object" },
574 "metrics": { "type": "object" }
575 },
576 "additionalProperties": true
577 },
578 "has_history": { "type": "boolean" },
579 "accepted_params": { "$ref": "#/definitions/accepted_params" },
580 "required_params": { "$ref": "#/definitions/required_params" },
581 "help": { "type": "string" },
582 "update_every": { "type": "integer" },
583 "expires": { "type": "integer" }
584 },
585 "additionalProperties": true
586 },
587 "flows_response": {
588 "type": "object",
589 "required": ["status", "type", "data"],
590 "properties": {
591 "status": { "type": "integer" },
592 "type": { "const": "flows" },
593 "data": {
594 "type": "object",
595 "required": ["schema_version", "agent_id", "collected_at"],
596 "properties": {
597 "schema_version": { "type": "string" },
598 "source": { "type": "string" },
599 "layer": { "type": "string" },
600 "agent_id": { "type": "string" },
601 "collected_at": { "type": "string", "format": "date-time" },
602 "view": { "type": "string" },
603 "ip_policy": { "$ref": "#/definitions/topology_ip_policy" },
604 "actors": {
605 "type": "array",
606 "items": { "$ref": "#/definitions/topology_actor" }
607 },
608 "links": {
609 "type": "array",
610 "items": { "$ref": "#/definitions/topology_link" }
611 },
612 "flows": {
613 "type": "array",
614 "items": { "$ref": "#/definitions/topology_flow" }
615 },
616 "stats": { "type": "object" },
617 "metrics": { "type": "object" },
618 "warnings": { "type": ["array", "object"] },
619 "facets": { "$ref": "#/definitions/facets" },
620 "histogram": { "type": "object" },
621 "visualizations": { "type": "object" },
622 "pagination": { "type": "object" }
623 },
624 "additionalProperties": true
625 },
626 "has_history": { "type": "boolean" },
627 "accepted_params": { "$ref": "#/definitions/accepted_params" },
628 "required_params": { "$ref": "#/definitions/required_params" },
629 "help": { "type": "string" },
630 "update_every": { "type": "integer" },
631 "expires": { "type": "integer" }
632 },
633 "additionalProperties": true
634 },
635 "error_response": {
636 "type": "object",
637 "required": ["status", "errorMessage"],
638 "properties": {
639 "status": { "type": "integer", "minimum": 400 },
640 "errorMessage": { "type": "string" },
641 "error": { "type": "string" },
642 "message": { "type": "string" },
643 "help": { "type": "string" }
644 },
645 "additionalProperties": true
646 },
647 "not_modified_response": {
648 "type": "object",
649 "required": ["status"],
650 "properties": {
651 "status": { "const": 304 }
652 },
653 "additionalProperties": false
654 }
655 }
656 }