-
Notifications
You must be signed in to change notification settings - Fork 0
/
notify.api
119 lines (115 loc) · 4.1 KB
/
notify.api
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
syntax = "v1"
type (
BKCallBack {
Type string `json:"type"`
Scenario string `json:"scenario"`
BkBizId int64 `json:"bk_biz_id"`
BkBizName string `json:"bk_biz_name"`
Event BkEvent `json:"event"`
Strategy BkStrategy `json:"strategy"`
LatestAnomalyRecord BkLatestAnomalyRecord `json:"latest_anomaly_record"`
RelatedInfo string `json:"related_info"`
Labels []interface{} `json:"labels,optional"`
BotKey string `form:"key"`
Secret string `form:"secret"`
TimeLocal int64 `form:"timeLocal,default=1"`
}
BkEvent {
Id int64 `json:"id"`
EventId string `json:"event_id"`
BeginTime string `json:"begin_time"`
CreateTime string `json:"create_time"`
EndTime string `json:"end_time"`
Level int64 `json:"level"`
LevelName string `json:"level_name"`
Dimensions BkDimensions `json:"dimensions,optional"`
DimensionTranslation BkDimensionTranslation `json:"dimension_translation,optional"`
}
BkDimensions {
BkTargetCloudId string `json:"bk_target_cloud_id"`
BkTargetIp string `json:"bk_target_ip"`
BkTopoNode []string `json:"bk_topo_node"`
}
BkDimensionTranslation {
BkTargetCloudId BkTargetValue `json:"bk_target_cloud_id"`
BkTargetIp BkTargetValue `json:"bk_target_ip"`
BktopoNode BkTargetValues `json:"bk_topo_node"`
}
BkTargetValue {
Value string `json:"value"`
DisplayName string `json:"display_name"`
DisplayValue string `json:"display_value"`
}
BkTargetValues {
Value []string `json:"value"`
DisplayName string `json:"display_name"`
DisplayValue []BkDisplayValues `json:"display_value"`
}
BkDisplayValues {
ObjName string `json:"bk_obj_name"`
InstName string `json:"bk_inst_name"`
}
BkStrategy {
Id int64 `json:"id"`
Name string `json:"name"`
Scenario string `json:"scenario"`
ItemList []BkItemList `json:"item_list"`
}
BkItemList {
MetricField string `json:"metric_field"`
MetricFieldName string `json:"metric_field_name"`
DataSourceLabel string `json:"data_source_label"`
DataSourceName string `json:"data_source_name"`
DataTypeLabel string `json:"data_type_label"`
DataTypeName string `json:"data_type_name"`
MetricId string `json:"metric_id"`
}
BkLatestAnomalyRecord {
AnomalyId int64 `json:"anomaly_id"`
SourceTime string `json:"source_time"`
CreateTime string `json:"create_time"`
OriginAlarm BkOriginAlarm `json:"origin_alarm"`
}
BkOriginAlarm {
Data BkData `json:"data"`
RecorId string `json:"record_id,optional"`
Anomaly BkAnomaly `json:"anomaly,optional"`
}
BkData {
Time int64 `json:"time"`
Value float64 `json:"value"`
Values Bkvalues `json:"values"`
Dimensions BkDimensions `json:"dimensions,optional"`
}
Bkvalues {
A float64 `json:"a,optional"`
Result float64 `json:"_result_,optional"`
Time int64 `json:"time"`
}
BkAnomaly {
Field1 BkField1 `json:"1,optional"`
Field2 BkField2 `json:"2,optional"`
Field3 BkField3 `json:"3,optional"`
}
BkField1 {
AnomalyMessage string `json:"anomaly_message"`
AnomalyTime string `json:"anomaly_time"`
AnomalyId string `json:"anomaly_id"`
}
BkField2 {
AnomalyMessage string `json:"anomaly_message"`
AnomalyTime string `json:"anomaly_time"`
AnomalyId string `json:"anomaly_id"`
}
BkField3 {
AnomalyMessage string `json:"anomaly_message"`
AnomalyTime string `json:"anomaly_time"`
AnomalyId string `json:"anomaly_id"`
}
)
service notify {
@handler larkBot
post /api/notify/larkBot (BKCallBack)
@handler dingTalkBot
post /api/notify/dingTalkBot (BKCallBack)
}