python-sdk: Support regions/vpc-availability endpoints#646
python-sdk: Support regions/vpc-availability endpoints#646mgwoj wants to merge 4 commits intolinode:devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for VPC availability endpoints in the Python SDK, enabling users to query which regions support VPC functionality and what IPv6 prefix lengths are available. The PR also adds support for retrieving availability information for a specific region.
Changes:
- Added
vpc_availability()andvpc_availability_get()methods toRegionGroupfor listing and retrieving VPC availability data - Added
availability_get()method toRegionGroupfor retrieving availability data for a specific region - Added
vpc_availabilityproperty toRegionobject for convenient access to VPC availability data - Introduced
RegionVPCAvailabilitydataclass to represent VPC availability information
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
linode_api4/groups/region.py |
Added three new methods: availability_get, vpc_availability, and vpc_availability_get for retrieving region availability data |
linode_api4/objects/region.py |
Added vpc_availability property to Region class and RegionVPCAvailability dataclass |
test/unit/groups/region_test.py |
Added unit tests for new VPC availability and availability_get methods; cleaned up existing test assertions |
test/unit/objects/region_test.py |
Added unit test for Region.vpc_availability property |
test/integration/models/region/test_region.py |
Added comprehensive integration tests covering all three access patterns for VPC availability and the new availability_get method |
test/fixtures/regions_vpc-availability.json |
Added fixture data for VPC availability listing endpoint with pagination support |
test/fixtures/regions_us-east_vpc-availability.json |
Added fixture data for single region VPC availability endpoint |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
The available_ipv6_prefix_lengths values for us-east region are inconsistent between the two fixtures. In regions_vpc-availability.json (line 6), it's [52, 48], but in regions_us-east_vpc-availability.json (line 4), it's [52, 60]. These should be the same since they represent the same region. Please verify which values are correct and update one of the fixtures accordingly.
| "available_ipv6_prefix_lengths": [52, 60] | |
| "available_ipv6_prefix_lengths": [52, 48] |
📝 Description
Added support regions/vpc-availability endpoints:
Also added support for get availability endpoint
✔️ How to Test