From 81581f9719bc56f01d5aa08952671d65fda9867a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 8 May 2023 18:27:08 +0200 Subject: Merging upstream version 1.39.0. Signed-off-by: Daniel Baumann --- web/api/web_api.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 web/api/web_api.h (limited to 'web/api/web_api.h') diff --git a/web/api/web_api.h b/web/api/web_api.h new file mode 100644 index 000000000..0ca91841f --- /dev/null +++ b/web/api/web_api.h @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef NETDATA_WEB_API_H +#define NETDATA_WEB_API_H 1 + +#include "daemon/common.h" +#include "web/api/badges/web_buffer_svg.h" +#include "web/api/formatters/rrd2json.h" +#include "web/api/health/health_cmdapi.h" +#include "web/api/queries/weights.h" + +struct web_api_command { + const char *command; + uint32_t hash; + WEB_CLIENT_ACL acl; + int (*callback)(RRDHOST *host, struct web_client *w, char *url); +}; + +struct web_client; + +int web_client_api_request_vX(RRDHOST *host, struct web_client *w, char *url_path_endpoint, struct web_api_command *api_commands); + +static inline void fix_google_param(char *s) { + if(unlikely(!s || !*s)) return; + + for( ; *s ;s++) { + if(!isalnum(*s) && *s != '.' && *s != '_' && *s != '-') + *s = '_'; + } +} + +int web_client_api_request_weights(RRDHOST *host, struct web_client *w, char *url, WEIGHTS_METHOD method, WEIGHTS_FORMAT format, size_t api_version); + +bool web_client_interrupt_callback(void *data); + +#include "web_api_v1.h" +#include "web_api_v2.h" + +#endif //NETDATA_WEB_API_H -- cgit v1.2.3