/
resource_interface_trunk_ipv6.go
861 lines (805 loc) · 31.9 KB
/
resource_interface_trunk_ipv6.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
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
package thunder
import (
"context"
edpt "github.com/a10networks/terraform-provider-thunder/thunder/axapi/endpoint"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
func resourceInterfaceTrunkIpv6() *schema.Resource {
return &schema.Resource{
Description: "`thunder_interface_trunk_ipv6`: Global IPv6 configuration subcommands\n\n__PLACEHOLDER__",
CreateContext: resourceInterfaceTrunkIpv6Create,
UpdateContext: resourceInterfaceTrunkIpv6Update,
ReadContext: resourceInterfaceTrunkIpv6Read,
DeleteContext: resourceInterfaceTrunkIpv6Delete,
Schema: map[string]*schema.Schema{
"access_list_cfg": {
Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"v6_acl_name": {
Type: schema.TypeString, Optional: true, Description: "Apply ACL rules to incoming packets on this interface (Named Access List)",
},
"inbound": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "ACL applied on incoming packets to this interface",
},
},
},
},
"address_list": {
Type: schema.TypeList, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"ipv6_addr": {
Type: schema.TypeString, Optional: true, Description: "Set the IPv6 address of an interface",
},
"address_type": {
Type: schema.TypeString, Optional: true, Description: "'anycast': Configure an IPv6 anycast address; 'link-local': Configure an IPv6 link local address;",
},
},
},
},
"ipv6_enable": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Enable IPv6 processing",
},
"nat": {
Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"inside": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Configure interface as NAT inside",
},
"outside": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Configure interface as NAT outside",
},
},
},
},
"ospf": {
Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"network_list": {
Type: schema.TypeList, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"broadcast_type": {
Type: schema.TypeString, Optional: true, Description: "'broadcast': Specify OSPF broadcast multi-access network; 'non-broadcast': Specify OSPF NBMA network; 'point-to-point': Specify OSPF point-to-point network; 'point-to-multipoint': Specify OSPF point-to-multipoint network;",
},
"p2mp_nbma": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Specify non-broadcast point-to-multipoint network",
},
"network_instance_id": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Specify the interface instance ID",
},
},
},
},
"bfd": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Bidirectional Forwarding Detection (BFD)",
},
"disable": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Disable BFD",
},
"cost_cfg": {
Type: schema.TypeList, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"cost": {
Type: schema.TypeInt, Optional: true, Description: "Interface cost",
},
"instance_id": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Specify the interface instance ID",
},
},
},
},
"dead_interval_cfg": {
Type: schema.TypeList, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"dead_interval": {
Type: schema.TypeInt, Optional: true, Default: 40, Description: "Interval after which a neighbor is declared dead (Seconds)",
},
"instance_id": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Specify the interface instance ID",
},
},
},
},
"hello_interval_cfg": {
Type: schema.TypeList, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"hello_interval": {
Type: schema.TypeInt, Optional: true, Default: 10, Description: "Time between HELLO packets (Seconds)",
},
"instance_id": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Specify the interface instance ID",
},
},
},
},
"mtu_ignore_cfg": {
Type: schema.TypeList, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"mtu_ignore": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Ignores the MTU in DBD packets",
},
"instance_id": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Specify the interface instance ID",
},
},
},
},
"neighbor_cfg": {
Type: schema.TypeList, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"neighbor": {
Type: schema.TypeString, Optional: true, Default: "::", Description: "OSPFv3 neighbor (Neighbor IPv6 address)",
},
"neig_inst": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Specify the interface instance ID",
},
"neighbor_cost": {
Type: schema.TypeInt, Optional: true, Description: "OSPF cost for point-to-multipoint neighbor (metric)",
},
"neighbor_poll_interval": {
Type: schema.TypeInt, Optional: true, Description: "OSPF dead-router polling interval (Seconds)",
},
"neighbor_priority": {
Type: schema.TypeInt, Optional: true, Description: "OSPF priority of non-broadcast neighbor",
},
},
},
},
"priority_cfg": {
Type: schema.TypeList, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"priority": {
Type: schema.TypeInt, Optional: true, Default: 1, Description: "Router priority",
},
"instance_id": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Specify the interface instance ID",
},
},
},
},
"retransmit_interval_cfg": {
Type: schema.TypeList, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"retransmit_interval": {
Type: schema.TypeInt, Optional: true, Default: 5, Description: "Time between retransmitting lost link state advertisements (Seconds)",
},
"instance_id": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Specify the interface instance ID",
},
},
},
},
"transmit_delay_cfg": {
Type: schema.TypeList, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"transmit_delay": {
Type: schema.TypeInt, Optional: true, Default: 1, Description: "Link state transmit delay (Seconds)",
},
"instance_id": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Specify the interface instance ID",
},
},
},
},
"uuid": {
Type: schema.TypeString, Optional: true, Computed: true, Description: "uuid of the object",
},
},
},
},
"rip": {
Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"split_horizon_cfg": {
Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"state": {
Type: schema.TypeString, Optional: true, Default: "poisoned", Description: "'poisoned': Perform split horizon with poisoned reverse; 'disable': Disable split horizon; 'enable': Perform split horizon without poisoned reverse;",
},
},
},
},
"uuid": {
Type: schema.TypeString, Optional: true, Computed: true, Description: "uuid of the object",
},
},
},
},
"router": {
Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"ripng": {
Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"rip": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "RIP Routing for IPv6",
},
"uuid": {
Type: schema.TypeString, Optional: true, Computed: true, Description: "uuid of the object",
},
},
},
},
"ospf": {
Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"area_list": {
Type: schema.TypeList, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"area_id_num": {
Type: schema.TypeInt, Optional: true, Description: "OSPF area ID as a decimal value",
},
"area_id_addr": {
Type: schema.TypeString, Optional: true, Description: "OSPF area ID in IP address format",
},
"tag": {
Type: schema.TypeString, Optional: true, Description: "Set the OSPFv3 process tag",
},
"instance_id": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Set the interface instance ID",
},
},
},
},
"uuid": {
Type: schema.TypeString, Optional: true, Computed: true, Description: "uuid of the object",
},
},
},
},
"isis": {
Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"tag": {
Type: schema.TypeString, Optional: true, Description: "ISO routing area tag",
},
"uuid": {
Type: schema.TypeString, Optional: true, Computed: true, Description: "uuid of the object",
},
},
},
},
},
},
},
"router_adver": {
Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"action": {
Type: schema.TypeString, Optional: true, Default: "disable", Description: "'enable': Enable Router Advertisements on this interface; 'disable': Disable Router Advertisements on this interface;",
},
"default_lifetime": {
Type: schema.TypeInt, Optional: true, Default: 1800, Description: "Set Router Advertisement Default Lifetime (default: 1800) (Default Lifetime (seconds))",
},
"hop_limit": {
Type: schema.TypeInt, Optional: true, Default: 255, Description: "Set Router Advertisement Hop Limit (default: 255) (Max Router Advertisement Interval (seconds))",
},
"max_interval": {
Type: schema.TypeInt, Optional: true, Default: 600, Description: "Set Router Advertisement Max Interval (default: 600) (Min Router Advertisement Interval (seconds))",
},
"min_interval": {
Type: schema.TypeInt, Optional: true, Default: 200, Description: "Set Router Advertisement Min Interval (default: 200) (Max Number of Router Solicitations to process per second)",
},
"rate_limit": {
Type: schema.TypeInt, Optional: true, Default: 100000, Description: "Rate Limit the processing of incoming Router Solicitations (Max Number of Router Solicitations to process per second)",
},
"reachable_time": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Set Router Advertisement Reachable ime (default: 0) (Reachable Time (milliseconds))",
},
"retransmit_timer": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Set Router Advertisement Retransmit Timer (default: 0)",
},
"mtu": {
Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"adver_mtu_disable": {
Type: schema.TypeInt, Optional: true, Default: 1, Description: "Disable Router Advertisement MTU Option",
},
"adver_mtu": {
Type: schema.TypeInt, Optional: true, Description: "Set Router Advertisement MTU Option",
},
},
},
},
"prefix_list": {
Type: schema.TypeList, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"prefix": {
Type: schema.TypeString, Optional: true, Description: "Set Router Advertisement On-Link Prefix (IPv6 On-Link Prefix)",
},
"not_autonomous": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Specify that the Prefix is not usable for autoconfiguration (default:autonomous)",
},
"not_on_link": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Specify that the Prefix is not On-Link (default: on-link)",
},
"preferred_lifetime": {
Type: schema.TypeInt, Optional: true, Default: 604800, Description: "Specify Prefix Preferred Lifetime (default:604800) (Prefix Advertised Preferred Lifetime (default: 604800))",
},
"valid_lifetime": {
Type: schema.TypeInt, Optional: true, Default: 2592000, Description: "Specify Valid Lifetime (default:2592000) (Prefix Advertised Valid Lifetime (default: 2592000))",
},
},
},
},
"managed_config_action": {
Type: schema.TypeString, Optional: true, Default: "disable", Description: "'enable': Enable the Managed Address Configuration flag; 'disable': Disable the Managed Address Configuration flag (default);",
},
"other_config_action": {
Type: schema.TypeString, Optional: true, Default: "disable", Description: "'enable': Enable the Other Stateful Configuration flag; 'disable': Disable the Other Stateful Configuration flag (default);",
},
"vrid": {
Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"adver_vrid": {
Type: schema.TypeInt, Optional: true, Description: "Specify ha VRRP-A vrid",
},
"use_floating_ip": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Use a floating IP as the source address for Router advertisements",
},
"floating_ip": {
Type: schema.TypeString, Optional: true, Description: "Use a floating IP as the source address for Router advertisements",
},
"adver_vrid_default": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Default VRRP-A vrid",
},
"use_floating_ip_default_vrid": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Use a floating IP as the source address for Router advertisements",
},
"floating_ip_default_vrid": {
Type: schema.TypeString, Optional: true, Description: "Use a floating IP as the source address for Router advertisements",
},
},
},
},
},
},
},
"stateful_firewall": {
Type: schema.TypeList, MaxItems: 1, Optional: true, Description: "",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"inside": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Inside (private) interface for stateful firewall",
},
"class_list": {
Type: schema.TypeString, Optional: true, Description: "Class List (Class List Name)",
},
"outside": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Outside (public) interface for stateful firewall",
},
"access_list": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Access-list for traffic from the outside",
},
"acl_name": {
Type: schema.TypeString, Optional: true, Description: "Access-list Name",
},
"uuid": {
Type: schema.TypeString, Optional: true, Computed: true, Description: "uuid of the object",
},
},
},
},
"ttl_ignore": {
Type: schema.TypeInt, Optional: true, Default: 0, Description: "Ignore TTL decrement for a received packet",
},
"uuid": {
Type: schema.TypeString, Optional: true, Computed: true, Description: "uuid of the object",
},
"ifnum": {
Type: schema.TypeString, Required: true, Description: "Ifnum",
},
},
}
}
func resourceInterfaceTrunkIpv6Create(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
client := meta.(Thunder)
logger := client.log
logger.Println("resourceInterfaceTrunkIpv6Create()")
var diags diag.Diagnostics
if client.Host != "" {
obj := dataToEndpointInterfaceTrunkIpv6(d)
d.SetId(obj.GetId())
err := obj.Post(client.Token, client.Host, logger)
if err != nil {
return diag.FromErr(err)
}
return resourceInterfaceTrunkIpv6Read(ctx, d, meta)
}
return diags
}
func resourceInterfaceTrunkIpv6Update(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
client := meta.(Thunder)
logger := client.log
logger.Println("resourceInterfaceTrunkIpv6Update()")
var diags diag.Diagnostics
if client.Host != "" {
obj := dataToEndpointInterfaceTrunkIpv6(d)
err := obj.Put(client.Token, client.Host, logger)
if err != nil {
return diag.FromErr(err)
}
return resourceInterfaceTrunkIpv6Read(ctx, d, meta)
}
return diags
}
func resourceInterfaceTrunkIpv6Delete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
client := meta.(Thunder)
logger := client.log
logger.Println("resourceInterfaceTrunkIpv6Delete()")
var diags diag.Diagnostics
if client.Host != "" {
obj := dataToEndpointInterfaceTrunkIpv6(d)
err := obj.Delete(client.Token, client.Host, d.Id(), logger)
if err != nil {
return diag.FromErr(err)
}
}
return diags
}
func resourceInterfaceTrunkIpv6Read(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
client := meta.(Thunder)
logger := client.log
logger.Println("resourceInterfaceTrunkIpv6Read()")
var diags diag.Diagnostics
if client.Host != "" {
obj := dataToEndpointInterfaceTrunkIpv6(d)
err := obj.Get(client.Token, client.Host, d.Id(), logger)
if err != nil {
return diag.FromErr(err)
}
}
return diags
}
func getObjectInterfaceTrunkIpv6AccessListCfg(d []interface{}) edpt.InterfaceTrunkIpv6AccessListCfg {
count1 := len(d)
var ret edpt.InterfaceTrunkIpv6AccessListCfg
if count1 > 0 {
in := d[0].(map[string]interface{})
ret.V6AclName = in["v6_acl_name"].(string)
ret.Inbound = in["inbound"].(int)
}
return ret
}
func getSliceInterfaceTrunkIpv6AddressList(d []interface{}) []edpt.InterfaceTrunkIpv6AddressList {
count1 := len(d)
ret := make([]edpt.InterfaceTrunkIpv6AddressList, 0, count1)
for _, item := range d {
in := item.(map[string]interface{})
var oi edpt.InterfaceTrunkIpv6AddressList
oi.Ipv6Addr = in["ipv6_addr"].(string)
oi.AddressType = in["address_type"].(string)
ret = append(ret, oi)
}
return ret
}
func getObjectInterfaceTrunkIpv6Nat(d []interface{}) edpt.InterfaceTrunkIpv6Nat {
count1 := len(d)
var ret edpt.InterfaceTrunkIpv6Nat
if count1 > 0 {
in := d[0].(map[string]interface{})
ret.Inside = in["inside"].(int)
ret.Outside = in["outside"].(int)
}
return ret
}
func getObjectInterfaceTrunkIpv6Ospf762(d []interface{}) edpt.InterfaceTrunkIpv6Ospf762 {
count1 := len(d)
var ret edpt.InterfaceTrunkIpv6Ospf762
if count1 > 0 {
in := d[0].(map[string]interface{})
ret.NetworkList = getSliceInterfaceTrunkIpv6OspfNetworkList763(in["network_list"].([]interface{}))
ret.Bfd = in["bfd"].(int)
ret.Disable = in["disable"].(int)
ret.CostCfg = getSliceInterfaceTrunkIpv6OspfCostCfg764(in["cost_cfg"].([]interface{}))
ret.DeadIntervalCfg = getSliceInterfaceTrunkIpv6OspfDeadIntervalCfg765(in["dead_interval_cfg"].([]interface{}))
ret.HelloIntervalCfg = getSliceInterfaceTrunkIpv6OspfHelloIntervalCfg766(in["hello_interval_cfg"].([]interface{}))
ret.MtuIgnoreCfg = getSliceInterfaceTrunkIpv6OspfMtuIgnoreCfg767(in["mtu_ignore_cfg"].([]interface{}))
ret.NeighborCfg = getSliceInterfaceTrunkIpv6OspfNeighborCfg768(in["neighbor_cfg"].([]interface{}))
ret.PriorityCfg = getSliceInterfaceTrunkIpv6OspfPriorityCfg769(in["priority_cfg"].([]interface{}))
ret.RetransmitIntervalCfg = getSliceInterfaceTrunkIpv6OspfRetransmitIntervalCfg770(in["retransmit_interval_cfg"].([]interface{}))
ret.TransmitDelayCfg = getSliceInterfaceTrunkIpv6OspfTransmitDelayCfg771(in["transmit_delay_cfg"].([]interface{}))
//omit uuid
}
return ret
}
func getSliceInterfaceTrunkIpv6OspfNetworkList763(d []interface{}) []edpt.InterfaceTrunkIpv6OspfNetworkList763 {
count1 := len(d)
ret := make([]edpt.InterfaceTrunkIpv6OspfNetworkList763, 0, count1)
for _, item := range d {
in := item.(map[string]interface{})
var oi edpt.InterfaceTrunkIpv6OspfNetworkList763
oi.BroadcastType = in["broadcast_type"].(string)
oi.P2mpNbma = in["p2mp_nbma"].(int)
oi.NetworkInstanceId = in["network_instance_id"].(int)
ret = append(ret, oi)
}
return ret
}
func getSliceInterfaceTrunkIpv6OspfCostCfg764(d []interface{}) []edpt.InterfaceTrunkIpv6OspfCostCfg764 {
count1 := len(d)
ret := make([]edpt.InterfaceTrunkIpv6OspfCostCfg764, 0, count1)
for _, item := range d {
in := item.(map[string]interface{})
var oi edpt.InterfaceTrunkIpv6OspfCostCfg764
oi.Cost = in["cost"].(int)
oi.InstanceId = in["instance_id"].(int)
ret = append(ret, oi)
}
return ret
}
func getSliceInterfaceTrunkIpv6OspfDeadIntervalCfg765(d []interface{}) []edpt.InterfaceTrunkIpv6OspfDeadIntervalCfg765 {
count1 := len(d)
ret := make([]edpt.InterfaceTrunkIpv6OspfDeadIntervalCfg765, 0, count1)
for _, item := range d {
in := item.(map[string]interface{})
var oi edpt.InterfaceTrunkIpv6OspfDeadIntervalCfg765
oi.DeadInterval = in["dead_interval"].(int)
oi.InstanceId = in["instance_id"].(int)
ret = append(ret, oi)
}
return ret
}
func getSliceInterfaceTrunkIpv6OspfHelloIntervalCfg766(d []interface{}) []edpt.InterfaceTrunkIpv6OspfHelloIntervalCfg766 {
count1 := len(d)
ret := make([]edpt.InterfaceTrunkIpv6OspfHelloIntervalCfg766, 0, count1)
for _, item := range d {
in := item.(map[string]interface{})
var oi edpt.InterfaceTrunkIpv6OspfHelloIntervalCfg766
oi.HelloInterval = in["hello_interval"].(int)
oi.InstanceId = in["instance_id"].(int)
ret = append(ret, oi)
}
return ret
}
func getSliceInterfaceTrunkIpv6OspfMtuIgnoreCfg767(d []interface{}) []edpt.InterfaceTrunkIpv6OspfMtuIgnoreCfg767 {
count1 := len(d)
ret := make([]edpt.InterfaceTrunkIpv6OspfMtuIgnoreCfg767, 0, count1)
for _, item := range d {
in := item.(map[string]interface{})
var oi edpt.InterfaceTrunkIpv6OspfMtuIgnoreCfg767
oi.MtuIgnore = in["mtu_ignore"].(int)
oi.InstanceId = in["instance_id"].(int)
ret = append(ret, oi)
}
return ret
}
func getSliceInterfaceTrunkIpv6OspfNeighborCfg768(d []interface{}) []edpt.InterfaceTrunkIpv6OspfNeighborCfg768 {
count1 := len(d)
ret := make([]edpt.InterfaceTrunkIpv6OspfNeighborCfg768, 0, count1)
for _, item := range d {
in := item.(map[string]interface{})
var oi edpt.InterfaceTrunkIpv6OspfNeighborCfg768
oi.Neighbor = in["neighbor"].(string)
oi.NeigInst = in["neig_inst"].(int)
oi.NeighborCost = in["neighbor_cost"].(int)
oi.NeighborPollInterval = in["neighbor_poll_interval"].(int)
oi.NeighborPriority = in["neighbor_priority"].(int)
ret = append(ret, oi)
}
return ret
}
func getSliceInterfaceTrunkIpv6OspfPriorityCfg769(d []interface{}) []edpt.InterfaceTrunkIpv6OspfPriorityCfg769 {
count1 := len(d)
ret := make([]edpt.InterfaceTrunkIpv6OspfPriorityCfg769, 0, count1)
for _, item := range d {
in := item.(map[string]interface{})
var oi edpt.InterfaceTrunkIpv6OspfPriorityCfg769
oi.Priority = in["priority"].(int)
oi.InstanceId = in["instance_id"].(int)
ret = append(ret, oi)
}
return ret
}
func getSliceInterfaceTrunkIpv6OspfRetransmitIntervalCfg770(d []interface{}) []edpt.InterfaceTrunkIpv6OspfRetransmitIntervalCfg770 {
count1 := len(d)
ret := make([]edpt.InterfaceTrunkIpv6OspfRetransmitIntervalCfg770, 0, count1)
for _, item := range d {
in := item.(map[string]interface{})
var oi edpt.InterfaceTrunkIpv6OspfRetransmitIntervalCfg770
oi.RetransmitInterval = in["retransmit_interval"].(int)
oi.InstanceId = in["instance_id"].(int)
ret = append(ret, oi)
}
return ret
}
func getSliceInterfaceTrunkIpv6OspfTransmitDelayCfg771(d []interface{}) []edpt.InterfaceTrunkIpv6OspfTransmitDelayCfg771 {
count1 := len(d)
ret := make([]edpt.InterfaceTrunkIpv6OspfTransmitDelayCfg771, 0, count1)
for _, item := range d {
in := item.(map[string]interface{})
var oi edpt.InterfaceTrunkIpv6OspfTransmitDelayCfg771
oi.TransmitDelay = in["transmit_delay"].(int)
oi.InstanceId = in["instance_id"].(int)
ret = append(ret, oi)
}
return ret
}
func getObjectInterfaceTrunkIpv6Rip772(d []interface{}) edpt.InterfaceTrunkIpv6Rip772 {
count1 := len(d)
var ret edpt.InterfaceTrunkIpv6Rip772
if count1 > 0 {
in := d[0].(map[string]interface{})
ret.SplitHorizonCfg = getObjectInterfaceTrunkIpv6RipSplitHorizonCfg773(in["split_horizon_cfg"].([]interface{}))
//omit uuid
}
return ret
}
func getObjectInterfaceTrunkIpv6RipSplitHorizonCfg773(d []interface{}) edpt.InterfaceTrunkIpv6RipSplitHorizonCfg773 {
count1 := len(d)
var ret edpt.InterfaceTrunkIpv6RipSplitHorizonCfg773
if count1 > 0 {
in := d[0].(map[string]interface{})
ret.State = in["state"].(string)
}
return ret
}
func getObjectInterfaceTrunkIpv6Router774(d []interface{}) edpt.InterfaceTrunkIpv6Router774 {
count1 := len(d)
var ret edpt.InterfaceTrunkIpv6Router774
if count1 > 0 {
in := d[0].(map[string]interface{})
ret.Ripng = getObjectInterfaceTrunkIpv6RouterRipng775(in["ripng"].([]interface{}))
ret.Ospf = getObjectInterfaceTrunkIpv6RouterOspf776(in["ospf"].([]interface{}))
ret.Isis = getObjectInterfaceTrunkIpv6RouterIsis778(in["isis"].([]interface{}))
}
return ret
}
func getObjectInterfaceTrunkIpv6RouterRipng775(d []interface{}) edpt.InterfaceTrunkIpv6RouterRipng775 {
count1 := len(d)
var ret edpt.InterfaceTrunkIpv6RouterRipng775
if count1 > 0 {
in := d[0].(map[string]interface{})
ret.Rip = in["rip"].(int)
//omit uuid
}
return ret
}
func getObjectInterfaceTrunkIpv6RouterOspf776(d []interface{}) edpt.InterfaceTrunkIpv6RouterOspf776 {
count1 := len(d)
var ret edpt.InterfaceTrunkIpv6RouterOspf776
if count1 > 0 {
in := d[0].(map[string]interface{})
ret.AreaList = getSliceInterfaceTrunkIpv6RouterOspfAreaList777(in["area_list"].([]interface{}))
//omit uuid
}
return ret
}
func getSliceInterfaceTrunkIpv6RouterOspfAreaList777(d []interface{}) []edpt.InterfaceTrunkIpv6RouterOspfAreaList777 {
count1 := len(d)
ret := make([]edpt.InterfaceTrunkIpv6RouterOspfAreaList777, 0, count1)
for _, item := range d {
in := item.(map[string]interface{})
var oi edpt.InterfaceTrunkIpv6RouterOspfAreaList777
oi.AreaIdNum = in["area_id_num"].(int)
oi.AreaIdAddr = in["area_id_addr"].(string)
oi.Tag = in["tag"].(string)
oi.InstanceId = in["instance_id"].(int)
ret = append(ret, oi)
}
return ret
}
func getObjectInterfaceTrunkIpv6RouterIsis778(d []interface{}) edpt.InterfaceTrunkIpv6RouterIsis778 {
count1 := len(d)
var ret edpt.InterfaceTrunkIpv6RouterIsis778
if count1 > 0 {
in := d[0].(map[string]interface{})
ret.Tag = in["tag"].(string)
//omit uuid
}
return ret
}
func getObjectInterfaceTrunkIpv6RouterAdver(d []interface{}) edpt.InterfaceTrunkIpv6RouterAdver {
count1 := len(d)
var ret edpt.InterfaceTrunkIpv6RouterAdver
if count1 > 0 {
in := d[0].(map[string]interface{})
ret.Action = in["action"].(string)
ret.DefaultLifetime = in["default_lifetime"].(int)
ret.HopLimit = in["hop_limit"].(int)
ret.MaxInterval = in["max_interval"].(int)
ret.MinInterval = in["min_interval"].(int)
ret.RateLimit = in["rate_limit"].(int)
ret.ReachableTime = in["reachable_time"].(int)
ret.RetransmitTimer = in["retransmit_timer"].(int)
ret.Mtu = getObjectInterfaceTrunkIpv6RouterAdverMtu(in["mtu"].([]interface{}))
ret.PrefixList = getSliceInterfaceTrunkIpv6RouterAdverPrefixList(in["prefix_list"].([]interface{}))
ret.ManagedConfigAction = in["managed_config_action"].(string)
ret.OtherConfigAction = in["other_config_action"].(string)
ret.Vrid = getObjectInterfaceTrunkIpv6RouterAdverVrid(in["vrid"].([]interface{}))
}
return ret
}
func getObjectInterfaceTrunkIpv6RouterAdverMtu(d []interface{}) edpt.InterfaceTrunkIpv6RouterAdverMtu {
count1 := len(d)
var ret edpt.InterfaceTrunkIpv6RouterAdverMtu
if count1 > 0 {
in := d[0].(map[string]interface{})
ret.AdverMtuDisable = in["adver_mtu_disable"].(int)
ret.AdverMtu = in["adver_mtu"].(int)
}
return ret
}
func getSliceInterfaceTrunkIpv6RouterAdverPrefixList(d []interface{}) []edpt.InterfaceTrunkIpv6RouterAdverPrefixList {
count1 := len(d)
ret := make([]edpt.InterfaceTrunkIpv6RouterAdverPrefixList, 0, count1)
for _, item := range d {
in := item.(map[string]interface{})
var oi edpt.InterfaceTrunkIpv6RouterAdverPrefixList
oi.Prefix = in["prefix"].(string)
oi.NotAutonomous = in["not_autonomous"].(int)
oi.NotOnLink = in["not_on_link"].(int)
oi.PreferredLifetime = in["preferred_lifetime"].(int)
oi.ValidLifetime = in["valid_lifetime"].(int)
ret = append(ret, oi)
}
return ret
}
func getObjectInterfaceTrunkIpv6RouterAdverVrid(d []interface{}) edpt.InterfaceTrunkIpv6RouterAdverVrid {
count1 := len(d)
var ret edpt.InterfaceTrunkIpv6RouterAdverVrid
if count1 > 0 {
in := d[0].(map[string]interface{})
ret.AdverVrid = in["adver_vrid"].(int)
ret.UseFloatingIp = in["use_floating_ip"].(int)
ret.FloatingIp = in["floating_ip"].(string)
ret.AdverVridDefault = in["adver_vrid_default"].(int)
ret.UseFloatingIpDefaultVrid = in["use_floating_ip_default_vrid"].(int)
ret.FloatingIpDefaultVrid = in["floating_ip_default_vrid"].(string)
}
return ret
}
func getObjectInterfaceTrunkIpv6StatefulFirewall779(d []interface{}) edpt.InterfaceTrunkIpv6StatefulFirewall779 {
count1 := len(d)
var ret edpt.InterfaceTrunkIpv6StatefulFirewall779
if count1 > 0 {
in := d[0].(map[string]interface{})
ret.Inside = in["inside"].(int)
ret.ClassList = in["class_list"].(string)
ret.Outside = in["outside"].(int)
ret.AccessList = in["access_list"].(int)
ret.AclName = in["acl_name"].(string)
//omit uuid
}
return ret
}
func dataToEndpointInterfaceTrunkIpv6(d *schema.ResourceData) edpt.InterfaceTrunkIpv6 {
var ret edpt.InterfaceTrunkIpv6
ret.Inst.AccessListCfg = getObjectInterfaceTrunkIpv6AccessListCfg(d.Get("access_list_cfg").([]interface{}))
ret.Inst.AddressList = getSliceInterfaceTrunkIpv6AddressList(d.Get("address_list").([]interface{}))
ret.Inst.Ipv6Enable = d.Get("ipv6_enable").(int)
ret.Inst.Nat = getObjectInterfaceTrunkIpv6Nat(d.Get("nat").([]interface{}))
ret.Inst.Ospf = getObjectInterfaceTrunkIpv6Ospf762(d.Get("ospf").([]interface{}))
ret.Inst.Rip = getObjectInterfaceTrunkIpv6Rip772(d.Get("rip").([]interface{}))
ret.Inst.Router = getObjectInterfaceTrunkIpv6Router774(d.Get("router").([]interface{}))
ret.Inst.RouterAdver = getObjectInterfaceTrunkIpv6RouterAdver(d.Get("router_adver").([]interface{}))
ret.Inst.StatefulFirewall = getObjectInterfaceTrunkIpv6StatefulFirewall779(d.Get("stateful_firewall").([]interface{}))
ret.Inst.TtlIgnore = d.Get("ttl_ignore").(int)
//omit uuid
ret.Inst.Ifnum = d.Get("ifnum").(string)
return ret
}