web_api.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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/badges/web_buffer_svg.h"
  6. #include "web/api/formatters/rrd2json.h"
  7. #include "web/api/health/health_cmdapi.h"
  8. #include "web/api/queries/weights.h"
  9. struct web_api_command {
  10. const char *command;
  11. uint32_t hash;
  12. WEB_CLIENT_ACL acl;
  13. int (*callback)(RRDHOST *host, struct web_client *w, char *url);
  14. };
  15. struct web_client;
  16. int web_client_api_request_vX(RRDHOST *host, struct web_client *w, char *url_path_endpoint, struct web_api_command *api_commands);
  17. static inline void fix_google_param(char *s) {
  18. if(unlikely(!s || !*s)) return;
  19. for( ; *s ;s++) {
  20. if(!isalnum(*s) && *s != '.' && *s != '_' && *s != '-')
  21. *s = '_';
  22. }
  23. }
  24. int web_client_api_request_weights(RRDHOST *host, struct web_client *w, char *url, WEIGHTS_METHOD method, WEIGHTS_FORMAT format, size_t api_version);
  25. bool web_client_interrupt_callback(void *data);
  26. #include "web_api_v1.h"
  27. #include "web_api_v2.h"
  28. #endif //NETDATA_WEB_API_H