Skip to content

Commit 6ff915b

Browse files
authored
fix: Add missing fields to IPv6Range (#318)
## 📝 Description [IPv6 range view](https://www.linode.com/docs/api/networking/#ipv6-range-view__responses) and [IPv6 range list](https://www.linode.com/docs/api/networking/#ipv6-ranges-list__responses) actually share different response structures. The current `IPv6Range` object has been built based on the structure of IPv6 range list, so fields `linodes` and `is_bgp` are missing. To quickly fix it, I think simply adding these two fields to the `IPv6Range` object properties makes sense without introducing any breaking change. Otherwise we may consider create two separated objects for returning a single object and list, which is probably confusing for customers to use and more complicated for us to maintain. Any different idea is appreciated. ## ✔️ How to Test `tox`
1 parent 12c60ef commit 6ff915b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

linode_api4/objects/networking.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ class IPv6Range(Base):
3131
"region": Property(slug_relationship=Region),
3232
"prefix": Property(),
3333
"route_target": Property(),
34+
"linodes": Property(),
35+
"is_bgp": Property(),
3436
}
3537

3638

test/unit/objects/networking_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ def test_get_ipv6_range(self):
2020
self.assertEqual(ipv6Range.range, "2600:3c01::")
2121
self.assertEqual(ipv6Range.prefix, 64)
2222
self.assertEqual(ipv6Range.region.id, "us-east")
23+
self.assertEqual(ipv6Range.linodes[0], 123)
24+
self.assertEqual(ipv6Range.is_bgp, False)
2325

2426
ranges = self.client.networking.ipv6_ranges()
2527

0 commit comments

Comments
 (0)