This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
event_definition.go
91 lines (78 loc) · 3.27 KB
/
event_definition.go
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package graylog
type (
// EventDefinition represents an event definition.
EventDefinition struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Priority int `json:"priority"`
Alert bool `json:"alert"`
FieldSpec map[string]EventDefinitionFieldSpec `json:"field_spec"`
// KeySpec []interface{} `json:"key_spec"`
NotificationSettings EventDefinitionNotificationSettings `json:"notification_settings"`
Notifications []EventDefinitionNotification `json:"notifications"`
Storage []interface{} `json:"storage"`
Config interface{} `json:"config"`
}
// EventDefinitionStorage struct {
// Type string `json:"type"`
// Streams []string `json:"streams"`
// }
EventDefinitionNotification struct {
NotificationID string `json:"notification_id"`
// NotificationParameters interface{} `json:"notification_parameters"`
}
EventDefinitionNotificationSettings struct {
GracePeriodMS int `json:"grace_period_ms"`
BacklogSize int `json:"backlog_size"`
}
EventDefinitionFieldSpec struct {
DataType string `json:"data_type"`
Providers []interface{} `json:"providers"`
}
// EventDefinitionFieldSpecProvider struct {
// Type string `json:"type"`
// Template string `json:"template"`
// RequireValues bool `json:"require_values"`
// }
// EventDefinitionConfig struct {
// Type string `json:"type"`
// Query string `json:"query"`
// Streams *set.StrSet `json:"streams"`
// // GroupBy []string `json:"group_by"`
// Series *EventDefinitionConfigSeries `json:"series"`
// Conditions EventDefinitionConfigConditions `json:"conditions"`
// }
EventDefinitionConfigSeries struct {
ID string `json:"id"`
Function string `json:"function"`
// Field string `json:"field"`
}
EventDefinitionConfigConditions struct {
Expression EventDefinitionConfigConditionsExpression `json:"expression"`
}
EventDefinitionConfigConditionsExpression struct {
Expr string `json:"expr"`
Left *EventDefinitionConfigConditionsExpressionLeft `json:"left"`
Right *EventDefinitionConfigConditionsExpressionRight `json:"right"`
}
EventDefinitionConfigConditionsExpressionLeft struct {
Expr string `json:"expr"`
Ref string `json:"ref"`
}
EventDefinitionConfigConditionsExpressionRight struct {
Expr string `json:"expr"`
Value string `json:"value"`
}
// EventDefinitionsBody represents Get EventDefinitions API's response body.
// Basically users don't use this struct, but this struct is public because some sub packages use this struct.
EventDefinitionsBody struct {
EventDefinitions []EventDefinition `json:"event_definitions"`
Total int `json:"total"`
Page int `json:"page"`
PerPage int `json:"per_page"`
Count int `json:"count"`
GrandTotal int `json:"grand_total"`
Query string `json:"query"`
}
)