From 71dc4373c10a201a55230b954cd71745b2426a6c Mon Sep 17 00:00:00 2001 From: Christopher Hart Date: Thu, 6 Nov 2025 13:08:15 -0500 Subject: [PATCH 1/5] feat(models): add CEF model to list to be loaded --- gen/load_models.go | 1 + 1 file changed, 1 insertion(+) diff --git a/gen/load_models.go b/gen/load_models.go index e79cfb191..645c0e9a4 100644 --- a/gen/load_models.go +++ b/gen/load_models.go @@ -44,6 +44,7 @@ var models = []string{ "https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/xe/17151/Cisco-IOS-XE-logging.yang", "https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/xe/17151/Cisco-IOS-XE-ip.yang", "https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/xe/17151/Cisco-IOS-XE-ipv6.yang", + "https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/xe/17151/Cisco-IOS-XE-cef.yang", "https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/xe/17151/Cisco-IOS-XE-interfaces.yang", "https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/xe/17151/Cisco-IOS-XE-isis.yang", "https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/xe/17151/Cisco-IOS-XE-snmp.yang", From 5911ba2d92c2929a4fed85edd3fd841443758ae3 Mon Sep 17 00:00:00 2001 From: Christopher Hart Date: Thu, 6 Nov 2025 13:09:18 -0500 Subject: [PATCH 2/5] feat(cef): add definitions for IP/IPv6/port-channel load balancing options --- gen/definitions/system.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gen/definitions/system.yaml b/gen/definitions/system.yaml index c81d0c8ee..e97102b99 100644 --- a/gen/definitions/system.yaml +++ b/gen/definitions/system.yaml @@ -651,6 +651,25 @@ attributes: - yang_name: ip/routing-new/routing/protocol/purge/interface tf_name: ip_routing_protocol_purge_interface example: true + - yang_name: ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/alg-type/include-ports/ios-cef:include-ports-v2/source + xpath: ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source + tf_name: ip_cef_load_sharing_algorithm_include_ports_source + example: true + - yang_name: ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/alg-type/include-ports/ios-cef:include-ports-v2/destination + xpath: ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination + tf_name: ip_cef_load_sharing_algorithm_include_ports_destination + example: true + - yang_name: ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/alg-type/include-ports/ios-cef:include-ports-v2/source + xpath: ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source + tf_name: ipv6_cef_load_sharing_algorithm_include_ports_source + example: true + - yang_name: ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/alg-type/include-ports/ios-cef:include-ports-v2/destination + xpath: ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination + tf_name: ipv6_cef_load_sharing_algorithm_include_ports_destination + example: true + - yang_name: port-channel/ios-eth:load-balance/load-balance + tf_name: port_channel_load_balance + example: src-dst-mixed-ip-port test_prerequisites: - path: Cisco-IOS-XE-native:native/vrf/definition=VRF1 From 7890790a0ce93bc33f57fa363a05748f263f2edb Mon Sep 17 00:00:00 2001 From: Christopher Hart Date: Thu, 6 Nov 2025 13:09:38 -0500 Subject: [PATCH 3/5] chore: add generated IP/IPv6/port-channel load balancing code --- docs/data-sources/system.md | 5 + docs/resources/system.md | 38 ++-- examples/resources/iosxe_system/resource.tf | 33 ++-- internal/provider/data_source_iosxe_system.go | 20 +++ .../provider/data_source_iosxe_system_test.go | 10 ++ internal/provider/model_iosxe_system.go | 162 ++++++++++++++++++ internal/provider/resource_iosxe_system.go | 23 +++ .../provider/resource_iosxe_system_test.go | 10 ++ 8 files changed, 273 insertions(+), 28 deletions(-) diff --git a/docs/data-sources/system.md b/docs/data-sources/system.md index c45474efc..cebef5555 100644 --- a/docs/data-sources/system.md +++ b/docs/data-sources/system.md @@ -51,6 +51,8 @@ data "iosxe_system" "example" { - `hostname` (String) Set system's network name - `id` (String) The path of the retrieved object. - `ip_bgp_community_new_format` (Boolean) select aa:nn format for BGP community +- `ip_cef_load_sharing_algorithm_include_ports_destination` (Boolean) +- `ip_cef_load_sharing_algorithm_include_ports_source` (Boolean) - `ip_domain_list_names` (List of String) - `ip_domain_list_vrf` (String) - `ip_domain_list_vrf_domain` (String) @@ -132,6 +134,8 @@ data "iosxe_system" "example" { - `ip_tacacs_source_interface_two_gigabit_ethernet` (String) Two GigabitEthernet - `ip_tacacs_source_interface_vlan` (Number) Iosxr Vlans - `ip_tacacs_source_interface_vrf` (String) VPN Routing/Forwarding parameters +- `ipv6_cef_load_sharing_algorithm_include_ports_destination` (Boolean) +- `ipv6_cef_load_sharing_algorithm_include_ports_source` (Boolean) - `ipv6_unicast_routing` (Boolean) Enable unicast routing - `login_delay` (Number) Set delay between successive fail login - `login_on_failure` (Boolean) Set options for failed login attempt @@ -144,6 +148,7 @@ data "iosxe_system" "example" { - `multicast_routing_vrfs` (Attributes List) Select VPN Routing/Forwarding instance (see [below for nested schema](#nestedatt--multicast_routing_vrfs)) - `multilink_ppp_bundle_name` (String) Select method for naming multilink bundles - `pnp_profiles` (Attributes List) PNP profile (see [below for nested schema](#nestedatt--pnp_profiles)) +- `port_channel_load_balance` (String) - `redundancy` (Boolean) Enter redundancy mode - `redundancy_mode` (String) redundancy mode for this chassis - `security_passwords_min_length` (Number) Minimum length of passwords diff --git a/docs/resources/system.md b/docs/resources/system.md index a5da7ee77..11614ab6c 100644 --- a/docs/resources/system.md +++ b/docs/resources/system.md @@ -45,20 +45,25 @@ resource "iosxe_system" "example" { source_interface_gigabit_ethernet = "1/0/1" } ] - diagnostic_bootup_level = "minimal" - memory_free_low_watermark_processor = 203038 - ip_ssh_time_out = 120 - ip_ssh_authentication_retries = 3 - ip_ssh_bulk_mode = true - ip_ssh_bulk_mode_window_size = 262144 - call_home_contact_email = "email@test.com" - call_home_cisco_tac_1_profile_active = true - call_home_cisco_tac_1_destination_transport_method = "email" - ip_nbar_classification_dns_classify_by_domain = true - ip_multicast_route_limit = 200000 - ip_domain_list_vrf_domain = "example.com" - ip_domain_list_vrf = "VRF1" - ip_routing_protocol_purge_interface = true + diagnostic_bootup_level = "minimal" + memory_free_low_watermark_processor = 203038 + ip_ssh_time_out = 120 + ip_ssh_authentication_retries = 3 + ip_ssh_bulk_mode = true + ip_ssh_bulk_mode_window_size = 262144 + call_home_contact_email = "email@test.com" + call_home_cisco_tac_1_profile_active = true + call_home_cisco_tac_1_destination_transport_method = "email" + ip_nbar_classification_dns_classify_by_domain = true + ip_multicast_route_limit = 200000 + ip_domain_list_vrf_domain = "example.com" + ip_domain_list_vrf = "VRF1" + ip_routing_protocol_purge_interface = true + ip_cef_load_sharing_algorithm_include_ports_source = true + ip_cef_load_sharing_algorithm_include_ports_destination = true + ipv6_cef_load_sharing_algorithm_include_ports_source = true + ipv6_cef_load_sharing_algorithm_include_ports_destination = true + port_channel_load_balance = "src-dst-mixed-ip-port" } ``` @@ -101,6 +106,8 @@ resource "iosxe_system" "example" { - Range: `2500`-`10000` - `hostname` (String) Set system's network name - `ip_bgp_community_new_format` (Boolean) select aa:nn format for BGP community +- `ip_cef_load_sharing_algorithm_include_ports_destination` (Boolean) +- `ip_cef_load_sharing_algorithm_include_ports_source` (Boolean) - `ip_domain_list_names` (List of String) - `ip_domain_list_vrf` (String) - `ip_domain_list_vrf_domain` (String) @@ -199,6 +206,8 @@ resource "iosxe_system" "example" { - `ip_tacacs_source_interface_vlan` (Number) Iosxr Vlans - Range: `0`-`65535` - `ip_tacacs_source_interface_vrf` (String) VPN Routing/Forwarding parameters +- `ipv6_cef_load_sharing_algorithm_include_ports_destination` (Boolean) +- `ipv6_cef_load_sharing_algorithm_include_ports_source` (Boolean) - `ipv6_unicast_routing` (Boolean) Enable unicast routing - `login_delay` (Number) Set delay between successive fail login - Range: `1`-`10` @@ -214,6 +223,7 @@ resource "iosxe_system" "example" { - `multilink_ppp_bundle_name` (String) Select method for naming multilink bundles - Choices: `authenticated`, `both`, `endpoint`, `rfc` - `pnp_profiles` (Attributes List) PNP profile (see [below for nested schema](#nestedatt--pnp_profiles)) +- `port_channel_load_balance` (String) - Choices: `dst-ip`, `dst-mac`, `dst-mixed-ip-port`, `dst-port`, `mpls`, `src-dst-ip`, `src-dst-mac`, `src-dst-mixed-ip-port`, `src-dst-port`, `src-ip`, `src-mac`, `src-mixed-ip-port`, `src-port`, `vlan-dst-ip`, `vlan-dst-mixed-ip-port`, `vlan-src-dst-ip`, `vlan-src-dst-mixed-ip-port`, `vlan-src-ip`, `vlan-src-mixed-ip-port` - `redundancy` (Boolean) Enter redundancy mode - `redundancy_mode` (String) redundancy mode for this chassis - Choices: `none`, `rpr`, `rpr-plus`, `sso` diff --git a/examples/resources/iosxe_system/resource.tf b/examples/resources/iosxe_system/resource.tf index a1d8d1b84..a34a99cc4 100644 --- a/examples/resources/iosxe_system/resource.tf +++ b/examples/resources/iosxe_system/resource.tf @@ -30,18 +30,23 @@ resource "iosxe_system" "example" { source_interface_gigabit_ethernet = "1/0/1" } ] - diagnostic_bootup_level = "minimal" - memory_free_low_watermark_processor = 203038 - ip_ssh_time_out = 120 - ip_ssh_authentication_retries = 3 - ip_ssh_bulk_mode = true - ip_ssh_bulk_mode_window_size = 262144 - call_home_contact_email = "email@test.com" - call_home_cisco_tac_1_profile_active = true - call_home_cisco_tac_1_destination_transport_method = "email" - ip_nbar_classification_dns_classify_by_domain = true - ip_multicast_route_limit = 200000 - ip_domain_list_vrf_domain = "example.com" - ip_domain_list_vrf = "VRF1" - ip_routing_protocol_purge_interface = true + diagnostic_bootup_level = "minimal" + memory_free_low_watermark_processor = 203038 + ip_ssh_time_out = 120 + ip_ssh_authentication_retries = 3 + ip_ssh_bulk_mode = true + ip_ssh_bulk_mode_window_size = 262144 + call_home_contact_email = "email@test.com" + call_home_cisco_tac_1_profile_active = true + call_home_cisco_tac_1_destination_transport_method = "email" + ip_nbar_classification_dns_classify_by_domain = true + ip_multicast_route_limit = 200000 + ip_domain_list_vrf_domain = "example.com" + ip_domain_list_vrf = "VRF1" + ip_routing_protocol_purge_interface = true + ip_cef_load_sharing_algorithm_include_ports_source = true + ip_cef_load_sharing_algorithm_include_ports_destination = true + ipv6_cef_load_sharing_algorithm_include_ports_source = true + ipv6_cef_load_sharing_algorithm_include_ports_destination = true + port_channel_load_balance = "src-dst-mixed-ip-port" } diff --git a/internal/provider/data_source_iosxe_system.go b/internal/provider/data_source_iosxe_system.go index f0951d833..aa6123467 100644 --- a/internal/provider/data_source_iosxe_system.go +++ b/internal/provider/data_source_iosxe_system.go @@ -777,6 +777,26 @@ func (d *SystemDataSource) Schema(ctx context.Context, req datasource.SchemaRequ MarkdownDescription: "Perform IP routing protocol routes purge on link failures", Computed: true, }, + "ip_cef_load_sharing_algorithm_include_ports_source": schema.BoolAttribute{ + MarkdownDescription: "", + Computed: true, + }, + "ip_cef_load_sharing_algorithm_include_ports_destination": schema.BoolAttribute{ + MarkdownDescription: "", + Computed: true, + }, + "ipv6_cef_load_sharing_algorithm_include_ports_source": schema.BoolAttribute{ + MarkdownDescription: "", + Computed: true, + }, + "ipv6_cef_load_sharing_algorithm_include_ports_destination": schema.BoolAttribute{ + MarkdownDescription: "", + Computed: true, + }, + "port_channel_load_balance": schema.StringAttribute{ + MarkdownDescription: "", + Computed: true, + }, }, } } diff --git a/internal/provider/data_source_iosxe_system_test.go b/internal/provider/data_source_iosxe_system_test.go index 7dd161cb8..663a24827 100644 --- a/internal/provider/data_source_iosxe_system_test.go +++ b/internal/provider/data_source_iosxe_system_test.go @@ -85,6 +85,11 @@ func TestAccDataSourceIosxeSystem(t *testing.T) { checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_system.test", "ip_domain_list_vrf_domain", "example.com")) checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_system.test", "ip_domain_list_vrf", "VRF1")) checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_system.test", "ip_routing_protocol_purge_interface", "true")) + checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_system.test", "ip_cef_load_sharing_algorithm_include_ports_source", "true")) + checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_system.test", "ip_cef_load_sharing_algorithm_include_ports_destination", "true")) + checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_system.test", "ipv6_cef_load_sharing_algorithm_include_ports_source", "true")) + checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_system.test", "ipv6_cef_load_sharing_algorithm_include_ports_destination", "true")) + checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_system.test", "port_channel_load_balance", "src-dst-mixed-ip-port")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, @@ -178,6 +183,11 @@ func testAccDataSourceIosxeSystemConfig() string { config += ` ip_domain_list_vrf_domain = "example.com"` + "\n" config += ` ip_domain_list_vrf = "VRF1"` + "\n" config += ` ip_routing_protocol_purge_interface = true` + "\n" + config += ` ip_cef_load_sharing_algorithm_include_ports_source = true` + "\n" + config += ` ip_cef_load_sharing_algorithm_include_ports_destination = true` + "\n" + config += ` ipv6_cef_load_sharing_algorithm_include_ports_source = true` + "\n" + config += ` ipv6_cef_load_sharing_algorithm_include_ports_destination = true` + "\n" + config += ` port_channel_load_balance = "src-dst-mixed-ip-port"` + "\n" config += ` depends_on = [iosxe_restconf.PreReq0, ]` + "\n" config += `}` + "\n" diff --git a/internal/provider/model_iosxe_system.go b/internal/provider/model_iosxe_system.go index 5fdbd35af..9f379c604 100644 --- a/internal/provider/model_iosxe_system.go +++ b/internal/provider/model_iosxe_system.go @@ -175,6 +175,11 @@ type System struct { StandbyRedirects types.Bool `tfsdk:"standby_redirects"` StandbyRedirectsEnableDisable types.String `tfsdk:"standby_redirects_enable_disable"` IpRoutingProtocolPurgeInterface types.Bool `tfsdk:"ip_routing_protocol_purge_interface"` + IpCefLoadSharingAlgorithmIncludePortsSource types.Bool `tfsdk:"ip_cef_load_sharing_algorithm_include_ports_source"` + IpCefLoadSharingAlgorithmIncludePortsDestination types.Bool `tfsdk:"ip_cef_load_sharing_algorithm_include_ports_destination"` + Ipv6CefLoadSharingAlgorithmIncludePortsSource types.Bool `tfsdk:"ipv6_cef_load_sharing_algorithm_include_ports_source"` + Ipv6CefLoadSharingAlgorithmIncludePortsDestination types.Bool `tfsdk:"ipv6_cef_load_sharing_algorithm_include_ports_destination"` + PortChannelLoadBalance types.String `tfsdk:"port_channel_load_balance"` } type SystemData struct { @@ -315,6 +320,11 @@ type SystemData struct { StandbyRedirects types.Bool `tfsdk:"standby_redirects"` StandbyRedirectsEnableDisable types.String `tfsdk:"standby_redirects_enable_disable"` IpRoutingProtocolPurgeInterface types.Bool `tfsdk:"ip_routing_protocol_purge_interface"` + IpCefLoadSharingAlgorithmIncludePortsSource types.Bool `tfsdk:"ip_cef_load_sharing_algorithm_include_ports_source"` + IpCefLoadSharingAlgorithmIncludePortsDestination types.Bool `tfsdk:"ip_cef_load_sharing_algorithm_include_ports_destination"` + Ipv6CefLoadSharingAlgorithmIncludePortsSource types.Bool `tfsdk:"ipv6_cef_load_sharing_algorithm_include_ports_source"` + Ipv6CefLoadSharingAlgorithmIncludePortsDestination types.Bool `tfsdk:"ipv6_cef_load_sharing_algorithm_include_ports_destination"` + PortChannelLoadBalance types.String `tfsdk:"port_channel_load_balance"` } type SystemMulticastRoutingVrfs struct { Vrf types.String `tfsdk:"vrf"` @@ -823,6 +833,29 @@ func (data System) toBody(ctx context.Context) string { if !data.IpRoutingProtocolPurgeInterface.IsNull() && !data.IpRoutingProtocolPurgeInterface.IsUnknown() { body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ip.routing-new.routing.protocol.purge.interface", data.IpRoutingProtocolPurgeInterface.ValueBool()) } + if !data.IpCefLoadSharingAlgorithmIncludePortsSource.IsNull() && !data.IpCefLoadSharingAlgorithmIncludePortsSource.IsUnknown() { + if data.IpCefLoadSharingAlgorithmIncludePortsSource.ValueBool() { + body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source", map[string]string{}) + } + } + if !data.IpCefLoadSharingAlgorithmIncludePortsDestination.IsNull() && !data.IpCefLoadSharingAlgorithmIncludePortsDestination.IsUnknown() { + if data.IpCefLoadSharingAlgorithmIncludePortsDestination.ValueBool() { + body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination", map[string]string{}) + } + } + if !data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsNull() && !data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsUnknown() { + if data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.ValueBool() { + body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source", map[string]string{}) + } + } + if !data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsNull() && !data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsUnknown() { + if data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.ValueBool() { + body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination", map[string]string{}) + } + } + if !data.PortChannelLoadBalance.IsNull() && !data.PortChannelLoadBalance.IsUnknown() { + body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"port-channel.ios-eth:load-balance.load-balance", data.PortChannelLoadBalance.ValueString()) + } if len(data.MulticastRoutingVrfs) > 0 { body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ip.Cisco-IOS-XE-multicast:multicast-routing.vrf", []interface{}{}) for index, item := range data.MulticastRoutingVrfs { @@ -2133,6 +2166,47 @@ func (data *System) updateFromBody(ctx context.Context, res gjson.Result) { } else { data.IpRoutingProtocolPurgeInterface = types.BoolNull() } + if value := res.Get(prefix + "ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source"); !data.IpCefLoadSharingAlgorithmIncludePortsSource.IsNull() { + if value.Exists() { + data.IpCefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(true) + } else { + data.IpCefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(false) + } + } else { + data.IpCefLoadSharingAlgorithmIncludePortsSource = types.BoolNull() + } + if value := res.Get(prefix + "ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination"); !data.IpCefLoadSharingAlgorithmIncludePortsDestination.IsNull() { + if value.Exists() { + data.IpCefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(true) + } else { + data.IpCefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(false) + } + } else { + data.IpCefLoadSharingAlgorithmIncludePortsDestination = types.BoolNull() + } + if value := res.Get(prefix + "ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source"); !data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsNull() { + if value.Exists() { + data.Ipv6CefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(true) + } else { + data.Ipv6CefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(false) + } + } else { + data.Ipv6CefLoadSharingAlgorithmIncludePortsSource = types.BoolNull() + } + if value := res.Get(prefix + "ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination"); !data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsNull() { + if value.Exists() { + data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(true) + } else { + data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(false) + } + } else { + data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination = types.BoolNull() + } + if value := res.Get(prefix + "port-channel.ios-eth:load-balance.load-balance"); value.Exists() && !data.PortChannelLoadBalance.IsNull() { + data.PortChannelLoadBalance = types.StringValue(value.String()) + } else { + data.PortChannelLoadBalance = types.StringNull() + } } // End of section. //template:end updateFromBody @@ -2776,6 +2850,29 @@ func (data *System) fromBody(ctx context.Context, res gjson.Result) { } else { data.IpRoutingProtocolPurgeInterface = types.BoolNull() } + if value := res.Get(prefix + "ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source"); value.Exists() { + data.IpCefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(true) + } else { + data.IpCefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(false) + } + if value := res.Get(prefix + "ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination"); value.Exists() { + data.IpCefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(true) + } else { + data.IpCefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(false) + } + if value := res.Get(prefix + "ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source"); value.Exists() { + data.Ipv6CefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(true) + } else { + data.Ipv6CefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(false) + } + if value := res.Get(prefix + "ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination"); value.Exists() { + data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(true) + } else { + data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(false) + } + if value := res.Get(prefix + "port-channel.ios-eth:load-balance.load-balance"); value.Exists() { + data.PortChannelLoadBalance = types.StringValue(value.String()) + } } // End of section. //template:end fromBody @@ -3419,6 +3516,29 @@ func (data *SystemData) fromBody(ctx context.Context, res gjson.Result) { } else { data.IpRoutingProtocolPurgeInterface = types.BoolNull() } + if value := res.Get(prefix + "ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source"); value.Exists() { + data.IpCefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(true) + } else { + data.IpCefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(false) + } + if value := res.Get(prefix + "ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination"); value.Exists() { + data.IpCefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(true) + } else { + data.IpCefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(false) + } + if value := res.Get(prefix + "ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source"); value.Exists() { + data.Ipv6CefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(true) + } else { + data.Ipv6CefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(false) + } + if value := res.Get(prefix + "ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination"); value.Exists() { + data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(true) + } else { + data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(false) + } + if value := res.Get(prefix + "port-channel.ios-eth:load-balance.load-balance"); value.Exists() { + data.PortChannelLoadBalance = types.StringValue(value.String()) + } } // End of section. //template:end fromBodyData @@ -3427,6 +3547,21 @@ func (data *SystemData) fromBody(ctx context.Context, res gjson.Result) { func (data *System) getDeletedItems(ctx context.Context, state System) []string { deletedItems := make([]string, 0) + if !state.PortChannelLoadBalance.IsNull() && data.PortChannelLoadBalance.IsNull() { + deletedItems = append(deletedItems, fmt.Sprintf("%v/port-channel/ios-eth:load-balance/load-balance", state.getPath())) + } + if !state.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsNull() && data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsNull() { + deletedItems = append(deletedItems, fmt.Sprintf("%v/ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination", state.getPath())) + } + if !state.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsNull() && data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsNull() { + deletedItems = append(deletedItems, fmt.Sprintf("%v/ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source", state.getPath())) + } + if !state.IpCefLoadSharingAlgorithmIncludePortsDestination.IsNull() && data.IpCefLoadSharingAlgorithmIncludePortsDestination.IsNull() { + deletedItems = append(deletedItems, fmt.Sprintf("%v/ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination", state.getPath())) + } + if !state.IpCefLoadSharingAlgorithmIncludePortsSource.IsNull() && data.IpCefLoadSharingAlgorithmIncludePortsSource.IsNull() { + deletedItems = append(deletedItems, fmt.Sprintf("%v/ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source", state.getPath())) + } if !state.IpRoutingProtocolPurgeInterface.IsNull() && data.IpRoutingProtocolPurgeInterface.IsNull() { deletedItems = append(deletedItems, fmt.Sprintf("%v/ip/routing-new/routing/protocol/purge/interface", state.getPath())) } @@ -4231,6 +4366,18 @@ func (data *System) getDeletedItems(ctx context.Context, state System) []string func (data *System) getEmptyLeafsDelete(ctx context.Context) []string { emptyLeafsDelete := make([]string, 0) + if !data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsNull() && !data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.ValueBool() { + emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination", data.getPath())) + } + if !data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsNull() && !data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.ValueBool() { + emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source", data.getPath())) + } + if !data.IpCefLoadSharingAlgorithmIncludePortsDestination.IsNull() && !data.IpCefLoadSharingAlgorithmIncludePortsDestination.ValueBool() { + emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination", data.getPath())) + } + if !data.IpCefLoadSharingAlgorithmIncludePortsSource.IsNull() && !data.IpCefLoadSharingAlgorithmIncludePortsSource.ValueBool() { + emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source", data.getPath())) + } for i := range data.TrackObjects { keyValues := [...]string{data.TrackObjects[i].Number.ValueString()} @@ -4328,6 +4475,21 @@ func (data *System) getEmptyLeafsDelete(ctx context.Context) []string { func (data *System) getDeletePaths(ctx context.Context) []string { var deletePaths []string + if !data.PortChannelLoadBalance.IsNull() { + deletePaths = append(deletePaths, fmt.Sprintf("%v/port-channel/ios-eth:load-balance/load-balance", data.getPath())) + } + if !data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsNull() { + deletePaths = append(deletePaths, fmt.Sprintf("%v/ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination", data.getPath())) + } + if !data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsNull() { + deletePaths = append(deletePaths, fmt.Sprintf("%v/ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source", data.getPath())) + } + if !data.IpCefLoadSharingAlgorithmIncludePortsDestination.IsNull() { + deletePaths = append(deletePaths, fmt.Sprintf("%v/ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination", data.getPath())) + } + if !data.IpCefLoadSharingAlgorithmIncludePortsSource.IsNull() { + deletePaths = append(deletePaths, fmt.Sprintf("%v/ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source", data.getPath())) + } if !data.IpRoutingProtocolPurgeInterface.IsNull() { deletePaths = append(deletePaths, fmt.Sprintf("%v/ip/routing-new/routing/protocol/purge/interface", data.getPath())) } diff --git a/internal/provider/resource_iosxe_system.go b/internal/provider/resource_iosxe_system.go index 29c7837c6..26fa0a43e 100644 --- a/internal/provider/resource_iosxe_system.go +++ b/internal/provider/resource_iosxe_system.go @@ -928,6 +928,29 @@ func (r *SystemResource) Schema(ctx context.Context, req resource.SchemaRequest, MarkdownDescription: helpers.NewAttributeDescription("Perform IP routing protocol routes purge on link failures").String, Optional: true, }, + "ip_cef_load_sharing_algorithm_include_ports_source": schema.BoolAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("").String, + Optional: true, + }, + "ip_cef_load_sharing_algorithm_include_ports_destination": schema.BoolAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("").String, + Optional: true, + }, + "ipv6_cef_load_sharing_algorithm_include_ports_source": schema.BoolAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("").String, + Optional: true, + }, + "ipv6_cef_load_sharing_algorithm_include_ports_destination": schema.BoolAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("").String, + Optional: true, + }, + "port_channel_load_balance": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("dst-ip", "dst-mac", "dst-mixed-ip-port", "dst-port", "mpls", "src-dst-ip", "src-dst-mac", "src-dst-mixed-ip-port", "src-dst-port", "src-ip", "src-mac", "src-mixed-ip-port", "src-port", "vlan-dst-ip", "vlan-dst-mixed-ip-port", "vlan-src-dst-ip", "vlan-src-dst-mixed-ip-port", "vlan-src-ip", "vlan-src-mixed-ip-port").String, + Optional: true, + Validators: []validator.String{ + stringvalidator.OneOf("dst-ip", "dst-mac", "dst-mixed-ip-port", "dst-port", "mpls", "src-dst-ip", "src-dst-mac", "src-dst-mixed-ip-port", "src-dst-port", "src-ip", "src-mac", "src-mixed-ip-port", "src-port", "vlan-dst-ip", "vlan-dst-mixed-ip-port", "vlan-src-dst-ip", "vlan-src-dst-mixed-ip-port", "vlan-src-ip", "vlan-src-mixed-ip-port"), + }, + }, }, } } diff --git a/internal/provider/resource_iosxe_system_test.go b/internal/provider/resource_iosxe_system_test.go index 2ab143bdf..c75ea0dfc 100644 --- a/internal/provider/resource_iosxe_system_test.go +++ b/internal/provider/resource_iosxe_system_test.go @@ -87,6 +87,11 @@ func TestAccIosxeSystem(t *testing.T) { checks = append(checks, resource.TestCheckResourceAttr("iosxe_system.test", "ip_domain_list_vrf_domain", "example.com")) checks = append(checks, resource.TestCheckResourceAttr("iosxe_system.test", "ip_domain_list_vrf", "VRF1")) checks = append(checks, resource.TestCheckResourceAttr("iosxe_system.test", "ip_routing_protocol_purge_interface", "true")) + checks = append(checks, resource.TestCheckResourceAttr("iosxe_system.test", "ip_cef_load_sharing_algorithm_include_ports_source", "true")) + checks = append(checks, resource.TestCheckResourceAttr("iosxe_system.test", "ip_cef_load_sharing_algorithm_include_ports_destination", "true")) + checks = append(checks, resource.TestCheckResourceAttr("iosxe_system.test", "ipv6_cef_load_sharing_algorithm_include_ports_source", "true")) + checks = append(checks, resource.TestCheckResourceAttr("iosxe_system.test", "ipv6_cef_load_sharing_algorithm_include_ports_destination", "true")) + checks = append(checks, resource.TestCheckResourceAttr("iosxe_system.test", "port_channel_load_balance", "src-dst-mixed-ip-port")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, @@ -213,6 +218,11 @@ func testAccIosxeSystemConfig_all() string { config += ` ip_domain_list_vrf_domain = "example.com"` + "\n" config += ` ip_domain_list_vrf = "VRF1"` + "\n" config += ` ip_routing_protocol_purge_interface = true` + "\n" + config += ` ip_cef_load_sharing_algorithm_include_ports_source = true` + "\n" + config += ` ip_cef_load_sharing_algorithm_include_ports_destination = true` + "\n" + config += ` ipv6_cef_load_sharing_algorithm_include_ports_source = true` + "\n" + config += ` ipv6_cef_load_sharing_algorithm_include_ports_destination = true` + "\n" + config += ` port_channel_load_balance = "src-dst-mixed-ip-port"` + "\n" config += ` depends_on = [iosxe_restconf.PreReq0, ]` + "\n" config += `}` + "\n" return config From 60fbcb57e907268d5468cddae81e87e7377faa7c Mon Sep 17 00:00:00 2001 From: Christopher Hart Date: Thu, 6 Nov 2025 13:56:27 -0500 Subject: [PATCH 4/5] fix: correct YANG paths to include module names --- gen/definitions/system.yaml | 18 +++---- internal/provider/model_iosxe_system.go | 68 ++++++++++++------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/gen/definitions/system.yaml b/gen/definitions/system.yaml index e97102b99..484c75575 100644 --- a/gen/definitions/system.yaml +++ b/gen/definitions/system.yaml @@ -651,23 +651,23 @@ attributes: - yang_name: ip/routing-new/routing/protocol/purge/interface tf_name: ip_routing_protocol_purge_interface example: true - - yang_name: ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/alg-type/include-ports/ios-cef:include-ports-v2/source - xpath: ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source + - yang_name: ip/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/Cisco-IOS-XE-cef:algorithm-v2/alg-type/include-ports/Cisco-IOS-XE-cef:include-ports-v2/source + xpath: ip/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/source tf_name: ip_cef_load_sharing_algorithm_include_ports_source example: true - - yang_name: ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/alg-type/include-ports/ios-cef:include-ports-v2/destination - xpath: ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination + - yang_name: ip/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/Cisco-IOS-XE-cef:algorithm-v2/alg-type/include-ports/Cisco-IOS-XE-cef:include-ports-v2/destination + xpath: ip/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/destination tf_name: ip_cef_load_sharing_algorithm_include_ports_destination example: true - - yang_name: ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/alg-type/include-ports/ios-cef:include-ports-v2/source - xpath: ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source + - yang_name: ipv6/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/Cisco-IOS-XE-cef:algorithm-v2/alg-type/include-ports/Cisco-IOS-XE-cef:include-ports-v2/source + xpath: ipv6/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/source tf_name: ipv6_cef_load_sharing_algorithm_include_ports_source example: true - - yang_name: ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/alg-type/include-ports/ios-cef:include-ports-v2/destination - xpath: ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination + - yang_name: ipv6/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/Cisco-IOS-XE-cef:algorithm-v2/alg-type/include-ports/Cisco-IOS-XE-cef:include-ports-v2/destination + xpath: ipv6/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/destination tf_name: ipv6_cef_load_sharing_algorithm_include_ports_destination example: true - - yang_name: port-channel/ios-eth:load-balance/load-balance + - yang_name: port-channel/Cisco-IOS-XE-ethernet:load-balance/load-balance tf_name: port_channel_load_balance example: src-dst-mixed-ip-port diff --git a/internal/provider/model_iosxe_system.go b/internal/provider/model_iosxe_system.go index 9f379c604..0b6cbe162 100644 --- a/internal/provider/model_iosxe_system.go +++ b/internal/provider/model_iosxe_system.go @@ -835,26 +835,26 @@ func (data System) toBody(ctx context.Context) string { } if !data.IpCefLoadSharingAlgorithmIncludePortsSource.IsNull() && !data.IpCefLoadSharingAlgorithmIncludePortsSource.IsUnknown() { if data.IpCefLoadSharingAlgorithmIncludePortsSource.ValueBool() { - body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source", map[string]string{}) + body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ip.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.source", map[string]string{}) } } if !data.IpCefLoadSharingAlgorithmIncludePortsDestination.IsNull() && !data.IpCefLoadSharingAlgorithmIncludePortsDestination.IsUnknown() { if data.IpCefLoadSharingAlgorithmIncludePortsDestination.ValueBool() { - body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination", map[string]string{}) + body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ip.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.destination", map[string]string{}) } } if !data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsNull() && !data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsUnknown() { if data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.ValueBool() { - body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source", map[string]string{}) + body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ipv6.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.source", map[string]string{}) } } if !data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsNull() && !data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsUnknown() { if data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.ValueBool() { - body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination", map[string]string{}) + body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ipv6.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.destination", map[string]string{}) } } if !data.PortChannelLoadBalance.IsNull() && !data.PortChannelLoadBalance.IsUnknown() { - body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"port-channel.ios-eth:load-balance.load-balance", data.PortChannelLoadBalance.ValueString()) + body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"port-channel.Cisco-IOS-XE-ethernet:load-balance.load-balance", data.PortChannelLoadBalance.ValueString()) } if len(data.MulticastRoutingVrfs) > 0 { body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ip.Cisco-IOS-XE-multicast:multicast-routing.vrf", []interface{}{}) @@ -2166,7 +2166,7 @@ func (data *System) updateFromBody(ctx context.Context, res gjson.Result) { } else { data.IpRoutingProtocolPurgeInterface = types.BoolNull() } - if value := res.Get(prefix + "ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source"); !data.IpCefLoadSharingAlgorithmIncludePortsSource.IsNull() { + if value := res.Get(prefix + "ip.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.source"); !data.IpCefLoadSharingAlgorithmIncludePortsSource.IsNull() { if value.Exists() { data.IpCefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(true) } else { @@ -2175,7 +2175,7 @@ func (data *System) updateFromBody(ctx context.Context, res gjson.Result) { } else { data.IpCefLoadSharingAlgorithmIncludePortsSource = types.BoolNull() } - if value := res.Get(prefix + "ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination"); !data.IpCefLoadSharingAlgorithmIncludePortsDestination.IsNull() { + if value := res.Get(prefix + "ip.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.destination"); !data.IpCefLoadSharingAlgorithmIncludePortsDestination.IsNull() { if value.Exists() { data.IpCefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(true) } else { @@ -2184,7 +2184,7 @@ func (data *System) updateFromBody(ctx context.Context, res gjson.Result) { } else { data.IpCefLoadSharingAlgorithmIncludePortsDestination = types.BoolNull() } - if value := res.Get(prefix + "ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source"); !data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsNull() { + if value := res.Get(prefix + "ipv6.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.source"); !data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsNull() { if value.Exists() { data.Ipv6CefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(true) } else { @@ -2193,7 +2193,7 @@ func (data *System) updateFromBody(ctx context.Context, res gjson.Result) { } else { data.Ipv6CefLoadSharingAlgorithmIncludePortsSource = types.BoolNull() } - if value := res.Get(prefix + "ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination"); !data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsNull() { + if value := res.Get(prefix + "ipv6.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.destination"); !data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsNull() { if value.Exists() { data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(true) } else { @@ -2202,7 +2202,7 @@ func (data *System) updateFromBody(ctx context.Context, res gjson.Result) { } else { data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination = types.BoolNull() } - if value := res.Get(prefix + "port-channel.ios-eth:load-balance.load-balance"); value.Exists() && !data.PortChannelLoadBalance.IsNull() { + if value := res.Get(prefix + "port-channel.Cisco-IOS-XE-ethernet:load-balance.load-balance"); value.Exists() && !data.PortChannelLoadBalance.IsNull() { data.PortChannelLoadBalance = types.StringValue(value.String()) } else { data.PortChannelLoadBalance = types.StringNull() @@ -2850,27 +2850,27 @@ func (data *System) fromBody(ctx context.Context, res gjson.Result) { } else { data.IpRoutingProtocolPurgeInterface = types.BoolNull() } - if value := res.Get(prefix + "ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source"); value.Exists() { + if value := res.Get(prefix + "ip.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.source"); value.Exists() { data.IpCefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(true) } else { data.IpCefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(false) } - if value := res.Get(prefix + "ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination"); value.Exists() { + if value := res.Get(prefix + "ip.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.destination"); value.Exists() { data.IpCefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(true) } else { data.IpCefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(false) } - if value := res.Get(prefix + "ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source"); value.Exists() { + if value := res.Get(prefix + "ipv6.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.source"); value.Exists() { data.Ipv6CefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(true) } else { data.Ipv6CefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(false) } - if value := res.Get(prefix + "ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination"); value.Exists() { + if value := res.Get(prefix + "ipv6.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.destination"); value.Exists() { data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(true) } else { data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(false) } - if value := res.Get(prefix + "port-channel.ios-eth:load-balance.load-balance"); value.Exists() { + if value := res.Get(prefix + "port-channel.Cisco-IOS-XE-ethernet:load-balance.load-balance"); value.Exists() { data.PortChannelLoadBalance = types.StringValue(value.String()) } } @@ -3516,27 +3516,27 @@ func (data *SystemData) fromBody(ctx context.Context, res gjson.Result) { } else { data.IpRoutingProtocolPurgeInterface = types.BoolNull() } - if value := res.Get(prefix + "ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source"); value.Exists() { + if value := res.Get(prefix + "ip.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.source"); value.Exists() { data.IpCefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(true) } else { data.IpCefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(false) } - if value := res.Get(prefix + "ip.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination"); value.Exists() { + if value := res.Get(prefix + "ip.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.destination"); value.Exists() { data.IpCefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(true) } else { data.IpCefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(false) } - if value := res.Get(prefix + "ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.source"); value.Exists() { + if value := res.Get(prefix + "ipv6.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.source"); value.Exists() { data.Ipv6CefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(true) } else { data.Ipv6CefLoadSharingAlgorithmIncludePortsSource = types.BoolValue(false) } - if value := res.Get(prefix + "ipv6.cef-v2.ios-cef:load-sharing-v2.ios-cef:algorithm-v2.ios-cef:include-ports-v2.destination"); value.Exists() { + if value := res.Get(prefix + "ipv6.cef-v2.Cisco-IOS-XE-cef:load-sharing-v2.algorithm-v2.include-ports-v2.destination"); value.Exists() { data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(true) } else { data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination = types.BoolValue(false) } - if value := res.Get(prefix + "port-channel.ios-eth:load-balance.load-balance"); value.Exists() { + if value := res.Get(prefix + "port-channel.Cisco-IOS-XE-ethernet:load-balance.load-balance"); value.Exists() { data.PortChannelLoadBalance = types.StringValue(value.String()) } } @@ -3548,19 +3548,19 @@ func (data *SystemData) fromBody(ctx context.Context, res gjson.Result) { func (data *System) getDeletedItems(ctx context.Context, state System) []string { deletedItems := make([]string, 0) if !state.PortChannelLoadBalance.IsNull() && data.PortChannelLoadBalance.IsNull() { - deletedItems = append(deletedItems, fmt.Sprintf("%v/port-channel/ios-eth:load-balance/load-balance", state.getPath())) + deletedItems = append(deletedItems, fmt.Sprintf("%v/port-channel/Cisco-IOS-XE-ethernet:load-balance/load-balance", state.getPath())) } if !state.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsNull() && data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsNull() { - deletedItems = append(deletedItems, fmt.Sprintf("%v/ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination", state.getPath())) + deletedItems = append(deletedItems, fmt.Sprintf("%v/ipv6/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/destination", state.getPath())) } if !state.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsNull() && data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsNull() { - deletedItems = append(deletedItems, fmt.Sprintf("%v/ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source", state.getPath())) + deletedItems = append(deletedItems, fmt.Sprintf("%v/ipv6/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/source", state.getPath())) } if !state.IpCefLoadSharingAlgorithmIncludePortsDestination.IsNull() && data.IpCefLoadSharingAlgorithmIncludePortsDestination.IsNull() { - deletedItems = append(deletedItems, fmt.Sprintf("%v/ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination", state.getPath())) + deletedItems = append(deletedItems, fmt.Sprintf("%v/ip/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/destination", state.getPath())) } if !state.IpCefLoadSharingAlgorithmIncludePortsSource.IsNull() && data.IpCefLoadSharingAlgorithmIncludePortsSource.IsNull() { - deletedItems = append(deletedItems, fmt.Sprintf("%v/ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source", state.getPath())) + deletedItems = append(deletedItems, fmt.Sprintf("%v/ip/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/source", state.getPath())) } if !state.IpRoutingProtocolPurgeInterface.IsNull() && data.IpRoutingProtocolPurgeInterface.IsNull() { deletedItems = append(deletedItems, fmt.Sprintf("%v/ip/routing-new/routing/protocol/purge/interface", state.getPath())) @@ -4367,16 +4367,16 @@ func (data *System) getDeletedItems(ctx context.Context, state System) []string func (data *System) getEmptyLeafsDelete(ctx context.Context) []string { emptyLeafsDelete := make([]string, 0) if !data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsNull() && !data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.ValueBool() { - emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination", data.getPath())) + emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/ipv6/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/destination", data.getPath())) } if !data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsNull() && !data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.ValueBool() { - emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source", data.getPath())) + emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/ipv6/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/source", data.getPath())) } if !data.IpCefLoadSharingAlgorithmIncludePortsDestination.IsNull() && !data.IpCefLoadSharingAlgorithmIncludePortsDestination.ValueBool() { - emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination", data.getPath())) + emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/ip/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/destination", data.getPath())) } if !data.IpCefLoadSharingAlgorithmIncludePortsSource.IsNull() && !data.IpCefLoadSharingAlgorithmIncludePortsSource.ValueBool() { - emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source", data.getPath())) + emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/ip/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/source", data.getPath())) } for i := range data.TrackObjects { @@ -4476,19 +4476,19 @@ func (data *System) getEmptyLeafsDelete(ctx context.Context) []string { func (data *System) getDeletePaths(ctx context.Context) []string { var deletePaths []string if !data.PortChannelLoadBalance.IsNull() { - deletePaths = append(deletePaths, fmt.Sprintf("%v/port-channel/ios-eth:load-balance/load-balance", data.getPath())) + deletePaths = append(deletePaths, fmt.Sprintf("%v/port-channel/Cisco-IOS-XE-ethernet:load-balance/load-balance", data.getPath())) } if !data.Ipv6CefLoadSharingAlgorithmIncludePortsDestination.IsNull() { - deletePaths = append(deletePaths, fmt.Sprintf("%v/ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination", data.getPath())) + deletePaths = append(deletePaths, fmt.Sprintf("%v/ipv6/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/destination", data.getPath())) } if !data.Ipv6CefLoadSharingAlgorithmIncludePortsSource.IsNull() { - deletePaths = append(deletePaths, fmt.Sprintf("%v/ipv6/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source", data.getPath())) + deletePaths = append(deletePaths, fmt.Sprintf("%v/ipv6/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/source", data.getPath())) } if !data.IpCefLoadSharingAlgorithmIncludePortsDestination.IsNull() { - deletePaths = append(deletePaths, fmt.Sprintf("%v/ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/destination", data.getPath())) + deletePaths = append(deletePaths, fmt.Sprintf("%v/ip/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/destination", data.getPath())) } if !data.IpCefLoadSharingAlgorithmIncludePortsSource.IsNull() { - deletePaths = append(deletePaths, fmt.Sprintf("%v/ip/cef-v2/ios-cef:load-sharing-v2/ios-cef:algorithm-v2/ios-cef:include-ports-v2/source", data.getPath())) + deletePaths = append(deletePaths, fmt.Sprintf("%v/ip/cef-v2/Cisco-IOS-XE-cef:load-sharing-v2/algorithm-v2/include-ports-v2/source", data.getPath())) } if !data.IpRoutingProtocolPurgeInterface.IsNull() { deletePaths = append(deletePaths, fmt.Sprintf("%v/ip/routing-new/routing/protocol/purge/interface", data.getPath())) From b432c14fb4c2a1ad79f1ef46459d0f740db84ea1 Mon Sep 17 00:00:00 2001 From: Christopher Hart Date: Thu, 6 Nov 2025 16:45:59 -0500 Subject: [PATCH 5/5] chore(docs): update changelog --- CHANGELOG.md | 1 + docs/guides/changelog.md | 1 + templates/guides/changelog.md.tmpl | 1 + 3 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ae6c484e..fea5ad91f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Add `ip_ssh_bulk_mode` and `ip_ssh_bulk_mode_window_size` attributes to `iosxe_system` resource and data source - Add `set_ip_next_hop_unchanged` attribute to `iosxe_route_map` resource and data source - Enhance `set_communities` attribute documentation in `iosxe_route_map` to clarify support for well-known BGP community values (internet, local-AS, no-advertise, no-export, gshut) +- Add `ip_cef_load_sharing_algorithm_include_ports_source`, `ip_cef_load_sharing_algorithm_include_ports_destination`, `ipv6_cef_load_sharing_algorithm_include_ports_source`, `ipv6_cef_load_sharing_algorithm_include_ports_destination`, and `port_channel_load_balance` attributes to `iosxe_system` resource and data source ## 0.9.3 diff --git a/docs/guides/changelog.md b/docs/guides/changelog.md index 7fa3bd4df..56a276381 100644 --- a/docs/guides/changelog.md +++ b/docs/guides/changelog.md @@ -16,6 +16,7 @@ description: |- - Add `ip_ssh_bulk_mode` and `ip_ssh_bulk_mode_window_size` attributes to `iosxe_system` resource and data source - Add `set_ip_next_hop_unchanged` attribute to `iosxe_route_map` resource and data source - Enhance `set_communities` attribute documentation in `iosxe_route_map` to clarify support for well-known BGP community values (internet, local-AS, no-advertise, no-export, gshut) +- Add `ip_cef_load_sharing_algorithm_include_ports_source`, `ip_cef_load_sharing_algorithm_include_ports_destination`, `ipv6_cef_load_sharing_algorithm_include_ports_source`, `ipv6_cef_load_sharing_algorithm_include_ports_destination`, and `port_channel_load_balance` attributes to `iosxe_system` resource and data source ## 0.9.3 diff --git a/templates/guides/changelog.md.tmpl b/templates/guides/changelog.md.tmpl index 7fa3bd4df..56a276381 100644 --- a/templates/guides/changelog.md.tmpl +++ b/templates/guides/changelog.md.tmpl @@ -16,6 +16,7 @@ description: |- - Add `ip_ssh_bulk_mode` and `ip_ssh_bulk_mode_window_size` attributes to `iosxe_system` resource and data source - Add `set_ip_next_hop_unchanged` attribute to `iosxe_route_map` resource and data source - Enhance `set_communities` attribute documentation in `iosxe_route_map` to clarify support for well-known BGP community values (internet, local-AS, no-advertise, no-export, gshut) +- Add `ip_cef_load_sharing_algorithm_include_ports_source`, `ip_cef_load_sharing_algorithm_include_ports_destination`, `ipv6_cef_load_sharing_algorithm_include_ports_source`, `ipv6_cef_load_sharing_algorithm_include_ports_destination`, and `port_channel_load_balance` attributes to `iosxe_system` resource and data source ## 0.9.3