// SPDX-License-Identifier: GPL-3.0-or-later
#include "web_api_v1.h"
static struct {
const char *name;
uint32_t hash;
int value;
} api_v1_data_groups[] = {
{ "average" , 0 , GROUP_AVERAGE}
, {"min" , 0 , GROUP_MIN}
, {"max" , 0 , GROUP_MAX}
, {"sum" , 0 , GROUP_SUM}
, {"incremental_sum", 0 , GROUP_INCREMENTAL_SUM}
, {"incremental-sum", 0 , GROUP_INCREMENTAL_SUM}
, { NULL, 0, 0}
};
static struct {
const char *name;
uint32_t hash;
uint32_t value;
} api_v1_data_options[] = {
{ "nonzero" , 0 , RRDR_OPTION_NONZERO}
, {"flip" , 0 , RRDR_OPTION_REVERSED}
, {"reversed" , 0 , RRDR_OPTION_REVERSED}
, {"reverse" , 0 , RRDR_OPTION_REVERSED}
, {"jsonwrap" , 0 , RRDR_OPTION_JSON_WRAP}
, {"min2max" , 0 , RRDR_OPTION_MIN2MAX}
, {"ms" , 0 , RRDR_OPTION_MILLISECONDS}
, {"milliseconds" , 0 , RRDR_OPTION_MILLISECONDS}
, {"abs" , 0 , RRDR_OPTION_ABSOLUTE}
, {"absolute" , 0 , RRDR_OPTION_ABSOLUTE}
, {"absolute_sum" , 0 , RRDR_OPTION_ABSOLUTE}
, {"absolute-sum" , 0 , RRDR_OPTION_ABSOLUTE}
, {"display_absolute", 0 , RRDR_OPTION_DISPLAY_ABS}
, {"display-absolute", 0 , RRDR_OPTION_DISPLAY_ABS}
, {"seconds" , 0 , RRDR_OPTION_SECONDS}
, {"null2zero" , 0 , RRDR_OPTION_NULL2ZERO}
, {"objectrows" , 0 , RRDR_OPTION_OBJECTSROWS}
, {"google_json" , 0 , RRDR_OPTION_GOOGLE_JSON}
, {"google-json" , 0 , RRDR_OPTION_GOOGLE_JSON}
, {"percentage" , 0 , RRDR_OPTION_PERCENTAGE}
, {"unaligned" , 0 , RRDR_OPTION_NOT_ALIGNED}
, {"match_ids" , 0 , RRDR_OPTION_MATCH_IDS}
, {"match-ids" , 0 , RRDR_OPTION_MATCH_IDS}
, {"match_names" , 0 , RRDR_OPTION_MATCH_NAMES}
, {"match-names" , 0 , RRDR_OPTION_MATCH_NAMES}
, { NULL, 0, 0}
};
static struct {
const char *name;
uint32_t hash;
uint32_t value;
} api_v1_data_formats[] = {
{ DATASOURCE_FORMAT_DATATABLE_JSON , 0 , DATASOURCE_DATATABLE_JSON}
, {DATASOURCE_FORMAT_DATATABLE_JSONP, 0 , DATASOURCE_DATATABLE_JSONP}
, {DATASOURCE_FORMAT_JSON , 0 , DATASOURCE_JSON}
, {DATASOURCE_FORMAT_JSONP , 0 , DATASOURCE_JSONP}
, {DATASOURCE_FORMAT_SSV , 0 , DATASOURCE_SSV}
, {DATASOURCE_FORMAT_CSV , 0 , DATASOURCE_CSV}
, {DATASOURCE_FORMAT_TSV , 0 , DATASOURCE_TSV}
, {"tsv-excel" , 0 , DATASOURCE_TSV}
, {DATASOURCE_FORMAT_HTML