diff --git a/outscale/data_source_outscale_net_peerings_test.go b/outscale/data_source_outscale_net_peerings_test.go index 2cb2b133a..36fdf8200 100644 --- a/outscale/data_source_outscale_net_peerings_test.go +++ b/outscale/data_source_outscale_net_peerings_test.go @@ -40,8 +40,8 @@ const testAccDataSourceOutscaleOAPILinPeeringsConnectionConfig = ` } resource "outscale_net_peering" "outscale_net_peering" { - accepter_net_id = "${outscale_net.outscale_net.net_id}" - source_net_id = "${outscale_net.outscale_net2.net_id}" + accepter_net_id = outscale_net.outscale_net.net_id + source_net_id = outscale_net.outscale_net2.net_id tags { key = "okht" value = "testacc-peerings-ds" @@ -50,14 +50,14 @@ const testAccDataSourceOutscaleOAPILinPeeringsConnectionConfig = ` } resource "outscale_net_peering" "outscale_net_peering2" { - accepter_net_id = "${outscale_net.outscale_net.net_id}" - source_net_id = "${outscale_net.outscale_net2.net_id}" + accepter_net_id = outscale_net.outscale_net.net_id + source_net_id = outscale_net.outscale_net2.net_id } data "outscale_net_peerings" "outscale_net_peerings" { filter { name = "net_peering_ids" - values = ["${outscale_net_peering.outscale_net_peering.net_peering_id}"] + values = [outscale_net_peering.outscale_net_peering.net_peering_id] } } ` diff --git a/outscale/data_source_outscale_vm.go b/outscale/data_source_outscale_vm.go index 7a610051f..2c521271f 100644 --- a/outscale/data_source_outscale_vm.go +++ b/outscale/data_source_outscale_vm.go @@ -82,6 +82,16 @@ func dataSourceOutscaleOAPIVMRead(d *schema.ResourceData, meta interface{}) erro // Populate vm attribute fields with the returned vm return resourceDataAttrSetter(d, func(set AttributeSetter) error { d.SetId(vm.GetVmId()) + + booTags, errTags := utils.GetBsuTagsMaps(vm, client) + if errTags != nil { + return errTags + } + if err := d.Set("block_device_mappings_created", getOscAPIVMBlockDeviceMapping( + booTags, vm.GetBlockDeviceMappings())); err != nil { + return err + } + return oapiVMDescriptionAttributes(set, &vm) }) } @@ -91,10 +101,6 @@ func oapiVMDescriptionAttributes(set AttributeSetter, vm *oscgo.Vm) error { if err := set("architecture", vm.GetArchitecture()); err != nil { return err } - if err := set("block_device_mappings_created", getOscAPIVMBlockDeviceMapping(vm.GetBlockDeviceMappings())); err != nil { - return err - } - if err := set("bsu_optimized", vm.GetBsuOptimized()); err != nil { return err } @@ -198,18 +204,26 @@ func oapiVMDescriptionAttributes(set AttributeSetter, vm *oscgo.Vm) error { return set("vm_type", vm.GetVmType()) } -func getOscAPIVMBlockDeviceMapping(blkMappings []oscgo.BlockDeviceMappingCreated) []map[string]interface{} { - res := []map[string]interface{}{} - for _, v := range blkMappings { - blk := map[string]interface{}{ +func getOscAPIVMBlockDeviceMapping(busTagsMaps map[string]interface{}, blockDeviceMappings []oscgo.BlockDeviceMappingCreated) (blockDeviceMapping []map[string]interface{}) { + for _, v := range blockDeviceMappings { + blockDevice := map[string]interface{}{ "device_name": v.GetDeviceName(), + "bsu": getbusToSet(v.GetBsu(), busTagsMaps, *v.DeviceName), } - if bsu, ok := v.GetBsuOk(); ok { - blk["bsu"] = getOAPIBsuSet(*bsu) - } - res = append(res, blk) + blockDeviceMapping = append(blockDeviceMapping, blockDevice) } - return res + return +} + +func getbusToSet(bsu oscgo.BsuCreated, busTagsMaps map[string]interface{}, deviceName string) (res []map[string]interface{}) { + res = append(res, map[string]interface{}{ + "delete_on_vm_deletion": bsu.GetDeleteOnVmDeletion(), + "volume_id": bsu.GetVolumeId(), + "state": bsu.GetState(), + "link_date": bsu.GetLinkDate(), + "tags": getOscAPITagSet(busTagsMaps[deviceName].([]oscgo.ResourceTag)), + }) + return } func getSecurityGroups(groupSet []oscgo.SecurityGroupLight) []map[string]interface{} { @@ -291,7 +305,8 @@ func getOApiVMAttributesSchema() map[string]*schema.Schema { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "bsu": { - Type: schema.TypeSet, + Type: schema.TypeList, + Optional: true, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -311,6 +326,7 @@ func getOApiVMAttributesSchema() map[string]*schema.Schema { Type: schema.TypeString, Computed: true, }, + "tags": tagsListOAPISchema(), }, }, }, diff --git a/outscale/data_source_outscale_vms.go b/outscale/data_source_outscale_vms.go index cd1ec795d..9735ddf5b 100644 --- a/outscale/data_source_outscale_vms.go +++ b/outscale/data_source_outscale_vms.go @@ -114,10 +114,10 @@ func dataSourceOutscaleOApiVMSRead(d *schema.ResourceData, meta interface{}) err } d.SetId(resource.UniqueId()) - return d.Set("vms", dataSourceOAPIVMS(filteredVms)) + return d.Set("vms", dataSourceOAPIVMS(filteredVms, client)) } -func dataSourceOAPIVMS(i []oscgo.Vm) []map[string]interface{} { +func dataSourceOAPIVMS(i []oscgo.Vm, conn *oscgo.APIClient) []map[string]interface{} { vms := make([]map[string]interface{}, len(i)) for index, v := range i { vm := make(map[string]interface{}) @@ -130,6 +130,8 @@ func dataSourceOAPIVMS(i []oscgo.Vm) []map[string]interface{} { if err := oapiVMDescriptionAttributes(setterFunc, &v); err != nil { log.Fatalf("[DEBUG] oapiVMDescriptionAttributes ERROR %+v", err) } + mapsTags, _ := utils.GetBsuTagsMaps(v, conn) + vm["block_device_mappings_created"] = getOscAPIVMBlockDeviceMapping(mapsTags, v.GetBlockDeviceMappings()) vm["tags"] = getOscAPITagSet(v.GetTags()) vms[index] = vm diff --git a/outscale/oapi_tags.go b/outscale/oapi_tags.go index ebf38757b..aa1c4eb74 100644 --- a/outscale/oapi_tags.go +++ b/outscale/oapi_tags.go @@ -16,23 +16,73 @@ import ( func setOSCAPITags(conn *oscgo.APIClient, d *schema.ResourceData) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(*schema.Set) - n := nraw.(*schema.Set) - create, remove := diffOSCAPITags(tagsFromSliceMap(o), tagsFromSliceMap(n)) - - // Set tag - if len(remove) > 0 { + oraw, nraw := d.GetChange("tags") + o := oraw.(*schema.Set) + n := nraw.(*schema.Set) + create, remove := diffOSCAPITags(tagsFromSliceMap(o), tagsFromSliceMap(n)) + resourceId := d.Id() + // Set tag + if len(remove) > 0 { + err := resource.Retry(60*time.Second, func() *resource.RetryError { + _, httpResp, err := conn.TagApi.DeleteTags(context.Background()).DeleteTagsRequest(oscgo.DeleteTagsRequest{ + ResourceIds: []string{resourceId}, + Tags: remove, + }).Execute() + if err != nil { + return utils.CheckThrottling(httpResp, err) + } + return nil + }) + if err != nil { + return err + } + } + if len(create) > 0 { + err := resource.Retry(60*time.Second, func() *resource.RetryError { + _, httpResp, err := conn.TagApi.CreateTags(context.Background()).CreateTagsRequest(oscgo.CreateTagsRequest{ + ResourceIds: []string{resourceId}, + Tags: create, + }).Execute() + if err != nil { + return utils.CheckThrottling(httpResp, err) + } + return nil + }) + if err != nil { + return err + } + } + return nil +} + +func updateBsuTags(conn *oscgo.APIClient, d *schema.ResourceData, addTags map[string]interface{}, delTags map[string]interface{}) error { + + var resp oscgo.ReadVmsResponse + err := resource.Retry(60*time.Second, func() *resource.RetryError { + rp, httpResp, err := conn.VmApi.ReadVms(context.Background()).ReadVmsRequest(oscgo.ReadVmsRequest{ + Filters: &oscgo.FiltersVm{ + VmIds: &[]string{d.Id()}, + }, + }).Execute() + + if err != nil { + return utils.CheckThrottling(httpResp, err) + } + resp = rp + return nil + }) + if err != nil { + return err + } + + if delTags != nil { + for dName := range delTags { err := resource.Retry(60*time.Second, func() *resource.RetryError { _, httpResp, err := conn.TagApi.DeleteTags(context.Background()).DeleteTagsRequest(oscgo.DeleteTagsRequest{ - ResourceIds: []string{d.Id()}, - Tags: remove, + ResourceIds: []string{utils.GetBsuId(resp.GetVms()[0], dName)}, + Tags: tagsFromSliceMap(delTags[dName].(*schema.Set)), }).Execute() if err != nil { - if strings.Contains(fmt.Sprint(err), ".NotFound") { - return resource.RetryableError(err) // retry - } return utils.CheckThrottling(httpResp, err) } return nil @@ -41,16 +91,15 @@ func setOSCAPITags(conn *oscgo.APIClient, d *schema.ResourceData) error { return err } } - if len(create) > 0 { + } + if addTags != nil { + for dName := range addTags { err := resource.Retry(60*time.Second, func() *resource.RetryError { _, httpResp, err := conn.TagApi.CreateTags(context.Background()).CreateTagsRequest(oscgo.CreateTagsRequest{ - ResourceIds: []string{d.Id()}, - Tags: create, + ResourceIds: []string{utils.GetBsuId(resp.GetVms()[0], dName)}, + Tags: tagsFromSliceMap(addTags[dName].(*schema.Set)), }).Execute() if err != nil { - if strings.Contains(fmt.Sprint(err), ".NotFound") { - return resource.RetryableError(err) // retry - } return utils.CheckThrottling(httpResp, err) } return nil @@ -60,7 +109,6 @@ func setOSCAPITags(conn *oscgo.APIClient, d *schema.ResourceData) error { } } } - return nil } diff --git a/outscale/resource_outscale_vm.go b/outscale/resource_outscale_vm.go index 95ff55e14..108b8c5ac 100644 --- a/outscale/resource_outscale_vm.go +++ b/outscale/resource_outscale_vm.go @@ -37,7 +37,6 @@ func resourceOutscaleOApiVM() *schema.Resource { "block_device_mappings": { Type: schema.TypeList, Optional: true, - //ForceNew: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "bsu": { @@ -86,6 +85,7 @@ func resourceOutscaleOApiVM() *schema.Resource { Optional: true, ForceNew: true, }, + "tags": tagsListOAPISchema(), }, }, }, @@ -574,7 +574,7 @@ func resourceOutscaleOApiVM() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "bsu": { - Type: schema.TypeList, + Type: schema.TypeSet, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -594,12 +594,13 @@ func resourceOutscaleOApiVM() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "tags": tagsListOAPISchema(), }, }, }, "device_name": { Type: schema.TypeString, - Optional: true, + Computed: true, }, }, }, @@ -716,11 +717,10 @@ func resourceOutscaleOApiVM() *schema.Resource { func resourceOAPIVMCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI - vmOpts, err := buildCreateVmsRequest(d, meta) + vmOpts, bsuMapsTags, err := buildCreateVmsRequest(d, meta) if err != nil { return err } - vState := d.Get("state").(string) if vState != "stopped" && vState != "running" { return fmt.Errorf("Error: state should be `stopped or running`") @@ -770,7 +770,17 @@ func resourceOAPIVMCreate(d *schema.ResourceData, meta interface{}) error { } } - log.Println("[DEBUG] imprimo log subnet") + if bsuMapsTags != nil { + for _, tMaps := range bsuMapsTags { + for dName, tags := range tMaps { + err := assignTags(tags.(*schema.Set), utils.GetBsuId(vm, dName), conn) + if err != nil { + return err + } + } + } + } + if tags, ok := d.GetOk("tags"); ok { err := assignTags(tags.(*schema.Set), vm.GetVmId(), conn) if err != nil { @@ -865,6 +875,17 @@ func resourceOAPIVMRead(d *schema.ResourceData, meta interface{}) error { } } d.SetId(vm.GetVmId()) + + bsuTagsMaps, errTags := utils.GetBsuTagsMaps(vm, conn) + if errTags != nil { + return errTags + } + + if err := d.Set("block_device_mappings_created", getOscAPIVMBlockDeviceMapping( + bsuTagsMaps, vm.GetBlockDeviceMappings())); err != nil { + return err + } + return oapiVMDescriptionAttributes(set, &vm) }); err != nil { return err @@ -975,8 +996,15 @@ func resourceOAPIVMUpdate(d *schema.ResourceData, meta interface{}) error { if d.HasChange("block_device_mappings") && !d.IsNewResource() { maps := d.Get("block_device_mappings").([]interface{}) - mappings := []oscgo.BlockDeviceMappingVmUpdate{} + oldT, newT := d.GetChange("block_device_mappings") + oldMapsTags, newMapsTags := getChangeTags(oldT, newT) + if oldMapsTags != nil || newMapsTags != nil { + if err := updateBsuTags(conn, d, oldMapsTags, newMapsTags); err != nil { + return err + } + } + mappings := []oscgo.BlockDeviceMappingVmUpdate{} for _, m := range maps { f := m.(map[string]interface{}) mapping := oscgo.BlockDeviceMappingVmUpdate{} @@ -1005,7 +1033,6 @@ func resourceOAPIVMUpdate(d *schema.ResourceData, meta interface{}) error { mapping.SetBsu(bsu) } } - mappings = append(mappings, mapping) } updateRequest.SetBlockDeviceMappings(mappings) @@ -1049,14 +1076,59 @@ out: return resourceOAPIVMRead(d, meta) } +func getChangeTags(oldCh interface{}, newCh interface{}) (map[string]interface{}, map[string]interface{}) { + oldMapsTags := getbsuMapsTags(oldCh.([]interface{})) + newMapsTags := getbsuMapsTags(newCh.([]interface{})) + addMapsTags := make(map[string]interface{}) + delMapsTags := make(map[string]interface{}) + + for v := range oldMapsTags { + inter := oldMapsTags[v].(*schema.Set).Intersection(newMapsTags[v].(*schema.Set)) + if add := oldMapsTags[v].(*schema.Set).Difference(inter); len(add.List()) > 0 { + addMapsTags[v] = add + } + if del := newMapsTags[v].(*schema.Set).Difference(inter); len(del.List()) > 0 { + delMapsTags[v] = del + } + } + return delMapsTags, addMapsTags +} + +func getbsuMapsTags(changeMaps []interface{}) map[string]interface{} { + mapsTags := make(map[string]interface{}) + + for _, value := range changeMaps { + val := value.(map[string]interface{}) + bsuMaps := val["bsu"].([]interface{}) + for _, v := range bsuMaps { + bsu := v.(map[string]interface{}) + bsu_tags, _ := bsu["tags"] + mapsTags[val["device_name"].(string)] = bsu_tags + } + } + return mapsTags +} func resourceOAPIVMDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI id := d.Id() + var err error + + err = resource.Retry(d.Timeout(schema.TimeoutDelete), func() *resource.RetryError { + _, httpResp, err := conn.VmApi.StopVms(context.Background()).StopVmsRequest(oscgo.StopVmsRequest{ + VmIds: []string{id}, + ForceStop: oscgo.PtrBool(true), + }).Execute() + if err != nil { + return utils.CheckThrottling(httpResp, err) + } + return nil + }) - log.Printf("[INFO] Terminating VM: %s", id) + if err != nil { + return fmt.Errorf("Error Force stopping vms before destroy %s", err) + } - var err error err = resource.Retry(d.Timeout(schema.TimeoutDelete), func() *resource.RetryError { _, httpResp, err := conn.VmApi.DeleteVms(context.Background()).DeleteVmsRequest(oscgo.DeleteVmsRequest{ VmIds: []string{id}, @@ -1092,7 +1164,7 @@ func resourceOAPIVMDelete(d *schema.ResourceData, meta interface{}) error { return nil } -func buildCreateVmsRequest(d *schema.ResourceData, meta interface{}) (oscgo.CreateVmsRequest, error) { +func buildCreateVmsRequest(d *schema.ResourceData, meta interface{}) (oscgo.CreateVmsRequest, []map[string]interface{}, error) { request := oscgo.CreateVmsRequest{ DeletionProtection: oscgo.PtrBool(d.Get("deletion_protection").(bool)), BootOnCreation: oscgo.PtrBool(true), @@ -1103,7 +1175,7 @@ func buildCreateVmsRequest(d *schema.ResourceData, meta interface{}) (oscgo.Crea placement, err := expandPlacement(d) if err != nil { - return request, err + return request, nil, err } else if placement != nil { request.SetPlacement(*placement) } @@ -1112,9 +1184,9 @@ func buildCreateVmsRequest(d *schema.ResourceData, meta interface{}) (oscgo.Crea if subNet != "" { request.SetSubnetId(subNet) } - blockDevices, err := expandBlockDeviceOApiMappings(d) + blockDevices, bsuMapsTags, err := expandBlockDeviceOApiMappings(d) if err != nil { - return request, err + return request, nil, err } if len(blockDevices) > 0 { request.SetBlockDeviceMappings(blockDevices) @@ -1122,7 +1194,7 @@ func buildCreateVmsRequest(d *schema.ResourceData, meta interface{}) (oscgo.Crea if nics := buildNetworkOApiInterfaceOpts(d); len(nics) > 0 { if subNet != "" || placement != nil { - return request, errors.New("If you specify nics parameter, you must not specify subnet_id and placement parameters.") + return request, nil, errors.New("If you specify nics parameter, you must not specify subnet_id and placement parameters.") } request.SetNics(nics) } @@ -1141,7 +1213,7 @@ func buildCreateVmsRequest(d *schema.ResourceData, meta interface{}) (oscgo.Crea nestedVirtualization := d.Get("nested_virtualization").(bool) if tenacy := d.Get("placement_tenancy").(string); nestedVirtualization && tenacy != "dedicated" { - return request, errors.New("The field nested_virtualization can be true, only if placement_tenancy is \"dedicated\".") + return request, nil, errors.New("The field nested_virtualization can be true, only if placement_tenancy is \"dedicated\".") } request.SetNestedVirtualization(nestedVirtualization) @@ -1169,21 +1241,21 @@ func buildCreateVmsRequest(d *schema.ResourceData, meta interface{}) (oscgo.Crea request.SetPerformance(v) } - return request, nil + return request, bsuMapsTags, nil } -func expandBlockDeviceOApiMappings(d *schema.ResourceData) ([]oscgo.BlockDeviceMappingVmCreation, error) { +func expandBlockDeviceOApiMappings(d *schema.ResourceData) ([]oscgo.BlockDeviceMappingVmCreation, []map[string]interface{}, error) { var blockDevices []oscgo.BlockDeviceMappingVmCreation block := d.Get("block_device_mappings").([]interface{}) - - for _, v := range block { + bsuMapsTags := make([]map[string]interface{}, len(block)) + for k, v := range block { blockDevice := oscgo.BlockDeviceMappingVmCreation{} value := v.(map[string]interface{}) - if bsu := value["bsu"].(*schema.Set).List(); len(bsu) > 0 { - expandBSU, err := expandBlockDeviceBSU(bsu[0].(map[string]interface{})) + expandBSU, mapsTags, err := expandBlockDeviceBSU(bsu[0].(map[string]interface{}), value["device_name"].(string)) + bsuMapsTags[k] = mapsTags if err != nil { - return nil, err + return nil, nil, err } blockDevice.SetBsu(expandBSU) } @@ -1198,21 +1270,22 @@ func expandBlockDeviceOApiMappings(d *schema.ResourceData) ([]oscgo.BlockDeviceM } blockDevices = append(blockDevices, blockDevice) } - return blockDevices, nil + return blockDevices, bsuMapsTags, nil } -func expandBlockDeviceBSU(bsu map[string]interface{}) (oscgo.BsuToCreate, error) { +func expandBlockDeviceBSU(bsu map[string]interface{}, deviceName string) (oscgo.BsuToCreate, map[string]interface{}, error) { + bsuMapsTags := make(map[string]interface{}) bsuToCreate := oscgo.BsuToCreate{} snapshotID := bsu["snapshot_id"].(string) volumeType := bsu["volume_type"].(string) volumeSize := int32(bsu["volume_size"].(int)) if snapshotID == "" && volumeSize == 0 { - return bsuToCreate, fmt.Errorf("Error: 'volume_size' parameter is required if the volume is not created from a snapshot (SnapshotId unspecified)") + return bsuToCreate, nil, fmt.Errorf("Error: 'volume_size' parameter is required if the volume is not created from a snapshot (SnapshotId unspecified)") } if iops, _ := bsu["iops"]; iops.(int) > 0 { if volumeType != "io1" { - return bsuToCreate, fmt.Errorf("Error: %s", utils.VolumeIOPSError) + return bsuToCreate, nil, fmt.Errorf("Error: %s", utils.VolumeIOPSError) } bsuToCreate.SetIops(int32(iops.(int))) } else { @@ -1230,7 +1303,11 @@ func expandBlockDeviceBSU(bsu map[string]interface{}) (oscgo.BsuToCreate, error) if deleteOnVMDeletion, ok := bsu["delete_on_vm_deletion"]; ok && deleteOnVMDeletion != "" { bsuToCreate.SetDeleteOnVmDeletion(cast.ToBool(deleteOnVMDeletion)) } - return bsuToCreate, nil + if bsu_tags, _ := bsu["tags"]; len(bsu_tags.(*schema.Set).List()) != 0 { + bsuMapsTags[deviceName] = bsu_tags + } + + return bsuToCreate, bsuMapsTags, nil } func buildNetworkOApiInterfaceOpts(d *schema.ResourceData) []oscgo.NicForVmCreation { diff --git a/outscale/resource_outscale_vm_test.go b/outscale/resource_outscale_vm_test.go index a21c973cd..9ec1eab38 100644 --- a/outscale/resource_outscale_vm_test.go +++ b/outscale/resource_outscale_vm_test.go @@ -403,6 +403,10 @@ func testAccCheckOutscaleVMWithMultiBlockDeviceMapping(region, omi, keypair stri volume_type = "gp2" snapshot_id = outscale_snapshot.snapshot.id delete_on_vm_deletion = false + tags { + key = "name" + value = "bsu-tags-gp2" + } } } diff --git a/tests/qa_provider_oapi/data/flexible_gpu_link/TF-174_flexible_gpu_link_resource_attributes_ok/step1.flexible_gpu_link_resource_attributes_ok.ref b/tests/qa_provider_oapi/data/flexible_gpu_link/TF-174_flexible_gpu_link_resource_attributes_ok/step1.flexible_gpu_link_resource_attributes_ok.ref index 3599e070b..5034b61a9 100644 --- a/tests/qa_provider_oapi/data/flexible_gpu_link/TF-174_flexible_gpu_link_resource_attributes_ok/step1.flexible_gpu_link_resource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/flexible_gpu_link/TF-174_flexible_gpu_link_resource_attributes_ok/step1.flexible_gpu_link_resource_attributes_ok.ref @@ -125,6 +125,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], diff --git a/tests/qa_provider_oapi/data/flexible_gpus/TF-175_flexible_gpus_datasource_attributes_ok/step1.flexible_gpus_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/flexible_gpus/TF-175_flexible_gpus_datasource_attributes_ok/step1.flexible_gpus_datasource_attributes_ok.ref index e5655c20a..b02246a23 100644 --- a/tests/qa_provider_oapi/data/flexible_gpus/TF-175_flexible_gpus_datasource_attributes_ok/step1.flexible_gpus_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/flexible_gpus/TF-175_flexible_gpus_datasource_attributes_ok/step1.flexible_gpus_datasource_attributes_ok.ref @@ -70,7 +70,7 @@ "generation": "v5", "model_name": "nvidia-p6", "state": "allocated", - "subregion_name": "eu-west-2a", + "subregion_name": "###region###a", "vm_id": "" }, { @@ -79,7 +79,7 @@ "generation": "v5", "model_name": "nvidia-p6", "state": "attached", - "subregion_name": "eu-west-2a", + "subregion_name": "###region###a", "vm_id": "##id-1##" } ], @@ -234,6 +234,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], diff --git a/tests/qa_provider_oapi/data/image/TF-66_image_datasource_attributes_ok/step1.image_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/image/TF-66_image_datasource_attributes_ok/step1.image_datasource_attributes_ok.ref index 3d315b7e5..28c9a1c2c 100644 --- a/tests/qa_provider_oapi/data/image/TF-66_image_datasource_attributes_ok/step1.image_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/image/TF-66_image_datasource_attributes_ok/step1.image_datasource_attributes_ok.ref @@ -592,6 +592,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], diff --git a/tests/qa_provider_oapi/data/image/TF-67_image_resource_attributes_ok/step1.image_no-reboot_resource_std_attributes_ok.ref b/tests/qa_provider_oapi/data/image/TF-67_image_resource_attributes_ok/step1.image_no-reboot_resource_std_attributes_ok.ref index da5bb9b02..f8631775b 100644 --- a/tests/qa_provider_oapi/data/image/TF-67_image_resource_attributes_ok/step1.image_no-reboot_resource_std_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/image/TF-67_image_resource_attributes_ok/step1.image_no-reboot_resource_std_attributes_ok.ref @@ -168,6 +168,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-7##" } ], diff --git a/tests/qa_provider_oapi/data/image_launch_permission/TF-68_image_launch_permission_resource_attributes_ok/step1.image_launch_permission_resource_attributes_ok.ref b/tests/qa_provider_oapi/data/image_launch_permission/TF-68_image_launch_permission_resource_attributes_ok/step1.image_launch_permission_resource_attributes_ok.ref index 834ad112d..77296c656 100644 --- a/tests/qa_provider_oapi/data/image_launch_permission/TF-68_image_launch_permission_resource_attributes_ok/step1.image_launch_permission_resource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/image_launch_permission/TF-68_image_launch_permission_resource_attributes_ok/step1.image_launch_permission_resource_attributes_ok.ref @@ -186,6 +186,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], diff --git a/tests/qa_provider_oapi/data/images/TF-69_images_datasource_attributes_ok/step1.images_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/images/TF-69_images_datasource_attributes_ok/step1.images_datasource_attributes_ok.ref index 6edcd91f0..ab613a047 100644 --- a/tests/qa_provider_oapi/data/images/TF-69_images_datasource_attributes_ok/step1.images_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/images/TF-69_images_datasource_attributes_ok/step1.images_datasource_attributes_ok.ref @@ -130,6 +130,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], diff --git a/tests/qa_provider_oapi/data/images/TF-69_images_datasource_attributes_ok/step2.images_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/images/TF-69_images_datasource_attributes_ok/step2.images_datasource_attributes_ok.ref index f2e106c4a..bdbbe8465 100644 --- a/tests/qa_provider_oapi/data/images/TF-69_images_datasource_attributes_ok/step2.images_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/images/TF-69_images_datasource_attributes_ok/step2.images_datasource_attributes_ok.ref @@ -760,6 +760,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-12##" } ], diff --git a/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-87_load_balancer_listener_rule_datasource_attributes_ok/step1.load_balancer_listener_rule_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-87_load_balancer_listener_rule_datasource_attributes_ok/step1.load_balancer_listener_rule_datasource_attributes_ok.ref index 65117746d..c5d12ec2e 100644 --- a/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-87_load_balancer_listener_rule_datasource_attributes_ok/step1.load_balancer_listener_rule_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-87_load_balancer_listener_rule_datasource_attributes_ok/step1.load_balancer_listener_rule_datasource_attributes_ok.ref @@ -285,6 +285,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-13##" } ], diff --git a/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step1.load_balancer_listener_rule_resource_attributes_ok.ref b/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step1.load_balancer_listener_rule_resource_attributes_ok.ref index 1d390232a..b1a76d2de 100644 --- a/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step1.load_balancer_listener_rule_resource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step1.load_balancer_listener_rule_resource_attributes_ok.ref @@ -301,6 +301,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-14##" } ], diff --git a/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step2.load_balancer_listener_rule_resource_attributes_ok.ref b/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step2.load_balancer_listener_rule_resource_attributes_ok.ref index be04b99cf..d8c90d2de 100644 --- a/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step2.load_balancer_listener_rule_resource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step2.load_balancer_listener_rule_resource_attributes_ok.ref @@ -303,6 +303,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-14##" } ], diff --git a/tests/qa_provider_oapi/data/load_balancer_listener_rules/TF-89_load_balancer_listener_rules_datasource_attributes_ok/step1.load_balancer_listener_rules_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/load_balancer_listener_rules/TF-89_load_balancer_listener_rules_datasource_attributes_ok/step1.load_balancer_listener_rules_datasource_attributes_ok.ref index 4e3cfe490..7a10aa561 100644 --- a/tests/qa_provider_oapi/data/load_balancer_listener_rules/TF-89_load_balancer_listener_rules_datasource_attributes_ok/step1.load_balancer_listener_rules_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/load_balancer_listener_rules/TF-89_load_balancer_listener_rules_datasource_attributes_ok/step1.load_balancer_listener_rules_datasource_attributes_ok.ref @@ -19,24 +19,24 @@ "listener_rules": [ { "action": "forward", - "host_name_pattern": "*.abc.-.abc.*.com", + "host_name_pattern": "", "listener_id": "##id-1##", "listener_rule_id": "##id-2##", - "listener_rule_name": "listener-rule-2", - "path_pattern": "", - "priority": 1, + "listener_rule_name": "listener-rule-1", + "path_pattern": "*.abc.*.abc.*.com", + "priority": 10, "vm_ids": [ "##id-3##" ] }, { "action": "forward", - "host_name_pattern": "", + "host_name_pattern": "*.abc.-.abc.*.com", "listener_id": "##id-1##", "listener_rule_id": "##id-4##", - "listener_rule_name": "listener-rule-1", - "path_pattern": "*.abc.*.abc.*.com", - "priority": 10, + "listener_rule_name": "listener-rule-2", + "path_pattern": "", + "priority": 1, "vm_ids": [ "##id-3##" ] @@ -163,7 +163,7 @@ "action": "forward", "host_name_pattern": "", "listener_id": "##id-1##", - "listener_rule_id": "##id-4##", + "listener_rule_id": "##id-2##", "listener_rule_name": "listener-rule-1", "path_pattern": "*.abc.*.abc.*.com", "priority": 10 @@ -206,7 +206,7 @@ "action": "forward", "host_name_pattern": "*.abc.-.abc.*.com", "listener_id": "##id-1##", - "listener_rule_id": "##id-2##", + "listener_rule_id": "##id-4##", "listener_rule_name": "listener-rule-2", "path_pattern": "", "priority": 1 @@ -301,7 +301,8 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", - "volume_id": "##id-13##" + "tags": [], + "volume_id": "##id-14##" } ], "device_name": "/dev/sda1" diff --git a/tests/qa_provider_oapi/data/load_balancer_vm_health/TF-92_load_balancer_vm_health_datasource_attributes_ok/step1.load_balancer_vm_health_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/load_balancer_vm_health/TF-92_load_balancer_vm_health_datasource_attributes_ok/step1.load_balancer_vm_health_datasource_attributes_ok.ref index 3a3acb1e5..b8c5c7f71 100644 --- a/tests/qa_provider_oapi/data/load_balancer_vm_health/TF-92_load_balancer_vm_health_datasource_attributes_ok/step1.load_balancer_vm_health_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/load_balancer_vm_health/TF-92_load_balancer_vm_health_datasource_attributes_ok/step1.load_balancer_vm_health_datasource_attributes_ok.ref @@ -307,6 +307,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-8##" } ], diff --git a/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step1.load_balancer_vms_resource_attributes_ok.ref b/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step1.load_balancer_vms_resource_attributes_ok.ref index cfde1901d..dc1b0d201 100644 --- a/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step1.load_balancer_vms_resource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step1.load_balancer_vms_resource_attributes_ok.ref @@ -182,7 +182,8 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", - "volume_id": "##id-8##" + "tags": [], + "volume_id": "##id-6##" } ], "device_name": "/dev/sda1" @@ -265,6 +266,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-11##" } ], diff --git a/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step2.load_balancer_vms_resource_remove_vm_ok.ref b/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step2.load_balancer_vms_resource_remove_vm_ok.ref index f4430adfb..60eacdfe9 100644 --- a/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step2.load_balancer_vms_resource_remove_vm_ok.ref +++ b/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step2.load_balancer_vms_resource_remove_vm_ok.ref @@ -184,6 +184,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-8##" } ], @@ -267,6 +268,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-11##" } ], diff --git a/tests/qa_provider_oapi/data/nets/TF-109_nic_datasource_attributes_ok/step1.nic_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/nets/TF-109_nic_datasource_attributes_ok/step1.nic_datasource_attributes_ok.ref index ac9ea66f2..be883ba3b 100644 --- a/tests/qa_provider_oapi/data/nets/TF-109_nic_datasource_attributes_ok/step1.nic_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/nets/TF-109_nic_datasource_attributes_ok/step1.nic_datasource_attributes_ok.ref @@ -761,6 +761,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-15##" } ], diff --git a/tests/qa_provider_oapi/data/nets/TF-111_nic_link_resource_attributes_ok/step1.nic_link_resource_attributes_ok.ref b/tests/qa_provider_oapi/data/nets/TF-111_nic_link_resource_attributes_ok/step1.nic_link_resource_attributes_ok.ref index 85f34304a..9ae73ae1b 100644 --- a/tests/qa_provider_oapi/data/nets/TF-111_nic_link_resource_attributes_ok/step1.nic_link_resource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/nets/TF-111_nic_link_resource_attributes_ok/step1.nic_link_resource_attributes_ok.ref @@ -223,6 +223,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-9##" } ], diff --git a/tests/qa_provider_oapi/data/nets/TF-113_nics_datasource_attributes_ok/step1.nics_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/nets/TF-113_nics_datasource_attributes_ok/step1.nics_datasource_attributes_ok.ref index ab7829147..1cd4e5934 100644 --- a/tests/qa_provider_oapi/data/nets/TF-113_nics_datasource_attributes_ok/step1.nics_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/nets/TF-113_nics_datasource_attributes_ok/step1.nics_datasource_attributes_ok.ref @@ -150,11 +150,20 @@ "account_id": "##id-1##", "description": "", "is_source_dest_checked": true, - "link_nic": [], + "link_nic": [ + { + "delete_on_vm_deletion": false, + "device_number": 2, + "link_nic_id": "##id-12##", + "state": "attached", + "vm_account_id": "##id-1##", + "vm_id": "##id-3##" + } + ], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-12##", + "nic_id": "##id-13##", "private_dns_name": "########", "private_ips": [ { @@ -162,6 +171,12 @@ "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" + }, + { + "is_primary": false, + "link_public_ip": [], + "private_dns_name": "########", + "private_ip": "########" } ], "security_groups": [ @@ -170,17 +185,13 @@ "security_group_name": "Terraform-SG" } ], - "state": "available", - "subnet_id": "##id-13##", - "subregion_name": "us-east-2b", + "state": "in-use", + "subnet_id": "##id-7##", + "subregion_name": "us-east-2a", "tags": [ { - "key": "Key:", - "value": ":value-tags" - }, - { - "key": "Key-2", - "value": "value-tags-2" + "key": "Name", + "value": "Nic-2" } ] }, @@ -188,20 +199,11 @@ "account_id": "##id-1##", "description": "", "is_source_dest_checked": true, - "link_nic": [ - { - "delete_on_vm_deletion": false, - "device_number": 2, - "link_nic_id": "##id-14##", - "state": "attached", - "vm_account_id": "##id-1##", - "vm_id": "##id-3##" - } - ], + "link_nic": [], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-15##", + "nic_id": "##id-14##", "private_dns_name": "########", "private_ips": [ { @@ -209,12 +211,6 @@ "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" - }, - { - "is_primary": false, - "link_public_ip": [], - "private_dns_name": "########", - "private_ip": "########" } ], "security_groups": [ @@ -223,13 +219,17 @@ "security_group_name": "Terraform-SG" } ], - "state": "in-use", - "subnet_id": "##id-7##", - "subregion_name": "us-east-2a", + "state": "available", + "subnet_id": "##id-15##", + "subregion_name": "us-east-2b", "tags": [ { - "key": "Name", - "value": "Nic-2" + "key": "Key:", + "value": ":value-tags" + }, + { + "key": "Key-2", + "value": "value-tags-2" } ] } @@ -307,13 +307,22 @@ }, { "account_id": "##id-1##", - "description": "", + "description": "Primary network interface", "is_source_dest_checked": true, - "link_nic": [], + "link_nic": [ + { + "delete_on_vm_deletion": true, + "device_number": 0, + "link_nic_id": "##id-9##", + "state": "attached", + "vm_account_id": "##id-1##", + "vm_id": "##id-3##" + } + ], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-12##", + "nic_id": "##id-10##", "private_dns_name": "########", "private_ips": [ { @@ -329,19 +338,10 @@ "security_group_name": "Terraform-SG" } ], - "state": "available", - "subnet_id": "##id-13##", - "subregion_name": "us-east-2b", - "tags": [ - { - "key": "Key:", - "value": ":value-tags" - }, - { - "key": "Key-2", - "value": "value-tags-2" - } - ] + "state": "in-use", + "subnet_id": "##id-7##", + "subregion_name": "us-east-2a", + "tags": [] }, { "account_id": "##id-1##", @@ -351,7 +351,7 @@ { "delete_on_vm_deletion": false, "device_number": 2, - "link_nic_id": "##id-14##", + "link_nic_id": "##id-12##", "state": "attached", "vm_account_id": "##id-1##", "vm_id": "##id-3##" @@ -360,7 +360,7 @@ "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-15##", + "nic_id": "##id-13##", "private_dns_name": "########", "private_ips": [ { @@ -394,22 +394,13 @@ }, { "account_id": "##id-1##", - "description": "Primary network interface", + "description": "", "is_source_dest_checked": true, - "link_nic": [ - { - "delete_on_vm_deletion": true, - "device_number": 0, - "link_nic_id": "##id-9##", - "state": "attached", - "vm_account_id": "##id-1##", - "vm_id": "##id-3##" - } - ], + "link_nic": [], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-10##", + "nic_id": "##id-14##", "private_dns_name": "########", "private_ips": [ { @@ -425,10 +416,19 @@ "security_group_name": "Terraform-SG" } ], - "state": "in-use", - "subnet_id": "##id-7##", - "subregion_name": "us-east-2a", - "tags": [] + "state": "available", + "subnet_id": "##id-15##", + "subregion_name": "us-east-2b", + "tags": [ + { + "key": "Key:", + "value": ":value-tags" + }, + { + "key": "Key-2", + "value": "value-tags-2" + } + ] } ], "request_id": "########" @@ -451,13 +451,22 @@ "nics": [ { "account_id": "##id-1##", - "description": "", + "description": "TF-109", "is_source_dest_checked": true, - "link_nic": [], + "link_nic": [ + { + "delete_on_vm_deletion": false, + "device_number": 1, + "link_nic_id": "##id-2##", + "state": "attached", + "vm_account_id": "##id-1##", + "vm_id": "##id-3##" + } + ], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-12##", + "nic_id": "##id-5##", "private_dns_name": "########", "private_ips": [ { @@ -465,6 +474,12 @@ "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" + }, + { + "is_primary": false, + "link_public_ip": [], + "private_dns_name": "########", + "private_ip": "########" } ], "security_groups": [ @@ -473,9 +488,9 @@ "security_group_name": "Terraform-SG" } ], - "state": "available", - "subnet_id": "##id-13##", - "subregion_name": "us-east-2b", + "state": "in-use", + "subnet_id": "##id-7##", + "subregion_name": "us-east-2a", "tags": [ { "key": "Key:", @@ -489,13 +504,13 @@ }, { "account_id": "##id-1##", - "description": "TF-109", + "description": "", "is_source_dest_checked": true, "link_nic": [ { "delete_on_vm_deletion": false, - "device_number": 1, - "link_nic_id": "##id-2##", + "device_number": 2, + "link_nic_id": "##id-12##", "state": "attached", "vm_account_id": "##id-1##", "vm_id": "##id-3##" @@ -504,7 +519,7 @@ "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-5##", + "nic_id": "##id-13##", "private_dns_name": "########", "private_ips": [ { @@ -531,33 +546,20 @@ "subregion_name": "us-east-2a", "tags": [ { - "key": "Key:", - "value": ":value-tags" - }, - { - "key": "Key-2", - "value": "value-tags-2" + "key": "Name", + "value": "Nic-2" } ] }, { "account_id": "##id-1##", - "description": "Primary network interface", + "description": "", "is_source_dest_checked": true, - "link_nic": [ - { - "delete_on_vm_deletion": true, - "device_number": 0, - "link_nic_id": "##id-9##", - "state": "attached", - "vm_account_id": "##id-1##", - "vm_id": "##id-3##" - } - ], + "link_nic": [], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-10##", + "nic_id": "##id-14##", "private_dns_name": "########", "private_ips": [ { @@ -573,20 +575,29 @@ "security_group_name": "Terraform-SG" } ], - "state": "in-use", - "subnet_id": "##id-7##", - "subregion_name": "us-east-2a", - "tags": [] + "state": "available", + "subnet_id": "##id-15##", + "subregion_name": "us-east-2b", + "tags": [ + { + "key": "Key:", + "value": ":value-tags" + }, + { + "key": "Key-2", + "value": "value-tags-2" + } + ] }, { "account_id": "##id-1##", - "description": "", + "description": "Primary network interface", "is_source_dest_checked": true, "link_nic": [ { - "delete_on_vm_deletion": false, - "device_number": 2, - "link_nic_id": "##id-14##", + "delete_on_vm_deletion": true, + "device_number": 0, + "link_nic_id": "##id-9##", "state": "attached", "vm_account_id": "##id-1##", "vm_id": "##id-3##" @@ -595,7 +606,7 @@ "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-15##", + "nic_id": "##id-10##", "private_dns_name": "########", "private_ips": [ { @@ -603,12 +614,6 @@ "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" - }, - { - "is_primary": false, - "link_public_ip": [], - "private_dns_name": "########", - "private_ip": "########" } ], "security_groups": [ @@ -620,12 +625,7 @@ "state": "in-use", "subnet_id": "##id-7##", "subregion_name": "us-east-2a", - "tags": [ - { - "key": "Name", - "value": "Nic-2" - } - ] + "tags": [] } ], "request_id": "########" @@ -654,7 +654,7 @@ "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-12##", + "nic_id": "##id-14##", "private_dns_name": "########", "private_ips": [ { @@ -671,7 +671,7 @@ } ], "state": "available", - "subnet_id": "##id-13##", + "subnet_id": "##id-15##", "subregion_name": "us-east-2b", "tags": [ { @@ -795,13 +795,13 @@ "attributes": { "account_id": "##id-1##", "description": "", - "id": "##id-15##", + "id": "##id-13##", "is_source_dest_checked": true, "link_nic": [], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-15##", + "nic_id": "##id-13##", "private_dns_name": "########", "private_ip": "########", "private_ips": [ @@ -861,13 +861,13 @@ "attributes": { "account_id": "##id-1##", "description": "", - "id": "##id-12##", + "id": "##id-14##", "is_source_dest_checked": true, "link_nic": [], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-12##", + "nic_id": "##id-14##", "private_dns_name": "########", "private_ip": "########", "private_ips": [ @@ -890,7 +890,7 @@ } ], "state": "available", - "subnet_id": "##id-13##", + "subnet_id": "##id-15##", "subregion_name": "us-east-2b", "tags": [ { @@ -956,9 +956,9 @@ "attributes": { "delete_on_vm_deletion": false, "device_number": 2, - "id": "##id-14##", - "link_nic_id": "##id-14##", - "nic_id": "##id-15##", + "id": "##id-12##", + "link_nic_id": "##id-12##", + "nic_id": "##id-13##", "request_id": "########", "state": null, "vm_account_id": null, @@ -1053,13 +1053,13 @@ "schema_version": 0, "attributes": { "available_ips_count": "########", - "id": "##id-13##", + "id": "##id-15##", "ip_range": "10.5.2.0/24", "map_public_ip_on_launch": false, "net_id": "##id-4##", "request_id": "########", "state": "available", - "subnet_id": "##id-13##", + "subnet_id": "##id-15##", "subregion_name": "us-east-2b", "tags": [], "timeouts": null @@ -1091,6 +1091,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-20##" } ], diff --git a/tests/qa_provider_oapi/data/nets/TF-144_vm_resource_centos_attributes_ok/step1.vm_resource_centos_ok.ref b/tests/qa_provider_oapi/data/nets/TF-144_vm_resource_centos_attributes_ok/step1.vm_resource_centos_ok.ref index 2fe03a1ed..a9a7e442a 100644 --- a/tests/qa_provider_oapi/data/nets/TF-144_vm_resource_centos_attributes_ok/step1.vm_resource_centos_ok.ref +++ b/tests/qa_provider_oapi/data/nets/TF-144_vm_resource_centos_attributes_ok/step1.vm_resource_centos_ok.ref @@ -414,6 +414,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-15##" } ], @@ -504,6 +505,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-19##" } ], @@ -596,6 +598,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-22##" } ], diff --git a/tests/qa_provider_oapi/data/nets/TF-145_vm_resource_private_with_multiple_NICs_attributes_ok/step1.vm_resource_private_with_multiple_NICs_ok.ref b/tests/qa_provider_oapi/data/nets/TF-145_vm_resource_private_with_multiple_NICs_attributes_ok/step1.vm_resource_private_with_multiple_NICs_ok.ref index 05256b523..833fc0b73 100644 --- a/tests/qa_provider_oapi/data/nets/TF-145_vm_resource_private_with_multiple_NICs_attributes_ok/step1.vm_resource_private_with_multiple_NICs_ok.ref +++ b/tests/qa_provider_oapi/data/nets/TF-145_vm_resource_private_with_multiple_NICs_attributes_ok/step1.vm_resource_private_with_multiple_NICs_ok.ref @@ -228,6 +228,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-9##" } ], diff --git a/tests/qa_provider_oapi/data/nets/TF-65_Check_IGW_Destroy/step1.test_destroy_igw.ref b/tests/qa_provider_oapi/data/nets/TF-65_Check_IGW_Destroy/step1.test_destroy_igw.ref index de8abed57..dcd28a742 100644 --- a/tests/qa_provider_oapi/data/nets/TF-65_Check_IGW_Destroy/step1.test_destroy_igw.ref +++ b/tests/qa_provider_oapi/data/nets/TF-65_Check_IGW_Destroy/step1.test_destroy_igw.ref @@ -857,6 +857,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-24##" } ], @@ -1023,6 +1024,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-28##" } ], @@ -1189,6 +1191,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-31##" } ], @@ -1363,6 +1366,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-36##" } ], @@ -1529,6 +1533,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-41##" } ], @@ -1695,6 +1700,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-46##" } ], diff --git a/tests/qa_provider_oapi/data/public_ip_link/TF-116_public_ip_link_resource_attributes_ok/step1.public_ip_link_resource_attributes_ok.ref b/tests/qa_provider_oapi/data/public_ip_link/TF-116_public_ip_link_resource_attributes_ok/step1.public_ip_link_resource_attributes_ok.ref index 8f91857ef..3668a230d 100644 --- a/tests/qa_provider_oapi/data/public_ip_link/TF-116_public_ip_link_resource_attributes_ok/step1.public_ip_link_resource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/public_ip_link/TF-116_public_ip_link_resource_attributes_ok/step1.public_ip_link_resource_attributes_ok.ref @@ -142,6 +142,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-7##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-143_vm_datasource_centos_attributes_ok/step1.vm_datasource_centos_ok.ref b/tests/qa_provider_oapi/data/vm/TF-143_vm_datasource_centos_attributes_ok/step1.vm_datasource_centos_ok.ref index e01a58fda..a61bfef57 100644 --- a/tests/qa_provider_oapi/data/vm/TF-143_vm_datasource_centos_attributes_ok/step1.vm_datasource_centos_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-143_vm_datasource_centos_attributes_ok/step1.vm_datasource_centos_ok.ref @@ -22,6 +22,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-0##" } ], @@ -106,6 +107,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -186,6 +188,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-8##" } ], @@ -317,6 +320,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-0##" } ], @@ -414,6 +418,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -497,6 +502,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-8##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-143_vm_datasource_centos_attributes_ok/step2.vm_datasource_centos_ok.ref b/tests/qa_provider_oapi/data/vm/TF-143_vm_datasource_centos_attributes_ok/step2.vm_datasource_centos_ok.ref index cf297adb2..2d300004c 100644 --- a/tests/qa_provider_oapi/data/vm/TF-143_vm_datasource_centos_attributes_ok/step2.vm_datasource_centos_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-143_vm_datasource_centos_attributes_ok/step2.vm_datasource_centos_ok.ref @@ -22,6 +22,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-0##" } ], @@ -106,6 +107,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-0##" } ], @@ -190,6 +192,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-0##" } ], @@ -274,6 +277,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -354,6 +358,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-8##" } ], @@ -485,6 +490,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-0##" } ], @@ -580,6 +586,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -663,6 +670,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-8##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step1.vm_resource_public_with_multiple_BDM_ok.ref b/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step1.vm_resource_public_with_multiple_BDM_ok.ref index 0ff5d756c..546a0100c 100644 --- a/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step1.vm_resource_public_with_multiple_BDM_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step1.vm_resource_public_with_multiple_BDM_ok.ref @@ -107,6 +107,7 @@ "delete_on_vm_deletion": false, "iops": null, "snapshot_id": "", + "tags": [], "volume_size": 100, "volume_type": "standard" } @@ -121,6 +122,7 @@ "delete_on_vm_deletion": false, "iops": null, "snapshot_id": "", + "tags": [], "volume_size": 15, "volume_type": "standard" } @@ -135,6 +137,7 @@ "delete_on_vm_deletion": true, "iops": 150, "snapshot_id": "##id-3##", + "tags": [], "volume_size": 22, "volume_type": "io1" } @@ -151,6 +154,7 @@ "delete_on_vm_deletion": false, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -162,6 +166,7 @@ "delete_on_vm_deletion": false, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], @@ -173,6 +178,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-7##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step2.vm_resource_public_with_multiple_BDM_ok.ref b/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step2.vm_resource_public_with_multiple_BDM_ok.ref index b385b3515..1fa6b2486 100644 --- a/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step2.vm_resource_public_with_multiple_BDM_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step2.vm_resource_public_with_multiple_BDM_ok.ref @@ -107,6 +107,7 @@ "delete_on_vm_deletion": true, "iops": null, "snapshot_id": "", + "tags": [], "volume_size": 100, "volume_type": "standard" } @@ -121,6 +122,7 @@ "delete_on_vm_deletion": false, "iops": null, "snapshot_id": "", + "tags": [], "volume_size": 15, "volume_type": "standard" } @@ -135,6 +137,7 @@ "delete_on_vm_deletion": true, "iops": 150, "snapshot_id": "##id-3##", + "tags": [], "volume_size": 22, "volume_type": "io1" } @@ -151,6 +154,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -162,6 +166,7 @@ "delete_on_vm_deletion": false, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], @@ -173,6 +178,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-7##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-147_vm_resource_with_user_data_attributes_ok/step1.vm_resource_with_user_data_ok.ref b/tests/qa_provider_oapi/data/vm/TF-147_vm_resource_with_user_data_attributes_ok/step1.vm_resource_with_user_data_ok.ref index 956cdfe77..8f912be2c 100644 --- a/tests/qa_provider_oapi/data/vm/TF-147_vm_resource_with_user_data_attributes_ok/step1.vm_resource_with_user_data_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-147_vm_resource_with_user_data_attributes_ok/step1.vm_resource_with_user_data_ok.ref @@ -73,6 +73,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-3##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-148_vm_resource_with_user_data_attributes_ok/step1.vm_resource_with_user_data_ok_2.ref b/tests/qa_provider_oapi/data/vm/TF-148_vm_resource_with_user_data_attributes_ok/step1.vm_resource_with_user_data_ok_2.ref index 5066fa659..553e87642 100644 --- a/tests/qa_provider_oapi/data/vm/TF-148_vm_resource_with_user_data_attributes_ok/step1.vm_resource_with_user_data_ok_2.ref +++ b/tests/qa_provider_oapi/data/vm/TF-148_vm_resource_with_user_data_attributes_ok/step1.vm_resource_with_user_data_ok_2.ref @@ -73,6 +73,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-3##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step1.vm_resource_update_attributes_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step1.vm_resource_update_attributes_ok.ref index 77c459464..2cac49c58 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step1.vm_resource_update_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step1.vm_resource_update_attributes_ok.ref @@ -109,6 +109,7 @@ "delete_on_vm_deletion": false, "iops": null, "snapshot_id": "", + "tags": [], "volume_size": 20, "volume_type": "standard" } @@ -125,6 +126,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -136,6 +138,7 @@ "delete_on_vm_deletion": false, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step2.vm_resource_update_keypair_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step2.vm_resource_update_keypair_ok.ref index fd571e847..676a7e21b 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step2.vm_resource_update_keypair_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step2.vm_resource_update_keypair_ok.ref @@ -109,6 +109,7 @@ "delete_on_vm_deletion": false, "iops": 0, "snapshot_id": "", + "tags": [], "volume_size": 20, "volume_type": "standard" } @@ -125,6 +126,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -136,6 +138,7 @@ "delete_on_vm_deletion": false, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step3.vm_resource_update_security_group_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step3.vm_resource_update_security_group_ok.ref index fa4a601a8..869e172c9 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step3.vm_resource_update_security_group_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step3.vm_resource_update_security_group_ok.ref @@ -109,6 +109,7 @@ "delete_on_vm_deletion": false, "iops": 0, "snapshot_id": "", + "tags": [], "volume_size": 20, "volume_type": "standard" } @@ -125,6 +126,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -136,6 +138,7 @@ "delete_on_vm_deletion": false, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step4.vm_resource_update_deletion_protection_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step4.vm_resource_update_deletion_protection_ok.ref index fa4a601a8..869e172c9 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step4.vm_resource_update_deletion_protection_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step4.vm_resource_update_deletion_protection_ok.ref @@ -109,6 +109,7 @@ "delete_on_vm_deletion": false, "iops": 0, "snapshot_id": "", + "tags": [], "volume_size": 20, "volume_type": "standard" } @@ -125,6 +126,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -136,6 +138,7 @@ "delete_on_vm_deletion": false, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step5.vm_resource_update_bdm_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step5.vm_resource_update_bdm_ok.ref index b2dad41f5..f782384cf 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step5.vm_resource_update_bdm_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step5.vm_resource_update_bdm_ok.ref @@ -109,6 +109,7 @@ "delete_on_vm_deletion": true, "iops": null, "snapshot_id": "", + "tags": [], "volume_size": 20, "volume_type": "standard" } @@ -125,6 +126,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -136,6 +138,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step6.vm_resource_update_performance_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step6.vm_resource_update_performance_ok.ref index f9efbac89..bc64accf0 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step6.vm_resource_update_performance_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step6.vm_resource_update_performance_ok.ref @@ -109,6 +109,7 @@ "delete_on_vm_deletion": true, "iops": 0, "snapshot_id": "", + "tags": [], "volume_size": 20, "volume_type": "standard" } @@ -125,6 +126,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -136,6 +138,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step7.vm_resource_update_vm_type_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step7.vm_resource_update_vm_type_ok.ref index 649b37ab3..0d2821be3 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step7.vm_resource_update_vm_type_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step7.vm_resource_update_vm_type_ok.ref @@ -109,6 +109,7 @@ "delete_on_vm_deletion": true, "iops": 0, "snapshot_id": "", + "tags": [], "volume_size": 20, "volume_type": "standard" } @@ -125,6 +126,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -136,6 +138,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step8.vm_resource_update_user_data_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step8.vm_resource_update_user_data_ok.ref index 913d700f0..d29f5681f 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step8.vm_resource_update_user_data_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step8.vm_resource_update_user_data_ok.ref @@ -109,6 +109,7 @@ "delete_on_vm_deletion": true, "iops": 0, "snapshot_id": "", + "tags": [], "volume_size": 20, "volume_type": "standard" } @@ -125,6 +126,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -136,6 +138,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step9.vm_resource_update_shtdown_behaviour_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step9.vm_resource_update_shtdown_behaviour_ok.ref index 8261f2882..7942e5ab5 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step9.vm_resource_update_shtdown_behaviour_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step9.vm_resource_update_shtdown_behaviour_ok.ref @@ -109,6 +109,7 @@ "delete_on_vm_deletion": true, "iops": 0, "snapshot_id": "", + "tags": [], "volume_size": 20, "volume_type": "standard" } @@ -125,6 +126,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-5##" } ], @@ -136,6 +138,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], diff --git a/tests/qa_provider_oapi/data/vm_state/TF-149_vm_state_datasource_centos_attributes_ok/step1.vm_state_datasource_centos_attributes_ok.ref b/tests/qa_provider_oapi/data/vm_state/TF-149_vm_state_datasource_centos_attributes_ok/step1.vm_state_datasource_centos_attributes_ok.ref index 4b72f0658..f915c92f1 100644 --- a/tests/qa_provider_oapi/data/vm_state/TF-149_vm_state_datasource_centos_attributes_ok/step1.vm_state_datasource_centos_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/vm_state/TF-149_vm_state_datasource_centos_attributes_ok/step1.vm_state_datasource_centos_attributes_ok.ref @@ -95,6 +95,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-4##" } ], diff --git a/tests/qa_provider_oapi/data/vm_states/TF-150_vm_states_datasource_centos_attributes_ok/step1.vm_states_datasource_centos_attributes_ok.ref b/tests/qa_provider_oapi/data/vm_states/TF-150_vm_states_datasource_centos_attributes_ok/step1.vm_states_datasource_centos_attributes_ok.ref index 305e4a5ad..7aed32091 100644 --- a/tests/qa_provider_oapi/data/vm_states/TF-150_vm_states_datasource_centos_attributes_ok/step1.vm_states_datasource_centos_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/vm_states/TF-150_vm_states_datasource_centos_attributes_ok/step1.vm_states_datasource_centos_attributes_ok.ref @@ -108,6 +108,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], @@ -193,6 +194,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-9##" } ], diff --git a/tests/qa_provider_oapi/data/vms/TF-151_vms_datasource_attributes_ok/step1.vms_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/vms/TF-151_vms_datasource_attributes_ok/step1.vms_datasource_attributes_ok.ref index 0e6103356..f1acdf274 100644 --- a/tests/qa_provider_oapi/data/vms/TF-151_vms_datasource_attributes_ok/step1.vms_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/vms/TF-151_vms_datasource_attributes_ok/step1.vms_datasource_attributes_ok.ref @@ -27,6 +27,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-1##" } ], @@ -88,6 +89,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], @@ -215,6 +217,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], @@ -293,6 +296,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-1##" } ], @@ -378,6 +382,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-11##" } ], diff --git a/tests/qa_provider_oapi/data/vms/TF-151_vms_datasource_attributes_ok/step2.vms_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/vms/TF-151_vms_datasource_attributes_ok/step2.vms_datasource_attributes_ok.ref index c829df4c4..7c71140bf 100644 --- a/tests/qa_provider_oapi/data/vms/TF-151_vms_datasource_attributes_ok/step2.vms_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/vms/TF-151_vms_datasource_attributes_ok/step2.vms_datasource_attributes_ok.ref @@ -27,6 +27,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-1##" } ], @@ -88,6 +89,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], @@ -168,6 +170,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-10##" } ], @@ -257,6 +260,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-10##" } ], @@ -346,6 +350,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-10##" } ], @@ -482,6 +487,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-6##" } ], @@ -560,6 +566,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-1##" } ], @@ -645,6 +652,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-10##" } ], diff --git a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.ref b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.ref index 3d43c18bf..5af7af1bc 100644 --- a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.ref +++ b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.ref @@ -152,6 +152,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-8##" } ], diff --git a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.ref b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.ref index 09ce32e8b..b49257a4c 100644 --- a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.ref +++ b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.ref @@ -152,6 +152,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-8##" } ], @@ -163,6 +164,12 @@ "delete_on_vm_deletion": false, "link_date": "########", "state": "attached", + "tags": [ + { + "key": "type", + "value": "io1" + } + ], "volume_id": "##id-3##" } ], diff --git a/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.ref b/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.ref index 0e5cf6698..79b9d988c 100644 --- a/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.ref @@ -73,6 +73,7 @@ "delete_on_vm_deletion": true, "link_date": "########", "state": "attached", + "tags": [], "volume_id": "##id-3##" } ], diff --git a/utils/utils.go b/utils/utils.go index 3d8f2ad12..5bc625faa 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -2,6 +2,7 @@ package utils import ( "bytes" + "context" "encoding/json" "fmt" "hash/crc32" @@ -47,6 +48,56 @@ func ToJSONString(v interface{}) string { return string(pretty) } +func GetBsuId(vmResp oscgo.Vm, deviceName string) string { + diskID := "" + blocks := vmResp.GetBlockDeviceMappings() + + for _, v := range blocks { + if v.GetDeviceName() == deviceName { + diskID = aws.StringValue(v.GetBsu().VolumeId) + break + } + } + return diskID +} + +func getBsuTags(volumeId string, conn *oscgo.APIClient) ([]oscgo.ResourceTag, error) { + request := oscgo.ReadVolumesRequest{ + Filters: &oscgo.FiltersVolume{VolumeIds: &[]string{volumeId}}, + } + var resp oscgo.ReadVolumesResponse + err := resource.Retry(5*time.Minute, func() *resource.RetryError { + r, httpResp, err := conn.VolumeApi.ReadVolumes(context.Background()).ReadVolumesRequest(request).Execute() + if err != nil { + return CheckThrottling(httpResp, err) + } + resp = r + return nil + }) + if err != nil { + return nil, err + } + return resp.GetVolumes()[0].GetTags(), nil +} + +func GetBsuTagsMaps(vmResp oscgo.Vm, conn *oscgo.APIClient) (map[string]interface{}, error) { + + blocks := vmResp.GetBlockDeviceMappings() + bsuTagsMaps := make(map[string]interface{}) + for _, v := range blocks { + volumeId := aws.StringValue(v.GetBsu().VolumeId) + bsuTags, err := getBsuTags(volumeId, conn) + if err != nil { + return nil, err + } + if bsuTags != nil { + bsuTagsMaps[v.GetDeviceName()] = bsuTags + } + } + + return bsuTagsMaps, nil +} + func GetErrorResponse(err error) error { if e, ok := err.(oscgo.GenericOpenAPIError); ok { if errorResponse, oker := e.Model().(oscgo.ErrorResponse); oker {