Skip to content

Commit 957fc25

Browse files
authored
Resolve Issue #443 (#482)
* Resolve issue #443 * Update definition * Update to show errors
1 parent 9cd3980 commit 957fc25

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

gen/definitions/profile_parcels/service_lan_vpn_interface_ethernet.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
# Manual resource - Modals toBody is manually configured to support sub interfaces.
23
name: Service LAN VPN Interface Ethernet
34
rest_endpoint: /v1/feature-profile/sdwan/service/%v/lan/vpn/%s/interface/ethernet
45
minimum_version: 20.12.0

gen/definitions/profile_parcels/transport_wan_vpn_interface_ethernet.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
# Manual resource - Modals toBody is manually configured to support sub interfaces.
23
name: Transport WAN VPN Interface Ethernet
34
rest_endpoint: /v1/feature-profile/sdwan/transport/%v/wan/vpn/%s/interface/ethernet
45
minimum_version: 20.12.0

internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_feature.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"fmt"
2424
"net/url"
2525
"strconv"
26+
"strings"
2627

2728
"github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
2829
"github.com/hashicorp/terraform-plugin-framework/types"
@@ -232,7 +233,6 @@ func (data ServiceLANVPNInterfaceEthernet) getPath() string {
232233

233234
// End of section. //template:end getPath
234235

235-
// Section below is generated&owned by "gen/generator.go". //template:begin toBody
236236
func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string {
237237
body := ""
238238
body, _ = sjson.Set(body, "name", data.Name.ValueString())
@@ -1143,7 +1143,7 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string {
11431143
body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString())
11441144
}
11451145
} else if data.InterfaceMtu.IsNull() {
1146-
if true {
1146+
if !strings.Contains(data.InterfaceName.ValueString(), ".") {
11471147
body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default")
11481148
body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500)
11491149
}
@@ -1326,8 +1326,6 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string {
13261326
return body
13271327
}
13281328

1329-
// End of section. //template:end toBody
1330-
13311329
// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
13321330
func (data *ServiceLANVPNInterfaceEthernet) fromBody(ctx context.Context, res gjson.Result) {
13331331
data.Name = types.StringValue(res.Get("payload.name").String())

internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_feature.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"context"
2323
"fmt"
2424
"net/url"
25+
"strings"
2526

2627
"github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers"
2728
"github.com/hashicorp/terraform-plugin-framework/types"
@@ -298,7 +299,6 @@ func (data TransportWANVPNInterfaceEthernet) getPath() string {
298299

299300
// End of section. //template:end getPath
300301

301-
// Section below is generated&owned by "gen/generator.go". //template:begin toBody
302302
func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string {
303303
body := ""
304304
body, _ = sjson.Set(body, "name", data.Name.ValueString())
@@ -1791,7 +1791,7 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string
17911791
body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString())
17921792
}
17931793
} else if data.InterfaceMtu.IsNull() {
1794-
if true {
1794+
if !strings.Contains(data.InterfaceName.ValueString(), ".") {
17951795
body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default")
17961796
body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500)
17971797
}
@@ -1991,8 +1991,6 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string
19911991
return body
19921992
}
19931993

1994-
// End of section. //template:end toBody
1995-
19961994
// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
19971995
func (data *TransportWANVPNInterfaceEthernet) fromBody(ctx context.Context, res gjson.Result) {
19981996
data.Name = types.StringValue(res.Get("payload.name").String())

0 commit comments

Comments
 (0)