@@ -313,6 +313,27 @@ class ConfigInterfaceIPv6(JSONObject):
313313 is_public : bool = False
314314
315315
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+
316337class NetworkInterface (DerivedBase ):
317338 """
318339 This class represents a Configuration Profile's network interface object.
@@ -593,6 +614,7 @@ def interface_create_vpc(
593614 subnet : Union [int , VPCSubnet ],
594615 primary = False ,
595616 ipv4 : Union [Dict [str , Any ], ConfigInterfaceIPv4 ] = None ,
617+ ipv6 : Union [Dict [str , Any ], ConfigInterfaceIPv6Options ] = None ,
596618 ip_ranges : Optional [List [str ]] = None ,
597619 ) -> NetworkInterface :
598620 """
@@ -606,6 +628,8 @@ def interface_create_vpc(
606628 :type primary: bool
607629 :param ipv4: The IPv4 configuration of the interface for the associated subnet.
608630 :type ipv4: Dict or ConfigInterfaceIPv4
631+ :param ipv6: The IPv6 configuration of the interface for the associated subnet.
632+ :type ipv6: Dict or ConfigInterfaceIPv6Options
609633 :param ip_ranges: A list of IPs or IP ranges in the VPC subnet.
610634 Packets to these CIDRs are routed through the
611635 VPC network interface.
@@ -616,19 +640,16 @@ def interface_create_vpc(
616640 """
617641 params = {
618642 "purpose" : "vpc" ,
619- "subnet_id" : subnet . id if isinstance ( subnet , VPCSubnet ) else subnet ,
643+ "subnet_id" : subnet ,
620644 "primary" : primary ,
645+ "ipv4" : ipv4 ,
646+ "ipv6" : ipv6 ,
647+ "ip_ranges" : ip_ranges ,
621648 }
622649
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+ )
632653
633654 def interface_reorder (self , interfaces : List [Union [int , NetworkInterface ]]):
634655 """
0 commit comments