Skip to content

new: Add support for the /vpcs/ips endpoint - #385

Merged
lgarber-akamai merged 1 commit into
linode:devfrom
lgarber-akamai:new/vpc-ips-endpoint
Mar 19, 2024
Merged

new: Add support for the /vpcs/ips endpoint#385
lgarber-akamai merged 1 commit into
linode:devfrom
lgarber-akamai:new/vpc-ips-endpoint

Conversation

@lgarber-akamai

@lgarber-akamai lgarber-akamai commented Mar 18, 2024

Copy link
Copy Markdown
Contributor

📝 Description

This change adds support for the /vpcs/ips endpoint through the LinodeClient(...).vpcs.ips() method.

✔️ How to Test

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

Unit Testing

make testunit

Integration Testing

make INTEGRATION_TEST_PATH=models/test_linode.py::TestNetworkInterface::test_create_vpc testint

Manual Testing

  1. In a linode_api4-python sandbox environment (e.g. dx-devenv), run the following:
import os

from linode_api4 import LinodeClient, VPCIPAddress
from linode_api4.objects import ConfigInterface

client = LinodeClient(os.getenv("LINODE_TOKEN"))

vpc = client.vpcs.create(
    "test-vpc",
    "us-mia",
)

subnet = vpc.subnet_create(
    "test-subnet",
    ipv4="10.0.0.0/24"
)

inst, _ = client.linode.instance_create(
    "g6-nanode-1",
    "us-mia",
    label="test-instance",
    image="linode/alpine3.19",
    interfaces=[
        ConfigInterface(
            purpose="vpc",
            subnet_id=subnet.id,
        )
    ]
)

result = client.vpcs.ips(VPCIPAddress.filters.linode_id == inst.id)

print(*result)
  1. Ensure the output contains the expected VPC IP addresses for the newly created instance.

@lgarber-akamai
lgarber-akamai requested a review from a team as a code owner March 18, 2024 16:27
@lgarber-akamai
lgarber-akamai requested review from jriddle-linode and yec-akamai and removed request for a team March 18, 2024 16:27
@lgarber-akamai lgarber-akamai added enhancement issues that request a enhancement Do Not Merge labels Mar 18, 2024

@yec-akamai yec-akamai left a comment

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.

Nice work! Tests passed locally

@jriddle-linode jriddle-linode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@lgarber-akamai
lgarber-akamai merged commit fd151d5 into linode:dev Mar 19, 2024
@jriddle-linode jriddle-linode added improvement for improvements in existing functionality in the changelog. and removed enhancement issues that request a enhancement labels Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement for improvements in existing functionality in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants