From 9e2ab66b88c6687c64a9d3563766f2549b811b25 Mon Sep 17 00:00:00 2001 From: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:10:36 -0400 Subject: [PATCH 01/14] Support Linode VPC (#362) --------- Co-authored-by: Ye Chen <127243817+yec-akamai@users.noreply.github.com> --- account_events.go | 8 + instance_config_interfaces.go | 227 ++++++++++++ instance_configs.go | 44 +-- instances.go | 1 + test/integration/instance_config_test.go | 440 +++++++++++++++++++++++ test/integration/instances_test.go | 142 +++----- test/integration/util_test.go | 13 + test/integration/vpc_subnet_test.go | 193 ++++++++++ test/integration/vpc_test.go | 164 +++++++++ vpc.go | 155 ++++++++ vpc_subnet.go | 157 ++++++++ 11 files changed, 1426 insertions(+), 118 deletions(-) create mode 100644 instance_config_interfaces.go create mode 100644 test/integration/instance_config_test.go create mode 100644 test/integration/vpc_subnet_test.go create mode 100644 test/integration/vpc_test.go create mode 100644 vpc.go create mode 100644 vpc_subnet.go diff --git a/account_events.go b/account_events.go index fb9691dd8..8812a53f5 100644 --- a/account_events.go +++ b/account_events.go @@ -181,6 +181,12 @@ const ( ActionVolumeUpdate EventAction = "volume_update" ActionVolumeDetach EventAction = "volume_detach" ActionVolumeResize EventAction = "volume_resize" + ActionVPCCreate EventAction = "vpc_create" + ActionVPCDelete EventAction = "vpc_delete" + ActionVPCUpdate EventAction = "vpc_update" + ActionVPCSubnetCreate EventAction = "subnet_create" + ActionVPCSubnetDelete EventAction = "subnet_delete" + ActionVPCSubnetUpdate EventAction = "subnet_update" // deprecated due to incorrect spelling, // to be removed in the next major version release. @@ -198,6 +204,8 @@ const ( EntityDomain EntityType = "domain" EntityFirewall EntityType = "firewall" EntityNodebalancer EntityType = "nodebalancer" + EntityVPC EntityType = "vpc" + EntityVPCSubnet EntityType = "subnet" ) // EventStatus constants start with Event and include Linode API Event Status values diff --git a/instance_config_interfaces.go b/instance_config_interfaces.go new file mode 100644 index 000000000..87e6bf514 --- /dev/null +++ b/instance_config_interfaces.go @@ -0,0 +1,227 @@ +package linodego + +import ( + "context" + "encoding/json" + "fmt" +) + +// InstanceConfigInterface contains information about a configuration's network interface +type InstanceConfigInterface struct { + ID int `json:"id"` + IPAMAddress string `json:"ipam_address"` + Label string `json:"label"` + Purpose ConfigInterfacePurpose `json:"purpose"` + Primary bool `json:"primary"` + VPC *int `json:"vpc"` + SubnetID *int `json:"subnet_id"` + IPv4 VPCIPv4 `json:"ipv4"` + IPRanges []string `json:"ip_ranges"` +} + +type VPCIPv4 struct { + VPC string `json:"vpc"` + NAT1To1 string `json:"nat_1_1"` +} + +type InstanceConfigInterfaceCreateOptions struct { + IPAMAddress string `json:"ipam_address,omitempty"` + Label string `json:"label,omitempty"` + Purpose ConfigInterfacePurpose `json:"purpose,omitempty"` + Primary bool `json:"primary,omitempty"` + SubnetID *int `json:"subnet_id,omitempty"` + IPv4 *VPCIPv4 `json:"ipv4,omitempty"` + IPRanges []string `json:"ip_ranges,omitempty"` +} + +type InstanceConfigInterfaceUpdateOptions struct { + Primary bool `json:"primary,omitempty"` + IPv4 *VPCIPv4 `json:"ipv4,omitempty"` + IPRanges []string `json:"ip_ranges,omitempty"` +} + +type InstanceConfigInterfacesReorderOptions struct { + IDs []int `json:"ids"` +} + +func getInstanceConfigInterfacesCreateOptionsList( + interfaces []InstanceConfigInterface, +) []InstanceConfigInterfaceCreateOptions { + interfaceOptsList := make([]InstanceConfigInterfaceCreateOptions, len(interfaces)) + for index, configInterface := range interfaces { + interfaceOptsList[index] = configInterface.GetCreateOptions() + } + return interfaceOptsList +} + +func (i InstanceConfigInterface) GetCreateOptions() InstanceConfigInterfaceCreateOptions { + opts := InstanceConfigInterfaceCreateOptions{ + Label: i.Label, + Purpose: i.Purpose, + Primary: i.Primary, + SubnetID: i.SubnetID, + } + + if len(i.IPRanges) > 0 { + opts.IPRanges = i.IPRanges + } + + if i.Purpose == InterfacePurposeVPC && + i.IPv4.NAT1To1 != "" && i.IPv4.VPC != "" { + opts.IPv4 = &VPCIPv4{ + VPC: i.IPv4.VPC, + NAT1To1: i.IPv4.NAT1To1, + } + } + + // workaround for API issue + if i.IPAMAddress == "222" { + opts.IPAMAddress = "" + } else { + opts.IPAMAddress = i.IPAMAddress + } + + return opts +} + +func (i InstanceConfigInterface) GetUpdateOptions() InstanceConfigInterfaceUpdateOptions { + opts := InstanceConfigInterfaceUpdateOptions{ + Primary: i.Primary, + } + + if i.Purpose == InterfacePurposeVPC { + opts.IPv4 = &VPCIPv4{ + VPC: i.IPv4.VPC, + NAT1To1: i.IPv4.NAT1To1, + } + } + + if len(i.IPRanges) > 0 { + opts.IPRanges = i.IPRanges + } + + return opts +} + +func (c *Client) AppendInstanceConfigInterface( + ctx context.Context, + linodeID int, + configID int, + opts InstanceConfigInterfaceCreateOptions, +) (*InstanceConfigInterface, error) { + body, err := json.Marshal(opts) + if err != nil { + return nil, err + } + + req := c.R(ctx).SetResult(&InstanceConfigInterface{}).SetBody(string(body)) + e := fmt.Sprintf("/linode/instances/%d/configs/%d/interfaces", linodeID, configID) + r, err := coupleAPIErrors(req.Post(e)) + if err != nil { + return nil, err + } + + return r.Result().(*InstanceConfigInterface), nil +} + +func (c *Client) GetInstanceConfigInterface( + ctx context.Context, + linodeID int, + configID int, + interfaceID int, +) (*InstanceConfigInterface, error) { + e := fmt.Sprintf( + "linode/instances/%d/configs/%d/interfaces/%d", + linodeID, + configID, + interfaceID, + ) + req := c.R(ctx).SetResult(&InstanceConfigInterface{}) + r, err := coupleAPIErrors(req.Get(e)) + if err != nil { + return nil, err + } + return r.Result().(*InstanceConfigInterface), nil +} + +func (c *Client) ListInstanceConfigInterfaces( + ctx context.Context, + linodeID int, + configID int, +) ([]InstanceConfigInterface, error) { + e := fmt.Sprintf( + "linode/instances/%d/configs/%d/interfaces", + linodeID, + configID, + ) + req := c.R(ctx).SetResult([]InstanceConfigInterface{}) + r, err := coupleAPIErrors(req.Get(e)) + if err != nil { + return nil, err + } + return *r.Result().(*[]InstanceConfigInterface), nil +} + +func (c *Client) UpdateInstanceConfigInterface( + ctx context.Context, + linodeID int, + configID int, + interfaceID int, + opts InstanceConfigInterfaceUpdateOptions, +) (*InstanceConfigInterface, error) { + body, err := json.Marshal(opts) + if err != nil { + return nil, err + } + + e := fmt.Sprintf( + "linode/instances/%d/configs/%d/interfaces/%d", + linodeID, + configID, + interfaceID, + ) + req := c.R(ctx).SetResult(&InstanceConfigInterface{}).SetBody(string(body)) + r, err := coupleAPIErrors(req.Put(e)) + if err != nil { + return nil, err + } + return r.Result().(*InstanceConfigInterface), nil +} + +func (c *Client) DeleteInstanceConfigInterface( + ctx context.Context, + linodeID int, + configID int, + interfaceID int, +) error { + e := fmt.Sprintf( + "linode/instances/%d/configs/%d/interfaces/%d", + linodeID, + configID, + interfaceID, + ) + _, err := coupleAPIErrors(c.R(ctx).Delete(e)) + return err +} + +func (c *Client) ReorderInstanceConfigInterfaces( + ctx context.Context, + linodeID int, + configID int, + opts InstanceConfigInterfacesReorderOptions, +) error { + body, err := json.Marshal(opts) + if err != nil { + return err + } + e := fmt.Sprintf( + "linode/instances/%d/configs/%d/interfaces/order", + linodeID, + configID, + ) + + req := c.R(ctx).SetBody(string(body)) + _, err = coupleAPIErrors(req.Post(e)) + + return err +} diff --git a/instance_configs.go b/instance_configs.go index 0a13acee2..0e155f71d 100644 --- a/instance_configs.go +++ b/instance_configs.go @@ -61,15 +61,9 @@ type ConfigInterfacePurpose string const ( InterfacePurposePublic ConfigInterfacePurpose = "public" InterfacePurposeVLAN ConfigInterfacePurpose = "vlan" + InterfacePurposeVPC ConfigInterfacePurpose = "vpc" ) -// InstanceConfigInterface contains information about a configuration's network interface -type InstanceConfigInterface struct { - IPAMAddress string `json:"ipam_address"` - Label string `json:"label"` - Purpose ConfigInterfacePurpose `json:"purpose"` -} - // InstanceConfigsPagedResponse represents a paginated InstanceConfig API response type InstanceConfigsPagedResponse struct { *PageOptions @@ -78,26 +72,26 @@ type InstanceConfigsPagedResponse struct { // InstanceConfigCreateOptions are InstanceConfig settings that can be used at creation type InstanceConfigCreateOptions struct { - Label string `json:"label,omitempty"` - Comments string `json:"comments,omitempty"` - Devices InstanceConfigDeviceMap `json:"devices"` - Helpers *InstanceConfigHelpers `json:"helpers,omitempty"` - Interfaces []InstanceConfigInterface `json:"interfaces"` - MemoryLimit int `json:"memory_limit,omitempty"` - Kernel string `json:"kernel,omitempty"` - InitRD int `json:"init_rd,omitempty"` - RootDevice *string `json:"root_device,omitempty"` - RunLevel string `json:"run_level,omitempty"` - VirtMode string `json:"virt_mode,omitempty"` + Label string `json:"label,omitempty"` + Comments string `json:"comments,omitempty"` + Devices InstanceConfigDeviceMap `json:"devices"` + Helpers *InstanceConfigHelpers `json:"helpers,omitempty"` + Interfaces []InstanceConfigInterfaceCreateOptions `json:"interfaces"` + MemoryLimit int `json:"memory_limit,omitempty"` + Kernel string `json:"kernel,omitempty"` + InitRD int `json:"init_rd,omitempty"` + RootDevice *string `json:"root_device,omitempty"` + RunLevel string `json:"run_level,omitempty"` + VirtMode string `json:"virt_mode,omitempty"` } // InstanceConfigUpdateOptions are InstanceConfig settings that can be used in updates type InstanceConfigUpdateOptions struct { - Label string `json:"label,omitempty"` - Comments string `json:"comments"` - Devices *InstanceConfigDeviceMap `json:"devices,omitempty"` - Helpers *InstanceConfigHelpers `json:"helpers,omitempty"` - Interfaces []InstanceConfigInterface `json:"interfaces"` + Label string `json:"label,omitempty"` + Comments string `json:"comments"` + Devices *InstanceConfigDeviceMap `json:"devices,omitempty"` + Helpers *InstanceConfigHelpers `json:"helpers,omitempty"` + Interfaces []InstanceConfigInterfaceCreateOptions `json:"interfaces"` // MemoryLimit 0 means unlimitted, this is not omitted MemoryLimit int `json:"memory_limit"` Kernel string `json:"kernel,omitempty"` @@ -141,7 +135,7 @@ func (i InstanceConfig) GetCreateOptions() InstanceConfigCreateOptions { Comments: i.Comments, Devices: *i.Devices, Helpers: i.Helpers, - Interfaces: i.Interfaces, + Interfaces: getInstanceConfigInterfacesCreateOptionsList(i.Interfaces), MemoryLimit: i.MemoryLimit, Kernel: i.Kernel, InitRD: initrd, @@ -158,7 +152,7 @@ func (i InstanceConfig) GetUpdateOptions() InstanceConfigUpdateOptions { Comments: i.Comments, Devices: i.Devices, Helpers: i.Helpers, - Interfaces: i.Interfaces, + Interfaces: getInstanceConfigInterfacesCreateOptionsList(i.Interfaces), MemoryLimit: i.MemoryLimit, Kernel: i.Kernel, InitRD: copyInt(i.InitRD), diff --git a/instances.go b/instances.go index 492d96f90..cff4f9c3f 100644 --- a/instances.go +++ b/instances.go @@ -123,6 +123,7 @@ type InstanceCreateOptions struct { PrivateIP bool `json:"private_ip,omitempty"` Tags []string `json:"tags,omitempty"` Metadata *InstanceMetadataOptions `json:"metadata,omitempty"` + FirewallID int `json:"firewall_id,omitempty"` // Creation fields that need to be set explicitly false, "", or 0 use pointers SwapSize *int `json:"swap_size,omitempty"` diff --git a/test/integration/instance_config_test.go b/test/integration/instance_config_test.go new file mode 100644 index 000000000..9fe5821d8 --- /dev/null +++ b/test/integration/instance_config_test.go @@ -0,0 +1,440 @@ +package integration + +import ( + "context" + "reflect" + "testing" + + . "github.com/linode/linodego" +) + +func setupVPCWithSubnetWithInstance( + t *testing.T, + fixturesYaml string, + modifiers ...instanceModifier, +) ( + *Client, + *VPC, + *VPCSubnet, + *Instance, + *InstanceConfig, + func(), + error, +) { + t.Helper() + client, instance, instanceConfig, instanceTeardown, err := setupInstanceWithoutDisks( + t, + fixturesYaml, + modifiers..., + ) + if err != nil { + if instanceTeardown != nil { + instanceTeardown() + } + t.Fatal(err) + } + + vpc, vpcSubnet, vpcWithSubnetTeardown, err := createVPCWithSubnet(t, client) + if err != nil { + t.Error(err) + instanceTeardown() + vpcWithSubnetTeardown() + } + + teardownAll := func() { + instanceTeardown() + vpcWithSubnetTeardown() + } + return client, vpc, vpcSubnet, instance, instanceConfig, teardownAll, err +} + +func setupInstanceWith3Interfaces(t *testing.T, fixturesYaml string) ( + *Client, + *VPC, + *VPCSubnet, + *Instance, + *InstanceConfig, + func(), + error, +) { + t.Helper() + client, vpc, vpcSubnet, instance, config, teardown, err := setupVPCWithSubnetWithInstance( + t, + fixturesYaml, + func(client *Client, opts *InstanceCreateOptions) { + opts.Region = getRegionsWithCaps(t, client, []string{"vlans", "VPCs"})[0] + }, + ) + if err != nil { + if teardown != nil { + teardown() + } + t.Fatal(err) + return nil, nil, nil, nil, nil, nil, err + } + + updateConfigOpts := config.GetUpdateOptions() + updateConfigOpts.Interfaces = []InstanceConfigInterfaceCreateOptions{ + { + Purpose: InterfacePurposePublic, + }, + { + Purpose: InterfacePurposeVLAN, + Label: "testvlan", + }, + { + Purpose: InterfacePurposeVPC, + SubnetID: &vpcSubnet.ID, + }, + } + _, err = client.UpdateInstanceConfig(context.Background(), instance.ID, config.ID, updateConfigOpts) + if err != nil { + teardown() + t.Fatal(err) + return nil, nil, nil, nil, nil, nil, err + } + + config, err = client.GetInstanceConfig(context.Background(), instance.ID, config.ID) + if err != nil { + teardown() + t.Fatal(err) + return nil, nil, nil, nil, nil, nil, err + } + + return client, vpc, vpcSubnet, instance, config, teardown, err +} + +func TestInstance_ConfigInterfaces_AppendDelete(t *testing.T) { + client, _, subnet, instance, config, teardown, err := setupVPCWithSubnetWithInstance( + t, + "fixtures/TestInstance_ConfigInterfaces_AppendDelete", + func(client *Client, opts *InstanceCreateOptions) { + // Ensure we're in a region that supports VLANs + opts.Region = getRegionsWithCaps(t, client, []string{"vlans", "VPCs"})[0] + }, + ) + defer teardown() + if err != nil { + t.Fatal(err) + } + + appednOpts := InstanceConfigInterfaceCreateOptions{ + Purpose: InterfacePurposeVPC, + SubnetID: &subnet.ID, + } + + intfc, err := client.AppendInstanceConfigInterface( + context.Background(), + instance.ID, + config.ID, + appednOpts, + ) + if err != nil { + t.Error(err) + } + + if intfc.ID == 0 || + appednOpts.Purpose != intfc.Purpose || + *appednOpts.SubnetID != *intfc.SubnetID { + t.Errorf( + "failed to append an interface to instance %v config %v", + instance.ID, + config.ID, + ) + } + + interfaces, err := client.ListInstanceConfigInterfaces( + context.Background(), + instance.ID, + config.ID, + ) + if err != nil { + t.Error(err) + } + + interfacesLength := len(interfaces) + + err = client.DeleteInstanceConfigInterface( + context.Background(), + instance.ID, + config.ID, + intfc.ID, + ) + if err != nil { + t.Error(err) + } + + updatedInterfaces, err := client.ListInstanceConfigInterfaces( + context.Background(), + instance.ID, + config.ID, + ) + if err != nil { + t.Error(err) + } + if len(updatedInterfaces) > interfacesLength { + t.Errorf( + "failed to delete interface %v of config %v of instance %v", + intfc.ID, + config.ID, + instance.ID, + ) + } +} + +func TestInstance_ConfigInterfaces_Reorder(t *testing.T) { + + client, _, _, instance, config, teardown, err := setupInstanceWith3Interfaces( + t, + "fixtures/TestInstance_ConfigInterfaces_Reorder", + ) + defer teardown() + if err != nil { + t.Fatal(err) + } + + desiredIDs := []int{ + config.Interfaces[1].ID, + config.Interfaces[0].ID, + config.Interfaces[2].ID, + } + err = client.ReorderInstanceConfigInterfaces( + context.Background(), + instance.ID, + config.ID, + InstanceConfigInterfacesReorderOptions{ + IDs: desiredIDs, + }, + ) + if err != nil { + t.Error(err) + } + + reorderedInterfacesConfig, err := client.GetInstanceConfig( + context.Background(), + instance.ID, + config.ID, + ) + if err != nil { + t.Error(err) + } + reorderedIDs := []int{ + reorderedInterfacesConfig.Interfaces[0].ID, + reorderedInterfacesConfig.Interfaces[1].ID, + reorderedInterfacesConfig.Interfaces[2].ID, + } + + if !reflect.DeepEqual(reorderedIDs, desiredIDs) { + t.Errorf( + "interface IDs reordering failed, desired IDs: %v, appeared IDs: %v", + desiredIDs, + reorderedIDs, + ) + } +} + +func TestInstance_ConfigInterfaces_List(t *testing.T) { + client, _, _, instance, config, teardown, err := setupInstanceWith3Interfaces( + t, + "fixtures/TestInstance_ConfigInterfaces_List", + ) + defer teardown() + if err != nil { + t.Fatal(err) + } + + interfaces, err := client.ListInstanceConfigInterfaces( + context.Background(), + instance.ID, + config.ID, + ) + + if err != nil { + t.Error(err) + } + + if !(len(interfaces) == 3 && + interfaces[0].ID != 0 && + interfaces[1].ID != 0 && + interfaces[2].ID != 0) { + t.Errorf("failed to list all interfaces of config %v", config.ID) + } +} + +// testing config interfaces update via config API +func TestInstance_ConfigInterfaces_Update(t *testing.T) { + client, _, vpcSubnet, instance, config, teardown, err := setupVPCWithSubnetWithInstance( + t, + "fixtures/TestInstance_ConfigInterfaces_Update", + func(client *Client, opts *InstanceCreateOptions) { + // Ensure we're in a region that supports VLANs + opts.Region = getRegionsWithCaps(t, client, []string{"vlans", "VPCs"})[0] + }, + ) + defer teardown() + if err != nil { + t.Error(err) + } + + updateConfigOpts := config.GetUpdateOptions() + + updateConfigOpts.Interfaces = []InstanceConfigInterfaceCreateOptions{ + { + Purpose: InterfacePurposePublic, + }, + { + Purpose: InterfacePurposeVLAN, + Label: "testvlan", + }, + { + Purpose: InterfacePurposeVPC, + SubnetID: &vpcSubnet.ID, + }, + } + + _, err = client.UpdateInstanceConfig(context.Background(), instance.ID, config.ID, updateConfigOpts) + if err != nil { + t.Error(err) + } + + result, err := client.GetInstanceConfig(context.Background(), instance.ID, config.ID) + if err != nil { + t.Error(err) + } + + interfaceOptsList := make([]InstanceConfigInterfaceCreateOptions, len(result.Interfaces)) + for index, configInterface := range result.Interfaces { + interfaceOptsList[index] = configInterface.GetCreateOptions() + } + + if !reflect.DeepEqual( + interfaceOptsList, + updateConfigOpts.Interfaces, + ) { + t.Error("failed to update linode interfaces: configs do not match") + } + + // Ensure that a nil value will not update interfaces + result, err = client.UpdateInstanceConfig(context.Background(), instance.ID, config.ID, InstanceConfigUpdateOptions{}) + if err != nil { + t.Error(err) + } + interfaceOptsList = make([]InstanceConfigInterfaceCreateOptions, len(result.Interfaces)) + for index, configInterface := range result.Interfaces { + interfaceOptsList[index] = configInterface.GetCreateOptions() + } + + if !reflect.DeepEqual( + interfaceOptsList, + updateConfigOpts.Interfaces, + ) { + t.Error("failed to update linode interfaces: configs do not match") + } +} + +// testing config interface update via interfaces API +func TestInstance_ConfigInterface_Update(t *testing.T) { + client, _, vpcSubnet, instance, config, teardown, err := setupVPCWithSubnetWithInstance( + t, + "fixtures/TestInstance_ConfigInterface_Update", + func(client *Client, opts *InstanceCreateOptions) { + // Ensure we're in a region that supports VLANs + opts.Region = getRegionsWithCaps(t, client, []string{"vlans", "VPCs"})[0] + }, + ) + defer teardown() + if err != nil { + t.Error(err) + } + + intfc, err := client.AppendInstanceConfigInterface( + context.Background(), + instance.ID, + config.ID, + InstanceConfigInterfaceCreateOptions{ + Purpose: InterfacePurposeVPC, + SubnetID: &vpcSubnet.ID, + }, + ) + if err != nil { + t.Errorf("an error occurs when appending an interface to config %v: %v", config.ID, err) + } + updateOpts := intfc.GetUpdateOptions() + updateOpts.Primary = true + + updatedIntfc, err := client.UpdateInstanceConfigInterface( + context.Background(), + instance.ID, + config.ID, + intfc.ID, + updateOpts, + ) + + if err != nil { + t.Errorf("an error occurs when updating an interface in config %v", config.ID) + } + + if !(updatedIntfc.Primary == updateOpts.Primary) { + t.Errorf("updating interface %v didn't succeed", intfc.ID) + } + + updateOpts.IPv4 = &VPCIPv4{ + VPC: "192.168.0.10", + NAT1To1: "any", + } + + updatedIntfc, err = client.UpdateInstanceConfigInterface( + context.Background(), + instance.ID, + config.ID, + intfc.ID, + updateOpts, + ) + + if err != nil { + t.Errorf("an error occurs when updating an interface in config %v", config.ID) + } + + if !(updatedIntfc.Primary == updateOpts.Primary && + updateOpts.IPv4.VPC == updatedIntfc.IPv4.VPC) { + t.Errorf("updating interface %v didn't succeed", intfc.ID) + } +} + +func TestInstance_Configs_List(t *testing.T) { + client, instance, config, teardown, err := setupInstanceWithoutDisks(t, "fixtures/TestInstance_Configs_List") + defer teardown() + if err != nil { + t.Error(err) + } + + configs, err := client.ListInstanceConfigs(context.Background(), instance.ID, nil) + if err != nil { + t.Errorf("Error listing instance configs, expected struct, got error %v", err) + } + if len(configs) == 0 { + t.Errorf("Expected a list of instance configs, but got %v", configs) + } + if configs[0].ID != config.ID { + t.Errorf("Expected config id %d, got %d", configs[0].ID, config.ID) + } +} + +func TestInstance_Config_Update(t *testing.T) { + client, instance, config, teardown, err := setupInstanceWithoutDisks(t, "fixtures/TestInstance_Config_Update") + defer teardown() + if err != nil { + t.Error(err) + } + + updateConfigOpts := InstanceConfigUpdateOptions{ + Label: "go-conf-test-" + randLabel(), + Devices: &InstanceConfigDeviceMap{}, + RootDevice: "/dev/root", + } + + _, err = client.UpdateInstanceConfig(context.Background(), instance.ID, config.ID, updateConfigOpts) + if err != nil { + t.Error(err) + } +} diff --git a/test/integration/instances_test.go b/test/integration/instances_test.go index ab1420dc4..7e1492eed 100644 --- a/test/integration/instances_test.go +++ b/test/integration/instances_test.go @@ -3,7 +3,6 @@ package integration import ( "context" "encoding/base64" - "reflect" "strconv" "testing" @@ -188,7 +187,7 @@ func TestInstance_Disk_ListMultiple(t *testing.T) { t.Errorf("Error creating disk from private image: %s", err) } - disk, err = client.CreateInstanceDisk(context.Background(), instance2.ID, linodego.InstanceDiskCreateOptions{ + _, err = client.CreateInstanceDisk(context.Background(), instance2.ID, linodego.InstanceDiskCreateOptions{ Label: "go-disk-test-" + randLabel(), Size: 2000, }) @@ -244,93 +243,6 @@ func TestInstance_Disk_ResetPassword(t *testing.T) { } } -func TestInstance_Configs_List(t *testing.T) { - client, instance, config, teardown, err := setupInstanceWithoutDisks(t, "fixtures/TestInstance_Configs_List") - defer teardown() - if err != nil { - t.Error(err) - } - - configs, err := client.ListInstanceConfigs(context.Background(), instance.ID, nil) - if err != nil { - t.Errorf("Error listing instance configs, expected struct, got error %v", err) - } - if len(configs) == 0 { - t.Errorf("Expected a list of instance configs, but got %v", configs) - } - if configs[0].ID != config.ID { - t.Errorf("Expected config id %d, got %d", configs[0].ID, config.ID) - } -} - -func TestInstance_Config_Update(t *testing.T) { - client, instance, config, teardown, err := setupInstanceWithoutDisks(t, "fixtures/TestInstance_Config_Update") - defer teardown() - if err != nil { - t.Error(err) - } - - updateConfigOpts := linodego.InstanceConfigUpdateOptions{ - Label: "go-conf-test-" + randLabel(), - Devices: &linodego.InstanceConfigDeviceMap{}, - RootDevice: "/dev/root", - } - - _, err = client.UpdateInstanceConfig(context.Background(), instance.ID, config.ID, updateConfigOpts) - if err != nil { - t.Error(err) - } -} - -func TestInstance_ConfigInterfaces_Update(t *testing.T) { - client, instance, config, teardown, err := setupInstanceWithoutDisks(t, - "fixtures/TestInstance_ConfigInterfaces_Update", - func(client *linodego.Client, opts *linodego.InstanceCreateOptions) { - // Ensure we're in a region that supports VLANs - opts.Region = getRegionsWithCaps(t, client, []string{"vlans"})[0] - }) - defer teardown() - if err != nil { - t.Error(err) - } - - updateConfigOpts := linodego.InstanceConfigUpdateOptions{ - Interfaces: []linodego.InstanceConfigInterface{ - { - Purpose: linodego.InterfacePurposePublic, - }, - { - Purpose: linodego.InterfacePurposeVLAN, - Label: instance.Label + "-r", - }, - }, - } - - _, err = client.UpdateInstanceConfig(context.Background(), instance.ID, config.ID, updateConfigOpts) - if err != nil { - t.Error(err) - } - - result, err := client.GetInstanceConfig(context.Background(), instance.ID, config.ID) - if err != nil { - t.Error(err) - } - - if !reflect.DeepEqual(result.Interfaces, updateConfigOpts.Interfaces) { - t.Error("failed to update linode interfaces: configs do not match") - } - - // Ensure that a nil value will not update interfaces - _, err = client.UpdateInstanceConfig(context.Background(), instance.ID, config.ID, linodego.InstanceConfigUpdateOptions{}) - if err != nil { - t.Error(err) - } - - if !reflect.DeepEqual(result.Interfaces, updateConfigOpts.Interfaces) { - t.Error("failed to update linode interfaces: configs do not match") - } -} - func TestInstance_Volumes_List(t *testing.T) { client, instance, config, teardown, err := setupInstanceWithoutDisks(t, "fixtures/TestInstance_Volumes_List_Instance") defer teardown() @@ -366,6 +278,32 @@ func TestInstance_Volumes_List(t *testing.T) { } } +func TestInstance_CreateUnderFirewall(t *testing.T) { + + client, firewall, firewallTeardown, err := setupFirewall( + t, + []firewallModifier{}, + "fixtures/TestInstance_CreateUnderFirewall", + ) + defer firewallTeardown() + + if err != nil { + t.Error(err) + } + _, _, teardownInstance, err := createInstanceWithoutDisks( + t, + client, + func(_ *linodego.Client, options *linodego.InstanceCreateOptions) { + options.FirewallID = firewall.ID + }, + ) + defer teardownInstance() + + if err != nil { + t.Error(err) + } +} + func TestInstance_Rebuild(t *testing.T) { client, instance, _, teardown, err := setupInstanceWithoutDisks( t, @@ -548,9 +486,13 @@ func setupInstance(t *testing.T, fixturesYaml string, modifiers ...instanceModif return client, instance, teardown, err } -func setupInstanceWithoutDisks(t *testing.T, fixturesYaml string, modifiers ...instanceModifier) (*linodego.Client, *linodego.Instance, *linodego.InstanceConfig, func(), error) { +func createInstanceWithoutDisks( + t *testing.T, + client *linodego.Client, + modifiers ...instanceModifier, +) (*linodego.Instance, *linodego.InstanceConfig, func(), error) { t.Helper() - client, fixtureTeardown := createTestClient(t, fixturesYaml) + falseBool := false createOpts := linodego.InstanceCreateOptions{ Label: "go-test-ins-wo-disk-" + randLabel(), @@ -566,7 +508,7 @@ func setupInstanceWithoutDisks(t *testing.T, fixturesYaml string, modifiers ...i instance, err := client.CreateInstance(context.Background(), createOpts) if err != nil { t.Errorf("Error creating test Instance: %s", err) - return nil, nil, nil, fixtureTeardown, err + return nil, nil, func(){}, err } configOpts := linodego.InstanceConfigCreateOptions{ Label: "go-test-conf-" + randLabel(), @@ -574,13 +516,27 @@ func setupInstanceWithoutDisks(t *testing.T, fixturesYaml string, modifiers ...i config, err := client.CreateInstanceConfig(context.Background(), instance.ID, configOpts) if err != nil { t.Errorf("Error creating config: %s", err) - return nil, nil, nil, fixtureTeardown, err + return nil, nil, func(){}, err + } + + teardown := func() { + if terr := client.DeleteInstance(context.Background(), instance.ID); terr != nil { + t.Errorf("Error deleting test Instance: %s", terr) + } } + return instance, config, teardown, err +} + +func setupInstanceWithoutDisks(t *testing.T, fixturesYaml string, modifiers ...instanceModifier) (*linodego.Client, *linodego.Instance, *linodego.InstanceConfig, func(), error) { + t.Helper() + client, fixtureTeardown := createTestClient(t, fixturesYaml) + instance, config, instanceTeardown, err := createInstanceWithoutDisks(t, client) teardown := func() { if terr := client.DeleteInstance(context.Background(), instance.ID); terr != nil { t.Errorf("Error deleting test Instance: %s", terr) } + instanceTeardown() fixtureTeardown() } return client, instance, config, teardown, err diff --git a/test/integration/util_test.go b/test/integration/util_test.go index a3ad1cb41..c836cca56 100644 --- a/test/integration/util_test.go +++ b/test/integration/util_test.go @@ -7,6 +7,7 @@ import ( "net/http" "reflect" "regexp" + "strconv" "strings" "testing" "time" @@ -66,3 +67,15 @@ func assertSliceContains[T comparable](t *testing.T, slice []T, target T) { t.Fatalf("value %v not found in slice", target) } + +func minInt(a, b int) int { + if a < b { + return a + } + return b +} + +// return the current nanosecond in string type as a unique text. +func getUniqueText() string { + return strconv.FormatInt(time.Now().UnixNano(), 10) +} diff --git a/test/integration/vpc_subnet_test.go b/test/integration/vpc_subnet_test.go new file mode 100644 index 000000000..aafccbffe --- /dev/null +++ b/test/integration/vpc_subnet_test.go @@ -0,0 +1,193 @@ +package integration + +import ( + "context" + "fmt" + "testing" + + "github.com/linode/linodego" +) + +const ( + TestSubnet = "192.168.0.0/25" +) + +func formatVPCSubnetError(err error, action string, vpcID, vpcSubnetID *int) error { + if err == nil { + return nil + } + vpcMsg := "" + if vpcID != nil { + vpcMsg = fmt.Sprintf(" in VPC %v", *vpcID) + } + if vpcSubnetID == nil { + return fmt.Errorf( + "an error occurs when %v the subnet(s)%v: %v", + action, + vpcMsg, + err, + ) + } + return fmt.Errorf( + "an error occurs when %v the subnet %v%v: %v", + action, + *vpcSubnetID, + vpcMsg, + err, + ) +} + +func vpcSubnetCheck(vpcSubnet *linodego.VPCSubnet, t *testing.T) { + if vpcSubnet.ID == 0 { + t.Error("expected a VPC subnet ID, but got 0") + } + assertDateSet(t, vpcSubnet.Created) + assertDateSet(t, vpcSubnet.Updated) +} + +func vpcSubnetCreateOptionsCheck( + opts *linodego.VPCSubnetCreateOptions, + vpcSubnet *linodego.VPCSubnet, + t *testing.T, +) { + if !(opts.IPv4 == vpcSubnet.IPv4 && opts.Label == vpcSubnet.Label) { + t.Error( + "the VPC subnet instance and the VPC subnet " + + "create options instance are mismatched", + ) + } +} + +func vpcSubnetUpdateOptionsCheck( + opts *linodego.VPCSubnetUpdateOptions, + vpcSubnet *linodego.VPCSubnet, + t *testing.T, +) { + if !(opts.Label == vpcSubnet.Label) { + t.Error( + "the VPC subnet instance and the VPC subnet " + + "update options instance are mismatched", + ) + } +} + +func createVPCWithSubnet(t *testing.T, client *linodego.Client) ( + *linodego.VPC, + *linodego.VPCSubnet, + func(), + error, +) { + t.Helper() + vpc, vpcTeardown, err := createVPC(t, client) + if err != nil { + if vpcTeardown != nil { + vpcTeardown() + } + t.Fatal(err) + } + createOpts := linodego.VPCSubnetCreateOptions{ + Label: "linodego-vpc-test-" + getUniqueText(), + IPv4: TestSubnet, + } + vpcSubnet, err := client.CreateVPCSubnet(context.Background(), createOpts, vpc.ID) + if err != nil { + vpcTeardown() + t.Fatal(formatVPCSubnetError(err, "creating", &vpc.ID, nil)) + } + + teardown := func() { + err = client.DeleteVPCSubnet(context.Background(), vpc.ID, vpcSubnet.ID) + if err != nil { + t.Error(formatVPCSubnetError(err, "deleting", &vpc.ID, &vpcSubnet.ID)) + } + vpcTeardown() + } + return vpc, vpcSubnet, teardown, err +} + +func setupVPCWithSubnet( + t *testing.T, + fixturesYaml string, +) ( + *linodego.Client, + *linodego.VPC, + *linodego.VPCSubnet, + func(), + error, +) { + t.Helper() + client, fixtureTeardown := createTestClient(t, fixturesYaml) + + vpc, vpcSubnet, vpcSubnetTeardown, err := createVPCWithSubnet(t, client) + if err != nil { + if vpcSubnetTeardown != nil { + vpcSubnetTeardown() + } + fixtureTeardown() + t.Fatal(err) + } + teardown := func() { + vpcSubnetTeardown() + fixtureTeardown() + } + return client, vpc, vpcSubnet, teardown, err +} + +func TestVPC_Subnet_Create(t *testing.T) { + _, _, vpcSubnet, teardown, err := setupVPCWithSubnet(t, "fixtures/TestVPC_Subnet_Create") + defer teardown() + if err != nil { + t.Error(formatVPCSubnetError(err, "setting up", nil, nil)) + } + vpcSubnetCheck(vpcSubnet, t) + opts := vpcSubnet.GetCreateOptions() + vpcSubnetCreateOptionsCheck(&opts, vpcSubnet, t) +} + +func TestVPC_Subnet_Update(t *testing.T) { + client, vpc, vpcSubnet, teardown, err := setupVPCWithSubnet(t, "fixtures/TestVPC_Subnet_Update") + defer teardown() + if err != nil { + t.Error(formatVPCSubnetError(err, "setting up", nil, nil)) + } + vpcSubnetCheck(vpcSubnet, t) + + opts := vpcSubnet.GetUpdateOptions() + vpcSubnetUpdateOptionsCheck(&opts, vpcSubnet, t) + + updatedVPCSubnet, err := client.UpdateVPCSubnet( + context.Background(), + vpc.ID, + vpcSubnet.ID, + opts, + ) + if err != nil { + t.Error(formatVPCSubnetError(err, "updating", &vpc.ID, &vpcSubnet.ID)) + } + + vpcSubnetUpdateOptionsCheck(&opts, updatedVPCSubnet, t) +} + +func TestVPC_Subnet_List(t *testing.T) { + client, vpc, vpcSubnet, teardown, err := setupVPCWithSubnet(t, "fixtures/TestVPC_Subnet_List") + defer teardown() + if err != nil { + t.Error(formatVPCSubnetError(err, "setting up", nil, nil)) + } + vpcSubnetCheck(vpcSubnet, t) + opts := vpcSubnet.GetCreateOptions() + vpcSubnetCreateOptionsCheck(&opts, vpcSubnet, t) + + vpcSubnets, err := client.ListVPCSubnet(context.Background(), vpc.ID, nil) + + found := false + for _, v := range vpcSubnets { + if v.ID == vpcSubnet.ID { + found = true + } + } + + if !found { + t.Errorf("the VPC %v subnet %v not found in list", vpc.ID, vpcSubnet.ID) + } +} diff --git a/test/integration/vpc_test.go b/test/integration/vpc_test.go new file mode 100644 index 000000000..824a4e163 --- /dev/null +++ b/test/integration/vpc_test.go @@ -0,0 +1,164 @@ +package integration + +import ( + "context" + "fmt" + "testing" + + "github.com/linode/linodego" +) + +func formatVPCError(err error, action string, vpcID *int) error { + if err == nil { + return nil + } + if vpcID == nil { + return fmt.Errorf( + "an error occurs when %v the VPC(s): %v", + action, + err, + ) + } + return fmt.Errorf( + "an error occurs when %v the VPC %v: %v", + action, + *vpcID, + err, + ) +} + +func createVPC(t *testing.T, client *linodego.Client) (*linodego.VPC, func(), error) { + t.Helper() + createOpts := linodego.VPCCreateOptions{ + Label: "go-test-vpc-" + getUniqueText(), + Region: getRegionsWithCaps(t, client, []string{"VPCs"})[0], + } + vpc, err := client.CreateVPC(context.Background(), createOpts) + if err != nil { + t.Fatal(formatVPCError(err, "creating", nil)) + } + + teardown := func() { + if err := client.DeleteVPC(context.Background(), vpc.ID); err != nil { + t.Error(formatVPCError(err, "deleting", &vpc.ID)) + } + } + return vpc, teardown, err +} + +func setupVPC(t *testing.T, fixturesYaml string) ( + *linodego.Client, + *linodego.VPC, + func(), + error, +) { + t.Helper() + client, fixtureTeardown := createTestClient(t, fixturesYaml) + + vpc, vpcTeardown, err := createVPC(t, client) + + teardown := func() { + vpcTeardown() + fixtureTeardown() + } + return client, vpc, teardown, err +} + +func vpcCheck(vpc *linodego.VPC, t *testing.T) { + if vpc.ID == 0 { + t.Errorf("expected a VPC ID, but got 0") + } + assertDateSet(t, vpc.Created) + assertDateSet(t, vpc.Updated) +} + +func vpcCreateOptionsCheck( + opts *linodego.VPCCreateOptions, + vpc *linodego.VPC, + t *testing.T, +) { + good := (opts.Description == vpc.Description && + opts.Label == vpc.Label && + opts.Region == vpc.Region && + len(opts.Subnets) == len(vpc.Subnets)) + + for i := 0; i < minInt(len(opts.Subnets), len(vpc.Subnets)); i++ { + good = good && (opts.Subnets[i].IPv4 == vpc.Subnets[i].IPv4 && + opts.Subnets[i].Label == vpc.Subnets[i].Label) + } + + if !good { + t.Error( + "the VPC instance and the VPC creation options instance are mismatched", + ) + } +} + +func vpcUpdateOptionsCheck( + opts *linodego.VPCUpdateOptions, + vpc *linodego.VPC, + t *testing.T, +) { + if !(opts.Description == vpc.Description && opts.Label == vpc.Label) { + t.Error("the VPC instance and VPC Update Options instance are mismatched") + } +} + +func TestVPC_Create(t *testing.T) { + _, vpc, teardown, err := setupVPC(t, "fixtures/TestVPC_Create") + defer teardown() + if err != nil { + t.Error(formatVPCError(err, "setting up", nil)) + } + vpcCheck(vpc, t) + opts := vpc.GetCreateOptions() + vpcCreateOptionsCheck(&opts, vpc, t) +} + +func TestVPC_Update(t *testing.T) { + client, vpc, teardown, err := setupVPC(t, "fixtures/TestVPC_Update") + defer teardown() + if err != nil { + t.Error(formatVPCError(err, "setting up", nil)) + } + vpcCheck(vpc, t) + + opts := vpc.GetUpdateOptions() + vpcUpdateOptionsCheck(&opts, vpc, t) + + updatedDescription := "updated description" + updatedLabel := "updated-label" + + opts.Description = updatedDescription + opts.Label = updatedLabel + updatedVPC, err := client.UpdateVPC(context.Background(), vpc.ID, opts) + if err != nil { + t.Error(formatVPCError(err, "updating", &vpc.ID)) + } + vpcUpdateOptionsCheck(&opts, updatedVPC, t) +} + +func TestVPC_List(t *testing.T) { + client, vpc, teardown, err := setupVPC(t, "fixtures/TestVPC_List") + defer teardown() + if err != nil { + t.Error(formatVPCError(err, "setting up", nil)) + } + vpcCheck(vpc, t) + + vpcs, err := client.ListVPC(context.Background(), nil) + if err != nil { + t.Error(formatVPCError(err, "listing", nil)) + } + + found := false + for _, v := range vpcs { + if v.ID == vpc.ID { + found = true + } + } + + if !found { + t.Errorf("vpc %v not found in list", vpc.ID) + } +} diff --git a/vpc.go b/vpc.go new file mode 100644 index 000000000..5d7d945ff --- /dev/null +++ b/vpc.go @@ -0,0 +1,155 @@ +package linodego + +import ( + "context" + "encoding/json" + "fmt" + "time" + + "github.com/go-resty/resty/v2" + "github.com/linode/linodego/internal/parseabletime" +) + +type VPC struct { + ID int `json:"id"` + Label string `json:"label"` + Description string `json:"description"` + Region string `json:"region"` + Subnets []VPCSubnet `json:"subnets"` + Created *time.Time `json:"-"` + Updated *time.Time `json:"-"` +} + +type VPCCreateOptions struct { + Label string `json:"label"` + Description string `json:"description,omitempty"` + Region string `json:"region"` + Subnets []VPCSubnetCreateOptions `json:"subnets,omitempty"` +} + +type VPCUpdateOptions struct { + Label string `json:"label,omitempty"` + Description string `json:"description,omitempty"` +} + +type VPCsPagedResponse struct { + *PageOptions + Data []VPC `json:"data"` +} + +func (VPCsPagedResponse) endpoint(_ ...any) string { + return "vpcs" +} + +func (resp *VPCsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) { + res, err := coupleAPIErrors(r.SetResult(VPCsPagedResponse{}).Get(e)) + if err != nil { + return 0, 0, err + } + castedRes := res.Result().(*VPCsPagedResponse) + resp.Data = append(resp.Data, castedRes.Data...) + return castedRes.Pages, castedRes.Results, nil +} + +func (v VPC) GetCreateOptions() VPCCreateOptions { + subnetCreations := make([]VPCSubnetCreateOptions, len(v.Subnets)) + for i, s := range v.Subnets { + subnetCreations[i] = s.GetCreateOptions() + } + + return VPCCreateOptions{ + Label: v.Label, + Description: v.Description, + Region: v.Region, + Subnets: subnetCreations, + } +} + +func (v VPC) GetUpdateOptions() VPCUpdateOptions { + return VPCUpdateOptions{ + Label: v.Label, + Description: v.Description, + } +} + +func (v *VPC) UnmarshalJSON(b []byte) error { + type Mask VPC + p := struct { + *Mask + Created *parseabletime.ParseableTime `json:"created"` + Updated *parseabletime.ParseableTime `json:"updated"` + }{ + Mask: (*Mask)(v), + } + if err := json.Unmarshal(b, &p); err != nil { + return err + } + + v.Created = (*time.Time)(p.Created) + v.Updated = (*time.Time)(p.Updated) + + return nil +} + +func (c *Client) CreateVPC( + ctx context.Context, + opts VPCCreateOptions, +) (*VPC, error) { + body, err := json.Marshal(opts) + if err != nil { + return nil, err + } + + req := c.R(ctx).SetResult(&VPC{}).SetBody(string(body)) + r, err := coupleAPIErrors(req.Post("vpcs")) + if err != nil { + return nil, err + } + + return r.Result().(*VPC), nil +} + +func (c *Client) GetVPC(ctx context.Context, vpcID int) (*VPC, error) { + e := fmt.Sprintf("/vpcs/%d", vpcID) + req := c.R(ctx).SetResult(&VPC{}) + r, err := coupleAPIErrors(req.Get(e)) + if err != nil { + return nil, err + } + return r.Result().(*VPC), nil +} + +func (c *Client) ListVPC(ctx context.Context, opts *ListOptions) ([]VPC, error) { + response := VPCsPagedResponse{} + err := c.listHelper(ctx, &response, opts) + if err != nil { + return nil, err + } + return response.Data, nil +} + +func (c *Client) UpdateVPC( + ctx context.Context, + vpcID int, + opts VPCUpdateOptions, +) (*VPC, error) { + body, err := json.Marshal(opts) + if err != nil { + return nil, err + } + + e := fmt.Sprintf("vpcs/%d", vpcID) + req := c.R(ctx).SetResult(&VPC{}).SetBody(body) + r, err := coupleAPIErrors(req.Put(e)) + if err != nil { + return nil, err + } + + return r.Result().(*VPC), nil +} + +func (c *Client) DeleteVPC(ctx context.Context, vpcID int) error { + e := fmt.Sprintf("vpcs/%d", vpcID) + _, err := coupleAPIErrors(c.R(ctx).Delete(e)) + return err +} diff --git a/vpc_subnet.go b/vpc_subnet.go new file mode 100644 index 000000000..9f56cb23b --- /dev/null +++ b/vpc_subnet.go @@ -0,0 +1,157 @@ +package linodego + +import ( + "context" + "encoding/json" + "fmt" + "time" + + "github.com/go-resty/resty/v2" + "github.com/linode/linodego/internal/parseabletime" +) + +type VPCSubnet struct { + ID int `json:"id"` + Label string `json:"label"` + IPv4 string `json:"ipv4"` + Linodes []int `json:"linodes"` + Created *time.Time `json:"-"` + Updated *time.Time `json:"-"` +} + +type VPCSubnetCreateOptions struct { + Label string `json:"label"` + IPv4 string `json:"ipv4"` +} + +type VPCSubnetUpdateOptions struct { + Label string `json:"label"` +} + +type VPCSubnetsPagedResponse struct { + *PageOptions + Data []VPCSubnet `json:"data"` +} + +func (VPCSubnetsPagedResponse) endpoint(ids ...any) string { + id := ids[0].(int) + return fmt.Sprintf("vpcs/%d/subnets", id) +} + +func (resp *VPCSubnetsPagedResponse) castResult( + r *resty.Request, + e string, +) (int, int, error) { + res, err := coupleAPIErrors(r.SetResult(VPCSubnetsPagedResponse{}).Get(e)) + if err != nil { + return 0, 0, err + } + castedRes := res.Result().(*VPCSubnetsPagedResponse) + resp.Data = append(resp.Data, castedRes.Data...) + return castedRes.Pages, castedRes.Results, nil +} + +func (v *VPCSubnet) UnmarshalJSON(b []byte) error { + type Mask VPCSubnet + p := struct { + *Mask + Created *parseabletime.ParseableTime `json:"created"` + Updated *parseabletime.ParseableTime `json:"updated"` + }{ + Mask: (*Mask)(v), + } + if err := json.Unmarshal(b, &p); err != nil { + return err + } + + v.Created = (*time.Time)(p.Created) + v.Updated = (*time.Time)(p.Updated) + + return nil +} + +func (v VPCSubnet) GetCreateOptions() VPCSubnetCreateOptions { + return VPCSubnetCreateOptions{ + Label: v.Label, + IPv4: v.IPv4, + } +} + +func (v VPCSubnet) GetUpdateOptions() VPCSubnetUpdateOptions { + return VPCSubnetUpdateOptions{Label: v.Label} +} + +func (c *Client) CreateVPCSubnet( + ctx context.Context, + opts VPCSubnetCreateOptions, + vpcID int, +) (*VPCSubnet, error) { + body, err := json.Marshal(opts) + if err != nil { + return nil, err + } + + req := c.R(ctx).SetResult(&VPCSubnet{}).SetBody(string(body)) + e := fmt.Sprintf("vpcs/%d/subnets", vpcID) + r, err := coupleAPIErrors(req.Post(e)) + if err != nil { + return nil, err + } + + return r.Result().(*VPCSubnet), nil +} + +func (c *Client) GetVPCSubnet( + ctx context.Context, + vpcID int, + subnetID int, +) (*VPCSubnet, error) { + req := c.R(ctx).SetResult(&VPCSubnet{}) + + e := fmt.Sprintf("vpcs/%d/subnets/%d", vpcID, subnetID) + r, err := coupleAPIErrors(req.Get(e)) + if err != nil { + return nil, err + } + return r.Result().(*VPCSubnet), nil +} + +func (c *Client) ListVPCSubnet( + ctx context.Context, + vpcID int, + opts *ListOptions, +) ([]VPCSubnet, error) { + response := VPCSubnetsPagedResponse{} + err := c.listHelper(ctx, &response, opts, vpcID) + if err != nil { + return nil, err + } + return response.Data, nil +} + +func (c *Client) UpdateVPCSubnet( + ctx context.Context, + vpcID int, + subnetID int, + opts VPCSubnetUpdateOptions, +) (*VPCSubnet, error) { + body, err := json.Marshal(opts) + if err != nil { + return nil, err + } + + req := c.R(ctx).SetResult(&VPCSubnet{}).SetBody(body) + e := fmt.Sprintf("vpcs/%d/subnets/%d", vpcID, subnetID) + r, err := coupleAPIErrors(req.Put(e)) + if err != nil { + return nil, err + } + + return r.Result().(*VPCSubnet), nil +} + +func (c *Client) DeleteVPCSubnet(ctx context.Context, vpcID int, subnetID int) error { + e := fmt.Sprintf("vpcs/%d/subnets/%d", vpcID, subnetID) + _, err := coupleAPIErrors(c.R(ctx).Delete(e)) + return err +} From 4d3bb35bb3b99e331b172f83e02a6faea648b2f2 Mon Sep 17 00:00:00 2001 From: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> Date: Fri, 1 Sep 2023 14:20:21 -0400 Subject: [PATCH 02/14] Fix instance create opts (#373) --- instances.go | 34 ++++++++++++------------ test/integration/instance_config_test.go | 2 -- test/integration/instances_test.go | 7 ++--- test/integration/vlans_test.go | 2 +- test/integration/vpc_test.go | 2 +- 5 files changed, 21 insertions(+), 26 deletions(-) diff --git a/instances.go b/instances.go index cff4f9c3f..d5a514232 100644 --- a/instances.go +++ b/instances.go @@ -107,23 +107,23 @@ type InstanceMetadataOptions struct { // InstanceCreateOptions require only Region and Type type InstanceCreateOptions struct { - Region string `json:"region"` - Type string `json:"type"` - Label string `json:"label,omitempty"` - Group string `json:"group,omitempty"` - RootPass string `json:"root_pass,omitempty"` - AuthorizedKeys []string `json:"authorized_keys,omitempty"` - AuthorizedUsers []string `json:"authorized_users,omitempty"` - StackScriptID int `json:"stackscript_id,omitempty"` - StackScriptData map[string]string `json:"stackscript_data,omitempty"` - BackupID int `json:"backup_id,omitempty"` - Image string `json:"image,omitempty"` - Interfaces []InstanceConfigInterface `json:"interfaces,omitempty"` - BackupsEnabled bool `json:"backups_enabled,omitempty"` - PrivateIP bool `json:"private_ip,omitempty"` - Tags []string `json:"tags,omitempty"` - Metadata *InstanceMetadataOptions `json:"metadata,omitempty"` - FirewallID int `json:"firewall_id,omitempty"` + Region string `json:"region"` + Type string `json:"type"` + Label string `json:"label,omitempty"` + Group string `json:"group,omitempty"` + RootPass string `json:"root_pass,omitempty"` + AuthorizedKeys []string `json:"authorized_keys,omitempty"` + AuthorizedUsers []string `json:"authorized_users,omitempty"` + StackScriptID int `json:"stackscript_id,omitempty"` + StackScriptData map[string]string `json:"stackscript_data,omitempty"` + BackupID int `json:"backup_id,omitempty"` + Image string `json:"image,omitempty"` + Interfaces []InstanceConfigInterfaceCreateOptions `json:"interfaces,omitempty"` + BackupsEnabled bool `json:"backups_enabled,omitempty"` + PrivateIP bool `json:"private_ip,omitempty"` + Tags []string `json:"tags,omitempty"` + Metadata *InstanceMetadataOptions `json:"metadata,omitempty"` + FirewallID int `json:"firewall_id,omitempty"` // Creation fields that need to be set explicitly false, "", or 0 use pointers SwapSize *int `json:"swap_size,omitempty"` diff --git a/test/integration/instance_config_test.go b/test/integration/instance_config_test.go index 9fe5821d8..c3cdec023 100644 --- a/test/integration/instance_config_test.go +++ b/test/integration/instance_config_test.go @@ -37,8 +37,6 @@ func setupVPCWithSubnetWithInstance( vpc, vpcSubnet, vpcWithSubnetTeardown, err := createVPCWithSubnet(t, client) if err != nil { t.Error(err) - instanceTeardown() - vpcWithSubnetTeardown() } teardownAll := func() { diff --git a/test/integration/instances_test.go b/test/integration/instances_test.go index 7e1492eed..57e3889e1 100644 --- a/test/integration/instances_test.go +++ b/test/integration/instances_test.go @@ -508,7 +508,7 @@ func createInstanceWithoutDisks( instance, err := client.CreateInstance(context.Background(), createOpts) if err != nil { t.Errorf("Error creating test Instance: %s", err) - return nil, nil, func(){}, err + return nil, nil, func() {}, err } configOpts := linodego.InstanceConfigCreateOptions{ Label: "go-test-conf-" + randLabel(), @@ -516,7 +516,7 @@ func createInstanceWithoutDisks( config, err := client.CreateInstanceConfig(context.Background(), instance.ID, configOpts) if err != nil { t.Errorf("Error creating config: %s", err) - return nil, nil, func(){}, err + return nil, nil, func() {}, err } teardown := func() { @@ -533,9 +533,6 @@ func setupInstanceWithoutDisks(t *testing.T, fixturesYaml string, modifiers ...i instance, config, instanceTeardown, err := createInstanceWithoutDisks(t, client) teardown := func() { - if terr := client.DeleteInstance(context.Background(), instance.ID); terr != nil { - t.Errorf("Error deleting test Instance: %s", terr) - } instanceTeardown() fixtureTeardown() } diff --git a/test/integration/vlans_test.go b/test/integration/vlans_test.go index 99b903db1..9b7bca69d 100644 --- a/test/integration/vlans_test.go +++ b/test/integration/vlans_test.go @@ -86,7 +86,7 @@ func createVLANInstance(t *testing.T, client *linodego.Client, instanceName, vla trueBool := true instance, err := createInstance(t, client, func(client *linodego.Client, opts *linodego.InstanceCreateOptions) { - opts.Interfaces = []linodego.InstanceConfigInterface{ + opts.Interfaces = []linodego.InstanceConfigInterfaceCreateOptions{ { Label: vlanName, Purpose: linodego.InterfacePurposeVLAN, diff --git a/test/integration/vpc_test.go b/test/integration/vpc_test.go index 824a4e163..43294afb3 100644 --- a/test/integration/vpc_test.go +++ b/test/integration/vpc_test.go @@ -157,7 +157,7 @@ func TestVPC_List(t *testing.T) { found = true } } - + if !found { t.Errorf("vpc %v not found in list", vpc.ID) } From 9eee757b17a61fcb5f94d733757ec8605155e9c6 Mon Sep 17 00:00:00 2001 From: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> Date: Tue, 26 Sep 2023 13:22:53 -0400 Subject: [PATCH 03/14] Change vpc to vpc_id in InstanceConfigInterface (#388) --- instance_config_interfaces.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instance_config_interfaces.go b/instance_config_interfaces.go index 87e6bf514..f756bb42e 100644 --- a/instance_config_interfaces.go +++ b/instance_config_interfaces.go @@ -13,7 +13,7 @@ type InstanceConfigInterface struct { Label string `json:"label"` Purpose ConfigInterfacePurpose `json:"purpose"` Primary bool `json:"primary"` - VPC *int `json:"vpc"` + VPCID *int `json:"vpc_id"` SubnetID *int `json:"subnet_id"` IPv4 VPCIPv4 `json:"ipv4"` IPRanges []string `json:"ip_ranges"` From 7e34133b47b8e8c110631a935a7e068ef1cc4570 Mon Sep 17 00:00:00 2001 From: Youjung Kim <126618609+ykim-1@users.noreply.github.com> Date: Mon, 16 Oct 2023 09:55:20 -0700 Subject: [PATCH 04/14] test: add test coverage for vpc (#405) * add negative test cases * address pr comment * spelling --- test/integration/vpc_subnet_test.go | 66 +++++++++++++++++++++++++++++ test/integration/vpc_test.go | 58 +++++++++++++++++++++++++ 2 files changed, 124 insertions(+) diff --git a/test/integration/vpc_subnet_test.go b/test/integration/vpc_subnet_test.go index aafccbffe..8a98baa6f 100644 --- a/test/integration/vpc_subnet_test.go +++ b/test/integration/vpc_subnet_test.go @@ -3,9 +3,11 @@ package integration import ( "context" "fmt" + "strings" "testing" "github.com/linode/linodego" + . "github.com/linode/linodego" ) const ( @@ -105,6 +107,24 @@ func createVPCWithSubnet(t *testing.T, client *linodego.Client) ( return vpc, vpcSubnet, teardown, err } +func createVPCWithSubnetInvalidLabel(t *testing.T, client *linodego.Client) error { + t.Helper() + vpc, vpcTeardown, err := createVPC(t, client) + if err != nil { + if vpcTeardown != nil { + vpcTeardown() + } + t.Fatal(err) + } + createOpts := linodego.VPCSubnetCreateOptions{ + Label: "linodego-vpc-test_invalid_label" + getUniqueText(), + IPv4: TestSubnet, + } + _, err = client.CreateVPCSubnet(context.Background(), createOpts, vpc.ID) + + return err +} + func setupVPCWithSubnet( t *testing.T, fixturesYaml string, @@ -191,3 +211,49 @@ func TestVPC_Subnet_List(t *testing.T) { t.Errorf("the VPC %v subnet %v not found in list", vpc.ID, vpcSubnet.ID) } } + +func TestVPC_Subnet_Create_Invalid_data(t *testing.T) { + client, _ := createTestClient(t, "fixtures/TestVPC_Subnet_Create_Invalid_Label") + + err := createVPCWithSubnetInvalidLabel(t, client) + + e, _ := err.(*Error) + + if e.Code != 400 { + t.Errorf("should have received a 400 Code with invalid label, got %v", e.Code) + } + expectedErrorMessage := "Label must include only ASCII letters, numbers, and dashes" + if !strings.Contains(e.Message, expectedErrorMessage) { + t.Errorf("Wrong error message displayed should have contained, %s", expectedErrorMessage) + } +} + +func TestVPC_Subnet_Update_Invalid_data(t *testing.T) { + client, vpc, vpcSubnet, teardown, err := setupVPCWithSubnet(t, "fixtures/TestVPC_Subnet_Update_Invalid_Label") + defer teardown() + if err != nil { + t.Error(formatVPCSubnetError(err, "setting up", nil, nil)) + } + vpcSubnetCheck(vpcSubnet, t) + + opts := vpcSubnet.GetUpdateOptions() + vpcSubnetUpdateOptionsCheck(&opts, vpcSubnet, t) + + opts.Label = "invalid_label" + _, err = client.UpdateVPCSubnet( + context.Background(), + vpc.ID, + vpcSubnet.ID, + opts, + ) + + e, _ := err.(*Error) + + if e.Code != 400 { + t.Errorf("should have received a 400 Code with invalid label, got %v", e.Code) + } + expectedErrorMessage := "Label must include only ASCII letters, numbers, and dashes" + if !strings.Contains(e.Message, expectedErrorMessage) { + t.Errorf("Wrong error message displayed should have contained, %s", expectedErrorMessage) + } +} diff --git a/test/integration/vpc_test.go b/test/integration/vpc_test.go index 43294afb3..6a9b627ed 100644 --- a/test/integration/vpc_test.go +++ b/test/integration/vpc_test.go @@ -3,9 +3,11 @@ package integration import ( "context" "fmt" + "strings" "testing" "github.com/linode/linodego" + . "github.com/linode/linodego" ) func formatVPCError(err error, action string, vpcID *int) error { @@ -46,6 +48,17 @@ func createVPC(t *testing.T, client *linodego.Client) (*linodego.VPC, func(), er return vpc, teardown, err } +func createVPC_invalid_label(t *testing.T, client *linodego.Client) error { + t.Helper() + createOpts := linodego.VPCCreateOptions{ + Label: "gotest_vpc_invalid_label" + getUniqueText(), + Region: getRegionsWithCaps(t, client, []string{"VPCs"})[0], + } + _, err := client.CreateVPC(context.Background(), createOpts) + + return err +} + func setupVPC(t *testing.T, fixturesYaml string) ( *linodego.Client, *linodego.VPC, @@ -162,3 +175,48 @@ func TestVPC_List(t *testing.T) { t.Errorf("vpc %v not found in list", vpc.ID) } } + +func TestVPC_Create_Invalid_data(t *testing.T) { + client, _ := createTestClient(t, "fixtures/TestVPC_Create_Invalid") + err := createVPC_invalid_label(t, client) + + e, _ := err.(*Error) + + if e.Code != 400 { + t.Errorf("should have received a 400 Code with invalid label, got %v", e.Code) + } + expectedErrorMessage := "Label must include only ASCII letters, numbers, and dashes" + if !strings.Contains(e.Message, expectedErrorMessage) { + t.Errorf("Wrong error message displayed should have contained, %s", expectedErrorMessage) + } +} + +func TestVPC_Update_Invalid_data(t *testing.T) { + client, vpc, teardown, err := setupVPC(t, "fixtures/TestVPC_Update_Invalid") + defer teardown() + if err != nil { + t.Error(formatVPCError(err, "setting up", nil)) + } + vpcCheck(vpc, t) + + opts := vpc.GetUpdateOptions() + vpcUpdateOptionsCheck(&opts, vpc, t) + + updatedDescription := "updated description" + updatedLabel := "updated_invalid_label" + + opts.Description = updatedDescription + opts.Label = updatedLabel + + _, err = client.UpdateVPC(context.Background(), vpc.ID, opts) + + e, _ := err.(*Error) + + if e.Code != 400 { + t.Errorf("should have received a 400 Code with invalid label, got %v", e.Code) + } + expectedErrorMessage := "Label must include only ASCII letters, numbers, and dashes" + if !strings.Contains(e.Message, expectedErrorMessage) { + t.Errorf("Wrong error message displayed should have contained, %s", expectedErrorMessage) + } +} From c889822db6720282496d1e046c5baa46abc69f68 Mon Sep 17 00:00:00 2001 From: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> Date: Sat, 21 Oct 2023 03:55:23 -0400 Subject: [PATCH 05/14] Add omitempty tag to `VPCIPv4` struct (#408) --- instance_config_interfaces.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instance_config_interfaces.go b/instance_config_interfaces.go index f756bb42e..f402e37de 100644 --- a/instance_config_interfaces.go +++ b/instance_config_interfaces.go @@ -20,8 +20,8 @@ type InstanceConfigInterface struct { } type VPCIPv4 struct { - VPC string `json:"vpc"` - NAT1To1 string `json:"nat_1_1"` + VPC string `json:"vpc,omitempty"` + NAT1To1 string `json:"nat_1_1,omitempty"` } type InstanceConfigInterfaceCreateOptions struct { From a3629785d59ba46e5aa727885aab0f7febd4035b Mon Sep 17 00:00:00 2001 From: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> Date: Mon, 23 Oct 2023 21:35:14 -0400 Subject: [PATCH 06/14] Fix and improve VPC test (#412) --- test/integration/vpc_subnet_test.go | 30 ++++++++++------------------- test/integration/vpc_test.go | 6 ++++-- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/test/integration/vpc_subnet_test.go b/test/integration/vpc_subnet_test.go index 8a98baa6f..b847b0ab4 100644 --- a/test/integration/vpc_subnet_test.go +++ b/test/integration/vpc_subnet_test.go @@ -107,23 +107,6 @@ func createVPCWithSubnet(t *testing.T, client *linodego.Client) ( return vpc, vpcSubnet, teardown, err } -func createVPCWithSubnetInvalidLabel(t *testing.T, client *linodego.Client) error { - t.Helper() - vpc, vpcTeardown, err := createVPC(t, client) - if err != nil { - if vpcTeardown != nil { - vpcTeardown() - } - t.Fatal(err) - } - createOpts := linodego.VPCSubnetCreateOptions{ - Label: "linodego-vpc-test_invalid_label" + getUniqueText(), - IPv4: TestSubnet, - } - _, err = client.CreateVPCSubnet(context.Background(), createOpts, vpc.ID) - - return err -} func setupVPCWithSubnet( t *testing.T, @@ -213,10 +196,17 @@ func TestVPC_Subnet_List(t *testing.T) { } func TestVPC_Subnet_Create_Invalid_data(t *testing.T) { - client, _ := createTestClient(t, "fixtures/TestVPC_Subnet_Create_Invalid_Label") - - err := createVPCWithSubnetInvalidLabel(t, client) + client, vpc, teardown, err := setupVPC(t, "fixtures/TestVPC_Subnet_Create_Invalid_data") + defer teardown() + if err != nil { + t.Error(formatVPCSubnetError(err, "setting up", nil, nil)) + } + createOpts := linodego.VPCSubnetCreateOptions{ + Label: "linodego-vpc-test_invalid_label" + getUniqueText(), + IPv4: TestSubnet, + } + _, err = client.CreateVPCSubnet(context.Background(), createOpts, vpc.ID) e, _ := err.(*Error) if e.Code != 400 { diff --git a/test/integration/vpc_test.go b/test/integration/vpc_test.go index 6a9b627ed..52633a39d 100644 --- a/test/integration/vpc_test.go +++ b/test/integration/vpc_test.go @@ -117,8 +117,9 @@ func vpcUpdateOptionsCheck( } } -func TestVPC_Create(t *testing.T) { - _, vpc, teardown, err := setupVPC(t, "fixtures/TestVPC_Create") + +func TestVPC_CreateGet(t *testing.T) { + client, vpc, teardown, err := setupVPC(t, "fixtures/TestVPC_CreateGet") defer teardown() if err != nil { t.Error(formatVPCError(err, "setting up", nil)) @@ -126,6 +127,7 @@ func TestVPC_Create(t *testing.T) { vpcCheck(vpc, t) opts := vpc.GetCreateOptions() vpcCreateOptionsCheck(&opts, vpc, t) + client.GetVPC(context.TODO(), vpc.ID) } func TestVPC_Update(t *testing.T) { From 9b516293c588b4c79a33f2c2a90d193dbe484dfb Mon Sep 17 00:00:00 2001 From: Lena Garber <114949949+lgarber-akamai@users.noreply.github.com> Date: Thu, 2 Nov 2023 13:15:25 -0400 Subject: [PATCH 07/14] Update VPCSubnet linodes field (#414) Prod fixtures --- .golangci.yml | 1 + go.work.sum | 12 +- instance_config_interfaces.go | 1 + internal/duration/duration.go | 17 +- pagination.go | 3 +- .../fixtures/TestVPC_CreateGet.yaml | 416 +++++++++++ test/integration/fixtures/TestVPC_List.yaml | 420 +++++++++++ .../fixtures/TestVPC_Subnet_Create.yaml | 471 ++++++++++++ .../TestVPC_Subnet_Create_Invalid_data.yaml | 396 +++++++++++ .../fixtures/TestVPC_Subnet_List.yaml | 532 ++++++++++++++ .../fixtures/TestVPC_Subnet_Update.yaml | 530 ++++++++++++++ .../TestVPC_Subnet_Update_Invalid_Label.yaml | 512 +++++++++++++ .../fixtures/TestVPC_Subnet_WithInstance.yaml | 671 ++++++++++++++++++ test/integration/fixtures/TestVPC_Update.yaml | 414 +++++++++++ .../fixtures/TestVPC_Update_Invalid.yaml | 396 +++++++++++ test/integration/instance_config_test.go | 36 +- test/integration/instances_test.go | 2 +- test/integration/vpc_subnet_test.go | 35 +- test/integration/vpc_test.go | 10 +- vpc_subnet.go | 25 +- 20 files changed, 4846 insertions(+), 54 deletions(-) create mode 100644 test/integration/fixtures/TestVPC_CreateGet.yaml create mode 100644 test/integration/fixtures/TestVPC_List.yaml create mode 100644 test/integration/fixtures/TestVPC_Subnet_Create.yaml create mode 100644 test/integration/fixtures/TestVPC_Subnet_Create_Invalid_data.yaml create mode 100644 test/integration/fixtures/TestVPC_Subnet_List.yaml create mode 100644 test/integration/fixtures/TestVPC_Subnet_Update.yaml create mode 100644 test/integration/fixtures/TestVPC_Subnet_Update_Invalid_Label.yaml create mode 100644 test/integration/fixtures/TestVPC_Subnet_WithInstance.yaml create mode 100644 test/integration/fixtures/TestVPC_Update.yaml create mode 100644 test/integration/fixtures/TestVPC_Update_Invalid.yaml diff --git a/.golangci.yml b/.golangci.yml index 955da7862..bc15e56d7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -86,4 +86,5 @@ linters: - exhaustive - depguard - tagalign + - inamedparam fast: false diff --git a/go.work.sum b/go.work.sum index 7657b6aff..3ace811a3 100644 --- a/go.work.sum +++ b/go.work.sum @@ -156,7 +156,7 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/yuin/goldmark v1.2.1 h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM= github.com/yuin/goldmark v1.3.5 h1:dPmz1Snjq0kmkz159iL7S6WzdahUTHnHB5M56WFVifs= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -168,35 +168,27 @@ golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98y golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= diff --git a/instance_config_interfaces.go b/instance_config_interfaces.go index f402e37de..d975ddcbc 100644 --- a/instance_config_interfaces.go +++ b/instance_config_interfaces.go @@ -13,6 +13,7 @@ type InstanceConfigInterface struct { Label string `json:"label"` Purpose ConfigInterfacePurpose `json:"purpose"` Primary bool `json:"primary"` + Active bool `json:"active"` VPCID *int `json:"vpc_id"` SubnetID *int `json:"subnet_id"` IPv4 VPCIPv4 `json:"ipv4"` diff --git a/internal/duration/duration.go b/internal/duration/duration.go index 088f12f02..14d4f1365 100644 --- a/internal/duration/duration.go +++ b/internal/duration/duration.go @@ -20,16 +20,17 @@ func UnmarshalTimeRemaining(m json.RawMessage) *int { var timeStr string if err := json.Unmarshal(jsonBytes, &timeStr); err == nil && len(timeStr) > 0 { - if dur, err := durationToSeconds(timeStr); err != nil { + dur, err := durationToSeconds(timeStr) + if err != nil { panic(err) - } else { - return &dur - } - } else { - var intPtr int - if err := json.Unmarshal(jsonBytes, &intPtr); err == nil { - return &intPtr } + + return &dur + } + + var intPtr int + if err := json.Unmarshal(jsonBytes, &intPtr); err == nil { + return &intPtr } log.Println("[WARN] Unexpected unmarshalTimeRemaining value: ", jsonBytes) diff --git a/pagination.go b/pagination.go index 608985d60..671ef602f 100644 --- a/pagination.go +++ b/pagination.go @@ -7,6 +7,7 @@ package linodego import ( "context" "crypto/sha256" + "encoding/hex" "encoding/json" "fmt" "reflect" @@ -53,7 +54,7 @@ func (l ListOptions) Hash() (string, error) { h.Write(data) - return fmt.Sprintf("%x", h.Sum(nil)), nil + return hex.EncodeToString(h.Sum(nil)), nil } func applyListOptionsToRequest(opts *ListOptions, req *resty.Request) error { diff --git a/test/integration/fixtures/TestVPC_CreateGet.yaml b/test/integration/fixtures/TestVPC_CreateGet.yaml new file mode 100644 index 000000000..abeabb370 --- /dev/null +++ b/test/integration/fixtures/TestVPC_CreateGet.yaml @@ -0,0 +1,416 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-vpc-1698762176794940000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 6055, "label": "go-test-vpc-1698762176794940000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6055 + method: GET + response: + body: '{"id": 6055, "label": "go-test-vpc-1698762176794940000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6055 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestVPC_List.yaml b/test/integration/fixtures/TestVPC_List.yaml new file mode 100644 index 000000000..99b9ab4b3 --- /dev/null +++ b/test/integration/fixtures/TestVPC_List.yaml @@ -0,0 +1,420 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-vpc-1698762178043273000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 6057, "label": "go-test-vpc-1698762178043273000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: GET + response: + body: '{"data": [{"id": 6007, "label": "sdfsdfdsfaf", "description": "", "region": + "es-mad", "subnets": [{"id": 6815, "label": "sdfadsf", "ipv4": "10.0.4.0/24", + "linodes": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}], + "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}, {"id": + 6057, "label": "go-test-vpc-1698762178043273000", "description": "", "region": + "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}], + "page": 1, "pages": 1, "results": 2}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "525" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6057 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestVPC_Subnet_Create.yaml b/test/integration/fixtures/TestVPC_Subnet_Create.yaml new file mode 100644 index 000000000..5d6cd5bd6 --- /dev/null +++ b/test/integration/fixtures/TestVPC_Subnet_Create.yaml @@ -0,0 +1,471 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-vpc-1698762163245862000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 6049, "label": "go-test-vpc-1698762163245862000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"linodego-vpc-test-1698762163910375000","ipv4":"192.168.0.0/25"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6049/subnets + method: POST + response: + body: '{"id": 6866, "label": "linodego-vpc-test-1698762163910375000", "ipv4": + "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "171" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6049/subnets/6866 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6049 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestVPC_Subnet_Create_Invalid_data.yaml b/test/integration/fixtures/TestVPC_Subnet_Create_Invalid_data.yaml new file mode 100644 index 000000000..500cbd626 --- /dev/null +++ b/test/integration/fixtures/TestVPC_Subnet_Create_Invalid_data.yaml @@ -0,0 +1,396 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-vpc-1698762167936940000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 6052, "label": "go-test-vpc-1698762167936940000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"linodego-vpc-test_invalid_label1698762168247777000","ipv4":"192.168.0.0/25"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6052/subnets + method: POST + response: + body: '{"errors": [{"reason": "Label must include only ASCII letters, numbers, + and dashes", "field": "label"}]}' + headers: + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Connection: + - keep-alive + Content-Length: + - "104" + Content-Type: + - application/json + Server: + - nginx + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Frame-Options: + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + status: 400 BAD REQUEST + code: 400 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6052 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestVPC_Subnet_List.yaml b/test/integration/fixtures/TestVPC_Subnet_List.yaml new file mode 100644 index 000000000..431efb756 --- /dev/null +++ b/test/integration/fixtures/TestVPC_Subnet_List.yaml @@ -0,0 +1,532 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-vpc-1698762165972812000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 6051, "label": "go-test-vpc-1698762165972812000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"linodego-vpc-test-1698762166877032000","ipv4":"192.168.0.0/25"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6051/subnets + method: POST + response: + body: '{"id": 6868, "label": "linodego-vpc-test-1698762166877032000", "ipv4": + "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "171" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6051/subnets + method: GET + response: + body: '{"data": [{"id": 6868, "label": "linodego-vpc-test-1698762166877032000", + "ipv4": "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}], "page": 1, "pages": 1, "results": 1}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "220" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6051/subnets/6868 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6051 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestVPC_Subnet_Update.yaml b/test/integration/fixtures/TestVPC_Subnet_Update.yaml new file mode 100644 index 000000000..e0b7d9fc5 --- /dev/null +++ b/test/integration/fixtures/TestVPC_Subnet_Update.yaml @@ -0,0 +1,530 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-vpc-1698762164731424000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 6050, "label": "go-test-vpc-1698762164731424000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"linodego-vpc-test-1698762165016049000","ipv4":"192.168.0.0/25"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6050/subnets + method: POST + response: + body: '{"id": 6867, "label": "linodego-vpc-test-1698762165016049000", "ipv4": + "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "171" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"linodego-vpc-test-1698762165016049000"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6050/subnets/6867 + method: PUT + response: + body: '{"id": 6867, "label": "linodego-vpc-test-1698762165016049000", "ipv4": + "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "171" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6050/subnets/6867 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6050 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestVPC_Subnet_Update_Invalid_Label.yaml b/test/integration/fixtures/TestVPC_Subnet_Update_Invalid_Label.yaml new file mode 100644 index 000000000..979304c1d --- /dev/null +++ b/test/integration/fixtures/TestVPC_Subnet_Update_Invalid_Label.yaml @@ -0,0 +1,512 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-vpc-1698762168414623000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 6053, "label": "go-test-vpc-1698762168414623000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"linodego-vpc-test-1698762169017965000","ipv4":"192.168.0.0/25"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6053/subnets + method: POST + response: + body: '{"id": 6869, "label": "linodego-vpc-test-1698762169017965000", "ipv4": + "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "171" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"invalid_label"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6053/subnets/6869 + method: PUT + response: + body: '{"errors": [{"reason": "Label must include only ASCII letters, numbers, + and dashes", "field": "label"}]}' + headers: + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Connection: + - keep-alive + Content-Length: + - "104" + Content-Type: + - application/json + Server: + - nginx + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Frame-Options: + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + status: 400 BAD REQUEST + code: 400 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6053/subnets/6869 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6053 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestVPC_Subnet_WithInstance.yaml b/test/integration/fixtures/TestVPC_Subnet_WithInstance.yaml new file mode 100644 index 000000000..56dd2d7d3 --- /dev/null +++ b/test/integration/fixtures/TestVPC_Subnet_WithInstance.yaml @@ -0,0 +1,671 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-1dr662rf8lv8","booted":false}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances + method: POST + response: + body: '{"id": 51465490, "label": "go-test-ins-wo-disk-1dr662rf8lv8", "group": + "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", + "type": "g6-nanode-1", "ipv4": ["172.233.110.34"], "ipv6": "1234::5678/128", + "image": null, "region": "es-mad", "specs": {"disk": 25600, "memory": 1024, + "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": + 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": + false, "available": false, "schedule": {"day": null, "window": null}, "last_successful": + null}, "hypervisor": "kvm", "watchdog_enabled": true, "tags": [], "host_uuid": + "afc09e0e1675161707bcf1232af4d0b7ffe00c7a", "has_user_data": false}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "737" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "10" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-conf-7gc8z7sk59k4","devices":{},"interfaces":null}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51465490/configs + method: POST + response: + body: '{"id": 54444688, "label": "go-test-conf-7gc8z7sk59k4", "helpers": {"updatedb_disabled": + true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": + true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": + "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", + "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, + "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", + "virt_mode": "paravirt", "interfaces": []}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "539" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-vpc-1698762171373822000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 6054, "label": "go-test-vpc-1698762171373822000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"linodego-vpc-test-1698762171783114000","ipv4":"192.168.0.0/25"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6054/subnets + method: POST + response: + body: '{"id": 6870, "label": "linodego-vpc-test-1698762171783114000", "ipv4": + "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "171" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-conf-7gc8z7sk59k4","comments":"","devices":{},"helpers":{"updatedb_disabled":true,"distro":true,"modules_dep":true,"network":true,"devtmpfs_automount":true},"interfaces":[{"purpose":"public"},{"label":"testvlan","purpose":"vlan"},{"purpose":"vpc","subnet_id":6870}],"memory_limit":0,"kernel":"linode/latest-64bit","init_rd":null,"root_device":"/dev/sda","run_level":"default","virt_mode":"paravirt"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51465490/configs/54444688 + method: PUT + response: + body: '{"id": 54444688, "label": "go-test-conf-7gc8z7sk59k4", "helpers": {"updatedb_disabled": + true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": + true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": + "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", + "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, + "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", + "virt_mode": "paravirt", "interfaces": [{"id": 778328, "purpose": "public", + "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": + null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 778329, + "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": + "testvlan", "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": + ""}}, {"id": 778330, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 6054, "subnet_id": 6870, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": ""}}]}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6054/subnets/6870 + method: GET + response: + body: '{"id": 6870, "label": "linodego-vpc-test-1698762171783114000", "ipv4": + "192.168.0.0/25", "linodes": [{"id": 51465490, "interfaces": [{"id": 778330, + "active": false}]}], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "236" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51465490 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestVPC_Update.yaml b/test/integration/fixtures/TestVPC_Update.yaml new file mode 100644 index 000000000..e917be25f --- /dev/null +++ b/test/integration/fixtures/TestVPC_Update.yaml @@ -0,0 +1,414 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-vpc-1698762177547107000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 6056, "label": "go-test-vpc-1698762177547107000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"updated-label","description":"updated description"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6056 + method: PUT + response: + body: '{"id": 6056, "label": "updated-label", "description": "updated description", + "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "179" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6056 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestVPC_Update_Invalid.yaml b/test/integration/fixtures/TestVPC_Update_Invalid.yaml new file mode 100644 index 000000000..1f9ed1b52 --- /dev/null +++ b/test/integration/fixtures/TestVPC_Update_Invalid.yaml @@ -0,0 +1,396 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-vpc-1698762179588832000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 6058, "label": "go-test-vpc-1698762179588832000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"updated_invalid_label","description":"updated description"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6058 + method: PUT + response: + body: '{"errors": [{"reason": "Label must include only ASCII letters, numbers, + and dashes", "field": "label"}]}' + headers: + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Connection: + - keep-alive + Content-Length: + - "104" + Content-Type: + - application/json + Server: + - nginx + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Frame-Options: + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + status: 400 BAD REQUEST + code: 400 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/6058 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/instance_config_test.go b/test/integration/instance_config_test.go index c3cdec023..036684e53 100644 --- a/test/integration/instance_config_test.go +++ b/test/integration/instance_config_test.go @@ -34,7 +34,13 @@ func setupVPCWithSubnetWithInstance( t.Fatal(err) } - vpc, vpcSubnet, vpcWithSubnetTeardown, err := createVPCWithSubnet(t, client) + vpc, vpcSubnet, vpcWithSubnetTeardown, err := createVPCWithSubnet( + t, + client, + func(client *Client, options *VPCCreateOptions) { + options.Region = instance.Region + }, + ) if err != nil { t.Error(err) } @@ -53,14 +59,13 @@ func setupInstanceWith3Interfaces(t *testing.T, fixturesYaml string) ( *Instance, *InstanceConfig, func(), - error, ) { t.Helper() client, vpc, vpcSubnet, instance, config, teardown, err := setupVPCWithSubnetWithInstance( t, fixturesYaml, func(client *Client, opts *InstanceCreateOptions) { - opts.Region = getRegionsWithCaps(t, client, []string{"vlans", "VPCs"})[0] + opts.Region = getRegionsWithCaps(t, client, []string{"VPCs"})[0] }, ) if err != nil { @@ -68,7 +73,6 @@ func setupInstanceWith3Interfaces(t *testing.T, fixturesYaml string) ( teardown() } t.Fatal(err) - return nil, nil, nil, nil, nil, nil, err } updateConfigOpts := config.GetUpdateOptions() @@ -85,21 +89,13 @@ func setupInstanceWith3Interfaces(t *testing.T, fixturesYaml string) ( SubnetID: &vpcSubnet.ID, }, } - _, err = client.UpdateInstanceConfig(context.Background(), instance.ID, config.ID, updateConfigOpts) + config, err = client.UpdateInstanceConfig(context.Background(), instance.ID, config.ID, updateConfigOpts) if err != nil { teardown() t.Fatal(err) - return nil, nil, nil, nil, nil, nil, err } - config, err = client.GetInstanceConfig(context.Background(), instance.ID, config.ID) - if err != nil { - teardown() - t.Fatal(err) - return nil, nil, nil, nil, nil, nil, err - } - - return client, vpc, vpcSubnet, instance, config, teardown, err + return client, vpc, vpcSubnet, instance, config, teardown } func TestInstance_ConfigInterfaces_AppendDelete(t *testing.T) { @@ -182,21 +178,18 @@ func TestInstance_ConfigInterfaces_AppendDelete(t *testing.T) { func TestInstance_ConfigInterfaces_Reorder(t *testing.T) { - client, _, _, instance, config, teardown, err := setupInstanceWith3Interfaces( + client, _, _, instance, config, teardown := setupInstanceWith3Interfaces( t, "fixtures/TestInstance_ConfigInterfaces_Reorder", ) defer teardown() - if err != nil { - t.Fatal(err) - } desiredIDs := []int{ config.Interfaces[1].ID, config.Interfaces[0].ID, config.Interfaces[2].ID, } - err = client.ReorderInstanceConfigInterfaces( + err := client.ReorderInstanceConfigInterfaces( context.Background(), instance.ID, config.ID, @@ -232,14 +225,11 @@ func TestInstance_ConfigInterfaces_Reorder(t *testing.T) { } func TestInstance_ConfigInterfaces_List(t *testing.T) { - client, _, _, instance, config, teardown, err := setupInstanceWith3Interfaces( + client, _, _, instance, config, teardown := setupInstanceWith3Interfaces( t, "fixtures/TestInstance_ConfigInterfaces_List", ) defer teardown() - if err != nil { - t.Fatal(err) - } interfaces, err := client.ListInstanceConfigInterfaces( context.Background(), diff --git a/test/integration/instances_test.go b/test/integration/instances_test.go index 57e3889e1..b380e7f22 100644 --- a/test/integration/instances_test.go +++ b/test/integration/instances_test.go @@ -530,7 +530,7 @@ func createInstanceWithoutDisks( func setupInstanceWithoutDisks(t *testing.T, fixturesYaml string, modifiers ...instanceModifier) (*linodego.Client, *linodego.Instance, *linodego.InstanceConfig, func(), error) { t.Helper() client, fixtureTeardown := createTestClient(t, fixturesYaml) - instance, config, instanceTeardown, err := createInstanceWithoutDisks(t, client) + instance, config, instanceTeardown, err := createInstanceWithoutDisks(t, client, modifiers...) teardown := func() { instanceTeardown() diff --git a/test/integration/vpc_subnet_test.go b/test/integration/vpc_subnet_test.go index b847b0ab4..05b7054c8 100644 --- a/test/integration/vpc_subnet_test.go +++ b/test/integration/vpc_subnet_test.go @@ -73,14 +73,14 @@ func vpcSubnetUpdateOptionsCheck( } } -func createVPCWithSubnet(t *testing.T, client *linodego.Client) ( +func createVPCWithSubnet(t *testing.T, client *linodego.Client, vpcModifier ...vpcModifier) ( *linodego.VPC, *linodego.VPCSubnet, func(), error, ) { t.Helper() - vpc, vpcTeardown, err := createVPC(t, client) + vpc, vpcTeardown, err := createVPC(t, client, vpcModifier...) if err != nil { if vpcTeardown != nil { vpcTeardown() @@ -107,7 +107,6 @@ func createVPCWithSubnet(t *testing.T, client *linodego.Client) ( return vpc, vpcSubnet, teardown, err } - func setupVPCWithSubnet( t *testing.T, fixturesYaml string, @@ -247,3 +246,33 @@ func TestVPC_Subnet_Update_Invalid_data(t *testing.T) { t.Errorf("Wrong error message displayed should have contained, %s", expectedErrorMessage) } } + +func TestVPC_Subnet_WithInstance(t *testing.T) { + client, vpc, vpcSubnet, inst, config, teardown := setupInstanceWith3Interfaces(t, "fixtures/TestVPC_Subnet_WithInstance") + defer teardown() + + // Refresh the subnet to show the assigned instance/interface + refreshedSubnet, err := client.GetVPCSubnet(context.Background(), vpc.ID, vpcSubnet.ID) + if err != nil { + t.Fatal(err) + } + + if len(refreshedSubnet.Linodes) != 1 { + t.Fatalf("expected 1 assigned linode, got %d", len(refreshedSubnet.Linodes)) + } + + targetLinode := refreshedSubnet.Linodes[0] + if targetLinode.ID != inst.ID { + t.Fatalf("expected assigned instance to have id %d, got %d", inst.ID, targetLinode.ID) + } + + if len(targetLinode.Interfaces) != 1 { + t.Fatalf("expected 1 assigned interface, got %d", len(targetLinode.Interfaces)) + } + + targetInterface := targetLinode.Interfaces[0] + + if targetInterface.ID != config.Interfaces[2].ID { + t.Fatalf("interface ID mismatch, expected %d for %d", config.Interfaces[2].ID, targetInterface.ID) + } +} diff --git a/test/integration/vpc_test.go b/test/integration/vpc_test.go index 52633a39d..efb78b95f 100644 --- a/test/integration/vpc_test.go +++ b/test/integration/vpc_test.go @@ -10,6 +10,8 @@ import ( . "github.com/linode/linodego" ) +type vpcModifier func(*linodego.Client, *linodego.VPCCreateOptions) + func formatVPCError(err error, action string, vpcID *int) error { if err == nil { return nil @@ -29,12 +31,17 @@ func formatVPCError(err error, action string, vpcID *int) error { ) } -func createVPC(t *testing.T, client *linodego.Client) (*linodego.VPC, func(), error) { +func createVPC(t *testing.T, client *linodego.Client, vpcModifier ...vpcModifier) (*linodego.VPC, func(), error) { t.Helper() createOpts := linodego.VPCCreateOptions{ Label: "go-test-vpc-" + getUniqueText(), Region: getRegionsWithCaps(t, client, []string{"VPCs"})[0], } + + for _, mod := range vpcModifier { + mod(client, &createOpts) + } + vpc, err := client.CreateVPC(context.Background(), createOpts) if err != nil { t.Fatal(formatVPCError(err, "creating", nil)) @@ -117,7 +124,6 @@ func vpcUpdateOptionsCheck( } } - func TestVPC_CreateGet(t *testing.T) { client, vpc, teardown, err := setupVPC(t, "fixtures/TestVPC_CreateGet") defer teardown() diff --git a/vpc_subnet.go b/vpc_subnet.go index 9f56cb23b..d82f96e6c 100644 --- a/vpc_subnet.go +++ b/vpc_subnet.go @@ -10,13 +10,26 @@ import ( "github.com/linode/linodego/internal/parseabletime" ) +// VPCSubnetLinodeInterface represents an interface on a Linode that is currently +// assigned to this VPC subnet. +type VPCSubnetLinodeInterface struct { + ID int `json:"id"` + Active bool `json:"active"` +} + +// VPCSubnetLinode represents a Linode currently assigned to a VPC subnet. +type VPCSubnetLinode struct { + ID int `json:"id"` + Interfaces []VPCSubnetLinodeInterface `json:"interfaces"` +} + type VPCSubnet struct { - ID int `json:"id"` - Label string `json:"label"` - IPv4 string `json:"ipv4"` - Linodes []int `json:"linodes"` - Created *time.Time `json:"-"` - Updated *time.Time `json:"-"` + ID int `json:"id"` + Label string `json:"label"` + IPv4 string `json:"ipv4"` + Linodes []VPCSubnetLinode `json:"linodes"` + Created *time.Time `json:"-"` + Updated *time.Time `json:"-"` } type VPCSubnetCreateOptions struct { From 045b3cdde28b89e40bf501fc40e6b24f7ca98d93 Mon Sep 17 00:00:00 2001 From: Lena Garber <114949949+lgarber-akamai@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:30:39 -0400 Subject: [PATCH 08/14] new: Add VPCNAT1To1 configuration to IPAddress struct (#415) --- instance_ips.go | 27 ++++++++++++------- .../TestRegionsAvailability_List.yaml | 2 +- test/integration/instance_config_test.go | 3 +++ test/integration/vpc_subnet_test.go | 25 +++++++++++++++++ 4 files changed, 47 insertions(+), 10 deletions(-) diff --git a/instance_ips.go b/instance_ips.go index 376142a99..beaeb0a21 100644 --- a/instance_ips.go +++ b/instance_ips.go @@ -23,15 +23,16 @@ type InstanceIPv4Response struct { // InstanceIP represents an Instance IP with additional DNS and networking details type InstanceIP struct { - Address string `json:"address"` - Gateway string `json:"gateway"` - SubnetMask string `json:"subnet_mask"` - Prefix int `json:"prefix"` - Type InstanceIPType `json:"type"` - Public bool `json:"public"` - RDNS string `json:"rdns"` - LinodeID int `json:"linode_id"` - Region string `json:"region"` + Address string `json:"address"` + Gateway string `json:"gateway"` + SubnetMask string `json:"subnet_mask"` + Prefix int `json:"prefix"` + Type InstanceIPType `json:"type"` + Public bool `json:"public"` + RDNS string `json:"rdns"` + LinodeID int `json:"linode_id"` + Region string `json:"region"` + VPCNAT1To1 *InstanceIPNAT1To1 `json:"vpc_nat_1_1"` } // InstanceIPv6Response contains the IPv6 addresses and ranges for an Instance @@ -41,6 +42,14 @@ type InstanceIPv6Response struct { Global []IPv6Range `json:"global"` } +// InstanceIPNAT1To1 contains information about the NAT 1:1 mapping +// of a public IP address to a VPC subnet. +type InstanceIPNAT1To1 struct { + Address string `json:"address"` + SubnetID int `json:"subnet_id"` + VPCID int `json:"vpc_id"` +} + // IPv6Range represents a range of IPv6 addresses routed to a single Linode in a given Region type IPv6Range struct { Range string `json:"range"` diff --git a/test/integration/fixtures/TestRegionsAvailability_List.yaml b/test/integration/fixtures/TestRegionsAvailability_List.yaml index 8d14ec4ee..bd3a29d0a 100644 --- a/test/integration/fixtures/TestRegionsAvailability_List.yaml +++ b/test/integration/fixtures/TestRegionsAvailability_List.yaml @@ -48,7 +48,7 @@ interactions: false}, {"region": "us-southeast", "plan": "premium65536.7", "available": false}, {"region": "us-southeast", "plan": "premium8192.7", "available": false}, {"region": "us-southeast", "plan": "premium98304.7", "available": false}, {"region": "us-east", - "plan": "gpu-rtx6000-1.1", "available": true}, {"region": "us-east", "plan": + "plan": "gpu-rtx6000-1.1", "available": false}, {"region": "us-east", "plan": "gpu-rtx6000-2.1", "available": false}, {"region": "us-east", "plan": "gpu-rtx6000-3.1", "available": false}, {"region": "us-east", "plan": "gpu-rtx6000-4.1", "available": false}, {"region": "us-east", "plan": "premium131072.7", "available": false}, diff --git a/test/integration/instance_config_test.go b/test/integration/instance_config_test.go index 036684e53..442d9e8d4 100644 --- a/test/integration/instance_config_test.go +++ b/test/integration/instance_config_test.go @@ -87,6 +87,9 @@ func setupInstanceWith3Interfaces(t *testing.T, fixturesYaml string) ( { Purpose: InterfacePurposeVPC, SubnetID: &vpcSubnet.ID, + IPv4: &VPCIPv4{ + NAT1To1: "any", + }, }, } config, err = client.UpdateInstanceConfig(context.Background(), instance.ID, config.ID, updateConfigOpts) diff --git a/test/integration/vpc_subnet_test.go b/test/integration/vpc_subnet_test.go index 05b7054c8..7e3cdeead 100644 --- a/test/integration/vpc_subnet_test.go +++ b/test/integration/vpc_subnet_test.go @@ -275,4 +275,29 @@ func TestVPC_Subnet_WithInstance(t *testing.T) { if targetInterface.ID != config.Interfaces[2].ID { t.Fatalf("interface ID mismatch, expected %d for %d", config.Interfaces[2].ID, targetInterface.ID) } + + // Ensure the NAT 1:1 information is reflected in the IP configuration of this instance + networking, err := client.GetInstanceIPAddresses(context.Background(), inst.ID) + if err != nil { + t.Fatal(err) + } + + nat1To1 := networking.IPv4.Public[0].VPCNAT1To1 + + if nat1To1 == nil { + t.Fatalf("expected VPCNAT1To1 to contain data, got nil") + } + + if nat1To1.SubnetID != refreshedSubnet.ID { + t.Fatal("IP/subnet id mismatch") + } + + if nat1To1.VPCID != vpc.ID { + t.Fatal("IP/VPC id mismatch") + } + + if nat1To1.Address != config.Interfaces[2].IPv4.VPC { + t.Fatalf("nat_1_1 subnet IP mismatch") + } + } From c287fea5e1943116be36a47816ae939876d5a0fe Mon Sep 17 00:00:00 2001 From: Zhiwei Liang Date: Mon, 6 Nov 2023 11:35:00 -0500 Subject: [PATCH 09/14] Fix test workflow --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e90cfd9b9..fad36bf10 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,7 +56,7 @@ jobs: timestamp=$(date +'%Y%m%d%H%M') report_filename="${timestamp}_linodego_test_report.log" - if ! make ARGS="2>&1" testacc > "$report_filename"; then + if ! make ARGS="2>&1" test > "$report_filename"; then echo "EXIT_STATUS=1" >> $GITHUB_ENV fi cat "$report_filename" From b38fbd67135b16e6cd75ac9e59c3159d5daee5cc Mon Sep 17 00:00:00 2001 From: Zhiwei Liang Date: Mon, 6 Nov 2023 12:01:56 -0500 Subject: [PATCH 10/14] Add config interfaces fixtures --- .../TestInstance_ConfigInterface_Update.yaml | 719 ++++++++++++++++ ...nstance_ConfigInterfaces_AppendDelete.yaml | 778 ++++++++++++++++++ .../TestInstance_ConfigInterfaces_List.yaml | 675 +++++++++++++++ ...TestInstance_ConfigInterfaces_Reorder.yaml | 737 +++++++++++++++++ 4 files changed, 2909 insertions(+) create mode 100644 test/integration/fixtures/TestInstance_ConfigInterface_Update.yaml create mode 100644 test/integration/fixtures/TestInstance_ConfigInterfaces_AppendDelete.yaml create mode 100644 test/integration/fixtures/TestInstance_ConfigInterfaces_List.yaml create mode 100644 test/integration/fixtures/TestInstance_ConfigInterfaces_Reorder.yaml diff --git a/test/integration/fixtures/TestInstance_ConfigInterface_Update.yaml b/test/integration/fixtures/TestInstance_ConfigInterface_Update.yaml new file mode 100644 index 000000000..f292cf56a --- /dev/null +++ b/test/integration/fixtures/TestInstance_ConfigInterface_Update.yaml @@ -0,0 +1,719 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-p67uc1u33z0e","booted":false}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances + method: POST + response: + body: '{"id": 51687525, "label": "go-test-ins-wo-disk-p67uc1u33z0e", "group": + "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", + "type": "g6-nanode-1", "ipv4": ["172.233.110.106"], "ipv6": "1234::5678/128", + "image": null, "region": "es-mad", "specs": {"disk": 25600, "memory": 1024, + "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": + 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": + false, "available": false, "schedule": {"day": null, "window": null}, "last_successful": + null}, "hypervisor": "kvm", "watchdog_enabled": true, "tags": [], "host_uuid": + "afc09e0e1675161707bcf1232af4d0b7ffe00c7a", "has_user_data": false}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "738" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "10" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-conf-z82rm8eb58k9","devices":{},"interfaces":null}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687525/configs + method: POST + response: + body: '{"id": 54672869, "label": "go-test-conf-z82rm8eb58k9", "helpers": {"updatedb_disabled": + true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": + true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": + "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", + "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, + "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", + "virt_mode": "paravirt", "interfaces": []}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "539" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-vpc-1699289566596805000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 7033, "label": "go-test-vpc-1699289566596805000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"linodego-vpc-test-1699289566861781000","ipv4":"192.168.0.0/25"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7033/subnets + method: POST + response: + body: '{"id": 7954, "label": "linodego-vpc-test-1699289566861781000", "ipv4": + "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "171" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"purpose":"vpc","subnet_id":7954}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687525/configs/54672869/interfaces + method: POST + response: + body: '{"id": 797897, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7033, "subnet_id": 7954, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": ""}}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "186" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"primary":true,"ipv4":{"vpc":"192.168.0.2"}}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687525/configs/54672869/interfaces/797897 + method: PUT + response: + body: '{"id": 797897, "purpose": "vpc", "primary": true, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7033, "subnet_id": 7954, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": ""}}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "185" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"primary":true,"ipv4":{"vpc":"192.168.0.10","nat_1_1":"any"}}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687525/configs/54672869/interfaces/797897 + method: PUT + response: + body: '{"id": 797897, "purpose": "vpc", "primary": true, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7033, "subnet_id": 7954, "ipv4": {"vpc": "192.168.0.10", + "nat_1_1": "172.233.110.106"}}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "201" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687525 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestInstance_ConfigInterfaces_AppendDelete.yaml b/test/integration/fixtures/TestInstance_ConfigInterfaces_AppendDelete.yaml new file mode 100644 index 000000000..60bced561 --- /dev/null +++ b/test/integration/fixtures/TestInstance_ConfigInterfaces_AppendDelete.yaml @@ -0,0 +1,778 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-uh7252u4wk6v","booted":false}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances + method: POST + response: + body: '{"id": 51687320, "label": "go-test-ins-wo-disk-uh7252u4wk6v", "group": + "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", + "type": "g6-nanode-1", "ipv4": ["172.233.110.110"], "ipv6": "1234::5678/128", + "image": null, "region": "es-mad", "specs": {"disk": 25600, "memory": 1024, + "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": + 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": + false, "available": false, "schedule": {"day": null, "window": null}, "last_successful": + null}, "hypervisor": "kvm", "watchdog_enabled": true, "tags": [], "host_uuid": + "afc09e0e1675161707bcf1232af4d0b7ffe00c7a", "has_user_data": false}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "738" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "10" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-conf-2e6l8uz0z8n9","devices":{},"interfaces":null}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687320/configs + method: POST + response: + body: '{"id": 54672641, "label": "go-test-conf-2e6l8uz0z8n9", "helpers": {"updatedb_disabled": + true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": + true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": + "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", + "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, + "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", + "virt_mode": "paravirt", "interfaces": []}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "539" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-vpc-1699289190376903000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 7025, "label": "go-test-vpc-1699289190376903000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"linodego-vpc-test-1699289190516844000","ipv4":"192.168.0.0/25"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7025/subnets + method: POST + response: + body: '{"id": 7946, "label": "linodego-vpc-test-1699289190516844000", "ipv4": + "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "171" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"purpose":"vpc","subnet_id":7946}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687320/configs/54672641/interfaces + method: POST + response: + body: '{"id": 797819, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7025, "subnet_id": 7946, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": ""}}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "186" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687320/configs/54672641/interfaces + method: GET + response: + body: '[{"id": 797819, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7025, "subnet_id": 7946, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": ""}}]' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "188" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687320/configs/54672641/interfaces/797819 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687320/configs/54672641/interfaces + method: GET + response: + body: '[]' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687320 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestInstance_ConfigInterfaces_List.yaml b/test/integration/fixtures/TestInstance_ConfigInterfaces_List.yaml new file mode 100644 index 000000000..827de6b84 --- /dev/null +++ b/test/integration/fixtures/TestInstance_ConfigInterfaces_List.yaml @@ -0,0 +1,675 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-q8k472gyih02","booted":false}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances + method: POST + response: + body: '{"id": 51687322, "label": "go-test-ins-wo-disk-q8k472gyih02", "group": + "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", + "type": "g6-nanode-1", "ipv4": ["172.233.110.112"], "ipv6": "1234::5678/128", + "image": null, "region": "es-mad", "specs": {"disk": 25600, "memory": 1024, + "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": + 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": + false, "available": false, "schedule": {"day": null, "window": null}, "last_successful": + null}, "hypervisor": "kvm", "watchdog_enabled": true, "tags": [], "host_uuid": + "afc09e0e1675161707bcf1232af4d0b7ffe00c7a", "has_user_data": false}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "738" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "10" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-conf-kz9e6m4o68q0","devices":{},"interfaces":null}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687322/configs + method: POST + response: + body: '{"id": 54672644, "label": "go-test-conf-kz9e6m4o68q0", "helpers": {"updatedb_disabled": + true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": + true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": + "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", + "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, + "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", + "virt_mode": "paravirt", "interfaces": []}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "539" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-vpc-1699289196770332000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 7027, "label": "go-test-vpc-1699289196770332000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"linodego-vpc-test-1699289197649277000","ipv4":"192.168.0.0/25"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7027/subnets + method: POST + response: + body: '{"id": 7948, "label": "linodego-vpc-test-1699289197649277000", "ipv4": + "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "171" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-conf-kz9e6m4o68q0","comments":"","devices":{},"helpers":{"updatedb_disabled":true,"distro":true,"modules_dep":true,"network":true,"devtmpfs_automount":true},"interfaces":[{"purpose":"public"},{"label":"testvlan","purpose":"vlan"},{"purpose":"vpc","subnet_id":7948,"ipv4":{"nat_1_1":"any"}}],"memory_limit":0,"kernel":"linode/latest-64bit","init_rd":null,"root_device":"/dev/sda","run_level":"default","virt_mode":"paravirt"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687322/configs/54672644 + method: PUT + response: + body: '{"id": 54672644, "label": "go-test-conf-kz9e6m4o68q0", "helpers": {"updatedb_disabled": + true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": + true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": + "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", + "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, + "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", + "virt_mode": "paravirt", "interfaces": [{"id": 797825, "purpose": "public", + "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": + null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 797826, + "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": + "testvlan", "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": + ""}}, {"id": 797827, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7027, "subnet_id": 7948, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": "172.233.110.112"}}]}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687322/configs/54672644/interfaces + method: GET + response: + body: '[{"id": 797825, "purpose": "public", "primary": false, "active": false, + "ipam_address": null, "label": null, "vpc_id": null, "subnet_id": null, "ipv4": + {"vpc": "", "nat_1_1": ""}}, {"id": 797826, "purpose": "vlan", "primary": false, + "active": false, "ipam_address": "", "label": "testvlan", "vpc_id": null, "subnet_id": + null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 797827, "purpose": "vpc", + "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": + 7027, "subnet_id": 7948, "ipv4": {"vpc": "192.168.0.2", "nat_1_1": "172.233.110.112"}}]' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "565" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687322 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestInstance_ConfigInterfaces_Reorder.yaml b/test/integration/fixtures/TestInstance_ConfigInterfaces_Reorder.yaml new file mode 100644 index 000000000..083beeab9 --- /dev/null +++ b/test/integration/fixtures/TestInstance_ConfigInterfaces_Reorder.yaml @@ -0,0 +1,737 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-i7i01rubi233","booted":false}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances + method: POST + response: + body: '{"id": 51687321, "label": "go-test-ins-wo-disk-i7i01rubi233", "group": + "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", + "type": "g6-nanode-1", "ipv4": ["172.233.110.111"], "ipv6": "1234::5678/128", + "image": null, "region": "es-mad", "specs": {"disk": 25600, "memory": 1024, + "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": + 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": + false, "available": false, "schedule": {"day": null, "window": null}, "last_successful": + null}, "hypervisor": "kvm", "watchdog_enabled": true, "tags": [], "host_uuid": + "afc09e0e1675161707bcf1232af4d0b7ffe00c7a", "has_user_data": false}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "738" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "10" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-conf-c3ul745e0g8m","devices":{},"interfaces":null}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687321/configs + method: POST + response: + body: '{"id": 54672643, "label": "go-test-conf-c3ul745e0g8m", "helpers": {"updatedb_disabled": + true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": + true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": + "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", + "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, + "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", + "virt_mode": "paravirt", "interfaces": []}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "539" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-vpc-1699289193773583000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 7026, "label": "go-test-vpc-1699289193773583000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"linodego-vpc-test-1699289193918539000","ipv4":"192.168.0.0/25"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7026/subnets + method: POST + response: + body: '{"id": 7947, "label": "linodego-vpc-test-1699289193918539000", "ipv4": + "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "171" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-conf-c3ul745e0g8m","comments":"","devices":{},"helpers":{"updatedb_disabled":true,"distro":true,"modules_dep":true,"network":true,"devtmpfs_automount":true},"interfaces":[{"purpose":"public"},{"label":"testvlan","purpose":"vlan"},{"purpose":"vpc","subnet_id":7947,"ipv4":{"nat_1_1":"any"}}],"memory_limit":0,"kernel":"linode/latest-64bit","init_rd":null,"root_device":"/dev/sda","run_level":"default","virt_mode":"paravirt"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687321/configs/54672643 + method: PUT + response: + body: '{"id": 54672643, "label": "go-test-conf-c3ul745e0g8m", "helpers": {"updatedb_disabled": + true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": + true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": + "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", + "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, + "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", + "virt_mode": "paravirt", "interfaces": [{"id": 797822, "purpose": "public", + "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": + null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 797823, + "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": + "testvlan", "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": + ""}}, {"id": 797824, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7026, "subnet_id": 7947, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": "172.233.110.111"}}]}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"ids":[797823,797822,797824]}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687321/configs/54672643/interfaces/order + method: POST + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687321/configs/54672643 + method: GET + response: + body: '{"id": 54672643, "label": "go-test-conf-c3ul745e0g8m", "helpers": {"updatedb_disabled": + true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": + true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": + "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", + "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, + "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", + "virt_mode": "paravirt", "interfaces": [{"id": 797823, "purpose": "vlan", "primary": + false, "active": false, "ipam_address": "", "label": "testvlan", "vpc_id": null, + "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 797822, "purpose": + "public", "primary": false, "active": false, "ipam_address": null, "label": + null, "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, + {"id": 797824, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7026, "subnet_id": 7947, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": "172.233.110.111"}}]}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51687321 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" From 7baa4f1100104e03771c7c8209ff318125b9b64b Mon Sep 17 00:00:00 2001 From: Zhiwei Liang Date: Mon, 6 Nov 2023 14:29:18 -0500 Subject: [PATCH 11/14] Fix test --- .../TestInstance_ConfigInterfaces_Update.yaml | 426 +++++++++++--- .../TestInstance_CreateUnderFirewall.yaml | 544 ++++++++++++++++++ .../fixtures/TestVPC_Create_Invalid.yaml | 280 +++++++++ .../fixtures/TestVPC_Subnet_WithInstance.yaml | 117 +++- .../fixtures/TestVPC_Update_Invalid.yaml | 8 +- test/integration/instance_config_test.go | 2 +- test/integration/vpc_test.go | 3 +- 7 files changed, 1274 insertions(+), 106 deletions(-) create mode 100644 test/integration/fixtures/TestInstance_CreateUnderFirewall.yaml create mode 100644 test/integration/fixtures/TestVPC_Create_Invalid.yaml diff --git a/test/integration/fixtures/TestInstance_ConfigInterfaces_Update.yaml b/test/integration/fixtures/TestInstance_ConfigInterfaces_Update.yaml index f5cf8bbae..072bc2059 100644 --- a/test/integration/fixtures/TestInstance_ConfigInterfaces_Update.yaml +++ b/test/integration/fixtures/TestInstance_ConfigInterfaces_Update.yaml @@ -14,56 +14,186 @@ interactions: url: https://api.linode.com/v4beta/regions method: GET response: - body: '{"data": [{"id": "ap-west", "country": "in", "capabilities": ["Linodes", - "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", - "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": - {"ipv4": "172.105.34.5,172.105.35.5,172.105.36.5,172.105.37.5,172.105.38.5,172.105.39.5,172.105.40.5,172.105.41.5,172.105.42.5,172.105.43.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "ca-central", "country": "ca", "capabilities": ["Linodes", "NodeBalancers", - "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", - "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5,172.105.3.5,172.105.4.5,172.105.5.5,172.105.6.5,172.105.7.5,172.105.8.5,172.105.9.5,172.105.10.5,172.105.11.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "ap-southeast", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", - "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5,172.105.169.5,172.105.168.5,172.105.172.5,172.105.162.5,172.105.170.5,172.105.167.5,172.105.171.5,172.105.181.5,172.105.161.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "us-central", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", - "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5,72.14.188.5,173.255.199.5,66.228.53.5,96.126.122.5,96.126.124.5,96.126.127.5,198.58.107.5,198.58.111.5,23.239.24.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "us-west", "country": "us", "capabilities": ["Linodes", "NodeBalancers", - "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", - "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "173.230.145.5,173.230.147.5,173.230.155.5,173.255.212.5,173.255.219.5,173.255.241.5,173.255.243.5,173.255.244.5,74.207.241.5,74.207.242.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "us-southeast", "country": "us", "capabilities": ["Linodes", "NodeBalancers", - "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": - {"ipv4": "74.207.231.5,173.230.128.5,173.230.129.5,173.230.136.5,173.230.140.5,66.228.59.5,66.228.62.5,50.116.35.5,50.116.41.5,23.239.18.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "us-east", "country": "us", "capabilities": ["Linodes", "NodeBalancers", - "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", - "Bare Metal", "Block Storage Migrations", "Managed Databases"], "status": "ok", - "resolvers": {"ipv4": "66.228.42.5,96.126.106.5,50.116.53.5,50.116.58.5,50.116.61.5,50.116.62.5,66.175.211.5,97.107.133.4,207.192.69.4,207.192.69.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "eu-west", "country": "uk", "capabilities": ["Linodes", "NodeBalancers", - "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", - "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "178.79.182.5,176.58.107.5,176.58.116.5,176.58.121.5,151.236.220.5,212.71.252.5,212.71.253.5,109.74.192.20,109.74.193.20,109.74.194.20", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "ap-south", "country": "sg", "capabilities": ["Linodes", "NodeBalancers", - "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", - "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": - {"ipv4": "139.162.11.5,139.162.13.5,139.162.14.5,139.162.15.5,139.162.16.5,139.162.21.5,139.162.27.5,103.3.60.18,103.3.60.19,103.3.60.20", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "eu-central", "country": "de", "capabilities": ["Linodes", "NodeBalancers", - "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", - "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": - {"ipv4": "139.162.130.5,139.162.131.5,139.162.132.5,139.162.133.5,139.162.134.5,139.162.135.5,139.162.136.5,139.162.137.5,139.162.138.5,139.162.139.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "ap-northeast", "country": "jp", "capabilities": ["Linodes", "NodeBalancers", - "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", - "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.66.5,139.162.67.5,139.162.68.5,139.162.69.5,139.162.70.5,139.162.71.5,139.162.72.5,139.162.73.5,139.162.74.5,139.162.75.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}], - "page": 1, "pages": 1, "results": 11}' + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' headers: Access-Control-Allow-Credentials: - "true" @@ -78,6 +208,8 @@ interactions: Cache-Control: - private, max-age=900 - private, max-age=60, s-maxage=60 + Connection: + - keep-alive Content-Security-Policy: - default-src 'none' Content-Type: @@ -106,7 +238,7 @@ interactions: code: 200 duration: "" - request: - body: '{"region":"ap-west","type":"g6-nanode-1","label":"go-test-ins-wo-disk-k20sl49e30fs","booted":false}' + body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-4be66072uqxc","booted":false}' form: {} headers: Accept: @@ -118,15 +250,15 @@ interactions: url: https://api.linode.com/v4beta/linode/instances method: POST response: - body: '{"id": 41004307, "label": "go-test-ins-wo-disk-k20sl49e30fs", "group": + body: '{"id": 51689661, "label": "go-test-ins-wo-disk-4be66072uqxc", "group": "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", - "type": "g6-nanode-1", "ipv4": ["172.105.59.146"], "ipv6": "1234::5678/128", - "image": null, "region": "ap-west", "specs": {"disk": 25600, "memory": 1024, + "type": "g6-nanode-1", "ipv4": ["172.233.111.127"], "ipv6": "1234::5678/128", + "image": null, "region": "es-mad", "specs": {"disk": 25600, "memory": 1024, "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": false, "available": false, "schedule": {"day": null, "window": null}, "last_successful": null}, "hypervisor": "kvm", "watchdog_enabled": true, "tags": [], "host_uuid": - "0346babe1bc45d9259a93fb78b6b7858acaf41c4"}' + "afc09e0e1675161707bcf1232af4d0b7ffe00c7a", "has_user_data": false}' headers: Access-Control-Allow-Credentials: - "true" @@ -140,8 +272,10 @@ interactions: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - private, max-age=60, s-maxage=60 + Connection: + - keep-alive Content-Length: - - "714" + - "738" Content-Security-Policy: - default-src 'none' Content-Type: @@ -169,7 +303,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-conf-1781gp3du8mu","devices":{},"interfaces":null}' + body: '{"label":"go-test-conf-x03wt9rpg533","devices":{},"interfaces":null}' form: {} headers: Accept: @@ -178,10 +312,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/41004307/configs + url: https://api.linode.com/v4beta/linode/instances/51689661/configs method: POST response: - body: '{"id": 43613864, "label": "go-test-conf-1781gp3du8mu", "helpers": {"updatedb_disabled": + body: '{"id": 54675061, "label": "go-test-conf-x03wt9rpg533", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", @@ -201,6 +335,8 @@ interactions: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - private, max-age=60, s-maxage=60 + Connection: + - keep-alive Content-Length: - "539" Content-Security-Policy: @@ -230,7 +366,66 @@ interactions: code: 200 duration: "" - request: - body: '{"comments":"","interfaces":[{"ipam_address":"","label":"","purpose":"public"},{"ipam_address":"","label":"go-test-ins-wo-disk-k20sl49e30fs-r","purpose":"vlan"}],"memory_limit":0,"init_rd":null}' + body: '{"label":"go-test-vpc-1699292058226124000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"id": 7073, "label": "go-test-vpc-1699292058226124000", "description": + "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "178" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"linodego-vpc-test-1699292058391243000","ipv4":"192.168.0.0/25"}' form: {} headers: Accept: @@ -239,17 +434,82 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/41004307/configs/43613864 + url: https://api.linode.com/v4beta/vpcs/7073/subnets + method: POST + response: + body: '{"id": 7984, "label": "linodego-vpc-test-1699292058391243000", "ipv4": + "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "171" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-conf-x03wt9rpg533","comments":"","devices":{},"helpers":{"updatedb_disabled":true,"distro":true,"modules_dep":true,"network":true,"devtmpfs_automount":true},"interfaces":[{"purpose":"public"},{"label":"testvlan","purpose":"vlan"},{"purpose":"vpc","subnet_id":7984}],"memory_limit":0,"kernel":"linode/latest-64bit","init_rd":null,"root_device":"/dev/sda","run_level":"default","virt_mode":"paravirt"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51689661/configs/54675061 method: PUT response: - body: '{"id": 43613864, "label": "go-test-conf-1781gp3du8mu", "helpers": {"updatedb_disabled": + body: '{"id": 54675061, "label": "go-test-conf-x03wt9rpg533", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", - "virt_mode": "paravirt", "interfaces": [{"purpose": "public", "ipam_address": - null, "label": null}, {"purpose": "vlan", "ipam_address": "", "label": "go-test-ins-wo-disk-k20sl49e30fs-r"}]}' + "virt_mode": "paravirt", "interfaces": [{"id": 798081, "purpose": "public", + "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": + null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 798082, + "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": + "testvlan", "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": + ""}}, {"id": 798083, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7073, "subnet_id": 7984, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": ""}}]}' headers: Access-Control-Allow-Credentials: - "true" @@ -263,8 +523,8 @@ interactions: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - private, max-age=60, s-maxage=60 - Content-Length: - - "685" + Connection: + - keep-alive Content-Security-Policy: - default-src 'none' Content-Type: @@ -301,17 +561,23 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/41004307/configs/43613864 + url: https://api.linode.com/v4beta/linode/instances/51689661/configs/54675061 method: GET response: - body: '{"id": 43613864, "label": "go-test-conf-1781gp3du8mu", "helpers": {"updatedb_disabled": + body: '{"id": 54675061, "label": "go-test-conf-x03wt9rpg533", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", - "virt_mode": "paravirt", "interfaces": [{"purpose": "public", "ipam_address": - null, "label": null}, {"purpose": "vlan", "ipam_address": "", "label": "go-test-ins-wo-disk-k20sl49e30fs-r"}]}' + "virt_mode": "paravirt", "interfaces": [{"id": 798081, "purpose": "public", + "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": + null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 798082, + "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": + "testvlan", "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": + ""}}, {"id": 798083, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7073, "subnet_id": 7984, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": ""}}]}' headers: Access-Control-Allow-Credentials: - "true" @@ -326,8 +592,8 @@ interactions: Cache-Control: - private, max-age=0, s-maxage=0, no-cache, no-store - private, max-age=60, s-maxage=60 - Content-Length: - - "685" + Connection: + - keep-alive Content-Security-Policy: - default-src 'none' Content-Type: @@ -365,17 +631,23 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/41004307/configs/43613864 + url: https://api.linode.com/v4beta/linode/instances/51689661/configs/54675061 method: PUT response: - body: '{"id": 43613864, "label": "go-test-conf-1781gp3du8mu", "helpers": {"updatedb_disabled": + body: '{"id": 54675061, "label": "go-test-conf-x03wt9rpg533", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", - "virt_mode": "paravirt", "interfaces": [{"purpose": "public", "ipam_address": - null, "label": null}, {"purpose": "vlan", "ipam_address": "", "label": "go-test-ins-wo-disk-k20sl49e30fs-r"}]}' + "virt_mode": "paravirt", "interfaces": [{"id": 798081, "purpose": "public", + "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": + null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 798082, + "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": + "testvlan", "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": + ""}}, {"id": 798083, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7073, "subnet_id": 7984, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": ""}}]}' headers: Access-Control-Allow-Credentials: - "true" @@ -389,8 +661,8 @@ interactions: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - private, max-age=60, s-maxage=60 - Content-Length: - - "685" + Connection: + - keep-alive Content-Security-Policy: - default-src 'none' Content-Type: @@ -427,7 +699,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/41004307 + url: https://api.linode.com/v4beta/linode/instances/51689661 method: DELETE response: body: '{}' @@ -444,6 +716,8 @@ interactions: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - private, max-age=60, s-maxage=60 + Connection: + - keep-alive Content-Length: - "2" Content-Security-Policy: diff --git a/test/integration/fixtures/TestInstance_CreateUnderFirewall.yaml b/test/integration/fixtures/TestInstance_CreateUnderFirewall.yaml new file mode 100644 index 000000000..b924df1a4 --- /dev/null +++ b/test/integration/fixtures/TestInstance_CreateUnderFirewall.yaml @@ -0,0 +1,544 @@ +--- +version: 1 +interactions: +- request: + body: '{"label":"linodego-fw-test","rules":{"inbound":[{"action":"ACCEPT","label":"go-fwrule-test","ports":"22","protocol":"TCP","addresses":{"ipv4":["0.0.0.0/0"],"ipv6":["1234::5678/0"]}}],"inbound_policy":"ACCEPT","outbound":[{"action":"ACCEPT","label":"go-fwrule-test","ports":"22","protocol":"TCP","addresses":{"ipv4":["0.0.0.0/0"],"ipv6":["1234::5678/0"]}}],"outbound_policy":"ACCEPT"},"tags":["testing"],"devices":{}}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/networking/firewalls + method: POST + response: + body: '{"id": 260831, "label": "linodego-fw-test", "created": "2018-01-02T03:04:05", + "updated": "2018-01-02T03:04:05", "status": "enabled", "rules": {"inbound": + [{"action": "ACCEPT", "label": "go-fwrule-test", "ports": "22", "protocol": + "TCP", "addresses": {"ipv4": ["0.0.0.0/0"], "ipv6": ["1234::5678/0"]}}], "inbound_policy": + "ACCEPT", "outbound": [{"action": "ACCEPT", "label": "go-fwrule-test", "ports": + "22", "protocol": "TCP", "addresses": {"ipv4": ["0.0.0.0/0"], "ipv6": ["1234::5678/0"]}}], + "outbound_policy": "ACCEPT"}, "tags": ["testing"]}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "526" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - firewall:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"region":"ap-west","type":"g6-nanode-1","label":"go-test-ins-wo-disk-hys905uc105p","firewall_id":260831,"booted":false}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances + method: POST + response: + body: '{"id": 51688451, "label": "go-test-ins-wo-disk-hys905uc105p", "group": + "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", + "type": "g6-nanode-1", "ipv4": ["192.46.209.173"], "ipv6": "1234::5678/128", + "image": null, "region": "ap-west", "specs": {"disk": 25600, "memory": 1024, + "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": + 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": + false, "available": false, "schedule": {"day": null, "window": null}, "last_successful": + null}, "hypervisor": "kvm", "watchdog_enabled": true, "tags": [], "host_uuid": + "d3e3867bf4380f65c2c4ddef448b3a8c94c84887", "has_user_data": false}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "738" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "10" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-conf-7u65tc4mf62i","devices":{},"interfaces":null}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51688451/configs + method: POST + response: + body: '{"id": 54673819, "label": "go-test-conf-7u65tc4mf62i", "helpers": {"updatedb_disabled": + true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": + true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": + "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", + "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, + "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", + "virt_mode": "paravirt", "interfaces": []}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "539" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51688451 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/networking/firewalls/260831 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - firewall:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestVPC_Create_Invalid.yaml b/test/integration/fixtures/TestVPC_Create_Invalid.yaml new file mode 100644 index 000000000..9a8f82b7c --- /dev/null +++ b/test/integration/fixtures/TestVPC_Create_Invalid.yaml @@ -0,0 +1,280 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/regions + method: GET + response: + body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud + Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Managed Databases", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, 139.144.192.66, 139.144.192.52, 139.144.192.68", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Managed Databases", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, 172.233.0.7, + 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, 172.233.0.8, + 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.33.36, + 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, 172.233.33.33, 172.233.33.31, + 172.233.33.30, 172.233.33.37, 172.233.33.32", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, + 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "es-mad", "label": "Madrid, ES", "country": + "es", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, + 172.233.111.25, 172.233.111.19, 172.233.111.12, 172.233.111.26, 172.233.111.16, + 172.233.111.18, 172.233.111.9", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "in-maa", + "label": "Chennai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, + 172.232.96.26, 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, + 172.232.96.22, 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "jp-osa", "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium Plans"], + "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, 172.232.192.16, + 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, 172.232.192.17, + 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-mia", + "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Block Storage Migrations", "Managed Databases"], "status": + "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, 173.255.212.5, + 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, 74.207.242.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, + 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, + 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", + "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5, 139.162.13.5, + 139.162.14.5, 139.162.15.5, 139.162.16.5, 139.162.21.5, 139.162.27.5, 103.3.60.18, + 103.3.60.19, 103.3.60.20", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5, + 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, 139.162.135.5, 139.162.136.5, + 139.162.137.5, 139.162.138.5, 139.162.139.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": 24}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=900 + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - '*' + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"gotest_vpc_invalid_label1699291691000431000","region":"es-mad"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs + method: POST + response: + body: '{"errors": [{"reason": "Label must include only ASCII letters, numbers, + and dashes", "field": "label"}]}' + headers: + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Connection: + - keep-alive + Content-Length: + - "104" + Content-Type: + - application/json + Server: + - nginx + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Frame-Options: + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + status: 400 BAD REQUEST + code: 400 + duration: "" diff --git a/test/integration/fixtures/TestVPC_Subnet_WithInstance.yaml b/test/integration/fixtures/TestVPC_Subnet_WithInstance.yaml index 56dd2d7d3..077fc89ae 100644 --- a/test/integration/fixtures/TestVPC_Subnet_WithInstance.yaml +++ b/test/integration/fixtures/TestVPC_Subnet_WithInstance.yaml @@ -238,7 +238,7 @@ interactions: code: 200 duration: "" - request: - body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-1dr662rf8lv8","booted":false}' + body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-2jyr37gon559","booted":false}' form: {} headers: Accept: @@ -250,9 +250,9 @@ interactions: url: https://api.linode.com/v4beta/linode/instances method: POST response: - body: '{"id": 51465490, "label": "go-test-ins-wo-disk-1dr662rf8lv8", "group": + body: '{"id": 51693566, "label": "go-test-ins-wo-disk-2jyr37gon559", "group": "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", - "type": "g6-nanode-1", "ipv4": ["172.233.110.34"], "ipv6": "1234::5678/128", + "type": "g6-nanode-1", "ipv4": ["172.233.111.111"], "ipv6": "1234::5678/128", "image": null, "region": "es-mad", "specs": {"disk": 25600, "memory": 1024, "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": @@ -275,7 +275,7 @@ interactions: Connection: - keep-alive Content-Length: - - "737" + - "738" Content-Security-Policy: - default-src 'none' Content-Type: @@ -303,7 +303,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-conf-7gc8z7sk59k4","devices":{},"interfaces":null}' + body: '{"label":"go-test-conf-ql94a57ne12p","devices":{},"interfaces":null}' form: {} headers: Accept: @@ -312,10 +312,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51465490/configs + url: https://api.linode.com/v4beta/linode/instances/51693566/configs method: POST response: - body: '{"id": 54444688, "label": "go-test-conf-7gc8z7sk59k4", "helpers": {"updatedb_disabled": + body: '{"id": 54679087, "label": "go-test-conf-ql94a57ne12p", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", @@ -366,7 +366,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-vpc-1698762171373822000","region":"es-mad"}' + body: '{"label":"go-test-vpc-1699297309404116000","region":"es-mad"}' form: {} headers: Accept: @@ -378,7 +378,7 @@ interactions: url: https://api.linode.com/v4beta/vpcs method: POST response: - body: '{"id": 6054, "label": "go-test-vpc-1698762171373822000", "description": + body: '{"id": 7304, "label": "go-test-vpc-1699297309404116000", "description": "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -425,7 +425,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"linodego-vpc-test-1698762171783114000","ipv4":"192.168.0.0/25"}' + body: '{"label":"linodego-vpc-test-1699297311041808000","ipv4":"192.168.0.0/25"}' form: {} headers: Accept: @@ -434,10 +434,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/vpcs/6054/subnets + url: https://api.linode.com/v4beta/vpcs/7304/subnets method: POST response: - body: '{"id": 6870, "label": "linodego-vpc-test-1698762171783114000", "ipv4": + body: '{"id": 8197, "label": "linodego-vpc-test-1699297311041808000", "ipv4": "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -484,7 +484,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-conf-7gc8z7sk59k4","comments":"","devices":{},"helpers":{"updatedb_disabled":true,"distro":true,"modules_dep":true,"network":true,"devtmpfs_automount":true},"interfaces":[{"purpose":"public"},{"label":"testvlan","purpose":"vlan"},{"purpose":"vpc","subnet_id":6870}],"memory_limit":0,"kernel":"linode/latest-64bit","init_rd":null,"root_device":"/dev/sda","run_level":"default","virt_mode":"paravirt"}' + body: '{"label":"go-test-conf-ql94a57ne12p","comments":"","devices":{},"helpers":{"updatedb_disabled":true,"distro":true,"modules_dep":true,"network":true,"devtmpfs_automount":true},"interfaces":[{"purpose":"public"},{"label":"testvlan","purpose":"vlan"},{"purpose":"vpc","subnet_id":8197,"ipv4":{"nat_1_1":"any"}}],"memory_limit":0,"kernel":"linode/latest-64bit","init_rd":null,"root_device":"/dev/sda","run_level":"default","virt_mode":"paravirt"}' form: {} headers: Accept: @@ -493,23 +493,23 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51465490/configs/54444688 + url: https://api.linode.com/v4beta/linode/instances/51693566/configs/54679087 method: PUT response: - body: '{"id": 54444688, "label": "go-test-conf-7gc8z7sk59k4", "helpers": {"updatedb_disabled": + body: '{"id": 54679087, "label": "go-test-conf-ql94a57ne12p", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", - "virt_mode": "paravirt", "interfaces": [{"id": 778328, "purpose": "public", + "virt_mode": "paravirt", "interfaces": [{"id": 798625, "purpose": "public", "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": - null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 778329, + null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 798626, "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": "testvlan", "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": - ""}}, {"id": 778330, "purpose": "vpc", "primary": false, "active": false, "ipam_address": - null, "label": null, "vpc_id": 6054, "subnet_id": 6870, "ipv4": {"vpc": "192.168.0.2", - "nat_1_1": ""}}]}' + ""}}, {"id": 798627, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7304, "subnet_id": 8197, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": "172.233.111.111"}}]}' headers: Access-Control-Allow-Credentials: - "true" @@ -561,11 +561,11 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/vpcs/6054/subnets/6870 + url: https://api.linode.com/v4beta/vpcs/7304/subnets/8197 method: GET response: - body: '{"id": 6870, "label": "linodego-vpc-test-1698762171783114000", "ipv4": - "192.168.0.0/25", "linodes": [{"id": 51465490, "interfaces": [{"id": 778330, + body: '{"id": 8197, "label": "linodego-vpc-test-1699297311041808000", "ipv4": + "192.168.0.0/25", "linodes": [{"id": 51693566, "interfaces": [{"id": 798627, "active": false}]}], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: Access-Control-Allow-Credentials: @@ -622,7 +622,76 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51465490 + url: https://api.linode.com/v4beta/linode/instances/51693566/ips + method: GET + response: + body: '{"ipv4": {"public": [{"address": "172.233.111.111", "gateway": "172.233.111.1", + "subnet_mask": "255.255.255.0", "prefix": 24, "type": "ipv4", "public": true, + "rdns": "172-233-111-111.ip.linodeusercontent.com", "linode_id": 51693566, "region": + "es-mad", "vpc_nat_1_1": {"vpc_id": 7304, "subnet_id": 8197, "address": "192.168.0.2"}}], + "private": [], "shared": [], "reserved": []}, "ipv6": {"slaac": {"address": + "1234::5678", "gateway": "1234::5678", "subnet_mask": "1234::5678", + "prefix": 64, "type": "ipv6", "rdns": null, "linode_id": 51693566, "region": + "es-mad", "public": true}, "link_local": {"address": "1234::5678", + "gateway": "1234::5678", "subnet_mask": "1234::5678", "prefix": 64, + "type": "ipv6", "rdns": null, "linode_id": 51693566, "region": "es-mad", "public": + false}, "global": []}}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "845" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - linodes:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/linode/instances/51693566 method: DELETE response: body: '{}' diff --git a/test/integration/fixtures/TestVPC_Update_Invalid.yaml b/test/integration/fixtures/TestVPC_Update_Invalid.yaml index 1f9ed1b52..c10761aec 100644 --- a/test/integration/fixtures/TestVPC_Update_Invalid.yaml +++ b/test/integration/fixtures/TestVPC_Update_Invalid.yaml @@ -238,7 +238,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-vpc-1698762179588832000","region":"es-mad"}' + body: '{"label":"go-test-vpc-1699291691153998000","region":"es-mad"}' form: {} headers: Accept: @@ -250,7 +250,7 @@ interactions: url: https://api.linode.com/v4beta/vpcs method: POST response: - body: '{"id": 6058, "label": "go-test-vpc-1698762179588832000", "description": + body: '{"id": 7069, "label": "go-test-vpc-1699291691153998000", "description": "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -306,7 +306,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/vpcs/6058 + url: https://api.linode.com/v4beta/vpcs/7069 method: PUT response: body: '{"errors": [{"reason": "Label must include only ASCII letters, numbers, @@ -347,7 +347,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/vpcs/6058 + url: https://api.linode.com/v4beta/vpcs/7069 method: DELETE response: body: '{}' diff --git a/test/integration/instance_config_test.go b/test/integration/instance_config_test.go index 442d9e8d4..dee7e4861 100644 --- a/test/integration/instance_config_test.go +++ b/test/integration/instance_config_test.go @@ -46,8 +46,8 @@ func setupVPCWithSubnetWithInstance( } teardownAll := func() { - instanceTeardown() vpcWithSubnetTeardown() + instanceTeardown() } return client, vpc, vpcSubnet, instance, instanceConfig, teardownAll, err } diff --git a/test/integration/vpc_test.go b/test/integration/vpc_test.go index efb78b95f..881bb176b 100644 --- a/test/integration/vpc_test.go +++ b/test/integration/vpc_test.go @@ -185,7 +185,8 @@ func TestVPC_List(t *testing.T) { } func TestVPC_Create_Invalid_data(t *testing.T) { - client, _ := createTestClient(t, "fixtures/TestVPC_Create_Invalid") + client, teardown := createTestClient(t, "fixtures/TestVPC_Create_Invalid") + defer teardown() err := createVPC_invalid_label(t, client) e, _ := err.(*Error) From a9ac19b31b36176ec80f978af30d2851251f2fe7 Mon Sep 17 00:00:00 2001 From: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:26:28 -0500 Subject: [PATCH 12/14] Explicitly store fixture in `setupVPCWithSubnetWithInstance` (#421) --- .../TestInstance_ConfigInterface_Update.yaml | 160 +++++++++++++--- ...nstance_ConfigInterfaces_AppendDelete.yaml | 156 +++++++++++++--- .../TestInstance_ConfigInterfaces_List.yaml | 164 +++++++++++++--- ...TestInstance_ConfigInterfaces_Reorder.yaml | 172 ++++++++++++++--- .../TestInstance_ConfigInterfaces_Update.yaml | 176 +++++++++++++++--- .../fixtures/TestVPC_Subnet_WithInstance.yaml | 172 ++++++++++++++--- test/integration/instance_config_test.go | 8 +- 7 files changed, 847 insertions(+), 161 deletions(-) diff --git a/test/integration/fixtures/TestInstance_ConfigInterface_Update.yaml b/test/integration/fixtures/TestInstance_ConfigInterface_Update.yaml index f292cf56a..ed687c980 100644 --- a/test/integration/fixtures/TestInstance_ConfigInterface_Update.yaml +++ b/test/integration/fixtures/TestInstance_ConfigInterface_Update.yaml @@ -238,7 +238,7 @@ interactions: code: 200 duration: "" - request: - body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-p67uc1u33z0e","booted":false}' + body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-94oh76dtq5q9","booted":false}' form: {} headers: Accept: @@ -250,9 +250,9 @@ interactions: url: https://api.linode.com/v4beta/linode/instances method: POST response: - body: '{"id": 51687525, "label": "go-test-ins-wo-disk-p67uc1u33z0e", "group": + body: '{"id": 51696212, "label": "go-test-ins-wo-disk-94oh76dtq5q9", "group": "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", - "type": "g6-nanode-1", "ipv4": ["172.233.110.106"], "ipv6": "1234::5678/128", + "type": "g6-nanode-1", "ipv4": ["172.233.111.128"], "ipv6": "1234::5678/128", "image": null, "region": "es-mad", "specs": {"disk": 25600, "memory": 1024, "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": @@ -303,7 +303,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-conf-z82rm8eb58k9","devices":{},"interfaces":null}' + body: '{"label":"go-test-conf-ahx01xo7709c","devices":{},"interfaces":null}' form: {} headers: Accept: @@ -312,10 +312,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687525/configs + url: https://api.linode.com/v4beta/linode/instances/51696212/configs method: POST response: - body: '{"id": 54672869, "label": "go-test-conf-z82rm8eb58k9", "helpers": {"updatedb_disabled": + body: '{"id": 54681856, "label": "go-test-conf-ahx01xo7709c", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", @@ -366,7 +366,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-vpc-1699289566596805000","region":"es-mad"}' + body: '{"label":"go-test-vpc-1699301187871294000","region":"es-mad"}' form: {} headers: Accept: @@ -378,7 +378,7 @@ interactions: url: https://api.linode.com/v4beta/vpcs method: POST response: - body: '{"id": 7033, "label": "go-test-vpc-1699289566596805000", "description": + body: '{"id": 7379, "label": "go-test-vpc-1699301187871294000", "description": "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -425,7 +425,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"linodego-vpc-test-1699289566861781000","ipv4":"192.168.0.0/25"}' + body: '{"label":"linodego-vpc-test-1699301188013974000","ipv4":"192.168.0.0/25"}' form: {} headers: Accept: @@ -434,10 +434,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/vpcs/7033/subnets + url: https://api.linode.com/v4beta/vpcs/7379/subnets method: POST response: - body: '{"id": 7954, "label": "linodego-vpc-test-1699289566861781000", "ipv4": + body: '{"id": 8278, "label": "linodego-vpc-test-1699301188013974000", "ipv4": "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -484,7 +484,7 @@ interactions: code: 200 duration: "" - request: - body: '{"purpose":"vpc","subnet_id":7954}' + body: '{"purpose":"vpc","subnet_id":8278}' form: {} headers: Accept: @@ -493,11 +493,11 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687525/configs/54672869/interfaces + url: https://api.linode.com/v4beta/linode/instances/51696212/configs/54681856/interfaces method: POST response: - body: '{"id": 797897, "purpose": "vpc", "primary": false, "active": false, "ipam_address": - null, "label": null, "vpc_id": 7033, "subnet_id": 7954, "ipv4": {"vpc": "192.168.0.2", + body: '{"id": 799678, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7379, "subnet_id": 8278, "ipv4": {"vpc": "192.168.0.2", "nat_1_1": ""}}' headers: Access-Control-Allow-Credentials: @@ -552,11 +552,11 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687525/configs/54672869/interfaces/797897 + url: https://api.linode.com/v4beta/linode/instances/51696212/configs/54681856/interfaces/799678 method: PUT response: - body: '{"id": 797897, "purpose": "vpc", "primary": true, "active": false, "ipam_address": - null, "label": null, "vpc_id": 7033, "subnet_id": 7954, "ipv4": {"vpc": "192.168.0.2", + body: '{"id": 799678, "purpose": "vpc", "primary": true, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7379, "subnet_id": 8278, "ipv4": {"vpc": "192.168.0.2", "nat_1_1": ""}}' headers: Access-Control-Allow-Credentials: @@ -611,12 +611,12 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687525/configs/54672869/interfaces/797897 + url: https://api.linode.com/v4beta/linode/instances/51696212/configs/54681856/interfaces/799678 method: PUT response: - body: '{"id": 797897, "purpose": "vpc", "primary": true, "active": false, "ipam_address": - null, "label": null, "vpc_id": 7033, "subnet_id": 7954, "ipv4": {"vpc": "192.168.0.10", - "nat_1_1": "172.233.110.106"}}' + body: '{"id": 799678, "purpose": "vpc", "primary": true, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7379, "subnet_id": 8278, "ipv4": {"vpc": "192.168.0.10", + "nat_1_1": "172.233.111.128"}}' headers: Access-Control-Allow-Credentials: - "true" @@ -670,7 +670,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687525 + url: https://api.linode.com/v4beta/linode/instances/51696212 method: DELETE response: body: '{}' @@ -717,3 +717,117 @@ interactions: status: 200 OK code: 200 duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7379/subnets/8278 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7379 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestInstance_ConfigInterfaces_AppendDelete.yaml b/test/integration/fixtures/TestInstance_ConfigInterfaces_AppendDelete.yaml index 60bced561..577e53ba3 100644 --- a/test/integration/fixtures/TestInstance_ConfigInterfaces_AppendDelete.yaml +++ b/test/integration/fixtures/TestInstance_ConfigInterfaces_AppendDelete.yaml @@ -238,7 +238,7 @@ interactions: code: 200 duration: "" - request: - body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-uh7252u4wk6v","booted":false}' + body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-15tp0q99gix9","booted":false}' form: {} headers: Accept: @@ -250,9 +250,9 @@ interactions: url: https://api.linode.com/v4beta/linode/instances method: POST response: - body: '{"id": 51687320, "label": "go-test-ins-wo-disk-uh7252u4wk6v", "group": + body: '{"id": 51696205, "label": "go-test-ins-wo-disk-15tp0q99gix9", "group": "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", - "type": "g6-nanode-1", "ipv4": ["172.233.110.110"], "ipv6": "1234::5678/128", + "type": "g6-nanode-1", "ipv4": ["172.233.111.125"], "ipv6": "1234::5678/128", "image": null, "region": "es-mad", "specs": {"disk": 25600, "memory": 1024, "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": @@ -303,7 +303,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-conf-2e6l8uz0z8n9","devices":{},"interfaces":null}' + body: '{"label":"go-test-conf-b3v8n5y46hv8","devices":{},"interfaces":null}' form: {} headers: Accept: @@ -312,10 +312,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687320/configs + url: https://api.linode.com/v4beta/linode/instances/51696205/configs method: POST response: - body: '{"id": 54672641, "label": "go-test-conf-2e6l8uz0z8n9", "helpers": {"updatedb_disabled": + body: '{"id": 54681848, "label": "go-test-conf-b3v8n5y46hv8", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", @@ -366,7 +366,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-vpc-1699289190376903000","region":"es-mad"}' + body: '{"label":"go-test-vpc-1699301175821254000","region":"es-mad"}' form: {} headers: Accept: @@ -378,7 +378,7 @@ interactions: url: https://api.linode.com/v4beta/vpcs method: POST response: - body: '{"id": 7025, "label": "go-test-vpc-1699289190376903000", "description": + body: '{"id": 7375, "label": "go-test-vpc-1699301175821254000", "description": "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -425,7 +425,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"linodego-vpc-test-1699289190516844000","ipv4":"192.168.0.0/25"}' + body: '{"label":"linodego-vpc-test-1699301175974513000","ipv4":"192.168.0.0/25"}' form: {} headers: Accept: @@ -434,10 +434,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/vpcs/7025/subnets + url: https://api.linode.com/v4beta/vpcs/7375/subnets method: POST response: - body: '{"id": 7946, "label": "linodego-vpc-test-1699289190516844000", "ipv4": + body: '{"id": 8274, "label": "linodego-vpc-test-1699301175974513000", "ipv4": "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -484,7 +484,7 @@ interactions: code: 200 duration: "" - request: - body: '{"purpose":"vpc","subnet_id":7946}' + body: '{"purpose":"vpc","subnet_id":8274}' form: {} headers: Accept: @@ -493,11 +493,11 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687320/configs/54672641/interfaces + url: https://api.linode.com/v4beta/linode/instances/51696205/configs/54681848/interfaces method: POST response: - body: '{"id": 797819, "purpose": "vpc", "primary": false, "active": false, "ipam_address": - null, "label": null, "vpc_id": 7025, "subnet_id": 7946, "ipv4": {"vpc": "192.168.0.2", + body: '{"id": 799668, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7375, "subnet_id": 8274, "ipv4": {"vpc": "192.168.0.2", "nat_1_1": ""}}' headers: Access-Control-Allow-Credentials: @@ -552,11 +552,11 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687320/configs/54672641/interfaces + url: https://api.linode.com/v4beta/linode/instances/51696205/configs/54681848/interfaces method: GET response: - body: '[{"id": 797819, "purpose": "vpc", "primary": false, "active": false, "ipam_address": - null, "label": null, "vpc_id": 7025, "subnet_id": 7946, "ipv4": {"vpc": "192.168.0.2", + body: '[{"id": 799668, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7375, "subnet_id": 8274, "ipv4": {"vpc": "192.168.0.2", "nat_1_1": ""}}]' headers: Access-Control-Allow-Credentials: @@ -613,7 +613,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687320/configs/54672641/interfaces/797819 + url: https://api.linode.com/v4beta/linode/instances/51696205/configs/54681848/interfaces/799668 method: DELETE response: body: '{}' @@ -670,7 +670,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687320/configs/54672641/interfaces + url: https://api.linode.com/v4beta/linode/instances/51696205/configs/54681848/interfaces method: GET response: body: '[]' @@ -729,7 +729,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687320 + url: https://api.linode.com/v4beta/linode/instances/51696205 method: DELETE response: body: '{}' @@ -776,3 +776,117 @@ interactions: status: 200 OK code: 200 duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7375/subnets/8274 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7375 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestInstance_ConfigInterfaces_List.yaml b/test/integration/fixtures/TestInstance_ConfigInterfaces_List.yaml index 827de6b84..0297e5e6e 100644 --- a/test/integration/fixtures/TestInstance_ConfigInterfaces_List.yaml +++ b/test/integration/fixtures/TestInstance_ConfigInterfaces_List.yaml @@ -238,7 +238,7 @@ interactions: code: 200 duration: "" - request: - body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-q8k472gyih02","booted":false}' + body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-orw13b4e44f8","booted":false}' form: {} headers: Accept: @@ -250,9 +250,9 @@ interactions: url: https://api.linode.com/v4beta/linode/instances method: POST response: - body: '{"id": 51687322, "label": "go-test-ins-wo-disk-q8k472gyih02", "group": + body: '{"id": 51696208, "label": "go-test-ins-wo-disk-orw13b4e44f8", "group": "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", - "type": "g6-nanode-1", "ipv4": ["172.233.110.112"], "ipv6": "1234::5678/128", + "type": "g6-nanode-1", "ipv4": ["172.233.111.127"], "ipv6": "1234::5678/128", "image": null, "region": "es-mad", "specs": {"disk": 25600, "memory": 1024, "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": @@ -303,7 +303,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-conf-kz9e6m4o68q0","devices":{},"interfaces":null}' + body: '{"label":"go-test-conf-4yg384mci23h","devices":{},"interfaces":null}' form: {} headers: Accept: @@ -312,10 +312,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687322/configs + url: https://api.linode.com/v4beta/linode/instances/51696208/configs method: POST response: - body: '{"id": 54672644, "label": "go-test-conf-kz9e6m4o68q0", "helpers": {"updatedb_disabled": + body: '{"id": 54681852, "label": "go-test-conf-4yg384mci23h", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", @@ -366,7 +366,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-vpc-1699289196770332000","region":"es-mad"}' + body: '{"label":"go-test-vpc-1699301180721667000","region":"es-mad"}' form: {} headers: Accept: @@ -378,7 +378,7 @@ interactions: url: https://api.linode.com/v4beta/vpcs method: POST response: - body: '{"id": 7027, "label": "go-test-vpc-1699289196770332000", "description": + body: '{"id": 7377, "label": "go-test-vpc-1699301180721667000", "description": "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -425,7 +425,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"linodego-vpc-test-1699289197649277000","ipv4":"192.168.0.0/25"}' + body: '{"label":"linodego-vpc-test-1699301181590276000","ipv4":"192.168.0.0/25"}' form: {} headers: Accept: @@ -434,10 +434,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/vpcs/7027/subnets + url: https://api.linode.com/v4beta/vpcs/7377/subnets method: POST response: - body: '{"id": 7948, "label": "linodego-vpc-test-1699289197649277000", "ipv4": + body: '{"id": 8276, "label": "linodego-vpc-test-1699301181590276000", "ipv4": "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -484,7 +484,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-conf-kz9e6m4o68q0","comments":"","devices":{},"helpers":{"updatedb_disabled":true,"distro":true,"modules_dep":true,"network":true,"devtmpfs_automount":true},"interfaces":[{"purpose":"public"},{"label":"testvlan","purpose":"vlan"},{"purpose":"vpc","subnet_id":7948,"ipv4":{"nat_1_1":"any"}}],"memory_limit":0,"kernel":"linode/latest-64bit","init_rd":null,"root_device":"/dev/sda","run_level":"default","virt_mode":"paravirt"}' + body: '{"label":"go-test-conf-4yg384mci23h","comments":"","devices":{},"helpers":{"updatedb_disabled":true,"distro":true,"modules_dep":true,"network":true,"devtmpfs_automount":true},"interfaces":[{"purpose":"public"},{"label":"testvlan","purpose":"vlan"},{"purpose":"vpc","subnet_id":8276,"ipv4":{"nat_1_1":"any"}}],"memory_limit":0,"kernel":"linode/latest-64bit","init_rd":null,"root_device":"/dev/sda","run_level":"default","virt_mode":"paravirt"}' form: {} headers: Accept: @@ -493,23 +493,23 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687322/configs/54672644 + url: https://api.linode.com/v4beta/linode/instances/51696208/configs/54681852 method: PUT response: - body: '{"id": 54672644, "label": "go-test-conf-kz9e6m4o68q0", "helpers": {"updatedb_disabled": + body: '{"id": 54681852, "label": "go-test-conf-4yg384mci23h", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", - "virt_mode": "paravirt", "interfaces": [{"id": 797825, "purpose": "public", + "virt_mode": "paravirt", "interfaces": [{"id": 799672, "purpose": "public", "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": - null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 797826, + null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 799673, "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": "testvlan", "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": - ""}}, {"id": 797827, "purpose": "vpc", "primary": false, "active": false, "ipam_address": - null, "label": null, "vpc_id": 7027, "subnet_id": 7948, "ipv4": {"vpc": "192.168.0.2", - "nat_1_1": "172.233.110.112"}}]}' + ""}}, {"id": 799674, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7377, "subnet_id": 8276, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": "172.233.111.127"}}]}' headers: Access-Control-Allow-Credentials: - "true" @@ -561,16 +561,16 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687322/configs/54672644/interfaces + url: https://api.linode.com/v4beta/linode/instances/51696208/configs/54681852/interfaces method: GET response: - body: '[{"id": 797825, "purpose": "public", "primary": false, "active": false, + body: '[{"id": 799672, "purpose": "public", "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": null, "subnet_id": null, "ipv4": - {"vpc": "", "nat_1_1": ""}}, {"id": 797826, "purpose": "vlan", "primary": false, + {"vpc": "", "nat_1_1": ""}}, {"id": 799673, "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": "testvlan", "vpc_id": null, "subnet_id": - null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 797827, "purpose": "vpc", + null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 799674, "purpose": "vpc", "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": - 7027, "subnet_id": 7948, "ipv4": {"vpc": "192.168.0.2", "nat_1_1": "172.233.110.112"}}]' + 7377, "subnet_id": 8276, "ipv4": {"vpc": "192.168.0.2", "nat_1_1": "172.233.111.127"}}]' headers: Access-Control-Allow-Credentials: - "true" @@ -626,7 +626,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687322 + url: https://api.linode.com/v4beta/linode/instances/51696208 method: DELETE response: body: '{}' @@ -673,3 +673,117 @@ interactions: status: 200 OK code: 200 duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7377/subnets/8276 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7377 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestInstance_ConfigInterfaces_Reorder.yaml b/test/integration/fixtures/TestInstance_ConfigInterfaces_Reorder.yaml index 083beeab9..63973979e 100644 --- a/test/integration/fixtures/TestInstance_ConfigInterfaces_Reorder.yaml +++ b/test/integration/fixtures/TestInstance_ConfigInterfaces_Reorder.yaml @@ -238,7 +238,7 @@ interactions: code: 200 duration: "" - request: - body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-i7i01rubi233","booted":false}' + body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-a626be47j9bs","booted":false}' form: {} headers: Accept: @@ -250,9 +250,9 @@ interactions: url: https://api.linode.com/v4beta/linode/instances method: POST response: - body: '{"id": 51687321, "label": "go-test-ins-wo-disk-i7i01rubi233", "group": + body: '{"id": 51696207, "label": "go-test-ins-wo-disk-a626be47j9bs", "group": "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", - "type": "g6-nanode-1", "ipv4": ["172.233.110.111"], "ipv6": "1234::5678/128", + "type": "g6-nanode-1", "ipv4": ["172.233.111.126"], "ipv6": "1234::5678/128", "image": null, "region": "es-mad", "specs": {"disk": 25600, "memory": 1024, "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": @@ -303,7 +303,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-conf-c3ul745e0g8m","devices":{},"interfaces":null}' + body: '{"label":"go-test-conf-a2li369h62rb","devices":{},"interfaces":null}' form: {} headers: Accept: @@ -312,10 +312,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687321/configs + url: https://api.linode.com/v4beta/linode/instances/51696207/configs method: POST response: - body: '{"id": 54672643, "label": "go-test-conf-c3ul745e0g8m", "helpers": {"updatedb_disabled": + body: '{"id": 54681850, "label": "go-test-conf-a2li369h62rb", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", @@ -366,7 +366,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-vpc-1699289193773583000","region":"es-mad"}' + body: '{"label":"go-test-vpc-1699301178430667000","region":"es-mad"}' form: {} headers: Accept: @@ -378,7 +378,7 @@ interactions: url: https://api.linode.com/v4beta/vpcs method: POST response: - body: '{"id": 7026, "label": "go-test-vpc-1699289193773583000", "description": + body: '{"id": 7376, "label": "go-test-vpc-1699301178430667000", "description": "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -425,7 +425,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"linodego-vpc-test-1699289193918539000","ipv4":"192.168.0.0/25"}' + body: '{"label":"linodego-vpc-test-1699301178582840000","ipv4":"192.168.0.0/25"}' form: {} headers: Accept: @@ -434,10 +434,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/vpcs/7026/subnets + url: https://api.linode.com/v4beta/vpcs/7376/subnets method: POST response: - body: '{"id": 7947, "label": "linodego-vpc-test-1699289193918539000", "ipv4": + body: '{"id": 8275, "label": "linodego-vpc-test-1699301178582840000", "ipv4": "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -484,7 +484,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-conf-c3ul745e0g8m","comments":"","devices":{},"helpers":{"updatedb_disabled":true,"distro":true,"modules_dep":true,"network":true,"devtmpfs_automount":true},"interfaces":[{"purpose":"public"},{"label":"testvlan","purpose":"vlan"},{"purpose":"vpc","subnet_id":7947,"ipv4":{"nat_1_1":"any"}}],"memory_limit":0,"kernel":"linode/latest-64bit","init_rd":null,"root_device":"/dev/sda","run_level":"default","virt_mode":"paravirt"}' + body: '{"label":"go-test-conf-a2li369h62rb","comments":"","devices":{},"helpers":{"updatedb_disabled":true,"distro":true,"modules_dep":true,"network":true,"devtmpfs_automount":true},"interfaces":[{"purpose":"public"},{"label":"testvlan","purpose":"vlan"},{"purpose":"vpc","subnet_id":8275,"ipv4":{"nat_1_1":"any"}}],"memory_limit":0,"kernel":"linode/latest-64bit","init_rd":null,"root_device":"/dev/sda","run_level":"default","virt_mode":"paravirt"}' form: {} headers: Accept: @@ -493,23 +493,23 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687321/configs/54672643 + url: https://api.linode.com/v4beta/linode/instances/51696207/configs/54681850 method: PUT response: - body: '{"id": 54672643, "label": "go-test-conf-c3ul745e0g8m", "helpers": {"updatedb_disabled": + body: '{"id": 54681850, "label": "go-test-conf-a2li369h62rb", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", - "virt_mode": "paravirt", "interfaces": [{"id": 797822, "purpose": "public", + "virt_mode": "paravirt", "interfaces": [{"id": 799669, "purpose": "public", "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": - null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 797823, + null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 799670, "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": "testvlan", "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": - ""}}, {"id": 797824, "purpose": "vpc", "primary": false, "active": false, "ipam_address": - null, "label": null, "vpc_id": 7026, "subnet_id": 7947, "ipv4": {"vpc": "192.168.0.2", - "nat_1_1": "172.233.110.111"}}]}' + ""}}, {"id": 799671, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7376, "subnet_id": 8275, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": "172.233.111.126"}}]}' headers: Access-Control-Allow-Credentials: - "true" @@ -552,7 +552,7 @@ interactions: code: 200 duration: "" - request: - body: '{"ids":[797823,797822,797824]}' + body: '{"ids":[799670,799669,799671]}' form: {} headers: Accept: @@ -561,7 +561,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687321/configs/54672643/interfaces/order + url: https://api.linode.com/v4beta/linode/instances/51696207/configs/54681850/interfaces/order method: POST response: body: '{}' @@ -618,23 +618,23 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687321/configs/54672643 + url: https://api.linode.com/v4beta/linode/instances/51696207/configs/54681850 method: GET response: - body: '{"id": 54672643, "label": "go-test-conf-c3ul745e0g8m", "helpers": {"updatedb_disabled": + body: '{"id": 54681850, "label": "go-test-conf-a2li369h62rb", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", - "virt_mode": "paravirt", "interfaces": [{"id": 797823, "purpose": "vlan", "primary": + "virt_mode": "paravirt", "interfaces": [{"id": 799670, "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": "testvlan", "vpc_id": null, - "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 797822, "purpose": + "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 799669, "purpose": "public", "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, - {"id": 797824, "purpose": "vpc", "primary": false, "active": false, "ipam_address": - null, "label": null, "vpc_id": 7026, "subnet_id": 7947, "ipv4": {"vpc": "192.168.0.2", - "nat_1_1": "172.233.110.111"}}]}' + {"id": 799671, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7376, "subnet_id": 8275, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": "172.233.111.126"}}]}' headers: Access-Control-Allow-Credentials: - "true" @@ -688,7 +688,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51687321 + url: https://api.linode.com/v4beta/linode/instances/51696207 method: DELETE response: body: '{}' @@ -735,3 +735,117 @@ interactions: status: 200 OK code: 200 duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7376/subnets/8275 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7376 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestInstance_ConfigInterfaces_Update.yaml b/test/integration/fixtures/TestInstance_ConfigInterfaces_Update.yaml index 072bc2059..7af76b71f 100644 --- a/test/integration/fixtures/TestInstance_ConfigInterfaces_Update.yaml +++ b/test/integration/fixtures/TestInstance_ConfigInterfaces_Update.yaml @@ -238,7 +238,7 @@ interactions: code: 200 duration: "" - request: - body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-4be66072uqxc","booted":false}' + body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-5cy6yk67gb29","booted":false}' form: {} headers: Accept: @@ -250,9 +250,9 @@ interactions: url: https://api.linode.com/v4beta/linode/instances method: POST response: - body: '{"id": 51689661, "label": "go-test-ins-wo-disk-4be66072uqxc", "group": + body: '{"id": 51696210, "label": "go-test-ins-wo-disk-5cy6yk67gb29", "group": "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", - "type": "g6-nanode-1", "ipv4": ["172.233.111.127"], "ipv6": "1234::5678/128", + "type": "g6-nanode-1", "ipv4": ["172.233.111.111"], "ipv6": "1234::5678/128", "image": null, "region": "es-mad", "specs": {"disk": 25600, "memory": 1024, "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": @@ -303,7 +303,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-conf-x03wt9rpg533","devices":{},"interfaces":null}' + body: '{"label":"go-test-conf-f1cm29s3r89f","devices":{},"interfaces":null}' form: {} headers: Accept: @@ -312,10 +312,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51689661/configs + url: https://api.linode.com/v4beta/linode/instances/51696210/configs method: POST response: - body: '{"id": 54675061, "label": "go-test-conf-x03wt9rpg533", "helpers": {"updatedb_disabled": + body: '{"id": 54681854, "label": "go-test-conf-f1cm29s3r89f", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", @@ -366,7 +366,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-vpc-1699292058226124000","region":"es-mad"}' + body: '{"label":"go-test-vpc-1699301184654464000","region":"es-mad"}' form: {} headers: Accept: @@ -378,7 +378,7 @@ interactions: url: https://api.linode.com/v4beta/vpcs method: POST response: - body: '{"id": 7073, "label": "go-test-vpc-1699292058226124000", "description": + body: '{"id": 7378, "label": "go-test-vpc-1699301184654464000", "description": "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -425,7 +425,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"linodego-vpc-test-1699292058391243000","ipv4":"192.168.0.0/25"}' + body: '{"label":"linodego-vpc-test-1699301184970841000","ipv4":"192.168.0.0/25"}' form: {} headers: Accept: @@ -434,10 +434,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/vpcs/7073/subnets + url: https://api.linode.com/v4beta/vpcs/7378/subnets method: POST response: - body: '{"id": 7984, "label": "linodego-vpc-test-1699292058391243000", "ipv4": + body: '{"id": 8277, "label": "linodego-vpc-test-1699301184970841000", "ipv4": "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -484,7 +484,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-conf-x03wt9rpg533","comments":"","devices":{},"helpers":{"updatedb_disabled":true,"distro":true,"modules_dep":true,"network":true,"devtmpfs_automount":true},"interfaces":[{"purpose":"public"},{"label":"testvlan","purpose":"vlan"},{"purpose":"vpc","subnet_id":7984}],"memory_limit":0,"kernel":"linode/latest-64bit","init_rd":null,"root_device":"/dev/sda","run_level":"default","virt_mode":"paravirt"}' + body: '{"label":"go-test-conf-f1cm29s3r89f","comments":"","devices":{},"helpers":{"updatedb_disabled":true,"distro":true,"modules_dep":true,"network":true,"devtmpfs_automount":true},"interfaces":[{"purpose":"public"},{"label":"testvlan","purpose":"vlan"},{"purpose":"vpc","subnet_id":8277}],"memory_limit":0,"kernel":"linode/latest-64bit","init_rd":null,"root_device":"/dev/sda","run_level":"default","virt_mode":"paravirt"}' form: {} headers: Accept: @@ -493,22 +493,22 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51689661/configs/54675061 + url: https://api.linode.com/v4beta/linode/instances/51696210/configs/54681854 method: PUT response: - body: '{"id": 54675061, "label": "go-test-conf-x03wt9rpg533", "helpers": {"updatedb_disabled": + body: '{"id": 54681854, "label": "go-test-conf-f1cm29s3r89f", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", - "virt_mode": "paravirt", "interfaces": [{"id": 798081, "purpose": "public", + "virt_mode": "paravirt", "interfaces": [{"id": 799675, "purpose": "public", "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": - null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 798082, + null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 799676, "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": "testvlan", "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": - ""}}, {"id": 798083, "purpose": "vpc", "primary": false, "active": false, "ipam_address": - null, "label": null, "vpc_id": 7073, "subnet_id": 7984, "ipv4": {"vpc": "192.168.0.2", + ""}}, {"id": 799677, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7378, "subnet_id": 8277, "ipv4": {"vpc": "192.168.0.2", "nat_1_1": ""}}]}' headers: Access-Control-Allow-Credentials: @@ -561,22 +561,22 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51689661/configs/54675061 + url: https://api.linode.com/v4beta/linode/instances/51696210/configs/54681854 method: GET response: - body: '{"id": 54675061, "label": "go-test-conf-x03wt9rpg533", "helpers": {"updatedb_disabled": + body: '{"id": 54681854, "label": "go-test-conf-f1cm29s3r89f", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", - "virt_mode": "paravirt", "interfaces": [{"id": 798081, "purpose": "public", + "virt_mode": "paravirt", "interfaces": [{"id": 799675, "purpose": "public", "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": - null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 798082, + null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 799676, "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": "testvlan", "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": - ""}}, {"id": 798083, "purpose": "vpc", "primary": false, "active": false, "ipam_address": - null, "label": null, "vpc_id": 7073, "subnet_id": 7984, "ipv4": {"vpc": "192.168.0.2", + ""}}, {"id": 799677, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7378, "subnet_id": 8277, "ipv4": {"vpc": "192.168.0.2", "nat_1_1": ""}}]}' headers: Access-Control-Allow-Credentials: @@ -631,22 +631,22 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51689661/configs/54675061 + url: https://api.linode.com/v4beta/linode/instances/51696210/configs/54681854 method: PUT response: - body: '{"id": 54675061, "label": "go-test-conf-x03wt9rpg533", "helpers": {"updatedb_disabled": + body: '{"id": 54681854, "label": "go-test-conf-f1cm29s3r89f", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", - "virt_mode": "paravirt", "interfaces": [{"id": 798081, "purpose": "public", + "virt_mode": "paravirt", "interfaces": [{"id": 799675, "purpose": "public", "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": - null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 798082, + null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 799676, "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": "testvlan", "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": - ""}}, {"id": 798083, "purpose": "vpc", "primary": false, "active": false, "ipam_address": - null, "label": null, "vpc_id": 7073, "subnet_id": 7984, "ipv4": {"vpc": "192.168.0.2", + ""}}, {"id": 799677, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7378, "subnet_id": 8277, "ipv4": {"vpc": "192.168.0.2", "nat_1_1": ""}}]}' headers: Access-Control-Allow-Credentials: @@ -699,7 +699,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51689661 + url: https://api.linode.com/v4beta/linode/instances/51696210 method: DELETE response: body: '{}' @@ -746,3 +746,117 @@ interactions: status: 200 OK code: 200 duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7378/subnets/8277 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7378 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestVPC_Subnet_WithInstance.yaml b/test/integration/fixtures/TestVPC_Subnet_WithInstance.yaml index 077fc89ae..f606c62d4 100644 --- a/test/integration/fixtures/TestVPC_Subnet_WithInstance.yaml +++ b/test/integration/fixtures/TestVPC_Subnet_WithInstance.yaml @@ -238,7 +238,7 @@ interactions: code: 200 duration: "" - request: - body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-2jyr37gon559","booted":false}' + body: '{"region":"es-mad","type":"g6-nanode-1","label":"go-test-ins-wo-disk-9upq91w9ma40","booted":false}' form: {} headers: Accept: @@ -250,9 +250,9 @@ interactions: url: https://api.linode.com/v4beta/linode/instances method: POST response: - body: '{"id": 51693566, "label": "go-test-ins-wo-disk-2jyr37gon559", "group": + body: '{"id": 51696129, "label": "go-test-ins-wo-disk-9upq91w9ma40", "group": "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", - "type": "g6-nanode-1", "ipv4": ["172.233.111.111"], "ipv6": "1234::5678/128", + "type": "g6-nanode-1", "ipv4": ["172.233.111.119"], "ipv6": "1234::5678/128", "image": null, "region": "es-mad", "specs": {"disk": 25600, "memory": 1024, "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": @@ -303,7 +303,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-conf-ql94a57ne12p","devices":{},"interfaces":null}' + body: '{"label":"go-test-conf-kut154l3d0e5","devices":{},"interfaces":null}' form: {} headers: Accept: @@ -312,10 +312,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51693566/configs + url: https://api.linode.com/v4beta/linode/instances/51696129/configs method: POST response: - body: '{"id": 54679087, "label": "go-test-conf-ql94a57ne12p", "helpers": {"updatedb_disabled": + body: '{"id": 54681781, "label": "go-test-conf-kut154l3d0e5", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", @@ -366,7 +366,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-vpc-1699297309404116000","region":"es-mad"}' + body: '{"label":"go-test-vpc-1699301061507635000","region":"es-mad"}' form: {} headers: Accept: @@ -378,7 +378,7 @@ interactions: url: https://api.linode.com/v4beta/vpcs method: POST response: - body: '{"id": 7304, "label": "go-test-vpc-1699297309404116000", "description": + body: '{"id": 7374, "label": "go-test-vpc-1699301061507635000", "description": "", "region": "es-mad", "subnets": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -425,7 +425,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"linodego-vpc-test-1699297311041808000","ipv4":"192.168.0.0/25"}' + body: '{"label":"linodego-vpc-test-1699301061876079000","ipv4":"192.168.0.0/25"}' form: {} headers: Accept: @@ -434,10 +434,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/vpcs/7304/subnets + url: https://api.linode.com/v4beta/vpcs/7374/subnets method: POST response: - body: '{"id": 8197, "label": "linodego-vpc-test-1699297311041808000", "ipv4": + body: '{"id": 8273, "label": "linodego-vpc-test-1699301061876079000", "ipv4": "192.168.0.0/25", "linodes": [], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: @@ -484,7 +484,7 @@ interactions: code: 200 duration: "" - request: - body: '{"label":"go-test-conf-ql94a57ne12p","comments":"","devices":{},"helpers":{"updatedb_disabled":true,"distro":true,"modules_dep":true,"network":true,"devtmpfs_automount":true},"interfaces":[{"purpose":"public"},{"label":"testvlan","purpose":"vlan"},{"purpose":"vpc","subnet_id":8197,"ipv4":{"nat_1_1":"any"}}],"memory_limit":0,"kernel":"linode/latest-64bit","init_rd":null,"root_device":"/dev/sda","run_level":"default","virt_mode":"paravirt"}' + body: '{"label":"go-test-conf-kut154l3d0e5","comments":"","devices":{},"helpers":{"updatedb_disabled":true,"distro":true,"modules_dep":true,"network":true,"devtmpfs_automount":true},"interfaces":[{"purpose":"public"},{"label":"testvlan","purpose":"vlan"},{"purpose":"vpc","subnet_id":8273,"ipv4":{"nat_1_1":"any"}}],"memory_limit":0,"kernel":"linode/latest-64bit","init_rd":null,"root_device":"/dev/sda","run_level":"default","virt_mode":"paravirt"}' form: {} headers: Accept: @@ -493,23 +493,23 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51693566/configs/54679087 + url: https://api.linode.com/v4beta/linode/instances/51696129/configs/54681781 method: PUT response: - body: '{"id": 54679087, "label": "go-test-conf-ql94a57ne12p", "helpers": {"updatedb_disabled": + body: '{"id": 54681781, "label": "go-test-conf-kut154l3d0e5", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", "devices": {"sda": null, "sdb": null, "sdc": null, "sdd": null, "sde": null, "sdf": null, "sdg": null, "sdh": null}, "initrd": null, "run_level": "default", - "virt_mode": "paravirt", "interfaces": [{"id": 798625, "purpose": "public", + "virt_mode": "paravirt", "interfaces": [{"id": 799665, "purpose": "public", "primary": false, "active": false, "ipam_address": null, "label": null, "vpc_id": - null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 798626, + null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": ""}}, {"id": 799666, "purpose": "vlan", "primary": false, "active": false, "ipam_address": "", "label": "testvlan", "vpc_id": null, "subnet_id": null, "ipv4": {"vpc": "", "nat_1_1": - ""}}, {"id": 798627, "purpose": "vpc", "primary": false, "active": false, "ipam_address": - null, "label": null, "vpc_id": 7304, "subnet_id": 8197, "ipv4": {"vpc": "192.168.0.2", - "nat_1_1": "172.233.111.111"}}]}' + ""}}, {"id": 799667, "purpose": "vpc", "primary": false, "active": false, "ipam_address": + null, "label": null, "vpc_id": 7374, "subnet_id": 8273, "ipv4": {"vpc": "192.168.0.2", + "nat_1_1": "172.233.111.119"}}]}' headers: Access-Control-Allow-Credentials: - "true" @@ -561,11 +561,11 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/vpcs/7304/subnets/8197 + url: https://api.linode.com/v4beta/vpcs/7374/subnets/8273 method: GET response: - body: '{"id": 8197, "label": "linodego-vpc-test-1699297311041808000", "ipv4": - "192.168.0.0/25", "linodes": [{"id": 51693566, "interfaces": [{"id": 798627, + body: '{"id": 8273, "label": "linodego-vpc-test-1699301061876079000", "ipv4": + "192.168.0.0/25", "linodes": [{"id": 51696129, "interfaces": [{"id": 799667, "active": false}]}], "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05"}' headers: Access-Control-Allow-Credentials: @@ -622,19 +622,19 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51693566/ips + url: https://api.linode.com/v4beta/linode/instances/51696129/ips method: GET response: - body: '{"ipv4": {"public": [{"address": "172.233.111.111", "gateway": "172.233.111.1", + body: '{"ipv4": {"public": [{"address": "172.233.111.119", "gateway": "172.233.111.1", "subnet_mask": "255.255.255.0", "prefix": 24, "type": "ipv4", "public": true, - "rdns": "172-233-111-111.ip.linodeusercontent.com", "linode_id": 51693566, "region": - "es-mad", "vpc_nat_1_1": {"vpc_id": 7304, "subnet_id": 8197, "address": "192.168.0.2"}}], + "rdns": "172-233-111-119.ip.linodeusercontent.com", "linode_id": 51696129, "region": + "es-mad", "vpc_nat_1_1": {"vpc_id": 7374, "subnet_id": 8273, "address": "192.168.0.2"}}], "private": [], "shared": [], "reserved": []}, "ipv6": {"slaac": {"address": "1234::5678", "gateway": "1234::5678", "subnet_mask": "1234::5678", - "prefix": 64, "type": "ipv6", "rdns": null, "linode_id": 51693566, "region": + "prefix": 64, "type": "ipv6", "rdns": null, "linode_id": 51696129, "region": "es-mad", "public": true}, "link_local": {"address": "1234::5678", "gateway": "1234::5678", "subnet_mask": "1234::5678", "prefix": 64, - "type": "ipv6", "rdns": null, "linode_id": 51693566, "region": "es-mad", "public": + "type": "ipv6", "rdns": null, "linode_id": 51696129, "region": "es-mad", "public": false}, "global": []}}' headers: Access-Control-Allow-Credentials: @@ -691,7 +691,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/51693566 + url: https://api.linode.com/v4beta/linode/instances/51696129 method: DELETE response: body: '{}' @@ -738,3 +738,117 @@ interactions: status: 200 OK code: 200 duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7374/subnets/8273 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/vpcs/7374 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - vpc:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "800" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/instance_config_test.go b/test/integration/instance_config_test.go index dee7e4861..0ce6af1a2 100644 --- a/test/integration/instance_config_test.go +++ b/test/integration/instance_config_test.go @@ -22,9 +22,10 @@ func setupVPCWithSubnetWithInstance( error, ) { t.Helper() - client, instance, instanceConfig, instanceTeardown, err := setupInstanceWithoutDisks( + client, fixtureTeardown := createTestClient(t, fixturesYaml) + instance, instanceConfig, instanceTeardown, err := createInstanceWithoutDisks( t, - fixturesYaml, + client, modifiers..., ) if err != nil { @@ -46,8 +47,9 @@ func setupVPCWithSubnetWithInstance( } teardownAll := func() { - vpcWithSubnetTeardown() instanceTeardown() + vpcWithSubnetTeardown() + fixtureTeardown() } return client, vpc, vpcSubnet, instance, instanceConfig, teardownAll, err } From 8b4b60315eed1d92f5200673595260cf92aefede Mon Sep 17 00:00:00 2001 From: Lena Garber <114949949+lgarber-akamai@users.noreply.github.com> Date: Tue, 7 Nov 2023 09:15:31 -0500 Subject: [PATCH 13/14] Rename `ListVPC` to be `ListVPCs` (#420) --- test/integration/vpc_test.go | 2 +- vpc.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/vpc_test.go b/test/integration/vpc_test.go index 881bb176b..b28bae319 100644 --- a/test/integration/vpc_test.go +++ b/test/integration/vpc_test.go @@ -167,7 +167,7 @@ func TestVPC_List(t *testing.T) { } vpcCheck(vpc, t) - vpcs, err := client.ListVPC(context.Background(), nil) + vpcs, err := client.ListVPCs(context.Background(), nil) if err != nil { t.Error(formatVPCError(err, "listing", nil)) } diff --git a/vpc.go b/vpc.go index 5d7d945ff..eb5aa1c1f 100644 --- a/vpc.go +++ b/vpc.go @@ -119,7 +119,7 @@ func (c *Client) GetVPC(ctx context.Context, vpcID int) (*VPC, error) { return r.Result().(*VPC), nil } -func (c *Client) ListVPC(ctx context.Context, opts *ListOptions) ([]VPC, error) { +func (c *Client) ListVPCs(ctx context.Context, opts *ListOptions) ([]VPC, error) { response := VPCsPagedResponse{} err := c.listHelper(ctx, &response, opts) if err != nil { From b97658d1d5de5f2142093d745e659c9ec8fd8c71 Mon Sep 17 00:00:00 2001 From: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:29:25 -0500 Subject: [PATCH 14/14] Rename `ListVPCSubnet` to be `ListVPCSubnets` (#422) --- test/integration/vpc_subnet_test.go | 2 +- vpc_subnet.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/vpc_subnet_test.go b/test/integration/vpc_subnet_test.go index 7e3cdeead..2f55922dc 100644 --- a/test/integration/vpc_subnet_test.go +++ b/test/integration/vpc_subnet_test.go @@ -180,7 +180,7 @@ func TestVPC_Subnet_List(t *testing.T) { opts := vpcSubnet.GetCreateOptions() vpcSubnetCreateOptionsCheck(&opts, vpcSubnet, t) - vpcSubnets, err := client.ListVPCSubnet(context.Background(), vpc.ID, nil) + vpcSubnets, err := client.ListVPCSubnets(context.Background(), vpc.ID, nil) found := false for _, v := range vpcSubnets { diff --git a/vpc_subnet.go b/vpc_subnet.go index d82f96e6c..24582bb33 100644 --- a/vpc_subnet.go +++ b/vpc_subnet.go @@ -129,7 +129,7 @@ func (c *Client) GetVPCSubnet( return r.Result().(*VPCSubnet), nil } -func (c *Client) ListVPCSubnet( +func (c *Client) ListVPCSubnets( ctx context.Context, vpcID int, opts *ListOptions,