Skip to content

Commit

Permalink
Update resource_ibm_is_dedicated_host_group.go
Browse files Browse the repository at this point in the history
  • Loading branch information
uibm committed Feb 6, 2025
1 parent f757e7e commit 178e096
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ibm/service/vpc/resource_ibm_is_dedicated_host_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func resourceIbmIsDedicatedHostGroupMapToResourceGroupIdentityByID(resourceGroup
return resourceGroupIdentityByID
}

func resourceIbmIsDedicatedHostGroupRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
func resourceIbmIsDedicatedHostGroupRead(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
vpcClient, err := meta.(conns.ClientSession).VpcV1API()
if err != nil {
tfErr := flex.DiscriminatedTerraformErrorf(err, err.Error(), "ibm_is_dedicated_host_group", "read", "initialize-client")
Expand All @@ -252,7 +252,7 @@ func resourceIbmIsDedicatedHostGroupRead(ctx context.Context, d *schema.Resource

getDedicatedHostGroupOptions.SetID(d.Id())

dedicatedHostGroup, response, err := vpcClient.GetDedicatedHostGroupWithContext(ctx, getDedicatedHostGroupOptions)
dedicatedHostGroup, response, err := vpcClient.GetDedicatedHostGroupWithContext(context, getDedicatedHostGroupOptions)
if err != nil {
if response != nil && response.StatusCode == 404 {
d.SetId("")
Expand Down Expand Up @@ -401,7 +401,7 @@ func resourceIbmIsDedicatedHostGroupInstanceProfileReferenceToMap(instanceProfil
return instanceProfileReferenceMap
}

func resourceIbmIsDedicatedHostGroupUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
func resourceIbmIsDedicatedHostGroupUpdate(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
vpcClient, err := meta.(conns.ClientSession).VpcV1API()
if err != nil {
tfErr := flex.DiscriminatedTerraformErrorf(err, err.Error(), "ibm_is_dedicated_host_group", "update", "initialize-client")
Expand Down Expand Up @@ -431,18 +431,18 @@ func resourceIbmIsDedicatedHostGroupUpdate(ctx context.Context, d *schema.Resour
}

if hasChange {
_, response, err := vpcClient.UpdateDedicatedHostGroupWithContext(ctx, updateDedicatedHostGroupOptions)
_, response, err := vpcClient.UpdateDedicatedHostGroupWithContext(context, updateDedicatedHostGroupOptions)
if err != nil {
tfErr := flex.TerraformErrorf(err, fmt.Sprintf("UpdateDedicatedHostGroupWithContext failed: %s\n%s", err, response), "ibm_is_dedicated_host_group", "update")
log.Printf("[DEBUG]\n%s", tfErr.GetDebugMessage())
return tfErr.GetDiag()
}
}

return resourceIbmIsDedicatedHostGroupRead(ctx, d, meta)
return resourceIbmIsDedicatedHostGroupRead(context, d, meta)
}

func resourceIbmIsDedicatedHostGroupDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
func resourceIbmIsDedicatedHostGroupDelete(context context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
vpcClient, err := meta.(conns.ClientSession).VpcV1API()
if err != nil {
tfErr := flex.DiscriminatedTerraformErrorf(err, err.Error(), "ibm_is_dedicated_host_group", "delete", "initialize-client")
Expand All @@ -454,7 +454,7 @@ func resourceIbmIsDedicatedHostGroupDelete(ctx context.Context, d *schema.Resour

getDedicatedHostGroupOptions.SetID(d.Id())

_, response, err := vpcClient.GetDedicatedHostGroupWithContext(ctx, getDedicatedHostGroupOptions)
_, response, err := vpcClient.GetDedicatedHostGroupWithContext(context, getDedicatedHostGroupOptions)
if err != nil {
if response != nil && response.StatusCode == 404 {
d.SetId("")
Expand All @@ -469,7 +469,7 @@ func resourceIbmIsDedicatedHostGroupDelete(ctx context.Context, d *schema.Resour

deleteDedicatedHostGroupOptions.SetID(d.Id())

response, err = vpcClient.DeleteDedicatedHostGroupWithContext(ctx, deleteDedicatedHostGroupOptions)
response, err = vpcClient.DeleteDedicatedHostGroupWithContext(context, deleteDedicatedHostGroupOptions)
if err != nil {
tfErr := flex.TerraformErrorf(err, fmt.Sprintf("DeleteDedicatedHostGroupWithContext failed: %s\n%s", err, response), "ibm_is_dedicated_host_group", "delete")
log.Printf("[DEBUG]\n%s", tfErr.GetDebugMessage())
Expand Down

0 comments on commit 178e096

Please sign in to comment.