Skip to content

Commit 8f164d1

Browse files
progress
1 parent 5750267 commit 8f164d1

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

linode_api4/objects/linode.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from typing import Any, Dict, List, Optional, Union
99
from urllib import parse
1010

11+
from linode_api4 import LinodeInterfacesSettings
1112
from linode_api4.common import load_and_validate_keys
1213
from linode_api4.errors import UnexpectedResponseError
1314
from linode_api4.objects.base import (
@@ -693,6 +694,7 @@ class Instance(Base):
693694
"disk_encryption": Property(),
694695
"lke_cluster_id": Property(),
695696
"capabilities": Property(unordered=True),
697+
"interfaces_settings": Property(relationship=LinodeInterfacesSettings),
696698
}
697699

698700
@property

linode_api4/objects/linode_interfaces.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,34 @@
66
from linode_api4.objects.serializable import JSONObject
77

88

9+
@dataclass
10+
class LinodeInterfacesSettingsDefaultRouteOptions(JSONObject):
11+
ipv4_interface_id: Optional[int] = None
12+
ipv6_interface_id: Optional[int] = None
13+
14+
15+
@dataclass
16+
class LinodeInterfacesSettingsDefaultRoute(JSONObject):
17+
put_body = LinodeInterfacesSettingsDefaultRouteOptions
18+
19+
ipv4_interface_id: Optional[int] = None
20+
ipv4_eligible_interface_ids: List[int] = field(default_factory=list)
21+
ipv6_interface_id: Optional[int] = None
22+
ipv6_eligible_interface_ids: List[int] = field(default_factory=list)
23+
24+
25+
class LinodeInterfacesSettings(Base):
26+
api_endpoint = "/linode/instances/{linode_id}/interfaces/settings"
27+
28+
properties = {
29+
"linode_id": Property(identifier=True),
30+
"network_helper": Property(mutable=True),
31+
"default_route": Property(
32+
mutable=True, json_object=LinodeInterfacesSettingsDefaultRoute
33+
),
34+
}
35+
36+
937
@dataclass
1038
class LinodeInterfaceDefaultRouteOptions(JSONObject):
1139
ipv4: bool = False

0 commit comments

Comments
 (0)