From c6b519120cc5ce1cc368fd2621b3e61f3ca8039b Mon Sep 17 00:00:00 2001 From: nvthongswansea Date: Thu, 24 Oct 2019 11:53:32 +0200 Subject: [PATCH 1/4] `status` is not supposed to be set when creating lb --- gridscale/resource_gridscale_loadbalancer.go | 1 - 1 file changed, 1 deletion(-) diff --git a/gridscale/resource_gridscale_loadbalancer.go b/gridscale/resource_gridscale_loadbalancer.go index 4df61f5d4..25cf8f796 100644 --- a/gridscale/resource_gridscale_loadbalancer.go +++ b/gridscale/resource_gridscale_loadbalancer.go @@ -131,7 +131,6 @@ func resourceGridscaleLoadBalancerCreate(d *schema.ResourceData, meta interface{ requestBody := gsclient.LoadBalancerCreateRequest{ Name: d.Get("name").(string), - Status: d.Get("status").(string), RedirectHTTPToHTTPS: d.Get("redirect_http_to_https").(bool), ListenIPv4UUID: d.Get("listen_ipv4_uuid").(string), ListenIPv6UUID: d.Get("listen_ipv6_uuid").(string), From 558615f3a1277d4f073090592d60cbba544ffa40 Mon Sep 17 00:00:00 2001 From: nvthongswansea Date: Thu, 24 Oct 2019 11:54:54 +0200 Subject: [PATCH 2/4] add `location_uuid` param when creating a lb --- gridscale/resource_gridscale_loadbalancer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/gridscale/resource_gridscale_loadbalancer.go b/gridscale/resource_gridscale_loadbalancer.go index 25cf8f796..dad05d4f2 100644 --- a/gridscale/resource_gridscale_loadbalancer.go +++ b/gridscale/resource_gridscale_loadbalancer.go @@ -131,6 +131,7 @@ func resourceGridscaleLoadBalancerCreate(d *schema.ResourceData, meta interface{ requestBody := gsclient.LoadBalancerCreateRequest{ Name: d.Get("name").(string), + LocationUUID: d.Get("location_uuid").(string), RedirectHTTPToHTTPS: d.Get("redirect_http_to_https").(bool), ListenIPv4UUID: d.Get("listen_ipv4_uuid").(string), ListenIPv6UUID: d.Get("listen_ipv6_uuid").(string), From e0f8b106391af6ed63d53e68206aa46bd24a6998 Mon Sep 17 00:00:00 2001 From: nvthongswansea Date: Thu, 24 Oct 2019 11:55:55 +0200 Subject: [PATCH 3/4] `status` not supposed to be set when updating a lb --- gridscale/resource_gridscale_loadbalancer.go | 1 - 1 file changed, 1 deletion(-) diff --git a/gridscale/resource_gridscale_loadbalancer.go b/gridscale/resource_gridscale_loadbalancer.go index dad05d4f2..787b82801 100644 --- a/gridscale/resource_gridscale_loadbalancer.go +++ b/gridscale/resource_gridscale_loadbalancer.go @@ -199,7 +199,6 @@ func resourceGridscaleLoadBalancerUpdate(d *schema.ResourceData, meta interface{ client := meta.(*gsclient.Client) requestBody := gsclient.LoadBalancerUpdateRequest{ Name: d.Get("name").(string), - Status: d.Get("status").(string), RedirectHTTPToHTTPS: d.Get("redirect_http_to_https").(bool), ListenIPv4UUID: d.Get("listen_ipv4_uuid").(string), ListenIPv6UUID: d.Get("listen_ipv6_uuid").(string), From 474d7d7d2a781e0b5758ace2c9aeee7981583979 Mon Sep 17 00:00:00 2001 From: nvthongswansea Date: Thu, 24 Oct 2019 11:56:56 +0200 Subject: [PATCH 4/4] read `location_uuid` when reading a lb data --- gridscale/resource_gridscale_loadbalancer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/gridscale/resource_gridscale_loadbalancer.go b/gridscale/resource_gridscale_loadbalancer.go index 787b82801..f3141febe 100644 --- a/gridscale/resource_gridscale_loadbalancer.go +++ b/gridscale/resource_gridscale_loadbalancer.go @@ -175,6 +175,7 @@ func resourceGridscaleLoadBalancerRead(d *schema.ResourceData, meta interface{}) d.Set("name", loadbalancer.Properties.Name) d.Set("algorithm", loadbalancer.Properties.Algorithm) + d.Set("location_uuid", loadbalancer.Properties.LocationUUID) d.Set("status", loadbalancer.Properties.Status) d.Set("redirect_http_to_https", loadbalancer.Properties.RedirectHTTPToHTTPS) d.Set("listen_ipv4_uuid", loadbalancer.Properties.ListenIPv4UUID)