-
Notifications
You must be signed in to change notification settings - Fork 78
Implement support for VPC Dual Stack #524
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
Conversation
| 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. | ||
| """ |
There was a problem hiding this comment.
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?
| if is_put and cls.put_class is not None: | ||
| cls = cls.put_class |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can separate business logic change and base class changes into different PR for the future work? 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zliang-akamai Did you end up finding a viable alternative to this, or am I good to put up a separate PR for this against dev? Just asking since I need something similar for Enhanced Interfaces 🙂
edit: Discussed in private. We're going to implement this and potentially replace it in the future.
0db0dd5 to
522587f
Compare
522587f to
d7ddd4a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, and tests passed. Nice work!
|
Adding @vshanthe for test case/plan validation |
|
Here's the PR for JSONObject.put_class on |
vshanthe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Re-requesting reviews after merging in #534, sorry for the inconvenience! |
* Enhanced Interfaces: Add support for Firewall templates (#529) * Add support for Firewall Templates * oops * Add LA notices * Enhanced Interfaces: Add account-related fields (#525) * Enhanced Interfaces: Add account-related fields * Add setting enum * Add LA notice * Drop residual print * Enhanced Interfaces: Implement endpoints & fields related to VPCs and non-interface networking (#526) * Implement endpoints & fields related to VPCs and non-interface networking * Add LA notices * Implement support for VPC Dual Stack (#524) * Enhanced Interfaces: Add support for Linode-related endpoints and fields (#533) * Add support for Linode-related endpoints and fields * oops * tiny fixes * fix docsa * Add docs examples * Docs fixes * oops * Remove irrelevant test * Add LA notices * Fill in API documentation URLs * Add return types * Enable `include_none_values` in FirewallSettingsDefaultFirewallIDs (#558) * VPC Dual Stack: Support changes related to Linode Interfaces (#559) * Implementation; needs tests * Add integration tests * vpctest * removeprint * test * Fix conflicts * Fix missed conflict --------- Co-authored-by: Zhiwei Liang <[email protected]> Co-authored-by: Zhiwei Liang <[email protected]> Co-authored-by: vshanthe <[email protected]> Co-authored-by: Vinay <[email protected]>
📝 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:
put_classJSONObject ClassVar that allows PUT requests to use a distinct schema from the schema defined usingjson_objectipv6field under instance config interfaces (both nested and CRUD)ipv6field on VPCs and VPC subnetsipv6_range,ipv6_is_public, andipv6_addressesfields 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
Integration Testing
Not yet available.
Manual Testing
Not yet available.