parent
d1e12fcf64
commit
24b7387db9
140 changed files with 1597 additions and 7 deletions
|
|
@ -130,6 +130,8 @@ func (r *networkInterfaceAttachResource) Create(ctx context.Context, req resourc
|
|||
return
|
||||
}
|
||||
|
||||
ctx = core.InitProviderContext(ctx)
|
||||
|
||||
projectId := model.ProjectId.ValueString()
|
||||
ctx = tflog.SetField(ctx, "project_id", projectId)
|
||||
serverId := model.ServerId.ValueString()
|
||||
|
|
@ -144,6 +146,8 @@ func (r *networkInterfaceAttachResource) Create(ctx context.Context, req resourc
|
|||
return
|
||||
}
|
||||
|
||||
ctx = core.LogResponse(ctx)
|
||||
|
||||
model.Id = utils.BuildInternalTerraformId(projectId, serverId, networkInterfaceId)
|
||||
|
||||
// Set state to fully populated data
|
||||
|
|
@ -163,6 +167,9 @@ func (r *networkInterfaceAttachResource) Read(ctx context.Context, req resource.
|
|||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
ctx = core.InitProviderContext(ctx)
|
||||
|
||||
projectId := model.ProjectId.ValueString()
|
||||
ctx = tflog.SetField(ctx, "project_id", projectId)
|
||||
serverId := model.ServerId.ValueString()
|
||||
|
|
@ -181,6 +188,8 @@ func (r *networkInterfaceAttachResource) Read(ctx context.Context, req resource.
|
|||
return
|
||||
}
|
||||
|
||||
ctx = core.LogResponse(ctx)
|
||||
|
||||
if nics == nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error reading network interface attachment", "List of network interfaces attached to the server is nil")
|
||||
return
|
||||
|
|
@ -221,6 +230,8 @@ func (r *networkInterfaceAttachResource) Delete(ctx context.Context, req resourc
|
|||
return
|
||||
}
|
||||
|
||||
ctx = core.InitProviderContext(ctx)
|
||||
|
||||
projectId := model.ProjectId.ValueString()
|
||||
ctx = tflog.SetField(ctx, "project_id", projectId)
|
||||
serverId := model.ServerId.ValueString()
|
||||
|
|
@ -235,6 +246,8 @@ func (r *networkInterfaceAttachResource) Delete(ctx context.Context, req resourc
|
|||
return
|
||||
}
|
||||
|
||||
ctx = core.LogResponse(ctx)
|
||||
|
||||
tflog.Info(ctx, "Network interface attachment deleted")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue