summaryrefslogtreecommitdiffstats
path: root/database/contexts/rrdcontext.h
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2023-06-22 01:16:57 +0300
committerGitHub <noreply@github.com>2023-06-22 01:16:57 +0300
commitf3efdba1a0cff9b8d5a2df7149824dba2b59b653 (patch)
tree79315d2a3037931627a831737b0d5acb55e6e08b /database/contexts/rrdcontext.h
parent8e8531d402b4038c12dfb73431559082787ebaa8 (diff)
New alerts endpoint (#15232)
* alerts / alerts_log v2 * Add global_id to ae Populate entries with global id * Remove transition id from template Change history to instances * Link ae to rc in all cases Code cleanup
Diffstat (limited to 'database/contexts/rrdcontext.h')
-rw-r--r--database/contexts/rrdcontext.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/database/contexts/rrdcontext.h b/database/contexts/rrdcontext.h
index 540f45075f..644aec9068 100644
--- a/database/contexts/rrdcontext.h
+++ b/database/contexts/rrdcontext.h
@@ -475,6 +475,27 @@ struct api_v2_contexts_request {
void *interrupt_callback_data;
};
+struct api_v2_alerts_request {
+ char *scope_nodes;
+ char *scope_contexts;
+ char *nodes;
+ char *contexts;
+ char *config_hash;
+ char *state;
+ SIMPLE_PATTERN *config_hash_pattern;
+ char *transition_id;
+ time_t alert_id;
+ uint32_t last;
+ char *alert_name;
+ SIMPLE_PATTERN *alert_name_pattern;
+ ALERT_OPTIONS options;
+ time_t after;
+ time_t before;
+ char *q;
+};
+
+ssize_t get_alert_index(Pvoid_t JudyHS, uuid_t *uuid);
+
typedef enum __attribute__ ((__packed__)) {
CONTEXTS_V2_DEBUG = (1 << 0),
CONTEXTS_V2_MINIFY = (1 << 1),
@@ -490,6 +511,7 @@ typedef enum __attribute__ ((__packed__)) {
} CONTEXTS_V2_OPTIONS;
int rrdcontext_to_json_v2(BUFFER *wb, struct api_v2_contexts_request *req, CONTEXTS_V2_OPTIONS options);
+int alerts_to_json_v2(BUFFER *wb, struct api_v2_alerts_request *req, CONTEXTS_V2_OPTIONS options);
RRDCONTEXT_TO_JSON_OPTIONS rrdcontext_to_json_parse_options(char *o);
void buffer_json_agents_array_v2(BUFFER *wb, struct query_timings *timings, time_t now_s, bool info);