TPT-4462: Support VPC RDMA Interfaces#711
Open
yec-akamai wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds SDK support for RDMA-capable VPCs by introducing a VPC type field and RDMA VPC Linode interface structures, plus corresponding unit/fixture updates.
Changes:
- Add
vpc_typesupport to VPC objects and VPC create requests (withVPCTypeenum). - Add RDMA VPC (
rdma_vpc) interface option/response models and unit tests for GET/PUT + instance-create serialization. - Extend fixtures and a small integration-test import cleanup to keep tests passing.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/objects/vpc_test.py | Adds assertions + create-request tests for vpc_type handling. |
| test/unit/objects/linode_interface_test.py | Adds RDMA VPC interface option builder and GET/PUT unit coverage. |
| test/unit/groups/linode_test.py | Adds instance-create unit coverage for RDMA VPC interface serialization. |
| test/integration/models/networking/test_networking.py | Import formatting cleanup only. |
| test/fixtures/vpcs.json | Adds vpc_type to VPC list fixture. |
| test/fixtures/vpcs_123456.json | Adds vpc_type to VPC detail fixture. |
| test/fixtures/vpcs_123456_subnets.json | Adds vpc_type to VPC subnets list fixture. |
| test/fixtures/vpcs_123456_subnets_789.json | Adds vpc_type to VPC subnet detail fixture. |
| test/fixtures/linode_instances_124_interfaces_999.json | New fixture for RDMA VPC Linode interface GET response. |
| linode_api4/objects/vpc.py | Introduces VPCType and maps vpc_type onto VPC/VPCSubnet properties. |
| linode_api4/objects/region.py | Adds gpudirect_rdma region capability enum value. |
| linode_api4/objects/linode.py | Documents RDMA interface creation limitation on interface_create. |
| linode_api4/objects/linode_interfaces.py | Adds RDMA VPC option/response JSONObject models + LinodeInterface.rdma_vpc property. |
| linode_api4/groups/vpc.py | Adds vpc_type parameter to VPC create and forwards it to the API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+83
to
+96
| def build_interface_options_rdma_vpc(): | ||
| return LinodeInterfaceOptions( | ||
| firewall_id=-1, | ||
| rdma_vpc=LinodeInterfaceRDMAVPCOptions( | ||
| subnet_id=1234, | ||
| ipv4=LinodeInterfaceRDMAVPCIPv4Options( | ||
| addresses=[ | ||
| LinodeInterfaceRDMAVPCIPv4AddressOptions( | ||
| address="auto", primary=True | ||
| ) | ||
| ] | ||
| ), | ||
| ), | ||
| ) |
Contributor
Author
There was a problem hiding this comment.
It's the value used in the API spec. We may verify which value to put in the request once we have the API works
Comment on lines
+156
to
+165
| assert m.call_data["interfaces"][0] == { | ||
| "firewall_id": -1, | ||
| "rdma_vpc": { | ||
| "subnet_id": 1234, | ||
| "ipv4": { | ||
| "addresses": [{"address": "auto", "primary": True}] | ||
| }, | ||
| }, | ||
| } | ||
|
|
Comment on lines
+2118
to
+2122
| .. note:: | ||
| RDMA VPC interfaces (``rdma_vpc``) cannot be added via this | ||
| endpoint. They may only be specified at instance creation time via | ||
| :func:`linode_api4.LinodeGroup.instance_create`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Add support to specify VPC type and RDMA VPC. Allow to create the RDMA intercase with the instance creation. Allow to change the RDMA interface with the interface object.
✔️ How to Test