chart_config.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef ACLK_SCHEMA_WRAPPER_CHART_CONFIG_H
  3. #define ACLK_SCHEMA_WRAPPER_CHART_CONFIG_H
  4. #include <stdlib.h>
  5. #include "database/rrd.h"
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. struct update_chart_config {
  10. char *claim_id;
  11. char *node_id;
  12. char **hashes;
  13. };
  14. enum chart_config_chart_type {
  15. LINE,
  16. AREA,
  17. STACKED
  18. };
  19. struct chart_config_updated {
  20. char *type;
  21. char *family;
  22. char *context;
  23. char *title;
  24. uint64_t priority;
  25. char *plugin;
  26. char *module;
  27. RRDSET_TYPE chart_type;
  28. char *units;
  29. char *config_hash;
  30. };
  31. void destroy_update_chart_config(struct update_chart_config *cfg);
  32. void destroy_chart_config_updated(struct chart_config_updated *cfg);
  33. struct update_chart_config parse_update_chart_config(const char *data, size_t len);
  34. char *generate_chart_configs_updated(size_t *len, const struct chart_config_updated *config_list, int list_size);
  35. #ifdef __cplusplus
  36. }
  37. #endif
  38. #endif /* ACLK_SCHEMA_WRAPPER_CHART_CONFIG_H */