Skip to content

Commit c556cd9

Browse files
progress
1 parent c4aff08 commit c556cd9

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

linode_api4/objects/linode.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import string
22
import sys
3-
from dataclasses import dataclass
3+
from dataclasses import dataclass, field
44
from datetime import datetime
55
from enum import Enum
66
from os import urandom
@@ -295,6 +295,24 @@ class ConfigInterfaceIPv4(JSONObject):
295295
nat_1_1: str = ""
296296

297297

298+
@dataclass
299+
class ConfigInterfaceIPv6SLAAC(JSONObject):
300+
range: str = ""
301+
address: str = ""
302+
303+
304+
@dataclass
305+
class ConfigInterfaceIPv6Range(JSONObject):
306+
range: str = ""
307+
308+
309+
@dataclass
310+
class ConfigInterfaceIPv6(JSONObject):
311+
slaac: List[ConfigInterfaceIPv6SLAAC] = field(default_factory=lambda: [])
312+
ranges: List[ConfigInterfaceIPv6Range] = field(default_factory=lambda: [])
313+
is_public: bool = False
314+
315+
298316
class NetworkInterface(DerivedBase):
299317
"""
300318
This class represents a Configuration Profile's network interface object.
@@ -320,6 +338,7 @@ class NetworkInterface(DerivedBase):
320338
"vpc_id": Property(id_relationship=VPC),
321339
"subnet_id": Property(),
322340
"ipv4": Property(mutable=True, json_object=ConfigInterfaceIPv4),
341+
"ipv6": Property(mutable=True, json_object=ConfigInterfaceIPv6),
323342
"ip_ranges": Property(mutable=True),
324343
}
325344

@@ -391,7 +410,10 @@ class ConfigInterface(JSONObject):
391410
# VPC-specific
392411
vpc_id: Optional[int] = None
393412
subnet_id: Optional[int] = None
413+
394414
ipv4: Optional[Union[ConfigInterfaceIPv4, Dict[str, Any]]] = None
415+
ipv6: Optional[Union[ConfigInterfaceIPv6, Dict[str, Any]]] = None
416+
395417
ip_ranges: Optional[List[str]] = None
396418

397419
# Computed

test/unit/objects/linode_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Config,
77
ConfigInterface,
88
ConfigInterfaceIPv4,
9+
ConfigInterfaceIPv6,
910
Disk,
1011
Image,
1112
Instance,

0 commit comments

Comments
 (0)