Skip to content

TPT-4278: python-sdk: Implement support for Reserved IP for IPv4#672

Open
mgwoj wants to merge 7 commits intolinode:proj/reserved-ipsfrom
mgwoj:feature/TPT-4278-python-sdk-implement-support-for-reserved-ip-for-ipv4
Open

TPT-4278: python-sdk: Implement support for Reserved IP for IPv4#672
mgwoj wants to merge 7 commits intolinode:proj/reserved-ipsfrom
mgwoj:feature/TPT-4278-python-sdk-implement-support-for-reserved-ip-for-ipv4

Conversation

@mgwoj
Copy link
Copy Markdown
Contributor

@mgwoj mgwoj commented Mar 26, 2026

📝 Description

Add full Reserved IP support to the Python SDK (linode_api4-python). Currently there is no reserved IP support in the SDK. This story covers new object classes, networking group methods, and updates to existing objects.

✔️ How to Test

make test-unit

@mgwoj mgwoj requested a review from Copilot March 26, 2026 13:09
@mgwoj mgwoj requested a review from a team as a code owner March 26, 2026 13:09
@mgwoj mgwoj requested review from yec-akamai and zliang-akamai and removed request for a team March 26, 2026 13:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Reserved IPv4 (Reserved IP) support across the SDK, including new networking objects, networking group endpoints, and integration with existing tagging and allocation flows.

Changes:

  • Introduces Reserved IP models (ReservedIPAddress, ReservedIPType, ReservedIPAssignedEntity) and exposes reserved/tags/assigned_entity on IPAddress.
  • Adds networking group methods for listing/creating reserved IPs and fetching reserved IP types/pricing.
  • Extends tagging and allocation APIs/tests to support reserved IPv4 assignment (Instance/NodeBalancer/Tag flows), plus new fixtures and pytest config.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/unit/objects/tag_test.py Adds unit coverage for tagged reserved IPv4 objects and tag creation with reserved IPv4s.
test/unit/objects/networking_test.py Adds unit coverage for Reserved IP fields, save/delete flows, and Instance IP allocation with explicit address.
test/unit/groups/networking_test.py Adds unit coverage for networking group reserved IP list/create/types and reserved-vs-ephemeral allocation behavior.
test/fixtures/networking_reserved_ips.json Fixture data for listing reserved IPs.
test/fixtures/networking_reserved_ips_types.json Fixture data for reserved IP type pricing.
pytest.ini Adds pytest discovery defaults and marker declarations.
conftest.py Ensures repo root is importable for pytest runs from arbitrary working dirs.
linode_api4/objects/tag.py Enables tagged object resolution for reserved_ipv4_address and supports non-id identifiers via id_attribute.
linode_api4/objects/networking.py Adds Reserved IP object models and new/updated IP-related properties.
linode_api4/objects/linode.py Extends Instance.ip_allocate to optionally assign a reserved IPv4 address.
linode_api4/groups/tag.py Adds reserved_ipv4_addresses support to tag creation.
linode_api4/groups/nodebalancer.py Adds optional ipv4 param to assign a reserved IPv4 at NodeBalancer creation.
linode_api4/groups/networking.py Extends ip_allocate for reserved IP allocation and adds reserved IP list/create/types group methods.
linode_api4/groups/linode.py Adds ipv4 parameter for assigning reserved IPv4s at instance creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread linode_api4/groups/networking.py
Comment thread linode_api4/groups/tag.py Outdated
@mgwoj mgwoj added the new-feature for new features in the changelog. label Mar 26, 2026
@mgwoj mgwoj changed the title TPT-4278 python-sdk: Implement support for Reserved IP for IPv4 TPT-4278: python-sdk: Implement support for Reserved IP for IPv4 Mar 26, 2026
)

def ip_allocate(self, linode, public=True):
def ip_allocate(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we restrict the type for the parameters? We prefer not implementing generic types for python-sdk.
Same for the rest functions in this PR

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread linode_api4/groups/nodebalancer.py Outdated
Comment thread linode_api4/groups/nodebalancer.py Outdated
Comment thread linode_api4/groups/tag.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pytest.ini
Comment on lines +1 to +6
[pytest]
testpaths = test
markers =
smoke: mark a test as a smoke test
flaky: mark a test as a flaky test for rerun
python_files = *_test.py test_*.py
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

Pytest configuration is now split between this pytest.ini and the existing [tool.pytest.ini_options] section in pyproject.toml. Because pytest.ini takes precedence, the pyproject settings will be ignored, which can lead to drift. Consider consolidating all pytest settings into a single config location (either remove pytest.ini and move these options into pyproject.toml, or remove the pyproject pytest section).

Suggested change
[pytest]
testpaths = test
markers =
smoke: mark a test as a smoke test
flaky: mark a test as a flaky test for rerun
python_files = *_test.py test_*.py
# Pytest configuration is centralized in pyproject.toml under
# [tool.pytest.ini_options]. This file is intentionally left without
# active pytest settings to avoid precedence conflicts and config drift.

Copilot uses AI. Check for mistakes.
Comment thread linode_api4/groups/networking.py Outdated
Comment thread conftest.py Outdated
mgwoj and others added 3 commits April 15, 2026 17:17
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

4 participants