11from datetime import datetime
22from test .unit .base import ClientBaseCase
33
4+
45from linode_api4 import (
56 LinodeInterface ,
67 LinodeInterfaceDefaultRouteOptions ,
78 LinodeInterfaceOptions ,
89 LinodeInterfacePublicIPv4AddressOptions ,
910 LinodeInterfacePublicIPv4Options ,
11+ LinodeInterfacePublicIPv6Options ,
1012 LinodeInterfacePublicIPv6RangeOptions ,
1113 LinodeInterfacePublicOptions ,
14+ LinodeInterfaceVLANOptions ,
1215 LinodeInterfaceVPCIPv4AddressOptions ,
16+ LinodeInterfaceVPCIPv4Options ,
1317 LinodeInterfaceVPCIPv4RangeOptions ,
18+ LinodeInterfaceVPCOptions ,
1419)
1520
1621
1722def build_interface_options_public ():
1823 return LinodeInterfaceOptions (
19- 123 ,
24+ firewall_id = 123 ,
2025 default_route = LinodeInterfaceDefaultRouteOptions (
2126 ipv4 = True ,
2227 ipv6 = True ,
@@ -29,6 +34,46 @@ def build_interface_options_public():
2934 )
3035 ],
3136 ),
37+ ipv6 = LinodeInterfacePublicIPv6Options (
38+ ranges = [
39+ LinodeInterfacePublicIPv6RangeOptions (
40+ range = "2600:3cO9:e001:59::/64"
41+ )
42+ ]
43+ ),
44+ ),
45+ )
46+
47+
48+ def build_interface_options_vpc ():
49+ return LinodeInterfaceOptions (
50+ firewall_id = 123 ,
51+ default_route = LinodeInterfaceDefaultRouteOptions (
52+ ipv4 = True ,
53+ ),
54+ vpc = LinodeInterfaceVPCOptions (
55+ subnet_id = 123 ,
56+ ipv4 = LinodeInterfaceVPCIPv4Options (
57+ addresses = [
58+ LinodeInterfaceVPCIPv4AddressOptions (
59+ address = "192.168.22.3" ,
60+ primary = True ,
61+ nat_1_1_address = "any" ,
62+ )
63+ ],
64+ ranges = [
65+ LinodeInterfaceVPCIPv4RangeOptions (range = "192.168.22.16/28" )
66+ ],
67+ ),
68+ ),
69+ )
70+
71+
72+ def build_interface_options_vlan ():
73+ return LinodeInterfaceOptions (
74+ firewall_id = 123 ,
75+ vlan = LinodeInterfaceVLANOptions (
76+ vlan_label = "my_vlan" , ipam_address = "10.0.0.1/24"
3277 ),
3378 )
3479
0 commit comments