@@ -13,6 +13,7 @@ import (
13
13
"github.com/vmware/terraform-provider-hcx/hcx"
14
14
)
15
15
16
+ // NetSchema defines the resource schema a network profile.
16
17
func NetSchema () map [string ]* schema.Schema {
17
18
return map [string ]* schema.Schema {
18
19
"vmc" : {
@@ -97,6 +98,7 @@ func NetSchema() map[string]*schema.Schema {
97
98
}
98
99
}
99
100
101
+ // resourceComputeProfile defines the resource for managing network profile configuration.
100
102
func resourceNetworkProfile () * schema.Resource {
101
103
return & schema.Resource {
102
104
CreateContext : resourceNetworkProfileCreate ,
@@ -108,6 +110,7 @@ func resourceNetworkProfile() *schema.Resource {
108
110
}
109
111
}
110
112
113
+ // resourceNetworkProfileCreate creates the network profile configuration.
111
114
func resourceNetworkProfileCreate (ctx context.Context , d * schema.ResourceData , m interface {}) diag.Diagnostics {
112
115
113
116
client := m .(* hcx.Client )
@@ -204,6 +207,7 @@ func resourceNetworkProfileCreate(ctx context.Context, d *schema.ResourceData, m
204
207
return resourceNetworkProfileRead (ctx , d , m )
205
208
}
206
209
210
+ // resourceNetworkProfileRead retrieves the network profile configuration.
207
211
func resourceNetworkProfileRead (ctx context.Context , d * schema.ResourceData , m interface {}) diag.Diagnostics {
208
212
var diags diag.Diagnostics
209
213
@@ -219,6 +223,7 @@ func resourceNetworkProfileRead(ctx context.Context, d *schema.ResourceData, m i
219
223
return diags
220
224
}
221
225
226
+ // resourceNetworkProfileUpdate updates the network profile configuration.
222
227
func resourceNetworkProfileUpdate (ctx context.Context , d * schema.ResourceData , m interface {}) diag.Diagnostics {
223
228
224
229
client := m .(* hcx.Client )
@@ -256,7 +261,7 @@ func resourceNetworkProfileUpdate(ctx context.Context, d *schema.ResourceData, m
256
261
})
257
262
}
258
263
259
- // Read the exising profile
264
+ // Read the existing profile
260
265
body , err := hcx .GetNetworkProfile (client , name )
261
266
if err != nil {
262
267
return diag .FromErr (err )
@@ -317,6 +322,8 @@ func resourceNetworkProfileUpdate(ctx context.Context, d *schema.ResourceData, m
317
322
return resourceNetworkProfileRead (ctx , d , m )
318
323
}
319
324
325
+ // resourceNetworkProfileDelete removes the network profile configuration and clears the state of the resource in the
326
+ // schema.
320
327
func resourceNetworkProfileDelete (ctx context.Context , d * schema.ResourceData , m interface {}) diag.Diagnostics {
321
328
var diags diag.Diagnostics
322
329
var res hcx.NetworkProfileResult
@@ -328,7 +335,7 @@ func resourceNetworkProfileDelete(ctx context.Context, d *schema.ResourceData, m
328
335
329
336
if vmc {
330
337
// If VMware Cloud on AWS, don't really delete the network profile
331
- // Read the exising profile
338
+ // Read the existing profile
332
339
/*
333
340
body, err := hcx.GetNetworkProfile(client, name)
334
341
if err != nil {
0 commit comments