-
Notifications
You must be signed in to change notification settings - Fork 1
/
api_controller.go
282 lines (261 loc) · 11.4 KB
/
api_controller.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
package api
import (
"context"
"errors"
"fmt"
"github.com/myENA/vsz-api/validators"
"net/http"
)
// This file is auto-generated
// Generation Date: 2018-04-27T15:10:38-0500
// API Version: v5
type ControllerAPI struct {
client *Client
}
type (
SystemSystemSummaryGet200ResponseListSlice []*SystemSystemSummaryGet200ResponseList
SystemSystemSummaryGet200ResponseList struct {
ApVersion *string `json:"apVersion,omitempty"`
ClusterIP *string `json:"clusterIp,omitempty"`
ClusterIpv6 *string `json:"clusterIpv6,omitempty"`
ClusterRole *string `json:"clusterRole,omitempty"`
ControlIP *string `json:"controlIp,omitempty"`
ControlIpv6 *string `json:"controlIpv6,omitempty"`
ControlNatIP *string `json:"controlNatIp,omitempty"`
Description *string `json:"description,omitempty"`
HostName *string `json:"hostName,omitempty"`
ID *string `json:"id,omitempty"`
Mac *string `json:"mac,omitempty"`
ManagementIP *string `json:"managementIp,omitempty"`
ManagementIpv6 *string `json:"managementIpv6,omitempty"`
Model *string `json:"model,omitempty"`
Name *string `json:"name,omitempty"`
SerialNumber *string `json:"serialNumber,omitempty"`
UptimeInSec *float64 `json:"uptimeInSec,omitempty"`
Version *string `json:"version,omitempty"`
}
SystemSystemSummaryGet200Response struct {
FirstIndex *int `json:"firstIndex,omitempty"`
HasMore *bool `json:"hasMore,omitempty"`
List SystemSystemSummaryGet200ResponseListSlice `json:"list,omitempty"`
TotalCount *int `json:"totalCount,omitempty"`
}
)
// SystemSystemSummaryGet: Use this API command to retrieve the system summary.
//
// Required Parameters:
// - ctx (context.Context): Context to use for this request
//
// Returns:
// - *http.Response: HTTP Response or nil on error
// - *SystemSystemSummaryGet200Response
// - error: Error seen or nil if none
func (c *ControllerAPI) SystemSystemSummaryGet(ctx context.Context) (*http.Response, *SystemSystemSummaryGet200Response, error) {
if ctx == nil {
return nil, nil, errors.New("user context cannot be nil")
}
request := NewRequest("GET", "/v5_0/controller", true)
out := &SystemSystemSummaryGet200Response{}
httpResponse, _, err := c.client.Ensure(ctx, request, 200, out)
return httpResponse, out, err
}
type (
SystemSystemStatisticsGet200ResponseSlice []*SystemSystemStatisticsGet200Response
SystemSystemStatisticsGet200ResponseCluster struct {
RxBps *float64 `json:"rxBps,omitempty"`
RxBpsMax *float64 `json:"rxBpsMax,omitempty"`
RxBpsMin *float64 `json:"rxBpsMin,omitempty"`
RxBytes *int `json:"rxBytes,omitempty"`
RxDropped *float64 `json:"rxDropped,omitempty"`
RxPackets *float64 `json:"rxPackets,omitempty"`
TxBps *float64 `json:"txBps,omitempty"`
TxBpsMax *float64 `json:"txBpsMax,omitempty"`
TxBpsMin *float64 `json:"txBpsMin,omitempty"`
TxBytes *int `json:"txBytes,omitempty"`
TxDropped *float64 `json:"txDropped,omitempty"`
TxPackets *float64 `json:"txPackets,omitempty"`
}
SystemSystemStatisticsGet200ResponseControl struct {
RxBps *float64 `json:"rxBps,omitempty"`
RxBpsMax *float64 `json:"rxBpsMax,omitempty"`
RxBpsMin *float64 `json:"rxBpsMin,omitempty"`
RxBytes *int `json:"rxBytes,omitempty"`
RxDropped *float64 `json:"rxDropped,omitempty"`
RxPackets *float64 `json:"rxPackets,omitempty"`
TxBps *float64 `json:"txBps,omitempty"`
TxBpsMax *float64 `json:"txBpsMax,omitempty"`
TxBpsMin *float64 `json:"txBpsMin,omitempty"`
TxBytes *int `json:"txBytes,omitempty"`
TxDropped *float64 `json:"txDropped,omitempty"`
TxPackets *float64 `json:"txPackets,omitempty"`
}
SystemSystemStatisticsGet200ResponseCPU struct {
MaxPercent *float64 `json:"maxPercent,omitempty"`
MinPercent *float64 `json:"minPercent,omitempty"`
Percent *float64 `json:"percent,omitempty"`
}
SystemSystemStatisticsGet200ResponseDisk struct {
Free *float64 `json:"free,omitempty"`
MaxFree *float64 `json:"maxFree,omitempty"`
MinFree *float64 `json:"minFree,omitempty"`
Total *float64 `json:"total,omitempty"`
}
SystemSystemStatisticsGet200ResponseManagement struct {
RxBps *float64 `json:"rxBps,omitempty"`
RxBpsMax *float64 `json:"rxBpsMax,omitempty"`
RxBpsMin *float64 `json:"rxBpsMin,omitempty"`
RxBytes *int `json:"rxBytes,omitempty"`
RxDropped *float64 `json:"rxDropped,omitempty"`
RxPackets *float64 `json:"rxPackets,omitempty"`
TxBps *float64 `json:"txBps,omitempty"`
TxBpsMax *float64 `json:"txBpsMax,omitempty"`
TxBpsMin *float64 `json:"txBpsMin,omitempty"`
TxBytes *int `json:"txBytes,omitempty"`
TxDropped *float64 `json:"txDropped,omitempty"`
TxPackets *float64 `json:"txPackets,omitempty"`
}
SystemSystemStatisticsGet200ResponseMemory struct {
MaxPercent *float64 `json:"maxPercent,omitempty"`
MinPercent *float64 `json:"minPercent,omitempty"`
Percent *float64 `json:"percent,omitempty"`
}
SystemSystemStatisticsGet200ResponsePort0 struct {
RxBps *float64 `json:"rxBps,omitempty"`
RxBpsMax *float64 `json:"rxBpsMax,omitempty"`
RxBpsMin *float64 `json:"rxBpsMin,omitempty"`
RxBytes *int `json:"rxBytes,omitempty"`
RxDropped *float64 `json:"rxDropped,omitempty"`
RxPackets *float64 `json:"rxPackets,omitempty"`
TxBps *float64 `json:"txBps,omitempty"`
TxBpsMax *float64 `json:"txBpsMax,omitempty"`
TxBpsMin *float64 `json:"txBpsMin,omitempty"`
TxBytes *int `json:"txBytes,omitempty"`
TxDropped *float64 `json:"txDropped,omitempty"`
TxPackets *float64 `json:"txPackets,omitempty"`
}
SystemSystemStatisticsGet200ResponsePort1 struct {
RxBps *float64 `json:"rxBps,omitempty"`
RxBpsMax *float64 `json:"rxBpsMax,omitempty"`
RxBpsMin *float64 `json:"rxBpsMin,omitempty"`
RxBytes *int `json:"rxBytes,omitempty"`
RxDropped *float64 `json:"rxDropped,omitempty"`
RxPackets *float64 `json:"rxPackets,omitempty"`
TxBps *float64 `json:"txBps,omitempty"`
TxBpsMax *float64 `json:"txBpsMax,omitempty"`
TxBpsMin *float64 `json:"txBpsMin,omitempty"`
TxBytes *int `json:"txBytes,omitempty"`
TxDropped *float64 `json:"txDropped,omitempty"`
TxPackets *float64 `json:"txPackets,omitempty"`
}
SystemSystemStatisticsGet200ResponsePort2 struct {
RxBps *float64 `json:"rxBps,omitempty"`
RxBpsMax *float64 `json:"rxBpsMax,omitempty"`
RxBpsMin *float64 `json:"rxBpsMin,omitempty"`
RxBytes *int `json:"rxBytes,omitempty"`
RxDropped *float64 `json:"rxDropped,omitempty"`
RxPackets *float64 `json:"rxPackets,omitempty"`
TxBps *float64 `json:"txBps,omitempty"`
TxBpsMax *float64 `json:"txBpsMax,omitempty"`
TxBpsMin *float64 `json:"txBpsMin,omitempty"`
TxBytes *int `json:"txBytes,omitempty"`
TxDropped *float64 `json:"txDropped,omitempty"`
TxPackets *float64 `json:"txPackets,omitempty"`
}
SystemSystemStatisticsGet200ResponsePort3 struct {
RxBps *float64 `json:"rxBps,omitempty"`
RxBpsMax *float64 `json:"rxBpsMax,omitempty"`
RxBpsMin *float64 `json:"rxBpsMin,omitempty"`
RxBytes *int `json:"rxBytes,omitempty"`
RxDropped *float64 `json:"rxDropped,omitempty"`
RxPackets *float64 `json:"rxPackets,omitempty"`
TxBps *float64 `json:"txBps,omitempty"`
TxBpsMax *float64 `json:"txBpsMax,omitempty"`
TxBpsMin *float64 `json:"txBpsMin,omitempty"`
TxBytes *int `json:"txBytes,omitempty"`
TxDropped *float64 `json:"txDropped,omitempty"`
TxPackets *float64 `json:"txPackets,omitempty"`
}
SystemSystemStatisticsGet200ResponsePort4 struct {
RxBps *float64 `json:"rxBps,omitempty"`
RxBpsMax *float64 `json:"rxBpsMax,omitempty"`
RxBpsMin *float64 `json:"rxBpsMin,omitempty"`
RxBytes *int `json:"rxBytes,omitempty"`
RxDropped *float64 `json:"rxDropped,omitempty"`
RxPackets *float64 `json:"rxPackets,omitempty"`
TxBps *float64 `json:"txBps,omitempty"`
TxBpsMax *float64 `json:"txBpsMax,omitempty"`
TxBpsMin *float64 `json:"txBpsMin,omitempty"`
TxBytes *int `json:"txBytes,omitempty"`
TxDropped *float64 `json:"txDropped,omitempty"`
TxPackets *float64 `json:"txPackets,omitempty"`
}
SystemSystemStatisticsGet200ResponsePort5 struct {
RxBps *float64 `json:"rxBps,omitempty"`
RxBpsMax *float64 `json:"rxBpsMax,omitempty"`
RxBpsMin *float64 `json:"rxBpsMin,omitempty"`
RxBytes *int `json:"rxBytes,omitempty"`
RxDropped *float64 `json:"rxDropped,omitempty"`
RxPackets *float64 `json:"rxPackets,omitempty"`
TxBps *float64 `json:"txBps,omitempty"`
TxBpsMax *float64 `json:"txBpsMax,omitempty"`
TxBpsMin *float64 `json:"txBpsMin,omitempty"`
TxBytes *int `json:"txBytes,omitempty"`
TxDropped *float64 `json:"txDropped,omitempty"`
TxPackets *float64 `json:"txPackets,omitempty"`
}
SystemSystemStatisticsGet200Response struct {
Cluster *SystemSystemStatisticsGet200ResponseCluster `json:"cluster,omitempty"`
Control *SystemSystemStatisticsGet200ResponseControl `json:"control,omitempty"`
CpID *string `json:"cpId,omitempty"`
CPU *SystemSystemStatisticsGet200ResponseCPU `json:"cpu,omitempty"`
Disk *SystemSystemStatisticsGet200ResponseDisk `json:"disk,omitempty"`
Management *SystemSystemStatisticsGet200ResponseManagement `json:"management,omitempty"`
Memory *SystemSystemStatisticsGet200ResponseMemory `json:"memory,omitempty"`
Port0 *SystemSystemStatisticsGet200ResponsePort0 `json:"port0,omitempty"`
Port1 *SystemSystemStatisticsGet200ResponsePort1 `json:"port1,omitempty"`
Port2 *SystemSystemStatisticsGet200ResponsePort2 `json:"port2,omitempty"`
Port3 *SystemSystemStatisticsGet200ResponsePort3 `json:"port3,omitempty"`
Port4 *SystemSystemStatisticsGet200ResponsePort4 `json:"port4,omitempty"`
Port5 *SystemSystemStatisticsGet200ResponsePort5 `json:"port5,omitempty"`
Timestamp *float64 `json:"timestamp,omitempty"`
}
)
// SystemSystemStatisticsGet: Use this API command to retrieve the system statistics.
//
// Required Parameters:
// - ctx (context.Context): Context to use for this request
// - id (UUIDv4): Controller ID
//
// Optional Parameter Map:
// - interval (string): Interval, only valid of (QUARTER, HOUR, DAY).
// - size (integer): Size, list size to response.
//
// Returns:
// - *http.Response: HTTP Response or nil on error
// - SystemSystemStatisticsGet200ResponseSlice
// - error: Error seen or nil if none
func (c *ControllerAPI) SystemSystemStatisticsGet(ctx context.Context, id string, optionalParams map[string]string) (*http.Response, SystemSystemStatisticsGet200ResponseSlice, error) {
if ctx == nil {
return nil, nil, errors.New("user context cannot be nil")
}
var err error
err = validators.StrIsUUIDv4(id)
if nil != err {
return nil, nil, fmt.Errorf("parameter \"id\" failed validation check: %s", err)
}
interval, ok := optionalParams["interval"]
if !ok {
interval = "QUARTER"
}
size, ok := optionalParams["size"]
if !ok {
size = "32"
}
request := NewRequest("GET", "/v5_0/controller/{id}/statistics", true)
request.SetPathParameter("id", id)
request.SetQueryParameter("interval", interval)
request.SetQueryParameter("size", size)
out := make(SystemSystemStatisticsGet200ResponseSlice, 0)
httpResponse, _, err := c.client.Ensure(ctx, request, 200, &(out))
return httpResponse, out, err
}