Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion instance_ips.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions regions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
28 changes: 27 additions & 1 deletion test/unit/fixtures/instance_ip_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
]
}
}

4 changes: 4 additions & 0 deletions test/unit/instance_ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down