@@ -194,6 +194,7 @@ func resourceIBMLogsRouterTenantCreate(context context.Context, d *schema.Resour
194194 return tfErr .GetDiag ()
195195 }
196196
197+ ibmCloudLogsRoutingClient , _ , err = updateClientURLWithEndpoint (ibmCloudLogsRoutingClient , d )
197198 createTenantOptions := & ibmcloudlogsroutingv0.CreateTenantOptions {}
198199
199200 createTenantOptions .SetName (d .Get ("name" ).(string ))
@@ -209,7 +210,7 @@ func resourceIBMLogsRouterTenantCreate(context context.Context, d *schema.Resour
209210 }
210211 createTenantOptions .SetTargets (targets )
211212
212- tenant , _ , err := ibmCloudLogsRoutingClient .CreateTenantWithContext (context , createTenantOptions )
213+ tenant , _ , err := ibmCloudLogsRoutingClient .CreateTenantWithContextEndpoint (context , createTenantOptions )
213214 if err != nil {
214215 tfErr := flex .TerraformErrorf (err , fmt .Sprintf ("CreateTenantWithContext failed: %s" , err .Error ()), "ibm_logs_router_tenant" , "create" )
215216 log .Printf ("[DEBUG]\n %s" , tfErr .GetDebugMessage ())
@@ -229,13 +230,14 @@ func resourceIBMLogsRouterTenantRead(context context.Context, d *schema.Resource
229230 return tfErr .GetDiag ()
230231 }
231232
233+ ibmCloudLogsRoutingClient , _ , err = updateClientURLWithEndpoint (ibmCloudLogsRoutingClient , d )
232234 getTenantDetailOptions := & ibmcloudlogsroutingv0.GetTenantDetailOptions {}
233235
234236 tenantId := strfmt .UUID (d .Id ())
235237 getTenantDetailOptions .SetTenantID (& tenantId )
236238 getTenantDetailOptions .SetRegion (d .Get ("region" ).(string ))
237239
238- tenant , response , err := ibmCloudLogsRoutingClient .GetTenantDetailWithContext (context , getTenantDetailOptions )
240+ tenant , response , err := ibmCloudLogsRoutingClient .GetTenantDetailWithContextEndpoint (context , getTenantDetailOptions )
239241 if err != nil {
240242 if response != nil && response .StatusCode == 404 {
241243 d .SetId ("" )
@@ -345,6 +347,7 @@ func resourceIBMLogsRouterTenantUpdate(context context.Context, d *schema.Resour
345347 log .Printf ("[DEBUG]\n %s" , tfErr .GetDebugMessage ())
346348 return tfErr .GetDiag ()
347349 }
350+ ibmCloudLogsRoutingClient , _ , err = updateClientURLWithEndpoint (ibmCloudLogsRoutingClient , d )
348351
349352 updateTenantOptions := & ibmcloudlogsroutingv0.UpdateTenantOptions {}
350353
@@ -462,7 +465,7 @@ func resourceIBMLogsRouterTenantUpdate(context context.Context, d *schema.Resour
462465 updateTenantOptions .TenantPatch ["name" ] = nil
463466 }
464467
465- _ , _ , err = ibmCloudLogsRoutingClient .UpdateTenantWithContext (context , updateTenantOptions )
468+ _ , _ , err = ibmCloudLogsRoutingClient .UpdateTenantWithContextEndpoint (context , updateTenantOptions )
466469 if err != nil {
467470 tfErr := flex .TerraformErrorf (err , fmt .Sprintf ("UpdateTenantWithContext failed: %s" , err .Error ()), "ibm_logs_router_tenant" , "update" )
468471 log .Printf ("[DEBUG]\n %s" , tfErr .GetDebugMessage ())
@@ -493,9 +496,9 @@ func resourceIBMLogsRouterTenantUpdate(context context.Context, d *schema.Resour
493496 _ , newCRN := d .GetChange ("targets.0.log_sink_crn" )
494497 if crn , ok := newCRN .(string ); ok {
495498 if strings .Contains (crn , ":logs:" ) {
496- _ , _ , err = ibmCloudLogsRoutingClient .UpdateLogsTargetWithContext (context , updateTarget0Options )
499+ _ , _ , err = ibmCloudLogsRoutingClient .UpdateLogsTargetWithContextEndpoint (context , updateTarget0Options )
497500 } else {
498- _ , _ , err = ibmCloudLogsRoutingClient .UpdateTargetWithContext (context , updateTarget0Options )
501+ _ , _ , err = ibmCloudLogsRoutingClient .UpdateTargetWithContextEndpoint (context , updateTarget0Options )
499502 }
500503 }
501504
@@ -507,7 +510,7 @@ func resourceIBMLogsRouterTenantUpdate(context context.Context, d *schema.Resour
507510 }
508511
509512 if target1Create {
510- _ , _ , err := ibmCloudLogsRoutingClient .CreateTargetWithContext (context , createTarget1Options )
513+ _ , _ , err := ibmCloudLogsRoutingClient .CreateTargetWithContextEndpoint (context , createTarget1Options )
511514 if err != nil {
512515 tfErr := flex .TerraformErrorf (err , fmt .Sprintf ("CreateTargetWithContext failed: %s" , err .Error ()), "ibm_logs_router_target" , "create" )
513516 log .Printf ("[DEBUG]\n %s" , tfErr .GetDebugMessage ())
@@ -535,7 +538,7 @@ func resourceIBMLogsRouterTenantUpdate(context context.Context, d *schema.Resour
535538 deleteTargetOptions .SetTenantID (& tenantId )
536539 deleteTargetOptions .SetTargetID (& target1ID )
537540 deleteTargetOptions .SetRegion (d .Get ("region" ).(string ))
538- _ , err = ibmCloudLogsRoutingClient .DeleteTargetWithContext (context , deleteTargetOptions )
541+ _ , err = ibmCloudLogsRoutingClient .DeleteTargetWithContextEndpoint (context , deleteTargetOptions )
539542 if err != nil {
540543 tfErr := flex .TerraformErrorf (err , fmt .Sprintf ("DeleteTargetWithContext failed: %s" , err .Error ()), "ibm_logs_router_target" , "delete" )
541544 log .Printf ("[DEBUG]\n %s" , tfErr .GetDebugMessage ())
@@ -546,9 +549,9 @@ func resourceIBMLogsRouterTenantUpdate(context context.Context, d *schema.Resour
546549 _ , newCRN := d .GetChange ("targets.1.log_sink_crn" )
547550 if crn , ok := newCRN .(string ); ok {
548551 if strings .Contains (crn , ":logs:" ) {
549- _ , _ , err = ibmCloudLogsRoutingClient .UpdateLogsTargetWithContext (context , updateTarget1Options )
552+ _ , _ , err = ibmCloudLogsRoutingClient .UpdateLogsTargetWithContextEndpoint (context , updateTarget1Options )
550553 } else {
551- _ , _ , err = ibmCloudLogsRoutingClient .UpdateTargetWithContext (context , updateTarget1Options )
554+ _ , _ , err = ibmCloudLogsRoutingClient .UpdateTargetWithContextEndpoint (context , updateTarget1Options )
552555 }
553556 }
554557 if err != nil {
@@ -578,9 +581,9 @@ func resourceIBMLogsRouterTenantUpdate(context context.Context, d *schema.Resour
578581 _ , newCRN := d .GetChange ("targets.0.log_sink_crn" )
579582 if crn , ok := newCRN .(string ); ok {
580583 if strings .Contains (crn , ":logs:" ) {
581- _ , _ , err = ibmCloudLogsRoutingClient .UpdateLogsTargetWithContext (context , updateTarget0Options )
584+ _ , _ , err = ibmCloudLogsRoutingClient .UpdateLogsTargetWithContextEndpoint (context , updateTarget0Options )
582585 } else {
583- _ , _ , err = ibmCloudLogsRoutingClient .UpdateTargetWithContext (context , updateTarget0Options )
586+ _ , _ , err = ibmCloudLogsRoutingClient .UpdateTargetWithContextEndpoint (context , updateTarget0Options )
584587 }
585588 }
586589 if err != nil {
@@ -601,13 +604,14 @@ func resourceIBMLogsRouterTenantDelete(context context.Context, d *schema.Resour
601604 return tfErr .GetDiag ()
602605 }
603606
607+ ibmCloudLogsRoutingClient , _ , err = updateClientURLWithEndpoint (ibmCloudLogsRoutingClient , d )
604608 deleteTenantOptions := & ibmcloudlogsroutingv0.DeleteTenantOptions {}
605609
606610 tenantId := strfmt .UUID (d .Id ())
607611 deleteTenantOptions .SetTenantID (& tenantId )
608612 deleteTenantOptions .SetRegion (d .Get ("region" ).(string ))
609613
610- _ , err = ibmCloudLogsRoutingClient .DeleteTenantWithContext (context , deleteTenantOptions )
614+ _ , err = ibmCloudLogsRoutingClient .DeleteTenantWithContextEndpoint (context , deleteTenantOptions )
611615 if err != nil {
612616 tfErr := flex .TerraformErrorf (err , fmt .Sprintf ("DeleteTenantWithContext failed: %s" , err .Error ()), "ibm_logs_router_tenant" , "delete" )
613617 log .Printf ("[DEBUG]\n %s" , tfErr .GetDebugMessage ())
0 commit comments