Skip to content

Commit c4aff08

Browse files
progress
1 parent e08d813 commit c4aff08

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

linode_api4/objects/networking.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from dataclasses import dataclass
2-
from typing import Optional
2+
from typing import List, Optional
33

44
from linode_api4.common import Price, RegionPrice
55
from linode_api4.errors import UnexpectedResponseError
@@ -127,6 +127,11 @@ def delete(self):
127127
return True
128128

129129

130+
@dataclass
131+
class VPCIPAddressIPv6(JSONObject):
132+
slaac_address: str = ""
133+
134+
130135
@dataclass
131136
class VPCIPAddress(JSONObject):
132137
"""
@@ -152,6 +157,10 @@ class VPCIPAddress(JSONObject):
152157
address_range: Optional[str] = None
153158
nat_1_1: Optional[str] = None
154159

160+
ipv6_range: Optional[str] = None
161+
ipv6_is_public: Optional[bool] = None
162+
ipv6_addresses: Optional[List[VPCIPAddressIPv6]] = None
163+
155164

156165
class VLAN(Base):
157166
"""

linode_api4/objects/vpc.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,27 @@
88
from linode_api4.paginated_list import PaginatedList
99

1010

11+
@dataclass
12+
class VPCIPv6RangeOptions(JSONObject):
13+
range: str = ""
14+
allocation_class: Optional[str] = None
15+
16+
17+
@dataclass
18+
class VPCIPv6Range(JSONObject):
19+
range: str = ""
20+
21+
22+
@dataclass
23+
class VPCIPv6SubnetRangeOptions(JSONObject):
24+
range: str = ""
25+
26+
27+
@dataclass
28+
class VPCSubnetIPv6Range(JSONObject):
29+
range: str = ""
30+
31+
1132
@dataclass
1233
class VPCSubnetLinodeInterface(JSONObject):
1334
id: int = 0
@@ -35,6 +56,7 @@ class VPCSubnet(DerivedBase):
3556
"id": Property(identifier=True),
3657
"label": Property(mutable=True),
3758
"ipv4": Property(),
59+
"ipv6": Property(json_object=VPCSubnetIPv6Range, unordered=True),
3860
"linodes": Property(json_object=VPCSubnetLinode, unordered=True),
3961
"created": Property(is_datetime=True),
4062
"updated": Property(is_datetime=True),
@@ -55,6 +77,7 @@ class VPC(Base):
5577
"label": Property(mutable=True),
5678
"description": Property(mutable=True),
5779
"region": Property(slug_relationship=Region),
80+
"ipv6": Property(json_object=VPCIPv6Range, unordered=True),
5881
"subnets": Property(derived_class=VPCSubnet),
5982
"created": Property(is_datetime=True),
6083
"updated": Property(is_datetime=True),

test/unit/objects/vpc_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def test_list_vpc_ips(self):
153153
self.assertEqual(vpc_ip.prefix, 8)
154154
self.assertEqual(vpc_ip.subnet_mask, "255.0.0.0")
155155

156-
vpc_ip_2 = vpc_ips[1]
156+
vpc_ip_2 = vpc_ips[2]
157157

158158
self.assertEqual(vpc_ip_2.ipv6_range, "fd71:1140:a9d0::/52")
159159
self.assertEqual(vpc_ip_2.ipv6_is_public, True)

0 commit comments

Comments
 (0)