-
Notifications
You must be signed in to change notification settings - Fork 71
/
dashboard.go
284 lines (251 loc) · 11.2 KB
/
dashboard.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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
package model
type DashboardBaseResponse struct {
Code int `json:"code,omitempty"`
Data map[string]interface{} `json:"data,omitempty"`
Message string `json:"message,omitempty"`
TraceInfo string `json:"traceInfo,omitempty"`
Success bool `json:"success,omitempty"`
}
type DashboardRequest struct {
DashboardName string `json:"dashboardName,omitempty"`
UserID string `json:"userId,omitempty"`
Title string `json:"title,omitempty"`
Configure string `json:"configure,omitempty"`
WidgetName string `json:"widgetName,omitempty"`
Type string `json:"type,omitempty"`
}
type DashboardResponse struct {
Code int `json:"code,omitempty"`
Data string `json:"data,omitempty"`
Message string `json:"message,omitempty"`
TraceInfo string `json:"traceInfo,omitempty"`
Success bool `json:"success,omitempty"`
}
type DashboardWidgetRequest struct {
DashboardName string `json:"dashboardName,omitempty"`
UserID string `json:"userId,omitempty"`
Title string `json:"title,omitempty"`
Configure DashboardWidgetConfigure `json:"configure,omitempty"`
WidgetName string `json:"widgetName,omitempty"`
Type string `json:"type,omitempty"`
}
type DashboardWidgetConfigure struct {
Data []Data `json:"data,omitempty"`
Style Style `json:"style,omitempty"`
Title string `json:"title,omitempty"`
TimeRange TimeRange `json:"timeRange,omitempty"`
Time string `json:"time,omitempty"`
MonitorType string `json:"monitorType,omitempty"`
}
type DashboardMonitorObject struct {
InstanceName string `json:"instanceName,omitempty"`
Id string `json:"id,omitempty"`
}
type Data struct {
Metric []DashboardMetric `json:"metric,omitempty"`
MonitorObject []DashboardMonitorObject `json:"monitorObject,omitempty"`
Scope string `json:"scope,omitempty"`
SubService string `json:"subService,omitempty"`
Region string `json:"region,omitempty"`
ScopeValue ScopeValue `json:"scopeValue,omitempty"`
ResourceType string `json:"resourceType,omitempty"`
MonitorType string `json:"monitorType,omitempty"`
Namespace []DashboardNamespace `json:"namespace,omitempty"`
Product string `json:"product,omitempty"`
}
type DashboardMetric struct {
Name string `json:"name,omitempty"`
Unit string `json:"unit,omitempty"`
Alias string `json:"alias,omitempty"`
Contrast []string `json:"contrast,omitempty"`
TimeContrast []string `json:"timeContrast,omitempty"`
Statistics string `json:"statistics,omitempty"`
Dimensions []string `json:"dimensions,omitempty"`
MetricDimensions []MetricDimensions `json:"metricDimensions,omitempty"`
Cycle int `json:"cycle,omitempty"`
DisplayName string `json:"displayName,omitempty"`
}
type MetricDimensions struct {
Name string `json:"name,omitempty"`
Values []string `json:"values,omitempty"`
}
type ScopeValue struct {
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
HasChildren bool `json:"hasChildren,omitempty"`
}
type DashboardNamespace struct {
NamespaceType string `json:"namespaceType,omitempty"`
Transfer string `json:"transfer"`
Filter string `json:"filter,omitempty"`
Name string `json:"name,omitempty"`
InstanceName string `json:"instanceName,omitempty"`
Region string `json:"region,omitempty"`
BcmService string `json:"bcmService,omitempty"`
SubService []SubService `json:"subService,omitempty"`
}
type TimeRange struct {
TimeType string `json:"timeType,omitempty"`
Unit string `json:"unit,omitempty"`
Number int `json:"number,omitempty"`
Relative string `json:"relative,omitempty"`
}
type Style struct {
DisplayType string `json:"displayType,omitempty"`
NullPointMode string `json:"nullPointMode,omitempty"`
Threshold int `json:"threshold,omitempty"`
Decimals int `json:"decimals,omitempty"`
IsEdit bool `json:"isEdit,omitempty"`
Unit string `json:"unit,omitempty"`
}
type SubService struct {
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
}
type DashboardDataRequest struct {
Data []Data `json:"data,omitempty"`
Time string `json:"time,omitempty"`
}
type DashboardTrendData struct {
Data [][]float64 `json:"data,omitempty"`
Denominator int `json:"denominator,omitempty"`
Dimensions string `json:"dimensions,omitempty"`
Legend interface{} `json:"legend,omitempty"`
Metric string `json:"metric,omitempty"`
MetricType string `json:"metricType,omitempty"`
MetricUnit string `json:"metricUnit,omitempty"`
MetricUnitTransformation string `json:"metricUnitTransformation,omitempty"`
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
Numerator int `json:"numerator,omitempty"`
Product interface{} `json:"product,omitempty"`
Scope string `json:"scope,omitempty"`
Statistics interface{} `json:"statistics,omitempty"`
Time interface{} `json:"time,omitempty"`
TransPolicy string `json:"transPolicy,omitempty"`
HostName interface{} `json:"hostName,omitempty"`
InternalIP interface{} `json:"internalIp,omitempty"`
}
type DashboardTrendResponse struct {
Code int `json:"code,omitempty"`
Data []DashboardTrendData `json:"data,omitempty"`
Message string `json:"message,omitempty"`
TraceInfo string `json:"traceInfo,omitempty"`
Success bool `json:"success,omitempty"`
}
type DashboardReportData struct {
Alias string `json:"alias,omitempty"`
Children []string `json:"children,omitempty"`
Metrics map[string]float64 `json:"metrics,omitempty"`
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
}
type DashboardReportDataResponse struct {
Code int `json:"code,omitempty"`
Data []DashboardReportData `json:"data,omitempty"`
Message string `json:"message,omitempty"`
TraceInfo interface{} `json:"traceInfo,omitempty"`
Success bool `json:"success,omitempty"`
}
type DashboardBillboardResponse struct {
Code int `json:"code,omitempty"`
Data []DashboardBillboardData `json:"data,omitempty"`
Message string `json:"message,omitempty"`
TraceInfo string `json:"traceInfo,omitempty"`
Success bool `json:"success,omitempty"`
}
type DashboardBillboardData struct {
Data [][]float64 `json:"data,omitempty"`
Decimals interface{} `json:"decimals,omitempty"`
DisplayName string `json:"displayName,omitempty"`
InstanceName string `json:"instanceName,omitempty"`
MetricDimension string `json:"metricDimension,omitempty"`
Name string `json:"name,omitempty"`
Unit string `json:"unit,omitempty"`
}
type DashboardTrendSeniorResponse struct {
Code int `json:"code,omitempty"`
Data []DashboardSeniorTrendData `json:"data,omitempty"`
Message string `json:"message,omitempty"`
TraceInfo string `json:"traceInfo,omitempty"`
Success bool `json:"success,omitempty"`
}
type DashboardSeniorTrendData struct {
Items []Item `json:"items,omitempty"`
Job Job `json:"job,omitempty"`
Numeric Numeric `json:"numeric,omitempty"`
}
type Item struct {
StatisticsValue Numeric `json:"statisticsValue,omitempty"`
Timestamp int `json:"timestamp,omitempty"`
}
type TagForTsdb struct {
Key string `json:"key,omitempty"`
Value string `json:"value,omitempty"`
}
type Job struct {
Alias string `json:"alias,omitempty"`
BcmSource bool `json:"bcmSource,omitempty"`
Contrast string `json:"contrast,omitempty"`
Decimals interface{} `json:"decimals,omitempty"`
DisplayName string `json:"displayName,omitempty"`
EndTime int `json:"endTime,omitempty"`
Flatten bool `json:"flatten,omitempty"`
InstanceID interface{} `json:"instanceId,omitempty"`
InstanceName string `json:"instanceName,omitempty"`
IntranetIP interface{} `json:"intranetIp,omitempty"`
Items []Item `json:"items,omitempty"`
MetricName string `json:"metricName,omitempty"`
Namespace string `json:"namespace,omitempty"`
Offset int `json:"offset,omitempty"`
OriginalPeriod int `json:"originalPeriod,omitempty"`
Period int `json:"period,omitempty"`
Product string `json:"product,omitempty"`
StartTime int `json:"startTime,omitempty"`
Statistics string `json:"statistics,omitempty"`
Tags string `json:"tags,omitempty"`
TagsForTsdb []TagForTsdb `json:"tagsForTsdb,omitempty"`
Unit string `json:"unit,omitempty"`
}
type Numeric struct {
Avg float64 `json:"avg,omitempty"`
Cnt float64 `json:"cnt,omitempty"`
Max float64 `json:"max,omitempty"`
Min float64 `json:"min,omitempty"`
Sum float64 `json:"sum,omitempty"`
}
type DashboardDimension struct {
Namespace string `json:"namespace,omitempty"`
Metrics []string `json:"metrics,omitempty"`
Tags []string `json:"tags,omitempty"`
}
type DimensionFilter struct {
Name string `json:"name,omitempty"`
Values []string `json:"value,omitempty"`
}
type DashboardDimensionsRequest struct {
UserID string `json:"userId,omitempty"`
Service string `json:"service,omitempty"`
Region string `json:"region,omitempty"`
ResourceID string `json:"showId,omitempty"`
Dimensions string `json:"dimensions,omitempty"`
MetricName string `json:"metricName,omitempty"`
}
type DimensionValue struct {
Name string `json:"name,omitempty"`
Comment string `json:"comment,omitempty"`
Available bool `json:"available,omitempty"`
}
type DashboardDimensionsData struct {
Name string `json:"name,omitempty"`
Product string `json:"product,omitempty"`
Comment string `json:"comment,omitempty"`
DimensionValues []DimensionValue `json:"dimensionValues,omitempty"`
}
type DashboardDimensionsResponse struct {
Code int `json:"code,omitempty"`
Data []DashboardDimensionsData `json:"data,omitempty"`
Message string `json:"message,omitempty"`
TraceInfo string `json:"traceInfo,omitempty"`
Success bool `json:"success,omitempty"`
}