/
api_describe_network_acls.go
597 lines (472 loc) · 18.7 KB
/
api_describe_network_acls.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
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT.
package vpc
import (
"github.com/volcengine/volcengine-go-sdk/volcengine"
"github.com/volcengine/volcengine-go-sdk/volcengine/request"
"github.com/volcengine/volcengine-go-sdk/volcengine/response"
"github.com/volcengine/volcengine-go-sdk/volcengine/volcengineutil"
)
const opDescribeNetworkAclsCommon = "DescribeNetworkAcls"
// DescribeNetworkAclsCommonRequest generates a "volcengine/request.Request" representing the
// client's request for the DescribeNetworkAclsCommon operation. The "output" return
// value will be populated with the DescribeNetworkAclsCommon request's response once the request completes
// successfully.
//
// Use "Send" method on the returned DescribeNetworkAclsCommon Request to send the API call to the service.
// the "output" return value is not valid until after DescribeNetworkAclsCommon Send returns without error.
//
// See DescribeNetworkAclsCommon for more information on using the DescribeNetworkAclsCommon
// API call, and error handling.
//
// // Example sending a request using the DescribeNetworkAclsCommonRequest method.
// req, resp := client.DescribeNetworkAclsCommonRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *VPC) DescribeNetworkAclsCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) {
op := &request.Operation{
Name: opDescribeNetworkAclsCommon,
HTTPMethod: "GET",
HTTPPath: "/",
}
if input == nil {
input = &map[string]interface{}{}
}
output = &map[string]interface{}{}
req = c.newRequest(op, input, output)
return
}
// DescribeNetworkAclsCommon API operation for VPC.
//
// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions
// with volcengineerr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the VOLCENGINE API reference guide for VPC's
// API operation DescribeNetworkAclsCommon for usage and error information.
func (c *VPC) DescribeNetworkAclsCommon(input *map[string]interface{}) (*map[string]interface{}, error) {
req, out := c.DescribeNetworkAclsCommonRequest(input)
return out, req.Send()
}
// DescribeNetworkAclsCommonWithContext is the same as DescribeNetworkAclsCommon with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeNetworkAclsCommon for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur.
// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *VPC) DescribeNetworkAclsCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) {
req, out := c.DescribeNetworkAclsCommonRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDescribeNetworkAcls = "DescribeNetworkAcls"
// DescribeNetworkAclsRequest generates a "volcengine/request.Request" representing the
// client's request for the DescribeNetworkAcls operation. The "output" return
// value will be populated with the DescribeNetworkAclsCommon request's response once the request completes
// successfully.
//
// Use "Send" method on the returned DescribeNetworkAclsCommon Request to send the API call to the service.
// the "output" return value is not valid until after DescribeNetworkAclsCommon Send returns without error.
//
// See DescribeNetworkAcls for more information on using the DescribeNetworkAcls
// API call, and error handling.
//
// // Example sending a request using the DescribeNetworkAclsRequest method.
// req, resp := client.DescribeNetworkAclsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *VPC) DescribeNetworkAclsRequest(input *DescribeNetworkAclsInput) (req *request.Request, output *DescribeNetworkAclsOutput) {
op := &request.Operation{
Name: opDescribeNetworkAcls,
HTTPMethod: "GET",
HTTPPath: "/",
}
if input == nil {
input = &DescribeNetworkAclsInput{}
}
output = &DescribeNetworkAclsOutput{}
req = c.newRequest(op, input, output)
return
}
// DescribeNetworkAcls API operation for VPC.
//
// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions
// with volcengineerr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the VOLCENGINE API reference guide for VPC's
// API operation DescribeNetworkAcls for usage and error information.
func (c *VPC) DescribeNetworkAcls(input *DescribeNetworkAclsInput) (*DescribeNetworkAclsOutput, error) {
req, out := c.DescribeNetworkAclsRequest(input)
return out, req.Send()
}
// DescribeNetworkAclsWithContext is the same as DescribeNetworkAcls with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeNetworkAcls for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. Ifthe context is nil a panic will occur.
// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *VPC) DescribeNetworkAclsWithContext(ctx volcengine.Context, input *DescribeNetworkAclsInput, opts ...request.Option) (*DescribeNetworkAclsOutput, error) {
req, out := c.DescribeNetworkAclsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
type DescribeNetworkAclsInput struct {
_ struct{} `type:"structure"`
MaxResults *int64 `min:"1" max:"100" type:"integer"`
NetworkAclIds []*string `type:"list"`
NetworkAclName *string `type:"string"`
NextToken *string `type:"string"`
PageNumber *int64 `type:"integer"`
PageSize *int64 `max:"100" type:"integer"`
ProjectName *string `type:"string"`
SubnetId *string `type:"string"`
VpcId *string `type:"string"`
}
// String returns the string representation
func (s DescribeNetworkAclsInput) String() string {
return volcengineutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeNetworkAclsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeNetworkAclsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeNetworkAclsInput"}
if s.MaxResults != nil && *s.MaxResults < 1 {
invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
}
if s.MaxResults != nil && *s.MaxResults > 100 {
invalidParams.Add(request.NewErrParamMaxValue("MaxResults", 100))
}
if s.PageSize != nil && *s.PageSize > 100 {
invalidParams.Add(request.NewErrParamMaxValue("PageSize", 100))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetMaxResults sets the MaxResults field's value.
func (s *DescribeNetworkAclsInput) SetMaxResults(v int64) *DescribeNetworkAclsInput {
s.MaxResults = &v
return s
}
// SetNetworkAclIds sets the NetworkAclIds field's value.
func (s *DescribeNetworkAclsInput) SetNetworkAclIds(v []*string) *DescribeNetworkAclsInput {
s.NetworkAclIds = v
return s
}
// SetNetworkAclName sets the NetworkAclName field's value.
func (s *DescribeNetworkAclsInput) SetNetworkAclName(v string) *DescribeNetworkAclsInput {
s.NetworkAclName = &v
return s
}
// SetNextToken sets the NextToken field's value.
func (s *DescribeNetworkAclsInput) SetNextToken(v string) *DescribeNetworkAclsInput {
s.NextToken = &v
return s
}
// SetPageNumber sets the PageNumber field's value.
func (s *DescribeNetworkAclsInput) SetPageNumber(v int64) *DescribeNetworkAclsInput {
s.PageNumber = &v
return s
}
// SetPageSize sets the PageSize field's value.
func (s *DescribeNetworkAclsInput) SetPageSize(v int64) *DescribeNetworkAclsInput {
s.PageSize = &v
return s
}
// SetProjectName sets the ProjectName field's value.
func (s *DescribeNetworkAclsInput) SetProjectName(v string) *DescribeNetworkAclsInput {
s.ProjectName = &v
return s
}
// SetSubnetId sets the SubnetId field's value.
func (s *DescribeNetworkAclsInput) SetSubnetId(v string) *DescribeNetworkAclsInput {
s.SubnetId = &v
return s
}
// SetVpcId sets the VpcId field's value.
func (s *DescribeNetworkAclsInput) SetVpcId(v string) *DescribeNetworkAclsInput {
s.VpcId = &v
return s
}
type DescribeNetworkAclsOutput struct {
_ struct{} `type:"structure"`
Metadata *response.ResponseMetadata
NetworkAcls []*NetworkAclForDescribeNetworkAclsOutput `type:"list"`
NextToken *string `type:"string"`
PageNumber *int64 `type:"integer"`
PageSize *int64 `type:"integer"`
RequestId *string `type:"string"`
TotalCount *int64 `type:"integer"`
}
// String returns the string representation
func (s DescribeNetworkAclsOutput) String() string {
return volcengineutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeNetworkAclsOutput) GoString() string {
return s.String()
}
// SetNetworkAcls sets the NetworkAcls field's value.
func (s *DescribeNetworkAclsOutput) SetNetworkAcls(v []*NetworkAclForDescribeNetworkAclsOutput) *DescribeNetworkAclsOutput {
s.NetworkAcls = v
return s
}
// SetNextToken sets the NextToken field's value.
func (s *DescribeNetworkAclsOutput) SetNextToken(v string) *DescribeNetworkAclsOutput {
s.NextToken = &v
return s
}
// SetPageNumber sets the PageNumber field's value.
func (s *DescribeNetworkAclsOutput) SetPageNumber(v int64) *DescribeNetworkAclsOutput {
s.PageNumber = &v
return s
}
// SetPageSize sets the PageSize field's value.
func (s *DescribeNetworkAclsOutput) SetPageSize(v int64) *DescribeNetworkAclsOutput {
s.PageSize = &v
return s
}
// SetRequestId sets the RequestId field's value.
func (s *DescribeNetworkAclsOutput) SetRequestId(v string) *DescribeNetworkAclsOutput {
s.RequestId = &v
return s
}
// SetTotalCount sets the TotalCount field's value.
func (s *DescribeNetworkAclsOutput) SetTotalCount(v int64) *DescribeNetworkAclsOutput {
s.TotalCount = &v
return s
}
type EgressAclEntryForDescribeNetworkAclsOutput struct {
_ struct{} `type:"structure"`
Description *string `type:"string"`
DestinationCidrIp *string `type:"string"`
NetworkAclEntryId *string `type:"string"`
NetworkAclEntryName *string `type:"string"`
Policy *string `type:"string"`
Port *string `type:"string"`
Priority *int64 `type:"integer"`
Protocol *string `type:"string"`
}
// String returns the string representation
func (s EgressAclEntryForDescribeNetworkAclsOutput) String() string {
return volcengineutil.Prettify(s)
}
// GoString returns the string representation
func (s EgressAclEntryForDescribeNetworkAclsOutput) GoString() string {
return s.String()
}
// SetDescription sets the Description field's value.
func (s *EgressAclEntryForDescribeNetworkAclsOutput) SetDescription(v string) *EgressAclEntryForDescribeNetworkAclsOutput {
s.Description = &v
return s
}
// SetDestinationCidrIp sets the DestinationCidrIp field's value.
func (s *EgressAclEntryForDescribeNetworkAclsOutput) SetDestinationCidrIp(v string) *EgressAclEntryForDescribeNetworkAclsOutput {
s.DestinationCidrIp = &v
return s
}
// SetNetworkAclEntryId sets the NetworkAclEntryId field's value.
func (s *EgressAclEntryForDescribeNetworkAclsOutput) SetNetworkAclEntryId(v string) *EgressAclEntryForDescribeNetworkAclsOutput {
s.NetworkAclEntryId = &v
return s
}
// SetNetworkAclEntryName sets the NetworkAclEntryName field's value.
func (s *EgressAclEntryForDescribeNetworkAclsOutput) SetNetworkAclEntryName(v string) *EgressAclEntryForDescribeNetworkAclsOutput {
s.NetworkAclEntryName = &v
return s
}
// SetPolicy sets the Policy field's value.
func (s *EgressAclEntryForDescribeNetworkAclsOutput) SetPolicy(v string) *EgressAclEntryForDescribeNetworkAclsOutput {
s.Policy = &v
return s
}
// SetPort sets the Port field's value.
func (s *EgressAclEntryForDescribeNetworkAclsOutput) SetPort(v string) *EgressAclEntryForDescribeNetworkAclsOutput {
s.Port = &v
return s
}
// SetPriority sets the Priority field's value.
func (s *EgressAclEntryForDescribeNetworkAclsOutput) SetPriority(v int64) *EgressAclEntryForDescribeNetworkAclsOutput {
s.Priority = &v
return s
}
// SetProtocol sets the Protocol field's value.
func (s *EgressAclEntryForDescribeNetworkAclsOutput) SetProtocol(v string) *EgressAclEntryForDescribeNetworkAclsOutput {
s.Protocol = &v
return s
}
type IngressAclEntryForDescribeNetworkAclsOutput struct {
_ struct{} `type:"structure"`
Description *string `type:"string"`
NetworkAclEntryId *string `type:"string"`
NetworkAclEntryName *string `type:"string"`
Policy *string `type:"string"`
Port *string `type:"string"`
Priority *int64 `type:"integer"`
Protocol *string `type:"string"`
SourceCidrIp *string `type:"string"`
}
// String returns the string representation
func (s IngressAclEntryForDescribeNetworkAclsOutput) String() string {
return volcengineutil.Prettify(s)
}
// GoString returns the string representation
func (s IngressAclEntryForDescribeNetworkAclsOutput) GoString() string {
return s.String()
}
// SetDescription sets the Description field's value.
func (s *IngressAclEntryForDescribeNetworkAclsOutput) SetDescription(v string) *IngressAclEntryForDescribeNetworkAclsOutput {
s.Description = &v
return s
}
// SetNetworkAclEntryId sets the NetworkAclEntryId field's value.
func (s *IngressAclEntryForDescribeNetworkAclsOutput) SetNetworkAclEntryId(v string) *IngressAclEntryForDescribeNetworkAclsOutput {
s.NetworkAclEntryId = &v
return s
}
// SetNetworkAclEntryName sets the NetworkAclEntryName field's value.
func (s *IngressAclEntryForDescribeNetworkAclsOutput) SetNetworkAclEntryName(v string) *IngressAclEntryForDescribeNetworkAclsOutput {
s.NetworkAclEntryName = &v
return s
}
// SetPolicy sets the Policy field's value.
func (s *IngressAclEntryForDescribeNetworkAclsOutput) SetPolicy(v string) *IngressAclEntryForDescribeNetworkAclsOutput {
s.Policy = &v
return s
}
// SetPort sets the Port field's value.
func (s *IngressAclEntryForDescribeNetworkAclsOutput) SetPort(v string) *IngressAclEntryForDescribeNetworkAclsOutput {
s.Port = &v
return s
}
// SetPriority sets the Priority field's value.
func (s *IngressAclEntryForDescribeNetworkAclsOutput) SetPriority(v int64) *IngressAclEntryForDescribeNetworkAclsOutput {
s.Priority = &v
return s
}
// SetProtocol sets the Protocol field's value.
func (s *IngressAclEntryForDescribeNetworkAclsOutput) SetProtocol(v string) *IngressAclEntryForDescribeNetworkAclsOutput {
s.Protocol = &v
return s
}
// SetSourceCidrIp sets the SourceCidrIp field's value.
func (s *IngressAclEntryForDescribeNetworkAclsOutput) SetSourceCidrIp(v string) *IngressAclEntryForDescribeNetworkAclsOutput {
s.SourceCidrIp = &v
return s
}
type NetworkAclForDescribeNetworkAclsOutput struct {
_ struct{} `type:"structure"`
CreationTime *string `type:"string"`
Description *string `type:"string"`
EgressAclEntries []*EgressAclEntryForDescribeNetworkAclsOutput `type:"list"`
IngressAclEntries []*IngressAclEntryForDescribeNetworkAclsOutput `type:"list"`
NetworkAclId *string `type:"string"`
NetworkAclName *string `type:"string"`
ProjectName *string `type:"string"`
Resources []*ResourceForDescribeNetworkAclsOutput `type:"list"`
Status *string `type:"string"`
UpdateTime *string `type:"string"`
VpcId *string `type:"string"`
}
// String returns the string representation
func (s NetworkAclForDescribeNetworkAclsOutput) String() string {
return volcengineutil.Prettify(s)
}
// GoString returns the string representation
func (s NetworkAclForDescribeNetworkAclsOutput) GoString() string {
return s.String()
}
// SetCreationTime sets the CreationTime field's value.
func (s *NetworkAclForDescribeNetworkAclsOutput) SetCreationTime(v string) *NetworkAclForDescribeNetworkAclsOutput {
s.CreationTime = &v
return s
}
// SetDescription sets the Description field's value.
func (s *NetworkAclForDescribeNetworkAclsOutput) SetDescription(v string) *NetworkAclForDescribeNetworkAclsOutput {
s.Description = &v
return s
}
// SetEgressAclEntries sets the EgressAclEntries field's value.
func (s *NetworkAclForDescribeNetworkAclsOutput) SetEgressAclEntries(v []*EgressAclEntryForDescribeNetworkAclsOutput) *NetworkAclForDescribeNetworkAclsOutput {
s.EgressAclEntries = v
return s
}
// SetIngressAclEntries sets the IngressAclEntries field's value.
func (s *NetworkAclForDescribeNetworkAclsOutput) SetIngressAclEntries(v []*IngressAclEntryForDescribeNetworkAclsOutput) *NetworkAclForDescribeNetworkAclsOutput {
s.IngressAclEntries = v
return s
}
// SetNetworkAclId sets the NetworkAclId field's value.
func (s *NetworkAclForDescribeNetworkAclsOutput) SetNetworkAclId(v string) *NetworkAclForDescribeNetworkAclsOutput {
s.NetworkAclId = &v
return s
}
// SetNetworkAclName sets the NetworkAclName field's value.
func (s *NetworkAclForDescribeNetworkAclsOutput) SetNetworkAclName(v string) *NetworkAclForDescribeNetworkAclsOutput {
s.NetworkAclName = &v
return s
}
// SetProjectName sets the ProjectName field's value.
func (s *NetworkAclForDescribeNetworkAclsOutput) SetProjectName(v string) *NetworkAclForDescribeNetworkAclsOutput {
s.ProjectName = &v
return s
}
// SetResources sets the Resources field's value.
func (s *NetworkAclForDescribeNetworkAclsOutput) SetResources(v []*ResourceForDescribeNetworkAclsOutput) *NetworkAclForDescribeNetworkAclsOutput {
s.Resources = v
return s
}
// SetStatus sets the Status field's value.
func (s *NetworkAclForDescribeNetworkAclsOutput) SetStatus(v string) *NetworkAclForDescribeNetworkAclsOutput {
s.Status = &v
return s
}
// SetUpdateTime sets the UpdateTime field's value.
func (s *NetworkAclForDescribeNetworkAclsOutput) SetUpdateTime(v string) *NetworkAclForDescribeNetworkAclsOutput {
s.UpdateTime = &v
return s
}
// SetVpcId sets the VpcId field's value.
func (s *NetworkAclForDescribeNetworkAclsOutput) SetVpcId(v string) *NetworkAclForDescribeNetworkAclsOutput {
s.VpcId = &v
return s
}
type ResourceForDescribeNetworkAclsOutput struct {
_ struct{} `type:"structure"`
ResourceId *string `type:"string"`
Status *string `type:"string"`
}
// String returns the string representation
func (s ResourceForDescribeNetworkAclsOutput) String() string {
return volcengineutil.Prettify(s)
}
// GoString returns the string representation
func (s ResourceForDescribeNetworkAclsOutput) GoString() string {
return s.String()
}
// SetResourceId sets the ResourceId field's value.
func (s *ResourceForDescribeNetworkAclsOutput) SetResourceId(v string) *ResourceForDescribeNetworkAclsOutput {
s.ResourceId = &v
return s
}
// SetStatus sets the Status field's value.
func (s *ResourceForDescribeNetworkAclsOutput) SetStatus(v string) *ResourceForDescribeNetworkAclsOutput {
s.Status = &v
return s
}