summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorAndrew Moss <1043609+amoss@users.noreply.github.com>2019-11-05 18:44:42 +0100
committerGitHub <noreply@github.com>2019-11-05 18:44:42 +0100
commit928c52f73f7f21e6d434bff82b01effedb6010bd (patch)
tree3baaeb1e110451917c726f067025e35b8a94d4b1 /web
parent6486c29ef595f92652f6cfe956f0e5566aeee2e8 (diff)
Upgraded the swagger definition to OpenAPI3.0
This fixes the "structural error" messages that were introduced in commit 7b3f17d32425...
Diffstat (limited to 'web')
-rw-r--r--web/api/netdata-swagger.json2390
-rw-r--r--web/api/netdata-swagger.yaml2049
2 files changed, 2382 insertions, 2057 deletions
diff --git a/web/api/netdata-swagger.json b/web/api/netdata-swagger.json
index dbf3c5b769..f09c8fe312 100644
--- a/web/api/netdata-swagger.json
+++ b/web/api/netdata-swagger.json
@@ -1,19 +1,10 @@
{
- "swagger": "2.0",
+ "openapi": "3.0.0",
"info": {
"title": "NetData API",
"description": "Real-time performance and health monitoring.",
"version": "1.11.1_rolling"
},
- "host": "registry.my-netdata.io",
- "schemes": [
- "https",
- "http"
- ],
- "basePath": "/api/v1",
- "produces": [
- "application/json"
- ],
"paths": {
"/info": {
"get": {
@@ -22,8 +13,12 @@
"responses": {
"200": {
"description": "netdata basic information.",
- "schema": {
- "$ref": "#/definitions/info"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/info"
+ }
+ }
}
},
"503": {
@@ -39,8 +34,12 @@
"responses": {
"200": {
"description": "An array of charts.",
- "schema": {
- "$ref": "#/definitions/chart_summary"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/chart_summary"
+ }
+ }
}
}
}
@@ -56,16 +55,22 @@
"in": "query",
"description": "The id of the chart as returned by the /charts call.",
"required": true,
- "type": "string",
- "format": "as returned by /charts",
- "default": "system.cpu"
+ "schema": {
+ "type": "string",
+ "format": "as returned by /charts",
+ "default": "system.cpu"
+ }
}
],
"responses": {
"200": {
"description": "A javascript object with detailed information about the chart.",
- "schema": {
- "$ref": "#/definitions/chart"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/chart"
+ }
+ }
}
},
"400": {
@@ -87,16 +92,22 @@
"in": "query",
"description": "The id of the chart as returned by the /charts call.",
"required": true,
- "type": "string",
- "format": "as returned by /charts",
- "default": "system.cpu"
+ "schema": {
+ "type": "string",
+ "format": "as returned by /charts",
+ "default": "system.cpu"
+ }
}
],
"responses": {
"200": {
"description": "A javascript object with information about the chart and the available variables.",
- "schema": {
- "$ref": "#/definitions/alarm_variables"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/alarm_variables"
+ }
+ }
}
},
"400": {
@@ -121,170 +132,196 @@
"in": "query",
"description": "The id of the chart as returned by the /charts call.",
"required": true,
- "type": "string",
- "format": "as returned by /charts",
"allowEmptyValue": false,
- "default": "system.cpu"
+ "schema": {
+ "type": "string",
+ "format": "as returned by /charts",
+ "default": "system.cpu"
+ }
},
{
"name": "dimension",
"in": "query",
"description": "Zero, one or more dimension ids or names, as returned by the /chart call, separated with comma or pipe. Netdata simple patterns are supported.",
"required": false,
- "type": "array",
- "items": {
- "type": "string",
- "collectionFormat": "pipes",
- "format": "as returned by /charts"
- },
- "allowEmptyValue": false
+ "allowEmptyValue": false,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "as returned by /charts"
+ }
+ }
},
{
"name": "after",
"in": "query",
"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 (negative, relative to parameter: before). Netdata will assume it is a relative number if it is less that 3 years (in seconds). Netdata will adapt this parameter to the boundaries of the round robin database. The default is the beginning of the round robin database (i.e. by default netdata will attempt to return data for the entire database).",
"required": true,
- "type": "number",
- "format": "integer",
"allowEmptyValue": false,
- "default": -600
+ "schema": {
+ "type": "number",
+ "format": "integer",
+ "default": -600
+ }
},
{
"name": "before",
"in": "query",
"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 (negative), relative to the last collected timestamp. Netdata will assume it is a relative number if it is less than 3 years (in seconds). Netdata will adapt this parameter to the boundaries of the round robin database. The default is zero (i.e. the timestamp of the last value collected).",
"required": false,
- "type": "number",
- "format": "integer",
- "default": 0
+ "schema": {
+ "type": "number",
+ "format": "integer",
+ "default": 0
+ }
},
{
"name": "points",
"in": "query",
"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 will be returned.",
"required": true,
- "type": "number",
- "format": "integer",
"allowEmptyValue": false,
- "default": 20
+ "schema": {
+ "type": "number",
+ "format": "integer",
+ "default": 20
+ }
},
{
"name": "group",
"in": "query",
"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. methods supported \"min\", \"max\", \"average\", \"sum\", \"incremental-sum\". \"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).",
"required": true,
- "type": "string",
- "enum": [
- "min",
- "max",
- "average",
- "median",
- "stddev",
- "sum",
- "incremental-sum"
- ],
- "default": "average",
- "allowEmptyValue": false
+ "allowEmptyValue": false,
+ "schema": {
+ "type": "string",
+ "enum": [
+ "min",
+ "max",
+ "average",
+ "median",
+ "stddev",
+ "sum",
+ "incremental-sum"
+ ],
+ "default": "average"
+ }
},
{
"name": "gtime",
"in": "query",
"description": "The grouping number of seconds. This is used in conjunction with group=average to change the units of metrics (ie when the data is per-second, setting gtime=60 will turn them to per-minute).",
"required": false,
- "type": "number",
- "format": "integer",
"allowEmptyValue": false,
- "default": 0
+ "schema": {
+ "type": "number",
+ "format": "integer",
+ "default": 0
+ }
},
{
"name": "format",
"in": "query",
"description": "The format of the data to be returned.",
"required": true,
- "type": "string",
- "enum": [
- "json",
- "jsonp",
- "csv",
- "tsv",
- "tsv-excel",
- "ssv",
- "ssvcomma",
- "datatable",
- "datasource",
- "html",
- "markdown",
- "array",
- "csvjsonarray"
- ],
- "default": "json",
- "allowEmptyValue": false
+ "allowEmptyValue": false,
+ "schema": {
+ "type": "string",
+ "enum": [
+ "json",
+ "jsonp",
+ "csv",
+ "tsv",
+ "tsv-excel",
+ "ssv",
+ "ssvcomma",
+ "datatable",
+ "datasource",
+ "html",
+ "markdown",
+ "array",
+ "csvjsonarray"
+ ],
+ "default": "json"
+ }
},
{
"name": "options",
"in": "query",
"description": "Options that affect data generation.",
"required": false,
- "type": "array",
- "items": {
- "type": "string",
- "enum": [
- "nonzero",
- "flip",
- "jsonwrap",
- "min2max",
+ "allowEmptyValue": false,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "nonzero",
+ "flip",
+ "jsonwrap",
+ "min2max",
+ "seconds",
+ "milliseconds",
+ "abs",
+ "absolute",
+ "absolute-sum",
+ "null2zero",
+ "objectrows",
+ "google_json",
+ "percentage",
+ "unaligned",
+ "match-ids",
+ "match-names",
+ "showcustomvars"
+ ]
+ },
+ "default": [
"seconds",
- "milliseconds",
- "abs",
- "absolute",
- "absolute-sum",
- "null2zero",
- "objectrows",
- "google_json",
- "percentage",
- "unaligned",
- "match-ids",
- "match-names",
- "showcustomvars"
- ],
- "collectionFormat": "pipes"
- },
- "default": [
- "seconds",
- "jsonwrap"
- ],
- "allowEmptyValue": false
+ "jsonwrap"
+ ]
+ }
},
{
"name": "callback",
"in": "query",
"description": "For JSONP responses, the callback function name.",
"required": false,
- "type": "string",
- "allowEmptyValue": true
+ "allowEmptyValue": true,
+ "schema": {
+ "type": "string"
+ }
},
{
"name": "filename",
"in": "query",
- "description": "Add Content-Disposition: attachment; filename=<filename> header to the response, that will instruct the browser to save the response with the given filename.",
+ "description": "Add Content-Disposition: attachment; filename= header to the response, that will instruct the browser to save the response with the given filename.",
"required": false,
- "type": "string",
- "allowEmptyValue": true
+ "allowEmptyValue": true,
+ "schema": {
+ "type": "string"
+ }
},
{
"name": "tqx",
"in": "query",
"description": "[Google Visualization API](https://developers.google.com/chart/interactive/docs/dev/implementing_data_source?hl=en) formatted parameter.",
"required": false,
- "type": "string",
- "allowEmptyValue": true
+ "allowEmptyValue": true,
+ "schema": {
+ "type": "string"
+ }
}
],
"responses": {
"200": {
"description": "The call was successful. The response includes the data in the format requested. Swagger2.0 does not process the discriminator field to show polymorphism. The response will be one of the sub-types of the data-schema according to the chosen format, e.g. json -> data_json.",
- "schema": {
- "$ref": "#/definitions/data"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/data"
+ }
+ }
}
},
"400": {
@@ -309,156 +346,182 @@
"in": "query",
"description": "The id of the chart as returned by the /charts call.",
"required": true,
- "type": "string",
- "format": "as returned by /charts",
"allowEmptyValue": false,
- "default": "system.cpu"
+ "schema": {
+ "type": "string",
+ "format": "as returned by /charts",
+ "default": "system.cpu"
+ }
},
{
"name": "alarm",
"in": "query",
"description": "The name of an alarm linked to the chart.",
"required": false,
- "type": "string",
- "format": "any text",
- "allowEmptyValue": true
+ "allowEmptyValue": true,
+ "schema": {
+ "type": "string",
+ "format": "any text"
+ }
},
{
"name": "dimension",
"in": "query",
"description": "Zero, one or more dimension ids, as returned by the /chart call.",
"required": false,
- "type": "array",
- "items": {
- "type": "string",
- "collectionFormat": "pipes",
- "format": "as returned by /charts"
- },
- "allowEmptyValue": false
+ "allowEmptyValue": false,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "as returned by /charts"
+ }
+ }
},
{
"name": "after",
"in": "query",
"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.",
"required": true,
- "type": "number",
- "format": "integer",
"allowEmptyValue": false,
- "default": -600
+ "schema": {
+ "type": "number",
+ "format": "integer",
+ "default": -600
+ }
},
{
"name": "before",
"in": "query",
"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.",
"required": false,
- "type": "number",
- "format": "integer",
- "default": 0
+ "schema": {
+ "type": "number",
+ "format": "integer",
+ "default": 0
+ }
},
{
"name": "group",
"in": "query",
"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. methods are supported \"min\", \"max\", \"average\", \"sum\", \"incremental-sum\". \"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).",
"required": true,
- "type": "string",
- "enum": [
- "min",
- "max",
- "average",
- "median",
- "stddev",
- "sum",
- "incremental-sum"
- ],
- "default": "average",
- "allowEmptyValue": false
+ "allowEmptyValue": false,
+ "schema": {
+ "type": "string",
+ "enum": [
+ "min",
+ "max",
+ "average",
+ "median",
+ "stddev",
+ "sum",
+ "incremental-sum"
+ ],
+ "default": "average"
+ }
},
{
"name": "options",
"in": "query",
"description": "Options that affect data generation.",
"required": false,
- "type": "array",
- "items": {
- "type": "string",
- "enum": [
- "abs",
- "absolute",
- "display-absolute",
- "absolute-sum",
- "null2zero",
- "percentage",
- "unaligned"
- ],
- "collectionFormat": "pipes"
- },
- "default": [
- "absolute"
- ],
- "allowEmptyValue": true
+ "allowEmptyValue": true,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "abs",
+ "absolute",
+ "display-absolute",
+ "absolute-sum",
+ "null2zero",
+ "percentage",
+ "unaligned"
+ ]
+ },
+ "default": [
+ "absolute"
+ ]
+ }
},
{
"name": "label",
"in": "query",
"description": "A text to be used as the label.",
"required": false,
- "type": "string",
- "format": "any text",
- "allowEmptyValue": true
+ "allowEmptyValue": true,
+ "schema": {
+ "type": "string",
+ "format": "any text"
+ }
},
{
"name": "units",
"in": "query",
"description": "A text to be used as the units.",
"required": false,
- "type": "string",
- "format": "any text",
- "allowEmptyValue": true
+ "allowEmptyValue": true,
+ "schema": {
+ "type": "string",
+ "format": "any text"
+ }
},
{
"name": "label_color",
"in": "query",
"description": "A color to be used for the background of the label.",
"required": false,
- "type": "string",
- "format": "any text",
- "allowEmptyValue": true
+ "allowEmptyValue": true,
+ "schema": {
+ "type": "string",
+ "format": "any text"
+ }
},
{
"name": "value_color",
"in": "query",
- "description": "A color to be used for the background of the label. You can set multiple using a pipe with a condition each, like this: color<value|color>value|color:null The following operators are supported: >, <, >=, <=, =, :null (to check if no value exists).",
+ "description": "A color to be used for the background of the label. You can set multiple using a pipe with a condition each, like this: colorvalue|color:null The following operators are supported: >, <, >=, <=, =, :null (to check if no value exists).",
"required": false,
- "type": "string",
- "format": "any text",
- "allowEmptyValue": true
+ "allowEmptyValue": true,
+ "schema": {
+ "type": "string",
+ "format": "any text"
+ }
},
{
"name": "multiply",
"in": "query",
"description": "Multiply the value with this number for rendering it at the image (integer value required).",
"required": false,
- "type": "number",
- "format": "integer",
- "allowEmptyValue": true
+ "allowEmptyValue": true,
+ "schema": {
+ "type": "number",
+ "format": "integer"
+ }
},
{
"name": "divide",
"in": "query",
"description": "Divide the value with this number for rendering it at the image (integer value required).",
"required": false,
- "type": "number",
- "format": "integer",
- "allowEmptyValue": true
+ "allowEmptyValue": true,
+ "schema": {
+ "type": "number",
+ "format": "integer"
+ }
},
{
"name": "scale",
"in": "query",
"description": "Set the scale of the badge (greater or equal to 100).",
"required": false,
- "type": "number",
- "format": "integer",
- "allowEmptyValue": true
+ "allowEmptyValue": true,
+ "schema": {
+ "type": "number",
+ "format": "integer"
+ }
}
],
"responses": {
@@ -487,115 +550,135 @@
"in": "query",
"description": "The format of the response to be returned.",
"required": true,
- "type": "string",
- "enum": [
- "shell",
- "prometheus",
- "prometheus_all_hosts",
- "json"
- ],
- "default": "shell"
+ "schema": {
+ "type": "string",
+ "enum": [
+ "shell",
+ "prometheus",
+ "prometheus_all_hosts",
+ "json"
+ ],
+ "default": "shell"
+ }
},
{
"name": "help",
"in": "query",
"description": "Enable or disable HELP lines in prometheus output.",
"required": false,
- "type": "string",
- "enum": [
- "yes",
- "no"
- ],
- "default": "no"
+ "schema": {
+ "type": "string",
+ "enum": [
+ "yes",
+ "no"
+ ],
+ "default": "no"
+ }
},
{
"name": "types",
"in": "query",
"description": "Enable or disable TYPE lines in prometheus output.",
"required": false,
- "type": "string",
- "enum": [
- "yes",
- "no"
- ],
- "default": "no"
+ "schema": {
+ "type": "string",
+ "enum": [
+ "yes",
+ "no"
+ ],
+ "default": "no"
+ }
},
{
"name": "timestamps",
"in": "query",
"description": "Enable or disable timestamps in prometheus output.",
"required": false,
- "type": "string",
- "enum": [
- "yes",
- "no"
- ],
- "default": "yes"
+ "schema": {
+ "type": "string",
+ "enum": [
+ "yes",
+ "no"
+ ],
+ "default": "yes"
+ }
},
{
"name": "names",
"in": "query",
"description": "When enabled netdata will report dimension names. When disabled netdata will report dimension IDs. The default is controlled in netdata.conf.",
"required": false,
- "type": "string",
- "enum": [
- "yes",
- "no"
- ],
- "default": "yes"
+ "schema": {
+ "type": "string",
+ "enum": [
+ "yes",
+ "no"
+ ],
+ "default": "yes"
+ }
},
{
"name": "oldunits",
"in": "query",
"description": "When enabled, netdata will show metric names for the default source=average as they appeared before 1.12, by using the legacy unit naming conventions.",
"required": false,
- "type": "string",
- "enum": [
- "yes",
- "no"
- ],
- "default": "yes"
+ "schema": {
+ "type": "string",
+ "enum": [
+ "yes",
+ "no"
+ ],
+ "default": "yes"
+ }
},
{
"name": "hideunits",
"in": "query",
"description": "When enabled, netdata will not include the units in the metric names, for the default source=average.",
"required": false,
- "type": "string",
- "enum": [
- "yes",
- "no"
- ],
- "default": "yes"
+ "schema": {
+ "type": "string",
+ "enum": [
+ "yes",
+ "no"
+ ],
+ "default": "yes"
+ }
},
{
"name": "server",
"in": "query",
"description": "Set a distinct name of the client querying prometheus metrics. Netdata will use the client IP if this is not set.",
"required": false,
- "type": "string",
- "format": "any text"
+ "schema": {
+ "type": "string",
+ "format": "any text"
+ }
},
{
"name": "prefix",
"in": "query",
"description": "Prefix all prometheus metrics with this string.",
"required": false,
- "type": "string",
- "format": "any text"
+ "schema": {
+ "type": "string",
+ "format": "any text"
+ }
},
{
"name": "data",
"in": "query",
"description": "Select the prometheus response data source. There is a setting in netdata.conf for the default.",
"required": false,
- "type": "string",
- "enum": [
- "as-collected",
- "average",
- "sum"
- ],
- "default": "average"
+ "schema": {
+ "type": "string",
+ "enum": [
+ "as-collected",
+ "average",
+ "sum"
+ ],
+ "default": "average"
+ }
}
],
"responses": {
@@ -618,15 +701,21 @@
"in": "query",
"description": "If passed, all enabled alarms are returned.",
"required": false,
- "type": "boolean",
- "allowEmptyValue": true
+ "allowEmptyValue": true,
+ "schema": {
+ "type": "boolean"
+ }
}
],
"responses": {
"200": {
"description": "An object containing general info and a linked list of alarms.",
- "schema": {
- "$ref": "#/definitions/alarms"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/alarms"
+ }
+ }
}
}
}
@@ -642,16 +731,22 @@
"in": "query",
"description": "Passing the parameter after=UNIQUEID returns all the events in the alarm log that occurred after UNIQUEID. An automated series of calls would call the interface once without after=, store the last UNIQUEID of the returned set, and give it back to get incrementally the next events.",
"required": false,
- "type": "integer"
+ "schema": {
+ "type": "integer"
+ }
}
],
"responses": {
"200": {
"description": "An array of alarm log entries.",
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/alarm_log_entry"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/alarm_log_entry"
+ }
+ }
}
}
}
@@ -669,14 +764,15 @@
"description": "Specify context which should be checked.",
"required": false,
"allowEmptyValue": true,
- "type": "array",
- "items": {
- "type": "string",
- "collectionFormat": "pipes"
- },
- "default": [
- "system.cpu"
- ]
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "default": [
+ "system.cpu"
+ ]
+ }
},
{
"in": "query",
@@ -684,26 +780,32 @@
"description": "Specify alarm status to count.",
"required": false,
"allowEmptyValue": true,
- "type": "string",
- "enum": [
- "REMOVED",
- "UNDEFINED",
- "UNINITIALIZED",
- "CLEAR",
- "RAISED",
- "WARNING",
- "CRITICAL"
- ],
- "default": "RAISED"
+ "schema": {
+ "type": "string",
+ "enum": [
+ "REMOVED",
+ "UNDEFINED",
+ "UNINITIALIZED",
+ "CLEAR",
+ "RAISED",
+ "WARNING",
+ "CRITICAL"
+ ],
+ "default": "RAISED"
+ }
}
],
"responses": {
"200": {
"description": "An object containing a count of alarms with given status for given contexts.",
- "schema": {
- "type": "array",
- "items": {
- "type": "number"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ }
}
}
},
@@ -723,45 +825,57 @@
"in": "query",
"description": "DISABLE ALL: No alarm criteria are evaluated, nothing is written in the alarm log. SILENCE ALL: No notifications are sent. RESET: Return to the default state. DISABLE/SILENCE: Set the mode to be used for the alarms matching the criteria of the alarm selectors. LIST: Show active configuration.",
"required": false,
- "type": "string",
- "enum": [
- "DISABLE ALL",
- "SILENCE ALL",
- "DISABLE",
- "SILENCE",
- "RESET",
- "LIST"
- ]
+ "schema": {
+ "type": "string",
+ "enum": [