From d8411c9d91f2ba2056c304aa069763424784490f Mon Sep 17 00:00:00 2001 From: Andreas Eriksson Date: Wed, 11 Sep 2024 20:38:07 +0200 Subject: [PATCH] Manage glesys_networkadapter Name changes --- glesys/resource_glesys_networkadapter.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/glesys/resource_glesys_networkadapter.go b/glesys/resource_glesys_networkadapter.go index 353cb9f..d88a3bf 100644 --- a/glesys/resource_glesys_networkadapter.go +++ b/glesys/resource_glesys_networkadapter.go @@ -37,6 +37,7 @@ func resourceGlesysNetworkAdapter() *schema.Resource { Description: "Network Adapter name", Type: schema.TypeString, Computed: true, + Optional: true, }, "networkid": { Description: "Network ID to connect to. Defaults to `internet`.", @@ -59,6 +60,7 @@ func resourceGlesysNetworkAdapterCreate(ctx context.Context, d *schema.ResourceD params := glesys.CreateNetworkAdapterParams{ AdapterType: d.Get("adaptertype").(string), Bandwidth: d.Get("bandwidth").(int), + Name: d.Get("name").(string), NetworkID: d.Get("networkid").(string), ServerID: d.Get("serverid").(string), } @@ -102,6 +104,9 @@ func resourceGlesysNetworkAdapterUpdate(ctx context.Context, d *schema.ResourceD if d.HasChange("bandwidth") { params.Bandwidth = d.Get("bandwidth").(int) } + if d.HasChange("name") { + params.Name = d.Get("name").(string) + } if d.HasChange("networkid") { params.NetworkID = d.Get("networkid").(string) }