@@ -313,6 +313,27 @@ class ConfigInterfaceIPv6(JSONObject):
313
313
is_public : bool = False
314
314
315
315
316
+ @dataclass
317
+ class ConfigInterfaceIPv6SLAACOptions (JSONObject ):
318
+ range : str = ""
319
+
320
+
321
+ @dataclass
322
+ class ConfigInterfaceIPv6RangeOptions (JSONObject ):
323
+ range : str = ""
324
+
325
+
326
+ @dataclass
327
+ class ConfigInterfaceIPv6Options (JSONObject ):
328
+ slaac : List [ConfigInterfaceIPv6SLAACOptions ] = field (
329
+ default_factory = lambda : []
330
+ )
331
+ ranges : List [ConfigInterfaceIPv6RangeOptions ] = field (
332
+ default_factory = lambda : []
333
+ )
334
+ is_public : bool = False
335
+
336
+
316
337
class NetworkInterface (DerivedBase ):
317
338
"""
318
339
This class represents a Configuration Profile's network interface object.
@@ -593,6 +614,7 @@ def interface_create_vpc(
593
614
subnet : Union [int , VPCSubnet ],
594
615
primary = False ,
595
616
ipv4 : Union [Dict [str , Any ], ConfigInterfaceIPv4 ] = None ,
617
+ ipv6 : Union [Dict [str , Any ], ConfigInterfaceIPv6Options ] = None ,
596
618
ip_ranges : Optional [List [str ]] = None ,
597
619
) -> NetworkInterface :
598
620
"""
@@ -606,6 +628,8 @@ def interface_create_vpc(
606
628
:type primary: bool
607
629
:param ipv4: The IPv4 configuration of the interface for the associated subnet.
608
630
:type ipv4: Dict or ConfigInterfaceIPv4
631
+ :param ipv6: The IPv6 configuration of the interface for the associated subnet.
632
+ :type ipv6: Dict or ConfigInterfaceIPv6Options
609
633
:param ip_ranges: A list of IPs or IP ranges in the VPC subnet.
610
634
Packets to these CIDRs are routed through the
611
635
VPC network interface.
@@ -616,19 +640,16 @@ def interface_create_vpc(
616
640
"""
617
641
params = {
618
642
"purpose" : "vpc" ,
619
- "subnet_id" : subnet . id if isinstance ( subnet , VPCSubnet ) else subnet ,
643
+ "subnet_id" : subnet ,
620
644
"primary" : primary ,
645
+ "ipv4" : ipv4 ,
646
+ "ipv6" : ipv6 ,
647
+ "ip_ranges" : ip_ranges ,
621
648
}
622
649
623
- if ipv4 is not None :
624
- params ["ipv4" ] = (
625
- ipv4 .dict if isinstance (ipv4 , ConfigInterfaceIPv4 ) else ipv4
626
- )
627
-
628
- if ip_ranges is not None :
629
- params ["ip_ranges" ] = ip_ranges
630
-
631
- return self ._interface_create (params )
650
+ return self ._interface_create (
651
+ drop_null_keys (_flatten_request_body_recursive (params ))
652
+ )
632
653
633
654
def interface_reorder (self , interfaces : List [Union [int , NetworkInterface ]]):
634
655
"""
0 commit comments