-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
endpoint_client.go
378 lines (321 loc) · 11.1 KB
/
endpoint_client.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
// Code generated by go-swagger; DO NOT EDIT.
package endpoint
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
)
// New creates a new endpoint API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
return &Client{transport: transport, formats: formats}
}
/*
Client for endpoint API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
/*
DeleteEndpointID deletes endpoint
Deletes the endpoint specified by the ID. Deletion is imminent and
atomic, if the deletion request is valid and the endpoint exists,
deletion will occur even if errors are encountered in the process. If
errors have been encountered, the code 202 will be returned, otherwise
200 on success.
All resources associated with the endpoint will be freed and the
workload represented by the endpoint will be disconnected.It will no
longer be able to initiate or receive communications of any sort.
*/
func (a *Client) DeleteEndpointID(params *DeleteEndpointIDParams) (*DeleteEndpointIDOK, *DeleteEndpointIDErrors, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteEndpointIDParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "DeleteEndpointID",
Method: "DELETE",
PathPattern: "/endpoint/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &DeleteEndpointIDReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, nil, err
}
switch value := result.(type) {
case *DeleteEndpointIDOK:
return value, nil, nil
case *DeleteEndpointIDErrors:
return nil, value, nil
}
return nil, nil, nil
}
/*
GetEndpoint retrieves a list of endpoints that have metadata matching the provided parameters
Retrieves a list of endpoints that have metadata matching the provided parameters, or all endpoints if no parameters provided.
*/
func (a *Client) GetEndpoint(params *GetEndpointParams) (*GetEndpointOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetEndpointParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "GetEndpoint",
Method: "GET",
PathPattern: "/endpoint",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetEndpointReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*GetEndpointOK), nil
}
/*
GetEndpointID gets endpoint by endpoint ID
Returns endpoint information
*/
func (a *Client) GetEndpointID(params *GetEndpointIDParams) (*GetEndpointIDOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetEndpointIDParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "GetEndpointID",
Method: "GET",
PathPattern: "/endpoint/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetEndpointIDReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*GetEndpointIDOK), nil
}
/*
GetEndpointIDConfig retrieves endpoint configuration
Retrieves the configuration of the specified endpoint.
*/
func (a *Client) GetEndpointIDConfig(params *GetEndpointIDConfigParams) (*GetEndpointIDConfigOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetEndpointIDConfigParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "GetEndpointIDConfig",
Method: "GET",
PathPattern: "/endpoint/{id}/config",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetEndpointIDConfigReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*GetEndpointIDConfigOK), nil
}
/*
GetEndpointIDHealthz retrieves the status logs associated with this endpoint
*/
func (a *Client) GetEndpointIDHealthz(params *GetEndpointIDHealthzParams) (*GetEndpointIDHealthzOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetEndpointIDHealthzParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "GetEndpointIDHealthz",
Method: "GET",
PathPattern: "/endpoint/{id}/healthz",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetEndpointIDHealthzReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*GetEndpointIDHealthzOK), nil
}
/*
GetEndpointIDLabels retrieves the list of labels associated with an endpoint
*/
func (a *Client) GetEndpointIDLabels(params *GetEndpointIDLabelsParams) (*GetEndpointIDLabelsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetEndpointIDLabelsParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "GetEndpointIDLabels",
Method: "GET",
PathPattern: "/endpoint/{id}/labels",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetEndpointIDLabelsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*GetEndpointIDLabelsOK), nil
}
/*
GetEndpointIDLog retrieves the status logs associated with this endpoint
*/
func (a *Client) GetEndpointIDLog(params *GetEndpointIDLogParams) (*GetEndpointIDLogOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetEndpointIDLogParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "GetEndpointIDLog",
Method: "GET",
PathPattern: "/endpoint/{id}/log",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetEndpointIDLogReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*GetEndpointIDLogOK), nil
}
/*
PatchEndpointID modifies existing endpoint
Applies the endpoint change request to an existing endpoint
*/
func (a *Client) PatchEndpointID(params *PatchEndpointIDParams) (*PatchEndpointIDOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPatchEndpointIDParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "PatchEndpointID",
Method: "PATCH",
PathPattern: "/endpoint/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PatchEndpointIDReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*PatchEndpointIDOK), nil
}
/*
PatchEndpointIDConfig modifies mutable endpoint configuration
Update the configuration of an existing endpoint and regenerates &
recompiles the corresponding programs automatically.
*/
func (a *Client) PatchEndpointIDConfig(params *PatchEndpointIDConfigParams) (*PatchEndpointIDConfigOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPatchEndpointIDConfigParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "PatchEndpointIDConfig",
Method: "PATCH",
PathPattern: "/endpoint/{id}/config",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PatchEndpointIDConfigReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*PatchEndpointIDConfigOK), nil
}
/*
PatchEndpointIDLabels sets label configuration of endpoint
Sets labels associated with an endpoint. These can be user provided or
derived from the orchestration system.
*/
func (a *Client) PatchEndpointIDLabels(params *PatchEndpointIDLabelsParams) (*PatchEndpointIDLabelsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPatchEndpointIDLabelsParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "PatchEndpointIDLabels",
Method: "PATCH",
PathPattern: "/endpoint/{id}/labels",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PatchEndpointIDLabelsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*PatchEndpointIDLabelsOK), nil
}
/*
PutEndpointID creates endpoint
Creates a new endpoint
*/
func (a *Client) PutEndpointID(params *PutEndpointIDParams) (*PutEndpointIDCreated, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPutEndpointIDParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "PutEndpointID",
Method: "PUT",
PathPattern: "/endpoint/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PutEndpointIDReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
return result.(*PutEndpointIDCreated), nil
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}