]> arthur.barton.de Git - netdata.git/blob - web/netdata-swagger.json
updated to latest yaml
[netdata.git] / web / netdata-swagger.json
1 {
2     "swagger": "2.0",
3     "info": {
4         "title": "NetData API",
5         "description": "Real time data collection and graphs...",
6         "version": "1.0.0"
7     },
8     "host": "netdata.firehol.org",
9     "schemes": [
10         "http"
11     ],
12     "basePath": "/api/v1",
13     "produces": [
14         "application/json"
15     ],
16     "paths": {
17         "/charts": {
18             "get": {
19                 "summary": "Get a list of all charts available at the server",
20                 "description": "The charts endpoint returns a summary about all charts stored in the netdata server.",
21                 "responses": {
22                     "200": {
23                         "description": "An array of charts",
24                         "schema": {
25                             "type": "array",
26                             "items": {
27                                 "$ref": "#/definitions/chart_summary"
28                             }
29                         }
30                     }
31                 }
32             }
33         },
34         "/chart": {
35             "get": {
36                 "summary": "Get info about a specific chart",
37                 "description": "The Chart endpoint returns detailed information about a chart.",
38                 "parameters": [
39                     {
40                         "name": "chart",
41                         "in": "query",
42                         "description": "The id of the chart as returned by the /charts call.",
43                         "required": true,
44                         "type": "string",
45                         "format": "as returned by /charts",
46                         "default": "system.cpu"
47                     }
48                 ],
49                 "responses": {
50                     "200": {
51                         "description": "A javascript object with detailed information about the chart.",
52                         "schema": {
53                             "$ref": "#/definitions/chart"
54                         }
55                     },
56                     "404": {
57                         "description": "No chart with the given id is found."
58                     }
59                 }
60             }
61         },
62         "/data": {
63             "get": {
64                 "summary": "Get collected data for a specific chart",
65                 "description": "The Data endpoint returns data stored in the round robin database of a chart.\n",
66                 "parameters": [
67                     {
68                         "name": "chart",
69                         "in": "query",
70                         "description": "The id of the chart as returned by the /charts call.",
71                         "required": true,
72                         "type": "string",
73                         "format": "as returned by /charts",
74                         "allowEmptyValue": false,
75                         "default": "system.cpu"
76                     },
77                     {
78                         "name": "dimension",
79                         "in": "query",
80                         "description": "zero, one or more dimension ids, as returned by the /chart call.",
81                         "required": false,
82                         "type": "array",
83                         "items": {
84                             "type": "string",
85                             "collectionFormat": "pipes",
86                             "format": "as returned by /charts"
87                         },
88                         "allowEmptyValue": false
89                     },
90                     {
91                         "name": "after",
92                         "in": "query",
93                         "description": "This parameter can either be an absolute timestamp specifying the starting point of the data to be returned, or a relative number of seconds, to the last collected timestamp. Netdata will assume it is a relative number if it is smaller than the duration of the round robin database for this chart. So, if the round robin database is 3600 seconds, any value from -3600 to 3600 will trigger relative arithmetics. Netdata will adapt this parameter to the boundaries of the round robin database.",
94                         "required": true,
95                         "type": "number",
96                         "format": "integer",
97                         "allowEmptyValue": false,
98                         "default": -600
99                     },
100                     {
101                         "name": "before",
102                         "in": "query",
103                         "description": "This parameter can either be an absolute timestamp specifying the ending point of the data to be returned, or a relative number of seconds, to the last collected timestamp. Netdata will assume it is a relative number if it is smaller than the duration of the round robin database for this chart. So, if the round robin database is 3600 seconds, any value from -3600 to 3600 will trigger relative arithmetics. Netdata will adapt this parameter to the boundaries of the round robin database.",
104                         "required": false,
105                         "type": "number",
106                         "format": "integer",
107                         "default": 0
108                     },
109                     {
110                         "name": "points",
111                         "in": "query",
112                         "description": "The number of points to be returned. If not given, or it is <= 0, or it is bigger than the points stored in the round robin database for this chart for the given duration, all the available collected values for the given duration are returned.",
113                         "required": true,
114                         "type": "number",
115                         "format": "integer",
116                         "allowEmptyValue": false,
117                         "default": 20
118                     },
119                     {
120                         "name": "group",
121                         "in": "query",
122                         "description": "The grouping method. If multiple collected values are to be grouped in order to return fewer points, this parameters defines the method of grouping. Two methods are supported, \"max\" and \"average\". \"max\" is actually calculated on the absolute value collected (so it works for both positive and negative dimesions to return the most extreme value in either direction).",
123                         "required": true,
124                         "type": "string",
125                         "enum": [
126                             "max",
127                             "average"
128                         ],
129                         "default": "average",
130                         "allowEmptyValue": false
131                     },
132                     {
133                         "name": "format",
134                         "in": "query",
135                         "description": "The format of the data to be returned.",
136                         "required": true,
137                         "type": "string",
138                         "enum": [
139                             "json",
140                             "jsonp",
141                             "csv",
142                             "tsv",
143                             "tsv-excel",
144                             "ssv",
145                             "ssvcomma",
146                             "datatable",
147                             "datasource",
148                             "html",
149                             "array",
150                             "csvjsonarray"
151                         ],
152                         "default": "json",
153                         "allowEmptyValue": false
154                     },
155                     {
156                         "name": "options",
157                         "in": "query",
158                         "description": "Options that affect data generation.",
159                         "required": false,
160                         "type": "array",
161                         "items": {
162                             "type": "string",
163                             "enum": [
164                                 "nonzero",
165                                 "flip",
166                                 "jsonwrap",
167                                 "min2max",
168                                 "seconds",
169                                 "milliseconds",
170                                 "abs",
171                                 "absolute",
172                                 "absolute-sum",
173                                 "null2zero",
174                                 "objectrows",
175                                 "google_json",
176                                 "percentage"
177                             ],
178                             "collectionFormat": "pipes"
179                         },
180                         "default": [
181                             "seconds",
182                             "jsonwrap"
183                         ],
184                         "allowEmptyValue": false
185                     },
186                     {
187                         "name": "callback",
188                         "in": "query",
189                         "description": "For JSONP responses, the callback function name.",
190                         "required": false,
191                         "type": "string",
192                         "allowEmptyValue": true
193                     },
194                     {
195                         "name": "filename",
196                         "in": "query",
197                         "description": "Add Content-Disposition: attachment; filename=<filename> header to the response, that will instruct the browser to save the response with the given filename.",
198                         "required": false,
199                         "type": "string",
200                         "allowEmptyValue": true
201                     },
202                     {
203                         "name": "tqx",
204                         "in": "query",
205                         "description": "[Google Visualization API](https://developers.google.com/chart/interactive/docs/dev/implementing_data_source?hl=en) formatted parameter.",
206                         "required": false,
207                         "type": "string",
208                         "allowEmptyValue": true
209                     }
210                 ],
211                 "responses": {
212                     "200": {
213                         "description": "The call was successful. The response should include the data.",
214                         "schema": {
215                             "$ref": "#/definitions/chart"
216                         }
217                     },
218                     "400": {
219                         "description": "Bad request - the body will include a message stating what is wrong."
220                     },
221                     "404": {
222                         "description": "No chart with the given id is found."
223                     },
224                     "500": {
225                         "description": "Internal server error. This usually means the server is out of memory."
226                     }
227                 }
228             }
229         }
230     },
231     "definitions": {
232         "chart_summary": {
233             "type": "object",
234             "properties": {
235                 "hostname": {
236                     "type": "string",
237                     "description": "The hostname of the netdata server."
238                 },
239                 "update_every": {
240                     "type": "number",
241                     "description": "The default update frequency of the netdata server. All charts have an update frequency equal or bigger than this."
242                 },
243                 "charts": {
244                     "type": "object",
245                     "description": "An object containing all the chart objects available at the netdata server. This is used as an indexed array. The key of each chart object is the id of the chart.",
246                     "properties": {
247                         "key": {
248                             "$ref": "#/definitions/chart"
249                         }
250                     }
251                 }
252             }
253         },
254         "chart": {
255             "type": "object",
256             "properties": {
257                 "id": {
258                     "type": "string",
259                     "description": "The unique id of the chart"
260                 },
261                 "name": {
262                     "type": "string",
263                     "description": "The name of the chart"
264                 },
265                 "type": {
266                     "type": "string",
267                     "description": "The type of the chart. Types are not handled by netdata. You can use this field for anything you like."
268                 },
269                 "family": {
270                     "type": "string",
271                     "description": "The family of the chart. Families are not handled by netdata. You can use this field for anything you like."
272                 },
273                 "title": {
274                     "type": "string",
275                     "description": "The title of the chart."
276                 },
277                 "priority": {
278                     "type": "string",
279                     "description": "The relative priority of the chart. NetData does not care about priorities. This is just an indication of importance for the chart viewers to sort charts of higher priority (lower number) closer to the top. Priority sorting should only be used among charts of the same type or family."
280                 },
281                 "enabled": {
282                     "type": "boolean",
283                     "description": "True when the chart is enabled. Disabled charts do not currently collect values, but they may have historical values available."
284                 },
285                 "units": {
286                     "type": "string",
287                     "description": "The unit of measurement for the values of all dimensions of the chart."
288                 },
289                 "data_url": {
290                     "type": "string",
291                     "description": "The absolute path to get data values for this chart. You are expected to use this path as the base when constructing the URL to fetch data values for this chart."
292                 },
293                 "chart_type": {
294                     "type": "string",
295                     "description": "The chart type.",
296                     "enum": [
297                         "line",
298                         "area",
299                         "stacked"
300                     ]
301                 },
302                 "duration": {
303                     "type": "number",
304                     "description": "The duration, in seconds, of the round robin database maintained by netdata."
305                 },
306                 "first_entry": {
307                     "type": "number",
308                     "description": "The UNIX timestamp of the first entry (the oldest) in the round robin database."
309                 },
310                 "last_entry": {
311                     "type": "number",
312                     "description": "The UNIX timestamp of the latest entry in the round robin database."
313                 },
314                 "update_every": {
315                     "type": "number",
316                     "description": "The update frequency of this chart, in seconds. One value every this amount of time is kept in the round robin database."
317                 },
318                 "dimensions": {
319                     "description": "An object containing all the chart dimensions available for the chart. This is used as an indexed array. The key of the object the id of the dimension.",
320                     "type": "object",
321                     "properties": {
322                         "key": {
323                             "$ref": "#/definitions/dimension"
324                         }
325                     }
326                 }
327             }
328         },
329         "dimension": {
330             "type": "object",
331             "properties": {
332                 "name": {
333                     "type": "string",
334                     "description": "The name of the dimension"
335                 }
336             }
337         },
338         "json_wrap": {
339             "type": "object",
340             "properties": {
341                 "api": {
342                     "type": "number",
343                     "description": "The API version this conforms to, currently 1"
344                 },
345                 "id": {
346                     "type": "string",
347                     "description": "The unique id of the chart"
348                 },
349                 "name": {
350                     "type": "string",
351                     "description": "The name of the chart"
352                 },
353                 "update_every": {
354                     "type": "number",
355                     "description": "The update frequency of this chart, in seconds. One value every this amount of time is kept in the round robin database (indepedently of the current view)."
356                 },
357                 "view_update_every": {
358                     "type": "number",
359                     "description": "The current view appropriate update frequency of this chart, in seconds. There is no point to request chart refreshes, using the same settings, more frequently than this."
360                 },
361                 "first_entry": {
362                     "type": "number",
363                     "description": "The UNIX timestamp of the first entry (the oldest) in the round robin database (indepedently of the current view)."
364                 },
365                 "last_entry": {
366                     "type": "number",
367                     "description": "The UNIX timestamp of the latest entry in the round robin database (indepedently of the current view)."
368                 },
369                 "after": {
370                     "type": "number",
371                     "description": "The UNIX timestamp of the first entry (the oldest) returned in this response."
372                 },
373                 "before": {
374                     "type": "number",
375                     "description": "The UNIX timestamp of the latest entry returned in this response."
376                 },
377                 "min": {
378                     "type": "number",
379                     "description": "The minimum value returned in the current view. This can be used to size the y-series of the chart."
380                 },
381                 "max": {
382                     "type": "number",
383                     "description": "The maximum value returned in the current view. This can be used to size the y-series of the chart."
384                 },
385                 "dimension_names": {
386                     "description": "The dimension names of the chart as returned in the current view.",
387                     "type": "array",
388                     "items": {
389                         "type": "string"
390                     }
391                 },
392                 "dimension_ids": {
393                     "description": "The dimension IDs of the chart as returned in the current view.",
394                     "type": "array",
395                     "items": {
396                         "type": "string"
397                     }
398                 },
399                 "latest_values": {
400                     "description": "The latest values collected for the chart (indepedently of the current view).",
401                     "type": "array",
402                     "items": {
403                         "type": "string"
404                     }
405                 },
406                 "view_latest_values": {
407                     "description": "The latest values returned with this response.",
408                     "type": "array",
409                     "items": {
410                         "type": "string"
411                     }
412                 },
413                 "dimensions": {
414                     "type": "number",
415                     "description": "The number of dimensions returned."
416                 },
417                 "points": {
418                     "type": "number",
419                     "description": "The number of rows / points returned."
420                 },
421                 "format": {
422                     "type": "string",
423                     "description": "The format of the result returned."
424                 },
425                 "result": {
426                     "description": "The result requested, in the format requested."
427                 }
428             }
429         }
430     }
431 }