Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions linode_api4/objects/linode.py
Original file line number Diff line number Diff line change
Expand Up @@ -2006,15 +2006,18 @@ def interfaces_settings(self) -> LinodeInterfacesSettings:
return self._interfaces_settings

@property
def interfaces(self) -> List[LinodeInterface]:
def linode_interfaces(self) -> Optional[list[LinodeInterface]]:
"""
All interfaces for this Linode.

API Documentation: https://techdocs.akamai.com/linode-api/reference/get-linode-interface

:returns: An ordered list of interfaces under this Linode.
:returns: An ordered list of linode interfaces under this Linode. If the linode is with legacy config interfaces, returns None.
:rtype: Optional[list[LinodeInterface]]
"""

if self.interface_generation != InterfaceGeneration.LINODE:
return None
if not hasattr(self, "_interfaces"):
result = self._client.get(
"{}/interfaces".format(Instance.api_endpoint),
Expand Down
2 changes: 1 addition & 1 deletion test/unit/objects/linode_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def test_get_interfaces(self):

assert instance.interface_generation == InterfaceGeneration.LINODE

interfaces = instance.interfaces
interfaces = instance.linode_interfaces

LinodeInterfaceTest.assert_linode_124_interface_123(
next(iface for iface in interfaces if iface.id == 123)
Expand Down