diff --git a/instance_ips.go b/instance_ips.go index cd2a78505..943dbdd39 100644 --- a/instance_ips.go +++ b/instance_ips.go @@ -49,7 +49,9 @@ type VPCIP struct { VPCID int `json:"vpc_id"` SubnetID int `json:"subnet_id"` InterfaceID int `json:"interface_id"` - + // NOTE: NodeBalancerID and DatabaseID may not currently be available to all users. + NodeBalancerID *int `json:"nodebalancer_id"` + DatabaseID *int `json:"database_id"` // NOTE: IPv6 VPCs may not currently be available to all users. IPv6Range *string `json:"ipv6_range"` IPv6IsPublic *bool `json:"ipv6_is_public"` @@ -70,6 +72,8 @@ type InstanceIPv6Response struct { LinkLocal *InstanceIP `json:"link_local"` SLAAC *InstanceIP `json:"slaac"` Global []IPv6Range `json:"global"` + // NOTE: IPv6 VPCs may not currently be available to all users. + VPC []VPCIP `json:"vpc"` } // InstanceIPNAT1To1 contains information about the NAT 1:1 mapping diff --git a/regions.go b/regions.go index e5c2aa916..43df21b23 100644 --- a/regions.go +++ b/regions.go @@ -40,6 +40,7 @@ const ( CapabilityQuadraT1UVPU string = "NETINT Quadra T1U" CapabilitySupportTicketSeverity string = "Support Ticket Severity" CapabilityVPCs string = "VPCs" + CapabilityVPCDualStack string = "VPC Dual Stack" CapabilityVPCsExtra string = "VPCs Extra" CapabilityVlans string = "Vlans" diff --git a/test/unit/fixtures/instance_ip_list.json b/test/unit/fixtures/instance_ip_list.json index 1deac52f9..11f043c04 100644 --- a/test/unit/fixtures/instance_ip_list.json +++ b/test/unit/fixtures/instance_ip_list.json @@ -29,7 +29,33 @@ "gateway": "2001:db8::ff", "prefix": 64 }, - "global": [] + "global": [], + "vpc": [ + { + "address": null, + "address_range": null, + "vpc_id": 123, + "subnet_id": 123, + "region": "us-east", + "linode_id": 123, + "config_id": 1234, + "interface_id": 1234, + "nodebalancer_id": null, + "database_id": null, + "active": true, + "nat_1_1": "", + "gateway": null, + "prefix": 64, + "subnet_mask": "", + "ipv6_range": "2001:db8:d001:321::/64", + "ipv6_is_public": true, + "ipv6_addresses": [ + { + "slaac_address": "2001:db8:d001:321:2000:bdff:fe10:6fa8" + } + ] + } + ] } } \ No newline at end of file diff --git a/test/unit/instance_ip_test.go b/test/unit/instance_ip_test.go index fd169a62b..27b046035 100644 --- a/test/unit/instance_ip_test.go +++ b/test/unit/instance_ip_test.go @@ -31,6 +31,10 @@ func TestInstanceIPAddresses_List(t *testing.T) { // IPv6 Assertions assert.NotNil(t, ips.IPv6.SLAAC) assert.Equal(t, "2001:db8::1", ips.IPv6.SLAAC.Address) + + assert.NotNil(t, ips.IPv6.VPC[0]) + assert.NotNil(t, ips.IPv6.VPC[0].IPv6Addresses) + assert.Equal(t, "2001:db8:d001:321:2000:bdff:fe10:6fa8", ips.IPv6.VPC[0].IPv6Addresses[0].SLAACAddress) } func TestInstanceIPAddress_Get(t *testing.T) {