This repository has been archived by the owner on Dec 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathnative_stat_stats.go
559 lines (404 loc) · 13.1 KB
/
native_stat_stats.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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
// Code generated by go-swagger; DO NOT EDIT.
// Copyright 2019 HAProxy Technologies
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// NativeStatStats native stat stats
//
// swagger:model native_stat_stats
type NativeStatStats struct {
// act
Act *int64 `json:"act,omitempty"`
// addr
Addr string `json:"addr,omitempty"`
// agent code
AgentCode *int64 `json:"agent_code,omitempty"`
// agent desc
AgentDesc string `json:"agent_desc,omitempty"`
// agent duration
AgentDuration *int64 `json:"agent_duration,omitempty"`
// agent fall
AgentFall *int64 `json:"agent_fall,omitempty"`
// agent health
AgentHealth *int64 `json:"agent_health,omitempty"`
// agent rise
AgentRise *int64 `json:"agent_rise,omitempty"`
// agent status
// Enum: [UNK INI SOCKERR L40K L4TOUT L4CON L7OK L7STS]
AgentStatus string `json:"agent_status,omitempty"`
// algo
Algo string `json:"algo,omitempty"`
// bck
Bck *int64 `json:"bck,omitempty"`
// bin
Bin *int64 `json:"bin,omitempty"`
// bout
Bout *int64 `json:"bout,omitempty"`
// check code
CheckCode *int64 `json:"check_code,omitempty"`
// check desc
CheckDesc string `json:"check_desc,omitempty"`
// check duration
CheckDuration *int64 `json:"check_duration,omitempty"`
// check fall
CheckFall *int64 `json:"check_fall,omitempty"`
// check health
CheckHealth *int64 `json:"check_health,omitempty"`
// check rise
CheckRise *int64 `json:"check_rise,omitempty"`
// check status
// Enum: [UNK INI SOCKERR L40K L4TOUT L4CON L6OK L6TOUT L6RSP L7OK L7OKC L7TOUT L7RSP L7STS]
CheckStatus string `json:"check_status,omitempty"`
// chkdown
Chkdown *int64 `json:"chkdown,omitempty"`
// chkfail
Chkfail *int64 `json:"chkfail,omitempty"`
// cli abrt
CliAbrt *int64 `json:"cli_abrt,omitempty"`
// comp byp
CompByp *int64 `json:"comp_byp,omitempty"`
// comp in
CompIn *int64 `json:"comp_in,omitempty"`
// comp out
CompOut *int64 `json:"comp_out,omitempty"`
// comp rsp
CompRsp *int64 `json:"comp_rsp,omitempty"`
// conn rate
ConnRate *int64 `json:"conn_rate,omitempty"`
// conn rate max
ConnRateMax *int64 `json:"conn_rate_max,omitempty"`
// conn tot
ConnTot *int64 `json:"conn_tot,omitempty"`
// cookie
Cookie string `json:"cookie,omitempty"`
// ctime
Ctime *int64 `json:"ctime,omitempty"`
// dcon
Dcon *int64 `json:"dcon,omitempty"`
// downtime
Downtime *int64 `json:"downtime,omitempty"`
// dreq
Dreq *int64 `json:"dreq,omitempty"`
// dresp
Dresp *int64 `json:"dresp,omitempty"`
// dses
Dses *int64 `json:"dses,omitempty"`
// econ
Econ *int64 `json:"econ,omitempty"`
// ereq
Ereq *int64 `json:"ereq,omitempty"`
// eresp
Eresp *int64 `json:"eresp,omitempty"`
// hanafail
Hanafail string `json:"hanafail,omitempty"`
// hrsp 1xx
Hrsp1xx *int64 `json:"hrsp_1xx,omitempty"`
// hrsp 2xx
Hrsp2xx *int64 `json:"hrsp_2xx,omitempty"`
// hrsp 3xx
Hrsp3xx *int64 `json:"hrsp_3xx,omitempty"`
// hrsp 4xx
Hrsp4xx *int64 `json:"hrsp_4xx,omitempty"`
// hrsp 5xx
Hrsp5xx *int64 `json:"hrsp_5xx,omitempty"`
// hrsp other
HrspOther *int64 `json:"hrsp_other,omitempty"`
// iid
Iid *int64 `json:"iid,omitempty"`
// intercepted
Intercepted *int64 `json:"intercepted,omitempty"`
// lastchg
Lastchg *int64 `json:"lastchg,omitempty"`
// lastsess
Lastsess *int64 `json:"lastsess,omitempty"`
// lbtot
Lbtot *int64 `json:"lbtot,omitempty"`
// mode
// Enum: [tcp http health unknown]
Mode string `json:"mode,omitempty"`
// pid
Pid *int64 `json:"pid,omitempty"`
// qcur
Qcur *int64 `json:"qcur,omitempty"`
// qlimit
Qlimit *int64 `json:"qlimit,omitempty"`
// qmax
Qmax *int64 `json:"qmax,omitempty"`
// qtime
Qtime *int64 `json:"qtime,omitempty"`
// rate
Rate *int64 `json:"rate,omitempty"`
// rate lim
RateLim *int64 `json:"rate_lim,omitempty"`
// rate max
RateMax *int64 `json:"rate_max,omitempty"`
// req rate
ReqRate *int64 `json:"req_rate,omitempty"`
// req rate max
ReqRateMax *int64 `json:"req_rate_max,omitempty"`
// req tot
ReqTot *int64 `json:"req_tot,omitempty"`
// rtime
Rtime *int64 `json:"rtime,omitempty"`
// scur
Scur *int64 `json:"scur,omitempty"`
// sid
Sid *int64 `json:"sid,omitempty"`
// slim
Slim *int64 `json:"slim,omitempty"`
// smax
Smax *int64 `json:"smax,omitempty"`
// srv abrt
SrvAbrt *int64 `json:"srv_abrt,omitempty"`
// status
// Enum: [UP DOWN NOLB MAINT no check]
Status string `json:"status,omitempty"`
// stot
Stot *int64 `json:"stot,omitempty"`
// throttle
Throttle *int64 `json:"throttle,omitempty"`
// tracked
Tracked string `json:"tracked,omitempty"`
// ttime
Ttime *int64 `json:"ttime,omitempty"`
// weight
Weight *int64 `json:"weight,omitempty"`
// wredis
Wredis *int64 `json:"wredis,omitempty"`
// wretr
Wretr *int64 `json:"wretr,omitempty"`
}
// Validate validates this native stat stats
func (m *NativeStatStats) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAgentStatus(formats); err != nil {
res = append(res, err)
}
if err := m.validateCheckStatus(formats); err != nil {
res = append(res, err)
}
if err := m.validateMode(formats); err != nil {
res = append(res, err)
}
if err := m.validateStatus(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var nativeStatStatsTypeAgentStatusPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["UNK","INI","SOCKERR","L40K","L4TOUT","L4CON","L7OK","L7STS"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
nativeStatStatsTypeAgentStatusPropEnum = append(nativeStatStatsTypeAgentStatusPropEnum, v)
}
}
const (
// NativeStatStatsAgentStatusUNK captures enum value "UNK"
NativeStatStatsAgentStatusUNK string = "UNK"
// NativeStatStatsAgentStatusINI captures enum value "INI"
NativeStatStatsAgentStatusINI string = "INI"
// NativeStatStatsAgentStatusSOCKERR captures enum value "SOCKERR"
NativeStatStatsAgentStatusSOCKERR string = "SOCKERR"
// NativeStatStatsAgentStatusL40K captures enum value "L40K"
NativeStatStatsAgentStatusL40K string = "L40K"
// NativeStatStatsAgentStatusL4TOUT captures enum value "L4TOUT"
NativeStatStatsAgentStatusL4TOUT string = "L4TOUT"
// NativeStatStatsAgentStatusL4CON captures enum value "L4CON"
NativeStatStatsAgentStatusL4CON string = "L4CON"
// NativeStatStatsAgentStatusL7OK captures enum value "L7OK"
NativeStatStatsAgentStatusL7OK string = "L7OK"
// NativeStatStatsAgentStatusL7STS captures enum value "L7STS"
NativeStatStatsAgentStatusL7STS string = "L7STS"
)
// prop value enum
func (m *NativeStatStats) validateAgentStatusEnum(path, location string, value string) error {
if err := validate.Enum(path, location, value, nativeStatStatsTypeAgentStatusPropEnum); err != nil {
return err
}
return nil
}
func (m *NativeStatStats) validateAgentStatus(formats strfmt.Registry) error {
if swag.IsZero(m.AgentStatus) { // not required
return nil
}
// value enum
if err := m.validateAgentStatusEnum("agent_status", "body", m.AgentStatus); err != nil {
return err
}
return nil
}
var nativeStatStatsTypeCheckStatusPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["UNK","INI","SOCKERR","L40K","L4TOUT","L4CON","L6OK","L6TOUT","L6RSP","L7OK","L7OKC","L7TOUT","L7RSP","L7STS"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
nativeStatStatsTypeCheckStatusPropEnum = append(nativeStatStatsTypeCheckStatusPropEnum, v)
}
}
const (
// NativeStatStatsCheckStatusUNK captures enum value "UNK"
NativeStatStatsCheckStatusUNK string = "UNK"
// NativeStatStatsCheckStatusINI captures enum value "INI"
NativeStatStatsCheckStatusINI string = "INI"
// NativeStatStatsCheckStatusSOCKERR captures enum value "SOCKERR"
NativeStatStatsCheckStatusSOCKERR string = "SOCKERR"
// NativeStatStatsCheckStatusL40K captures enum value "L40K"
NativeStatStatsCheckStatusL40K string = "L40K"
// NativeStatStatsCheckStatusL4TOUT captures enum value "L4TOUT"
NativeStatStatsCheckStatusL4TOUT string = "L4TOUT"
// NativeStatStatsCheckStatusL4CON captures enum value "L4CON"
NativeStatStatsCheckStatusL4CON string = "L4CON"
// NativeStatStatsCheckStatusL6OK captures enum value "L6OK"
NativeStatStatsCheckStatusL6OK string = "L6OK"
// NativeStatStatsCheckStatusL6TOUT captures enum value "L6TOUT"
NativeStatStatsCheckStatusL6TOUT string = "L6TOUT"
// NativeStatStatsCheckStatusL6RSP captures enum value "L6RSP"
NativeStatStatsCheckStatusL6RSP string = "L6RSP"
// NativeStatStatsCheckStatusL7OK captures enum value "L7OK"
NativeStatStatsCheckStatusL7OK string = "L7OK"
// NativeStatStatsCheckStatusL7OKC captures enum value "L7OKC"
NativeStatStatsCheckStatusL7OKC string = "L7OKC"
// NativeStatStatsCheckStatusL7TOUT captures enum value "L7TOUT"
NativeStatStatsCheckStatusL7TOUT string = "L7TOUT"
// NativeStatStatsCheckStatusL7RSP captures enum value "L7RSP"
NativeStatStatsCheckStatusL7RSP string = "L7RSP"
// NativeStatStatsCheckStatusL7STS captures enum value "L7STS"
NativeStatStatsCheckStatusL7STS string = "L7STS"
)
// prop value enum
func (m *NativeStatStats) validateCheckStatusEnum(path, location string, value string) error {
if err := validate.Enum(path, location, value, nativeStatStatsTypeCheckStatusPropEnum); err != nil {
return err
}
return nil
}
func (m *NativeStatStats) validateCheckStatus(formats strfmt.Registry) error {
if swag.IsZero(m.CheckStatus) { // not required
return nil
}
// value enum
if err := m.validateCheckStatusEnum("check_status", "body", m.CheckStatus); err != nil {
return err
}
return nil
}
var nativeStatStatsTypeModePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["tcp","http","health","unknown"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
nativeStatStatsTypeModePropEnum = append(nativeStatStatsTypeModePropEnum, v)
}
}
const (
// NativeStatStatsModeTCP captures enum value "tcp"
NativeStatStatsModeTCP string = "tcp"
// NativeStatStatsModeHTTP captures enum value "http"
NativeStatStatsModeHTTP string = "http"
// NativeStatStatsModeHealth captures enum value "health"
NativeStatStatsModeHealth string = "health"
// NativeStatStatsModeUnknown captures enum value "unknown"
NativeStatStatsModeUnknown string = "unknown"
)
// prop value enum
func (m *NativeStatStats) validateModeEnum(path, location string, value string) error {
if err := validate.Enum(path, location, value, nativeStatStatsTypeModePropEnum); err != nil {
return err
}
return nil
}
func (m *NativeStatStats) validateMode(formats strfmt.Registry) error {
if swag.IsZero(m.Mode) { // not required
return nil
}
// value enum
if err := m.validateModeEnum("mode", "body", m.Mode); err != nil {
return err
}
return nil
}
var nativeStatStatsTypeStatusPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["UP","DOWN","NOLB","MAINT","no check"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
nativeStatStatsTypeStatusPropEnum = append(nativeStatStatsTypeStatusPropEnum, v)
}
}
const (
// NativeStatStatsStatusUP captures enum value "UP"
NativeStatStatsStatusUP string = "UP"
// NativeStatStatsStatusDOWN captures enum value "DOWN"
NativeStatStatsStatusDOWN string = "DOWN"
// NativeStatStatsStatusNOLB captures enum value "NOLB"
NativeStatStatsStatusNOLB string = "NOLB"
// NativeStatStatsStatusMAINT captures enum value "MAINT"
NativeStatStatsStatusMAINT string = "MAINT"
// NativeStatStatsStatusNoCheck captures enum value "no check"
NativeStatStatsStatusNoCheck string = "no check"
)
// prop value enum
func (m *NativeStatStats) validateStatusEnum(path, location string, value string) error {
if err := validate.Enum(path, location, value, nativeStatStatsTypeStatusPropEnum); err != nil {
return err
}
return nil
}
func (m *NativeStatStats) validateStatus(formats strfmt.Registry) error {
if swag.IsZero(m.Status) { // not required
return nil
}
// value enum
if err := m.validateStatusEnum("status", "body", m.Status); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *NativeStatStats) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *NativeStatStats) UnmarshalBinary(b []byte) error {
var res NativeStatStats
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}