node_info.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef ACLK_SCHEMA_WRAPPER_NODE_INFO_H
  3. #define ACLK_SCHEMA_WRAPPER_NODE_INFO_H
  4. #include <stdlib.h>
  5. #include <stdint.h>
  6. #include "capability.h"
  7. #include "database/rrd.h"
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. struct machine_learning_info {
  12. bool ml_capable;
  13. bool ml_enabled;
  14. };
  15. struct aclk_node_info {
  16. const char *name;
  17. const char *os;
  18. const char *os_name;
  19. const char *os_version;
  20. const char *kernel_name;
  21. const char *kernel_version;
  22. const char *architecture;
  23. uint32_t cpus;
  24. const char *cpu_frequency;
  25. const char *memory;
  26. const char *disk_space;
  27. const char *version;
  28. const char *release_channel;
  29. const char *timezone;
  30. const char *virtualization_type;
  31. const char *container_type;
  32. const char *custom_info;
  33. const char *machine_guid;
  34. RRDLABELS *host_labels_ptr;
  35. struct machine_learning_info ml_info;
  36. };
  37. struct update_node_info {
  38. char *node_id;
  39. char *claim_id;
  40. struct aclk_node_info data;
  41. struct timeval updated_at;
  42. char *machine_guid;
  43. int child;
  44. struct machine_learning_info ml_info;
  45. struct capability *node_capabilities;
  46. struct capability *node_instance_capabilities;
  47. };
  48. struct collector_info {
  49. const char *module;
  50. const char *plugin;
  51. };
  52. struct update_node_collectors {
  53. char *claim_id;
  54. char *node_id;
  55. DICTIONARY *node_collectors;
  56. };
  57. char *generate_update_node_info_message(size_t *len, struct update_node_info *info);
  58. char *generate_update_node_collectors_message(size_t *len, struct update_node_collectors *collectors);
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62. #endif /* ACLK_SCHEMA_WRAPPER_NODE_INFO_H */