parent
d1e12fcf64
commit
24b7387db9
140 changed files with 1597 additions and 7 deletions
|
|
@ -78,6 +78,8 @@ func (d *routingTableRouteDataSource) Read(ctx context.Context, req datasource.R
|
|||
return
|
||||
}
|
||||
|
||||
ctx = core.InitProviderContext(ctx)
|
||||
|
||||
organizationId := model.OrganizationId.ValueString()
|
||||
region := d.providerData.GetRegionWithOverride(model.Region)
|
||||
routingTableId := model.RoutingTableId.ValueString()
|
||||
|
|
@ -106,6 +108,8 @@ func (d *routingTableRouteDataSource) Read(ctx context.Context, req datasource.R
|
|||
return
|
||||
}
|
||||
|
||||
ctx = core.LogResponse(ctx)
|
||||
|
||||
err = shared.MapRouteModel(ctx, routeResp, &model, region)
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error reading routing table route", fmt.Sprintf("Processing API payload: %v", err))
|
||||
|
|
|
|||
|
|
@ -237,6 +237,8 @@ func (r *routeResource) Create(ctx context.Context, req resource.CreateRequest,
|
|||
return
|
||||
}
|
||||
|
||||
ctx = core.InitProviderContext(ctx)
|
||||
|
||||
organizationId := model.OrganizationId.ValueString()
|
||||
routingTableId := model.RoutingTableId.ValueString()
|
||||
networkAreaId := model.NetworkAreaId.ValueString()
|
||||
|
|
@ -260,6 +262,8 @@ func (r *routeResource) Create(ctx context.Context, req resource.CreateRequest,
|
|||
return
|
||||
}
|
||||
|
||||
ctx = core.LogResponse(ctx)
|
||||
|
||||
// Map response body to schema
|
||||
err = mapFieldsFromList(ctx, routeResp, &model, region)
|
||||
if err != nil {
|
||||
|
|
@ -284,6 +288,9 @@ func (r *routeResource) Read(ctx context.Context, req resource.ReadRequest, resp
|
|||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
ctx = core.InitProviderContext(ctx)
|
||||
|
||||
organizationId := model.OrganizationId.ValueString()
|
||||
routingTableId := model.RoutingTableId.ValueString()
|
||||
networkAreaId := model.NetworkAreaId.ValueString()
|
||||
|
|
@ -302,6 +309,8 @@ func (r *routeResource) Read(ctx context.Context, req resource.ReadRequest, resp
|
|||
return
|
||||
}
|
||||
|
||||
ctx = core.LogResponse(ctx)
|
||||
|
||||
// Map response body to schema
|
||||
err = shared.MapRouteModel(ctx, routeResp, &model, region)
|
||||
if err != nil {
|
||||
|
|
@ -328,6 +337,8 @@ func (r *routeResource) Update(ctx context.Context, req resource.UpdateRequest,
|
|||
return
|
||||
}
|
||||
|
||||
ctx = core.InitProviderContext(ctx)
|
||||
|
||||
organizationId := model.OrganizationId.ValueString()
|
||||
routingTableId := model.RoutingTableId.ValueString()
|
||||
networkAreaId := model.NetworkAreaId.ValueString()
|
||||
|
|
@ -361,6 +372,8 @@ func (r *routeResource) Update(ctx context.Context, req resource.UpdateRequest,
|
|||
return
|
||||
}
|
||||
|
||||
ctx = core.LogResponse(ctx)
|
||||
|
||||
// Map response body to schema
|
||||
err = shared.MapRouteModel(ctx, route, &model, region)
|
||||
if err != nil {
|
||||
|
|
@ -385,6 +398,8 @@ func (r *routeResource) Delete(ctx context.Context, req resource.DeleteRequest,
|
|||
return
|
||||
}
|
||||
|
||||
ctx = core.InitProviderContext(ctx)
|
||||
|
||||
organizationId := model.OrganizationId.ValueString()
|
||||
routingTableId := model.RoutingTableId.ValueString()
|
||||
networkAreaId := model.NetworkAreaId.ValueString()
|
||||
|
|
@ -403,6 +418,8 @@ func (r *routeResource) Delete(ctx context.Context, req resource.DeleteRequest,
|
|||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error routing table route", fmt.Sprintf("Calling API: %v", err))
|
||||
}
|
||||
|
||||
ctx = core.LogResponse(ctx)
|
||||
|
||||
tflog.Info(ctx, "Routing table route deleted")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue