/
nginx_plus_api_types.go
159 lines (144 loc) · 5.3 KB
/
nginx_plus_api_types.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
package nginx_plus_api
type Processes struct {
Respawned int `json:"respawned"`
}
type Connections struct {
Accepted int64 `json:"accepted"`
Dropped int64 `json:"dropped"`
Active int64 `json:"active"`
Idle int64 `json:"idle"`
}
type Ssl struct { // added in version 6
Handshakes int64 `json:"handshakes"`
HandshakesFailed int64 `json:"handshakes_failed"`
SessionReuses int64 `json:"session_reuses"`
}
type ResolverZones map[string]struct {
Requests struct {
Name int64 `json:"name"`
Srv int64 `json:"srv"`
Addr int64 `json:"addr"`
} `json:"requests"`
Responses struct {
Noerror int64 `json:"noerror"`
Formerr int64 `json:"formerr"`
Servfail int64 `json:"servfail"`
Nxdomain int64 `json:"nxdomain"`
Notimp int64 `json:"notimp"`
Refused int64 `json:"refused"`
Timedout int64 `json:"timedout"`
Unknown int64 `json:"unknown"`
} `json:"responses"`
}
type HTTPRequests struct {
Total int64 `json:"total"`
Current int64 `json:"current"`
}
type ResponseStats struct {
Responses1xx int64 `json:"1xx"`
Responses2xx int64 `json:"2xx"`
Responses3xx int64 `json:"3xx"`
Responses4xx int64 `json:"4xx"`
Responses5xx int64 `json:"5xx"`
Total int64 `json:"total"`
}
type HTTPServerZones map[string]struct {
Processing int `json:"processing"`
Requests int64 `json:"requests"`
Responses ResponseStats `json:"responses"`
Discarded *int64 `json:"discarded"` // added in version 6
Received int64 `json:"received"`
Sent int64 `json:"sent"`
}
type HTTPLocationZones map[string]struct {
Requests int64 `json:"requests"`
Responses ResponseStats `json:"responses"`
Discarded *int64 `json:"discarded"` // added in version 6
Received int64 `json:"received"`
Sent int64 `json:"sent"`
}
type HealthCheckStats struct {
Checks int64 `json:"checks"`
Fails int64 `json:"fails"`
Unhealthy int64 `json:"unhealthy"`
LastPassed *bool `json:"last_passed"`
}
type HTTPUpstreams map[string]struct {
Peers []struct {
ID *int `json:"id"` // added in version 3
Server string `json:"server"`
Backup bool `json:"backup"`
Weight int `json:"weight"`
State string `json:"state"`
Active int `json:"active"`
Keepalive *int `json:"keepalive"` // removed in version 5
MaxConns *int `json:"max_conns"` // added in version 3
Requests int64 `json:"requests"`
Responses ResponseStats `json:"responses"`
Sent int64 `json:"sent"`
Received int64 `json:"received"`
Fails int64 `json:"fails"`
Unavail int64 `json:"unavail"`
HealthChecks HealthCheckStats `json:"health_checks"`
Downtime int64 `json:"downtime"`
HeaderTime *int64 `json:"header_time"` // added in version 5
ResponseTime *int64 `json:"response_time"` // added in version 5
} `json:"peers"`
Keepalive int `json:"keepalive"`
Zombies int `json:"zombies"` // added in version 6
Queue *struct { // added in version 6
Size int `json:"size"`
MaxSize int `json:"max_size"`
Overflows int64 `json:"overflows"`
} `json:"queue"`
}
type StreamServerZones map[string]struct {
Processing int `json:"processing"`
Connections int `json:"connections"`
Sessions *ResponseStats `json:"sessions"`
Discarded *int64 `json:"discarded"` // added in version 7
Received int64 `json:"received"`
Sent int64 `json:"sent"`
}
type StreamUpstreams map[string]struct {
Peers []struct {
ID int `json:"id"`
Server string `json:"server"`
Backup bool `json:"backup"`
Weight int `json:"weight"`
State string `json:"state"`
Active int `json:"active"`
Connections int64 `json:"connections"`
ConnectTime *int `json:"connect_time"`
FirstByteTime *int `json:"first_byte_time"`
ResponseTime *int `json:"response_time"`
Sent int64 `json:"sent"`
Received int64 `json:"received"`
Fails int64 `json:"fails"`
Unavail int64 `json:"unavail"`
HealthChecks HealthCheckStats `json:"health_checks"`
Downtime int64 `json:"downtime"`
} `json:"peers"`
Zombies int `json:"zombies"`
}
type BasicHitStats struct {
Responses int64 `json:"responses"`
Bytes int64 `json:"bytes"`
}
type ExtendedHitStats struct {
BasicHitStats
ResponsesWritten int64 `json:"responses_written"`
BytesWritten int64 `json:"bytes_written"`
}
type HTTPCaches map[string]struct { // added in version 2
Size int64 `json:"size"`
MaxSize int64 `json:"max_size"`
Cold bool `json:"cold"`
Hit BasicHitStats `json:"hit"`
Stale BasicHitStats `json:"stale"`
Updating BasicHitStats `json:"updating"`
Revalidated *BasicHitStats `json:"revalidated"` // added in version 3
Miss ExtendedHitStats `json:"miss"`
Expired ExtendedHitStats `json:"expired"`
Bypass ExtendedHitStats `json:"bypass"`
}