-
Notifications
You must be signed in to change notification settings - Fork 1
/
api_upgrade.go
309 lines (277 loc) · 16.9 KB
/
api_upgrade.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
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 UpgradeAPI struct {
client *Client
}
type (
SystemUpgradeSystemUpgradePost200ResponseClusterOperationProgressBladeProgresssSlice []*SystemUpgradeSystemUpgradePost200ResponseClusterOperationProgressBladeProgresss
SystemUpgradeSystemUpgradePost200ResponseClusterOperationProgressBladeProgresss struct {
BladeUUID *string `json:"bladeUUID,omitempty"`
HostName *string `json:"hostName,omitempty"`
IterationName *string `json:"iterationName,omitempty"`
Progress *float64 `json:"progress,omitempty"`
State *string `json:"state,omitempty"`
}
SystemUpgradeSystemUpgradePost200ResponseClusterOperationProgressPreviousOperationRecord struct {
ErrorMsg *string `json:"errorMsg,omitempty"`
Operation *string `json:"operation,omitempty"`
Success *bool `json:"success,omitempty"`
}
SystemUpgradeSystemUpgradePost200ResponseClusterOperationProgress struct {
BladeProgresss SystemUpgradeSystemUpgradePost200ResponseClusterOperationProgressBladeProgresssSlice `json:"bladeProgresss,omitempty"`
ClusterOperationBlockUI *bool `json:"clusterOperationBlockUI,omitempty"`
ClusterOperationDisplayMsg *string `json:"clusterOperationDisplayMsg,omitempty"`
ClusterSubTaskState *string `json:"clusterSubTaskState,omitempty"`
IsSelfBladeRebooting *bool `json:"isSelfBladeRebooting,omitempty"`
Operation *string `json:"operation,omitempty"`
OverallProgress *float64 `json:"overallProgress,omitempty"`
PreviousOperationRecord *SystemUpgradeSystemUpgradePost200ResponseClusterOperationProgressPreviousOperationRecord `json:"previousOperationRecord,omitempty"`
}
SystemUpgradeSystemUpgradePost200Response struct {
ClusterOperationProgress *SystemUpgradeSystemUpgradePost200ResponseClusterOperationProgress `json:"clusterOperationProgress,omitempty"`
}
)
// SystemUpgradeSystemUpgradePost: Use this API command to do system upgrade
//
// Required Parameters:
// - ctx (context.Context): Context to use for this request
//
// Returns:
// - *http.Response: HTTP Response or nil on error
// - *SystemUpgradeSystemUpgradePost200Response
// - error: Error seen or nil if none
func (u *UpgradeAPI) SystemUpgradeSystemUpgradePost(ctx context.Context) (*http.Response, *SystemUpgradeSystemUpgradePost200Response, error) {
if ctx == nil {
return nil, nil, errors.New("user context cannot be nil")
}
request := NewRequest("POST", "/v5_0/upgrade", true)
out := &SystemUpgradeSystemUpgradePost200Response{}
httpResponse, _, err := u.client.Ensure(ctx, request, 200, out)
return httpResponse, out, err
}
type (
SystemUpgradeRetriveUpgradeHistoryGet200ResponseListSlice []*SystemUpgradeRetriveUpgradeHistoryGet200ResponseList
SystemUpgradeRetriveUpgradeHistoryGet200ResponseList struct {
ApFwVersion *string `json:"apFwVersion,omitempty"`
CbVersion *string `json:"cbVersion,omitempty"`
DpVersion *string `json:"dpVersion,omitempty"`
ElapsedSeconds *float64 `json:"elapsedSeconds,omitempty"`
FileName *string `json:"fileName,omitempty"`
OldApFwVersion *string `json:"oldApFwVersion,omitempty"`
OldCbVersion *string `json:"oldCbVersion,omitempty"`
OldDpVersion *string `json:"oldDpVersion,omitempty"`
OldVersion *string `json:"oldVersion,omitempty"`
StartTime *string `json:"startTime,omitempty"`
Version *string `json:"version,omitempty"`
}
SystemUpgradeRetriveUpgradeHistoryGet200Response struct {
FirstIndex *int `json:"firstIndex,omitempty"`
HasMore *bool `json:"hasMore,omitempty"`
List SystemUpgradeRetriveUpgradeHistoryGet200ResponseListSlice `json:"list,omitempty"`
TotalCount *int `json:"totalCount,omitempty"`
}
)
// SystemUpgradeRetriveUpgradeHistoryGet: Use this API command to retrive upgrade history
//
// Required Parameters:
// - ctx (context.Context): Context to use for this request
//
// Optional Parameter Map:
// - index (integer): The index of the first entry to be retrieved.
// - listSize (integer): The maximum number of entries to be retrieved.
// - timezone (string)
//
// Returns:
// - *http.Response: HTTP Response or nil on error
// - *SystemUpgradeRetriveUpgradeHistoryGet200Response
// - error: Error seen or nil if none
func (u *UpgradeAPI) SystemUpgradeRetriveUpgradeHistoryGet(ctx context.Context, optionalParams map[string]string) (*http.Response, *SystemUpgradeRetriveUpgradeHistoryGet200Response, error) {
if ctx == nil {
return nil, nil, errors.New("user context cannot be nil")
}
var err error
index, ok := optionalParams["index"]
if ok {
err = validators.StrIsPositiveInt(index)
if nil != err {
return nil, nil, fmt.Errorf("parameter \"index\" failed validation check: %s", err)
}
} else {
index = "0"
}
listSize, ok := optionalParams["listSize"]
if ok {
err = validators.StrIsPositiveInt(listSize)
if nil != err {
return nil, nil, fmt.Errorf("parameter \"listSize\" failed validation check: %s", err)
}
} else {
listSize = "100"
}
request := NewRequest("GET", "/v5_0/upgrade/history", true)
request.SetQueryParameter("index", index)
request.SetQueryParameter("listSize", listSize)
request.SetQueryParameter("timezone", optionalParams["timezone"])
out := &SystemUpgradeRetriveUpgradeHistoryGet200Response{}
httpResponse, _, err := u.client.Ensure(ctx, request, 200, out)
return httpResponse, out, err
}
type (
SystemUpgradeRetriveUploadPatchInfoGet200ResponseClusterOperationProgressBladeProgresssSlice []*SystemUpgradeRetriveUploadPatchInfoGet200ResponseClusterOperationProgressBladeProgresss
SystemUpgradeRetriveUploadPatchInfoGet200ResponseClusterOperationProgressBladeProgresss struct {
BladeUUID *string `json:"bladeUUID,omitempty"`
HostName *string `json:"hostName,omitempty"`
IterationName *string `json:"iterationName,omitempty"`
Progress *float64 `json:"progress,omitempty"`
State *string `json:"state,omitempty"`
}
SystemUpgradeRetriveUploadPatchInfoGet200ResponseClusterOperationProgressPreviousOperationRecord struct {
ErrorMsg *string `json:"errorMsg,omitempty"`
Operation *string `json:"operation,omitempty"`
Success *bool `json:"success,omitempty"`
}
SystemUpgradeRetriveUploadPatchInfoGet200ResponseClusterOperationProgress struct {
BladeProgresss SystemUpgradeRetriveUploadPatchInfoGet200ResponseClusterOperationProgressBladeProgresssSlice `json:"bladeProgresss,omitempty"`
ClusterOperationBlockUI *bool `json:"clusterOperationBlockUI,omitempty"`
ClusterOperationDisplayMsg *string `json:"clusterOperationDisplayMsg,omitempty"`
ClusterSubTaskState *string `json:"clusterSubTaskState,omitempty"`
IsSelfBladeRebooting *bool `json:"isSelfBladeRebooting,omitempty"`
Operation *string `json:"operation,omitempty"`
OverallProgress *float64 `json:"overallProgress,omitempty"`
PreviousOperationRecord *SystemUpgradeRetriveUploadPatchInfoGet200ResponseClusterOperationProgressPreviousOperationRecord `json:"previousOperationRecord,omitempty"`
}
SystemUpgradeRetriveUploadPatchInfoGet200ResponseUploadPatchInfoAllowVersionsSlice []string
SystemUpgradeRetriveUploadPatchInfoGet200ResponseUploadPatchInfo struct {
AllowVersions SystemUpgradeRetriveUploadPatchInfoGet200ResponseUploadPatchInfoAllowVersionsSlice `json:"allowVersions,omitempty"`
ApVersion *string `json:"apVersion,omitempty"`
ControlbladeVersion *string `json:"controlbladeVersion,omitempty"`
DatabladeVersion *string `json:"databladeVersion,omitempty"`
FileName *string `json:"fileName,omitempty"`
FileSize *float64 `json:"fileSize,omitempty"`
FileUploadPath *string `json:"fileUploadPath,omitempty"`
Version *string `json:"version,omitempty"`
}
SystemUpgradeRetriveUploadPatchInfoGet200Response struct {
ClusterOperationProgress *SystemUpgradeRetriveUploadPatchInfoGet200ResponseClusterOperationProgress `json:"clusterOperationProgress,omitempty"`
UploadPatchInfo *SystemUpgradeRetriveUploadPatchInfoGet200ResponseUploadPatchInfo `json:"uploadPatchInfo,omitempty"`
}
)
// SystemUpgradeRetriveUploadPatchInfoGet: Use this API command to retrive upload file Info
//
// Required Parameters:
// - ctx (context.Context): Context to use for this request
//
// Returns:
// - *http.Response: HTTP Response or nil on error
// - *SystemUpgradeRetriveUploadPatchInfoGet200Response
// - error: Error seen or nil if none
func (u *UpgradeAPI) SystemUpgradeRetriveUploadPatchInfoGet(ctx context.Context) (*http.Response, *SystemUpgradeRetriveUploadPatchInfoGet200Response, error) {
if ctx == nil {
return nil, nil, errors.New("user context cannot be nil")
}
request := NewRequest("GET", "/v5_0/upgrade/patch", true)
out := &SystemUpgradeRetriveUploadPatchInfoGet200Response{}
httpResponse, _, err := u.client.Ensure(ctx, request, 200, out)
return httpResponse, out, err
}
type (
SystemUpgradeRetriveClusterProgressStatusGet200ResponseClusterOperationProgressBladeProgresssSlice []*SystemUpgradeRetriveClusterProgressStatusGet200ResponseClusterOperationProgressBladeProgresss
SystemUpgradeRetriveClusterProgressStatusGet200ResponseClusterOperationProgressBladeProgresss struct {
BladeUUID *string `json:"bladeUUID,omitempty"`
HostName *string `json:"hostName,omitempty"`
IterationName *string `json:"iterationName,omitempty"`
Progress *float64 `json:"progress,omitempty"`
State *string `json:"state,omitempty"`
}
SystemUpgradeRetriveClusterProgressStatusGet200ResponseClusterOperationProgressPreviousOperationRecord struct {
ErrorMsg *string `json:"errorMsg,omitempty"`
Operation *string `json:"operation,omitempty"`
Success *bool `json:"success,omitempty"`
}
SystemUpgradeRetriveClusterProgressStatusGet200ResponseClusterOperationProgress struct {
BladeProgresss SystemUpgradeRetriveClusterProgressStatusGet200ResponseClusterOperationProgressBladeProgresssSlice `json:"bladeProgresss,omitempty"`
ClusterOperationBlockUI *bool `json:"clusterOperationBlockUI,omitempty"`
ClusterOperationDisplayMsg *string `json:"clusterOperationDisplayMsg,omitempty"`
ClusterSubTaskState *string `json:"clusterSubTaskState,omitempty"`
IsSelfBladeRebooting *bool `json:"isSelfBladeRebooting,omitempty"`
Operation *string `json:"operation,omitempty"`
OverallProgress *float64 `json:"overallProgress,omitempty"`
PreviousOperationRecord *SystemUpgradeRetriveClusterProgressStatusGet200ResponseClusterOperationProgressPreviousOperationRecord `json:"previousOperationRecord,omitempty"`
}
SystemUpgradeRetriveClusterProgressStatusGet200Response struct {
ClusterOperationProgress *SystemUpgradeRetriveClusterProgressStatusGet200ResponseClusterOperationProgress `json:"clusterOperationProgress,omitempty"`
}
)
// SystemUpgradeRetriveClusterProgressStatusGet: Use this API command to retrive cluster progress status
//
// Required Parameters:
// - ctx (context.Context): Context to use for this request
//
// Returns:
// - *http.Response: HTTP Response or nil on error
// - *SystemUpgradeRetriveClusterProgressStatusGet200Response
// - error: Error seen or nil if none
func (u *UpgradeAPI) SystemUpgradeRetriveClusterProgressStatusGet(ctx context.Context) (*http.Response, *SystemUpgradeRetriveClusterProgressStatusGet200Response, error) {
if ctx == nil {
return nil, nil, errors.New("user context cannot be nil")
}
request := NewRequest("GET", "/v5_0/upgrade/status", true)
out := &SystemUpgradeRetriveClusterProgressStatusGet200Response{}
httpResponse, _, err := u.client.Ensure(ctx, request, 200, out)
return httpResponse, out, err
}
type (
SystemUpgradeUploadFilePost200ResponseClusterOperationProgressBladeProgresssSlice []*SystemUpgradeUploadFilePost200ResponseClusterOperationProgressBladeProgresss
SystemUpgradeUploadFilePost200ResponseClusterOperationProgressBladeProgresss struct {
BladeUUID *string `json:"bladeUUID,omitempty"`
HostName *string `json:"hostName,omitempty"`
IterationName *string `json:"iterationName,omitempty"`
Progress *float64 `json:"progress,omitempty"`
State *string `json:"state,omitempty"`
}
SystemUpgradeUploadFilePost200ResponseClusterOperationProgressPreviousOperationRecord struct {
ErrorMsg *string `json:"errorMsg,omitempty"`
Operation *string `json:"operation,omitempty"`
Success *bool `json:"success,omitempty"`
}
SystemUpgradeUploadFilePost200ResponseClusterOperationProgress struct {
BladeProgresss SystemUpgradeUploadFilePost200ResponseClusterOperationProgressBladeProgresssSlice `json:"bladeProgresss,omitempty"`
ClusterOperationBlockUI *bool `json:"clusterOperationBlockUI,omitempty"`
ClusterOperationDisplayMsg *string `json:"clusterOperationDisplayMsg,omitempty"`
ClusterSubTaskState *string `json:"clusterSubTaskState,omitempty"`
IsSelfBladeRebooting *bool `json:"isSelfBladeRebooting,omitempty"`
Operation *string `json:"operation,omitempty"`
OverallProgress *float64 `json:"overallProgress,omitempty"`
PreviousOperationRecord *SystemUpgradeUploadFilePost200ResponseClusterOperationProgressPreviousOperationRecord `json:"previousOperationRecord,omitempty"`
}
SystemUpgradeUploadFilePost200Response struct {
ClusterOperationProgress *SystemUpgradeUploadFilePost200ResponseClusterOperationProgress `json:"clusterOperationProgress,omitempty"`
}
)
// SystemUpgradeUploadFilePost: Use this API command to upload patch file
//
// Required Parameters:
// - ctx (context.Context): Context to use for this request
//
// Returns:
// - *http.Response: HTTP Response or nil on error
// - *SystemUpgradeUploadFilePost200Response
// - error: Error seen or nil if none
func (u *UpgradeAPI) SystemUpgradeUploadFilePost(ctx context.Context) (*http.Response, *SystemUpgradeUploadFilePost200Response, error) {
if ctx == nil {
return nil, nil, errors.New("user context cannot be nil")
}
request := NewRequest("POST", "/v5_0/upgrade/upload", true)
out := &SystemUpgradeUploadFilePost200Response{}
httpResponse, _, err := u.client.Ensure(ctx, request, 200, out)
return httpResponse, out, err
}