mirror of
https://github.com/netdata/netdata.git
synced 2025-05-18 07:01:20 +00:00
Add functionality to store node_id for a host (#11059)
This commit is contained in:
parent
0277deeb1c
commit
ece7c8df64
5 changed files with 268 additions and 0 deletions
database/sqlite
|
@ -6,6 +6,17 @@
|
|||
#include "../../daemon/common.h"
|
||||
#include "sqlite3.h"
|
||||
|
||||
// return a node list
|
||||
struct node_instance_list {
|
||||
uuid_t node_id;
|
||||
uuid_t host_id;
|
||||
char *hostname;
|
||||
int live;
|
||||
int querable;
|
||||
int hops;
|
||||
};
|
||||
|
||||
|
||||
#define SQLITE_INSERT_DELAY (50) // Insert delay in case of lock
|
||||
|
||||
#define SQL_STORE_HOST "insert or replace into host (host_id,hostname,registry_hostname,update_every,os,timezone,tags) values (?1,?2,?3,?4,?5,?6,?7);"
|
||||
|
@ -61,4 +72,9 @@ extern void delete_dimension_uuid(uuid_t *dimension_uuid);
|
|||
extern void sql_store_chart_label(uuid_t *chart_uuid, int source_type, char *label, char *value);
|
||||
extern void sql_build_context_param_list(struct context_param **param_list, RRDHOST *host, char *context, char *chart);
|
||||
extern void store_claim_id(uuid_t *host_id, uuid_t *claim_id);
|
||||
extern int update_node_id(uuid_t *host_id, uuid_t *node_id);
|
||||
extern int get_node_id(uuid_t *host_id, uuid_t *node_id);
|
||||
extern void invalidate_node_instances(uuid_t *host_id, uuid_t *claim_id);
|
||||
extern struct node_instance_list *get_node_list(void);
|
||||
extern void sql_load_node_id(RRDHOST *host);
|
||||
#endif //NETDATA_SQLITE_FUNCTIONS_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue