@@ -191,7 +191,6 @@ func buildServiceDeviceClusterInterfacesPayload(d *schema.ResourceData) []map[st
191191 iface := val .(map [string ]interface {})
192192
193193 advancedConfig := make (map [string ]interface {})
194-
195194 if v , ok := iface ["preferred_group" ]; ok {
196195 advancedConfig ["preferredGroup" ] = v .(bool )
197196 }
@@ -233,8 +232,8 @@ func buildServiceDeviceClusterInterfacesPayload(d *schema.ResourceData) []map[st
233232 if v , ok := iface ["load_balance_hashing" ].(string ); ok {
234233 advancedConfig ["loadBalanceHashing" ] = v
235234 }
236- thresholdConfig := make (map [string ]interface {})
237235
236+ thresholdConfig := make (map [string ]interface {})
238237 if v , ok := iface ["min_threshold" ].(int ); ok && v >= 0 {
239238 thresholdConfig ["minThreshold" ] = v
240239 }
@@ -279,12 +278,9 @@ func buildServiceDeviceClusterPayload(d *schema.ResourceData) map[string]interfa
279278 payload ["description" ] = d .Get ("description" ).(string )
280279 payload ["deviceMode" ] = d .Get ("device_mode" ).(string )
281280 payload ["deviceLocation" ] = "onPremise"
282-
283281 payload ["deviceType" ] = normalizeDeviceType (d .Get ("device_type" ).(string ))
284-
285282 interfaces := buildServiceDeviceClusterInterfacesPayload (d )
286283 payload ["interfaces" ] = interfaces
287-
288284 payload ["connectivityMode" ] = getConnectivityMode (len (interfaces ))
289285
290286 return payload
@@ -295,13 +291,12 @@ func setServiceDeviceClusterData(d *schema.ResourceData, response *container.Con
295291 d .Set ("template_id" , templateId )
296292 d .Set ("name" , models .StripQuotes (response .S ("name" ).String ()))
297293 d .Set ("uuid" , models .StripQuotes (response .S ("uuid" ).String ()))
294+ d .Set ("device_mode" , models .StripQuotes (response .S ("deviceMode" ).String ()))
298295
299296 if response .Exists ("description" ) {
300297 d .Set ("description" , models .StripQuotes (response .S ("description" ).String ()))
301298 }
302299
303- d .Set ("device_mode" , models .StripQuotes (response .S ("deviceMode" ).String ()))
304-
305300 deviceType := models .StripQuotes (response .S ("deviceType" ).String ())
306301 if deviceType == "loadBalancer" {
307302 d .Set ("device_type" , "load_balancer" )
@@ -328,10 +323,8 @@ func setServiceDeviceClusterData(d *schema.ResourceData, response *container.Con
328323 if iface .Exists ("ipslaMonitoringRef" ) {
329324 prop ["ipsla_monitoring_policy_uuid" ] = models .StripQuotes (iface .S ("ipslaMonitoringRef" ).String ())
330325 }
331-
332326 if iface .Exists ("advancedIntfConfig" ) {
333327 advancedConfig := iface .S ("advancedIntfConfig" )
334-
335328 if advancedConfig .Exists ("qosPolicyRef" ) {
336329 qosPolicyRef := models .StripQuotes (advancedConfig .S ("qosPolicyRef" ).String ())
337330 if qosPolicyRef == "{}" {
@@ -340,7 +333,6 @@ func setServiceDeviceClusterData(d *schema.ResourceData, response *container.Con
340333 prop ["qos_policy_uuid" ] = qosPolicyRef
341334 }
342335 }
343-
344336 if advancedConfig .Exists ("preferredGroup" ) {
345337 prop ["preferred_group" ] = advancedConfig .S ("preferredGroup" ).Data ().(bool )
346338 }
@@ -365,11 +357,9 @@ func setServiceDeviceClusterData(d *schema.ResourceData, response *container.Con
365357 if advancedConfig .Exists ("tag" ) {
366358 prop ["tag_based_sorting" ] = advancedConfig .S ("tag" ).Data ().(bool )
367359 }
368-
369360 if advancedConfig .Exists ("loadBalanceHashing" ) {
370361 prop ["load_balance_hashing" ] = models .StripQuotes (advancedConfig .S ("loadBalanceHashing" ).String ())
371362 }
372-
373363 if advancedConfig .Exists ("thresholdForRedirect" ) {
374364 thresholdConfig := advancedConfig .S ("thresholdForRedirect" )
375365 if thresholdConfig .Exists ("minThreshold" ) {
0 commit comments