Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for VPC Dual Stack #524

Open
wants to merge 1 commit into
base: proj/vpc-dual-stack
Choose a base branch
from

Conversation

lgarber-akamai
Copy link
Contributor

@lgarber-akamai lgarber-akamai commented Apr 2, 2025

📝 Description

This pull request implements support for endpoints and request/response fields relating to Dual Stack (IPv6) VPCs. Because the API changes for this feature aren't yet available this PR was developed against unit test mocks.

Changes include:

  • A new put_class JSONObject ClassVar that allows PUT requests to use a distinct schema from the schema defined using json_object
  • A new ipv6 field under instance config interfaces (both nested and CRUD)
  • A new ipv6 field on VPCs and VPC subnets
  • New ipv6_range, ipv6_is_public, and ipv6_addresses fields under the VPC IPs endpoints

✔️ How to Test

The following test steps assume you have pulled down this PR locally and run make install.

Unit Testing

make test-unit

Integration Testing

Not yet available.

Manual Testing

Not yet available.

@lgarber-akamai lgarber-akamai added the new-feature for new features in the changelog. label Apr 2, 2025
Comment on lines +75 to +80
put_class: ClassVar[Optional[Type["JSONObject"]]] = None
"""
An alternative JSONObject class to use as the schema for PUT requests.
This prevents read-only fields from being included in PUT request bodies,
which in theory will result in validation errors from the API.
"""
Copy link
Contributor Author

@lgarber-akamai lgarber-akamai Apr 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this specifically to prevent the read-only ConfigInterface(...).ipv6.slaac.address field from being sent along in PUT requests, which would in theory result in a validation error. This was not implemented at the Property level because it needs to function recursively.

Assuming we're okay with this solution, do we think this is worth splitting into a separate PR against dev in case we want to reuse it elsewhere?

Comment on lines +171 to +172
if is_put and cls.put_class is not None:
cls = cls.put_class
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super hacky but much more efficient than serializing, loading, and re-serializing the data. If anyone has an ideas to clean this up please let me know!

@lgarber-akamai lgarber-akamai marked this pull request as ready for review April 2, 2025 18:14
@lgarber-akamai lgarber-akamai requested a review from a team as a code owner April 2, 2025 18:14
@lgarber-akamai lgarber-akamai requested review from zliang-akamai and ykim-akamai and removed request for a team April 2, 2025 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature for new features in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant