summaryrefslogtreecommitdiffstats
path: root/aclk/schema-wrappers/chart_config.h
blob: f08f76b6182059c1e2e4b05ab46dd6e6ed98d679 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef ACLK_SCHEMA_WRAPPER_CHART_CONFIG_H
#define ACLK_SCHEMA_WRAPPER_CHART_CONFIG_H

#include <stdlib.h>

#include "database/rrd.h"

#ifdef __cplusplus
extern "C" {
#endif

struct update_chart_config {
    char *claim_id;
    char *node_id;
    char **hashes;
};

enum chart_config_chart_type {
    LINE,
    AREA,
    STACKED
};

struct chart_config_updated {
    char *type;
    char *family;
    char *context;
    char *title;
    uint64_t priority;
    char *plugin;
    char *module;
    RRDSET_TYPE chart_type;
    char *units;
    char *config_hash;
};

void destroy_update_chart_config(struct update_chart_config *cfg);
void destroy_chart_config_updated(struct chart_config_updated *cfg);

struct update_chart_config parse_update_chart_config(const char *data, size_t len);

char *generate_chart_configs_updated(size_t *len, const struct chart_config_updated *config_list, int list_size);

#ifdef __cplusplus
}
#endif

#endif /* ACLK_SCHEMA_WRAPPER_CHART_CONFIG_H */