@cryptotaxi247 / netdata-1 / commits / e12af64d7

Update swagger with definition of api/v1/alarm_variables (#6055)

Chris Akritidis committed May 21, 2019 at 11:31 UTC e12af64d7579299b33b5699e0ace0678330a3b96
2 files changed +164
web/api/netdata-swagger.json
+97
@@ -77,6 +77,39 @@
77 }
78 }
79 },
80 + "/alarm_variables": {
81 + "get": {
82 + "summary": "List variables available to configure alarms for a chart",
83 + "description": "Returns the basic information of a chart and all the variables that can be used in alarm and template health configurations for the particular chart or family",
84 + "parameters": [
85 + {
86 + "name": "chart",
87 + "in": "query",
88 + "description": "The id of the chart as returned by the /charts call.",
89 + "required": true,
90 + "type": "string",
91 + "format": "as returned by /charts"
92 + }
93 + ],
94 + "responses": {
95 + "200": {
96 + "description": "A javascript object with information about the chart and the available variables",
97 + "schema": {
98 + "$ref": "#/definitions/alarm_variables"
99 + }
100 + },
101 + "400": {
102 + "description": "Bad request - the body will include a message stating what is wrong."
103 + },
104 + "404": {
105 + "description": "No chart with the given id is found."
106 + },
107 + "500": {
108 + "description": "Internal server error. This usually means the server is out of memory."
109 + }
110 + }
111 + }
112 + },
113 "/data": {
114 "get": {
115 "summary": "Get collected data for a specific chart",
@@ -951,6 +984,70 @@
984 }
985 }
986 },
987 + "alarm_variables": {
988 + "type": "object",
989 + "properties": {
990 + "chart": {
991 + "type": "string",
992 + "description": "The unique id of the chart"
993 + },
994 + "chart_name": {
995 + "type": "string",
996 + "description": "The name of the chart"
997 + },
998 + "cnart_context": {
999 + "type": "string",
1000 + "description": "The context of the chart. It is shared across multiple monitored software or hardware instances and used in alarm templates"
1001 + },
1002 + "family": {
1003 + "type": "string",
1004 + "description": "The family of the chart."
1005 + },
1006 + "host": {
1007 + "type": "string",
1008 + "description": "The host containing the chart."
1009 + },
1010 + "chart_variables": {
1011 + "type": "object",
1012 + "properties": {
1013 + "varname1": {
1014 + "type": "number",
1015 + "format": "float"
1016 + },
1017 + "varname2": {
1018 + "type": "number",
1019 + "format": "float"
1020 + }
1021 + }
1022 + },
1023 + "family_variables": {
1024 + "type": "object",
1025 + "properties": {
1026 + "varname1": {
1027 + "type": "number",
1028 + "format": "float"
1029 + },
1030 + "varname2": {
1031 + "type": "number",
1032 + "format": "float"
1033 + }
1034 + }
1035 + },
1036 + "host_variables": {
1037 + "type": "object",
1038 + "properties": {
1039 + "varname1": {
1040 + "type": "number",
1041 + "format": "float"
1042 + },
1043 + "varname2": {
1044 + "type": "number",
1045 + "format": "float"
1046 + }
1047 + }
1048 + }
1049 + }
1050 + },
1051 "dimension": {
1052 "type": "object",
1053 "properties": {
web/api/netdata-swagger.yaml
+67
@@ -63,6 +63,28 @@ paths:
63 $ref: '#/definitions/chart'
64 '404':
65 description: 'No chart with the given id is found.'
66 + /alarm_variables:
67 + get:
68 + summary: 'List variables available to configure alarms for a chart'
69 + description: 'Returns the basic information of a chart and all the variables that can be used in alarm and template health configurations for the particular chart or family'
70 + parameters:
71 + - name: chart
72 + in: query
73 + description: 'The id of the chart as returned by the /charts call.'
74 + required: true
75 + type: string
76 + format: 'as returned by /charts'
77 + responses:
78 + '200':
79 + description: 'A javascript object with information about the chart and the available variables'
80 + schema:
81 + $ref: '#/definitions/alarm_variables'
82 + '400':
83 + description: 'Bad request - the body will include a message stating what is wrong.'
84 + '404':
85 + description: 'No chart with the given id is found.'
86 + '500':
87 + description: 'Internal server error. This usually means the server is out of memory.'
88 /data:
89 get:
90 summary: 'Get collected data for a specific chart'
@@ -638,6 +660,51 @@ definitions:
660 red:
661 type: number
662 description: 'Chart health red trheshold'
663 + alarm_variables:
664 + type: object
665 + properties:
666 + chart:
667 + type: string
668 + description: 'The unique id of the chart'
669 + chart_name:
670 + type: string
671 + description: 'The name of the chart'
672 + cnart_context:
673 + type: string
674 + description: 'The context of the chart. It is shared across multiple monitored software or hardware instances and used in alarm templates'
675 + family:
676 + type: string
677 + description: 'The family of the chart.'
678 + host:
679 + type: string
680 + description: 'The host containing the chart.'
681 + chart_variables:
682 + type: object
683 + properties:
684 + varname1:
685 + type: number
686 + format: float
687 + varname2:
688 + type: number
689 + format: float
690 + family_variables:
691 + type: object
692 + properties:
693 + varname1:
694 + type: number
695 + format: float
696 + varname2:
697 + type: number
698 + format: float
699 + host_variables:
700 + type: object
701 + properties:
702 + varname1:
703 + type: number
704 + format: float
705 + varname2:
706 + type: number
707 + format: float
708 dimension:
709 type: object
710 properties: