web_api.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef NETDATA_WEB_API_H
  3. #define NETDATA_WEB_API_H 1
  4. #include "daemon/common.h"
  5. #include "web/api/http_header.h"
  6. #include "web/api/http_auth.h"
  7. #include "web/api/badges/web_buffer_svg.h"
  8. #include "web/api/ilove/ilove.h"
  9. #include "web/api/formatters/rrd2json.h"
  10. #include "web/api/health/health_cmdapi.h"
  11. #include "web/api/queries/weights.h"
  12. struct web_api_command {
  13. const char *command;
  14. uint32_t hash;
  15. HTTP_ACL acl;
  16. int (*callback)(RRDHOST *host, struct web_client *w, char *url);
  17. unsigned int allow_subpaths;
  18. };
  19. struct web_client;
  20. int web_client_api_request_vX(RRDHOST *host, struct web_client *w, char *url_path_endpoint, struct web_api_command *api_commands);
  21. static inline void fix_google_param(char *s) {
  22. if(unlikely(!s || !*s)) return;
  23. for( ; *s ;s++) {
  24. if(!isalnum(*s) && *s != '.' && *s != '_' && *s != '-')
  25. *s = '_';
  26. }
  27. }
  28. int web_client_api_request_weights(RRDHOST *host, struct web_client *w, char *url, WEIGHTS_METHOD method, WEIGHTS_FORMAT format, size_t api_version);
  29. bool web_client_interrupt_callback(void *data);
  30. #include "web_api_v1.h"
  31. #include "web_api_v2.h"
  32. #endif //NETDATA_WEB_API_H