master
h 37 lines 2.22 KB
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 #ifndef NETDATA_CONTEXTS_OPTIONS_H
4 #define NETDATA_CONTEXTS_OPTIONS_H
5
6 #include "libnetdata/libnetdata.h"
7 #include "rrdr_options.h"
8
9 typedef enum contexts_options {
10 CONTEXTS_OPTION_MINIFY = (1 << 0), // remove JSON spaces and newlines from JSON output
11 CONTEXTS_OPTION_DEBUG = (1 << 1), // show the request
12 CONTEXTS_OPTION_CONFIGURATIONS = (1 << 2), // include alert configurations (used by /api/v2/alert_transitions)
13 CONTEXTS_OPTION_INSTANCES = (1 << 3), // include alert/context instances (used by /api/v2/alerts)
14 CONTEXTS_OPTION_VALUES = (1 << 4), // include alert latest values (used by /api/v2/alerts)
15 CONTEXTS_OPTION_SUMMARY = (1 << 5), // include alerts summary counters (used by /api/v2/alerts)
16 CONTEXTS_OPTION_MCP = (1 << 6), // MCP output format
17 CONTEXTS_OPTION_DIMENSIONS = (1 << 7), // include context dimensions
18 CONTEXTS_OPTION_LABELS = (1 << 8), // include context labels
19 CONTEXTS_OPTION_PRIORITIES = (1 << 9), // include context priorities
20 CONTEXTS_OPTION_TITLES = (1 << 10), // include context titles
21 CONTEXTS_OPTION_RETENTION = (1 << 11), // include first_entry and last_entry
22 CONTEXTS_OPTION_LIVENESS = (1 << 12), // include live status
23 CONTEXTS_OPTION_FAMILY = (1 << 13), // include family
24 CONTEXTS_OPTION_UNITS = (1 << 14), // include units
25 CONTEXTS_OPTION_RFC3339 = (1 << 15), // Return timestamps in RFC3339 format
26 CONTEXTS_OPTION_JSON_LONG_KEYS = (1 << 16), // Use long JSON keys instead of short ones
27 } CONTEXTS_OPTIONS;
28
29 CONTEXTS_OPTIONS contexts_options_str_to_id(char *o);
30 void contexts_options_to_buffer_json_array(BUFFER *wb, const char *key, CONTEXTS_OPTIONS options);
31
32 void contexts_options_init(void);
33
34 // Map RRDR_OPTIONS to CONTEXTS_OPTIONS for options that are common between both
35 CONTEXTS_OPTIONS rrdr_options_to_contexts_options(RRDR_OPTIONS rrdr_options);
36
37 #endif //NETDATA_CONTEXTS_OPTIONS_H