diff options
Diffstat (limited to 'src/web/api/formatters')
-rw-r--r-- | src/web/api/formatters/README.md | 9 | ||||
-rw-r--r-- | src/web/api/formatters/charts2json.c | 2 | ||||
-rw-r--r-- | src/web/api/formatters/csv/README.md | 9 | ||||
-rw-r--r-- | src/web/api/formatters/json/README.md | 9 | ||||
-rw-r--r-- | src/web/api/formatters/rrd2json.c | 40 | ||||
-rw-r--r-- | src/web/api/formatters/rrd2json.h | 35 | ||||
-rw-r--r-- | src/web/api/formatters/ssv/README.md | 9 | ||||
-rw-r--r-- | src/web/api/formatters/value/README.md | 9 |
8 files changed, 2 insertions, 120 deletions
diff --git a/src/web/api/formatters/README.md b/src/web/api/formatters/README.md index 6347f5fb4..27d80d403 100644 --- a/src/web/api/formatters/README.md +++ b/src/web/api/formatters/README.md @@ -1,12 +1,3 @@ -<!-- -title: "Query formatting" -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/formatters/README.md -sidebar_label: "Query formatting" -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Formatters" ---> - # Query formatting API data queries need to be formatted before returned to the caller. diff --git a/src/web/api/formatters/charts2json.c b/src/web/api/formatters/charts2json.c index 0b45d77c4..9407f224b 100644 --- a/src/web/api/formatters/charts2json.c +++ b/src/web/api/formatters/charts2json.c @@ -37,7 +37,7 @@ const char* get_release_channel() { } void charts2json(RRDHOST *host, BUFFER *wb) { - static char *custom_dashboard_info_js_filename = NULL; + static const char *custom_dashboard_info_js_filename = NULL; size_t c = 0, dimensions = 0, memory = 0, alarms = 0; RRDSET *st; diff --git a/src/web/api/formatters/csv/README.md b/src/web/api/formatters/csv/README.md index e60aab57b..435d23808 100644 --- a/src/web/api/formatters/csv/README.md +++ b/src/web/api/formatters/csv/README.md @@ -1,12 +1,3 @@ -<!-- -title: "CSV formatter" -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/formatters/csv/README.md -sidebar_label: "CSV formatter" -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Formatters" ---> - # CSV formatter The CSV formatter presents [results of database queries](/src/web/api/queries/README.md) in the following formats: diff --git a/src/web/api/formatters/json/README.md b/src/web/api/formatters/json/README.md index 4137b0372..b1d025559 100644 --- a/src/web/api/formatters/json/README.md +++ b/src/web/api/formatters/json/README.md @@ -1,12 +1,3 @@ -<!-- -title: "JSON formatter" -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/formatters/json/README.md -sidebar_label: "JSON formatter" -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Formatters" ---> - # JSON formatter The CSV formatter presents [results of database queries](/src/web/api/queries/README.md) in the following formats: diff --git a/src/web/api/formatters/rrd2json.c b/src/web/api/formatters/rrd2json.c index 81c9ad5c7..a80275487 100644 --- a/src/web/api/formatters/rrd2json.c +++ b/src/web/api/formatters/rrd2json.c @@ -10,46 +10,6 @@ void rrd_stats_api_v1_chart(RRDSET *st, BUFFER *wb) buffer_json_finalize(wb); } -const char *rrdr_format_to_string(DATASOURCE_FORMAT format) { - switch(format) { - case DATASOURCE_JSON: - return DATASOURCE_FORMAT_JSON; - - case DATASOURCE_JSON2: - return DATASOURCE_FORMAT_JSON2; - - case DATASOURCE_DATATABLE_JSON: - return DATASOURCE_FORMAT_DATATABLE_JSON; - - case DATASOURCE_DATATABLE_JSONP: - return DATASOURCE_FORMAT_DATATABLE_JSONP; - - case DATASOURCE_JSONP: - return DATASOURCE_FORMAT_JSONP; - - case DATASOURCE_SSV: - return DATASOURCE_FORMAT_SSV; - - case DATASOURCE_CSV: - return DATASOURCE_FORMAT_CSV; - - case DATASOURCE_TSV: - return DATASOURCE_FORMAT_TSV; - - case DATASOURCE_HTML: - return DATASOURCE_FORMAT_HTML; - - case DATASOURCE_JS_ARRAY: - return DATASOURCE_FORMAT_JS_ARRAY; - - case DATASOURCE_SSV_COMMA: - return DATASOURCE_FORMAT_SSV_COMMA; - - default: - return "unknown"; - } -} - int rrdset2value_api_v1( RRDSET *st , BUFFER *wb diff --git a/src/web/api/formatters/rrd2json.h b/src/web/api/formatters/rrd2json.h index f0c0c39ba..cf3492ff2 100644 --- a/src/web/api/formatters/rrd2json.h +++ b/src/web/api/formatters/rrd2json.h @@ -3,26 +3,8 @@ #ifndef NETDATA_RRD2JSON_H #define NETDATA_RRD2JSON_H 1 -// type of JSON generations -typedef enum { - DATASOURCE_JSON = 0, - DATASOURCE_DATATABLE_JSON = 1, - DATASOURCE_DATATABLE_JSONP = 2, - DATASOURCE_SSV = 3, - DATASOURCE_CSV = 4, - DATASOURCE_JSONP = 5, - DATASOURCE_TSV = 6, - DATASOURCE_HTML = 7, - DATASOURCE_JS_ARRAY = 8, - DATASOURCE_SSV_COMMA = 9, - DATASOURCE_CSV_JSON_ARRAY = 10, - DATASOURCE_CSV_MARKDOWN = 11, - DATASOURCE_JSON2 = 12, -} DATASOURCE_FORMAT; +#include "web/api/web_api.h" -#include "web/api/web_api_v1.h" - -#include "web/api/exporters/allmetrics.h" #include "web/api/queries/rrdr.h" #include "web/api/formatters/csv/csv.h" @@ -38,22 +20,7 @@ typedef enum { #define HOSTNAME_MAX 1024 -#define DATASOURCE_FORMAT_JSON "json" -#define DATASOURCE_FORMAT_JSON2 "json2" -#define DATASOURCE_FORMAT_DATATABLE_JSON "datatable" -#define DATASOURCE_FORMAT_DATATABLE_JSONP "datasource" -#define DATASOURCE_FORMAT_JSONP "jsonp" -#define DATASOURCE_FORMAT_SSV "ssv" -#define DATASOURCE_FORMAT_CSV "csv" -#define DATASOURCE_FORMAT_TSV "tsv" -#define DATASOURCE_FORMAT_HTML "html" -#define DATASOURCE_FORMAT_JS_ARRAY "array" -#define DATASOURCE_FORMAT_SSV_COMMA "ssvcomma" -#define DATASOURCE_FORMAT_CSV_JSON_ARRAY "csvjsonarray" -#define DATASOURCE_FORMAT_CSV_MARKDOWN "markdown" - void rrd_stats_api_v1_chart(RRDSET *st, BUFFER *wb); -const char *rrdr_format_to_string(DATASOURCE_FORMAT format); int data_query_execute(ONEWAYALLOC *owa, BUFFER *wb, struct query_target *qt, time_t *latest_timestamp); diff --git a/src/web/api/formatters/ssv/README.md b/src/web/api/formatters/ssv/README.md index b32494014..4d07fe5b7 100644 --- a/src/web/api/formatters/ssv/README.md +++ b/src/web/api/formatters/ssv/README.md @@ -1,12 +1,3 @@ -<!-- -title: "SSV formatter" -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/formatters/ssv/README.md -sidebar_label: "SSV formatter" -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Formatters" ---> - # SSV formatter The SSV formatter sums all dimensions in [results of database queries](/src/web/api/queries/README.md) diff --git a/src/web/api/formatters/value/README.md b/src/web/api/formatters/value/README.md index 8a2df23c6..1f0af813d 100644 --- a/src/web/api/formatters/value/README.md +++ b/src/web/api/formatters/value/README.md @@ -1,12 +1,3 @@ -<!-- -title: "Value formatter" -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/formatters/value/README.md -sidebar_label: "Value formatter" -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Formatters" ---> - # Value formatter The Value formatter presents [results of database queries](/src/web/api/queries/README.md) as a single value. |