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

[Feature]: return VPC ips as well in InstanceIPv4Response #480

Closed
rahulait opened this issue Mar 20, 2024 · 3 comments
Closed

[Feature]: return VPC ips as well in InstanceIPv4Response #480

rahulait opened this issue Mar 20, 2024 · 3 comments
Labels
enhancement issues that request a enhancement

Comments

@rahulait
Copy link

rahulait commented Mar 20, 2024

Description

Hi, currently one can list ip's configured on a linode using GetInstanceIPAddresses . However, this only returns public, private, shared and reserved. https://github.com/linode/linodego/blob/v1.30.0/instance_ips.go#L17-L22. To get VPC specific ip-addresses, one has to send another request to get instance configs and then parse through them. It would be nice to get vpc addresses in response of GetInstanceIPAddresses only.

linode-cli and linode API does provide this:

➜  ~ linode-cli linodes ips-list 56229162 --json | jq .
[
  {
    "ipv4": {
      "public": [
        {
          "address": "172.234.213.108",
          "gateway": "172.234.213.1",
          "subnet_mask": "255.255.255.0",
          "prefix": 24,
          "type": "ipv4",
          "public": true,
          "rdns": "172-234-213-108.ip.linodeusercontent.com",
          "linode_id": 56229162,
          "region": "us-ord",
          "vpc_nat_1_1": null
        }
      ],
      "private": [
        {
          "address": "192.168.138.178",
          "gateway": null,
          "subnet_mask": "255.255.128.0",
          "prefix": 17,
          "type": "ipv4",
          "public": false,
          "rdns": null,
          "linode_id": 56229162,
          "region": "us-ord"
        }
      ],
      "shared": [],
      "reserved": [],
      "vpc": [
        {
          "address": "10.0.0.6",
          "vpc_id": 47539,
          "subnet_id": 47373,
          "region": "us-ord",
          "linode_id": 56229162,
          "gateway": "10.0.0.1",
          "prefix": 8,
          "subnet_mask": "255.0.0.0"
        },
        {
          "address": null,
          "vpc_id": 47539,
          "subnet_id": 47373,
          "region": "us-ord",
          "linode_id": 56229162,
          "gateway": "10.0.0.1",
          "prefix": 8,
          "subnet_mask": "255.0.0.0"
        }
      ]
    },
    "ipv6": {...}
]

Can we have something like:

// InstanceIPv4Response contains the details of all IPv4 addresses associated with an Instance
type InstanceIPv4Response struct {
	Public   []*InstanceIP `json:"public"`
	Private  []*InstanceIP `json:"private"`
	Shared   []*InstanceIP `json:"shared"`
	Reserved []*InstanceIP `json:"reserved"`
        VPC      []*InstanceIP `json:"vpc"`
}

Example Code

No response

@rahulait rahulait added the enhancement issues that request a enhancement label Mar 20, 2024
@rahulait
Copy link
Author

I do see a PR already merged. #465
Is it going to be in the next release?

@zliang-akamai
Copy link
Member

Hi @rahulait, thanks for the feature request! We plan to do a release within this week.

@lgarber-akamai
Copy link
Contributor

This functionality has been released in v1.31.0, thank you for the feature request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement issues that request a enhancement
Projects
None yet
Development

No branches or pull requests

3 participants