cisco_node_utils_mgx 2.1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.rubocop.yml +96 -0
- data/.travis.yml +17 -0
- data/CHANGELOG.md +676 -0
- data/CONTRIBUTING.md +43 -0
- data/Gemfile +10 -0
- data/LICENSE +201 -0
- data/README.md +246 -0
- data/Rakefile +44 -0
- data/SUPPORT.md +3 -0
- data/bin/.rubocop.yml +18 -0
- data/bin/check_metric_limits.rb +109 -0
- data/bin/git/hooks/commit-msg/enforce_style +89 -0
- data/bin/git/hooks/hook_lib +115 -0
- data/bin/git/hooks/hooks-wrapper +38 -0
- data/bin/git/hooks/post-flow-hotfix-start/update-version +24 -0
- data/bin/git/hooks/post-flow-release-finish/update-version +29 -0
- data/bin/git/hooks/post-flow-release-start/update-version +19 -0
- data/bin/git/hooks/post-merge/update-hooks +6 -0
- data/bin/git/hooks/post-rewrite/update-hooks +6 -0
- data/bin/git/hooks/pre-commit/check_unstaged_changes +18 -0
- data/bin/git/hooks/pre-commit/rubocop +25 -0
- data/bin/git/hooks/pre-commit/validate-diffs +45 -0
- data/bin/git/hooks/pre-commit/validate-yaml +18 -0
- data/bin/git/hooks/pre-push/check-changelog +24 -0
- data/bin/git/hooks/pre-push/rubocop +7 -0
- data/bin/git/update-hooks +123 -0
- data/bin/show_running_yang.rb +233 -0
- data/cisco_node_utils.gemspec +41 -0
- data/docs/README-develop-best-practices.md +521 -0
- data/docs/README-develop-node-utils-APIs.md +570 -0
- data/docs/README-maintainers.md +77 -0
- data/docs/README-test-execution.md +57 -0
- data/docs/README-utilities.md +14 -0
- data/docs/agent_files.png +0 -0
- data/docs/cisco_node_utils.yaml.example +36 -0
- data/docs/template-router.rb +123 -0
- data/docs/template-test_router.rb +104 -0
- data/ext/mkrf_conf.rb +63 -0
- data/lib/.rubocop.yml +18 -0
- data/lib/cisco_node_utils/aaa_authentication_login.rb +95 -0
- data/lib/cisco_node_utils/aaa_authentication_login_service.rb +138 -0
- data/lib/cisco_node_utils/aaa_authorization_service.rb +156 -0
- data/lib/cisco_node_utils/ace.rb +467 -0
- data/lib/cisco_node_utils/acl.rb +101 -0
- data/lib/cisco_node_utils/banner.rb +63 -0
- data/lib/cisco_node_utils/bfd_global.rb +305 -0
- data/lib/cisco_node_utils/bgp.rb +988 -0
- data/lib/cisco_node_utils/bgp_af.rb +545 -0
- data/lib/cisco_node_utils/bgp_af_aggr_addr.rb +207 -0
- data/lib/cisco_node_utils/bgp_neighbor.rb +527 -0
- data/lib/cisco_node_utils/bgp_neighbor_af.rb +780 -0
- data/lib/cisco_node_utils/bridge_domain.rb +178 -0
- data/lib/cisco_node_utils/bridge_domain_vni.rb +206 -0
- data/lib/cisco_node_utils/cisco_cmn_utils.rb +444 -0
- data/lib/cisco_node_utils/client/client.rb +238 -0
- data/lib/cisco_node_utils/client/grpc/client.rb +395 -0
- data/lib/cisco_node_utils/client/grpc/ems.proto +148 -0
- data/lib/cisco_node_utils/client/grpc/ems.rb +111 -0
- data/lib/cisco_node_utils/client/grpc/ems_services.rb +49 -0
- data/lib/cisco_node_utils/client/grpc.rb +33 -0
- data/lib/cisco_node_utils/client/nxapi/client.rb +368 -0
- data/lib/cisco_node_utils/client/nxapi.rb +31 -0
- data/lib/cisco_node_utils/client/utils.rb +180 -0
- data/lib/cisco_node_utils/client.rb +35 -0
- data/lib/cisco_node_utils/cmd_ref/README_YAML.md +590 -0
- data/lib/cisco_node_utils/cmd_ref/aaa_auth_login_service.yaml +25 -0
- data/lib/cisco_node_utils/cmd_ref/aaa_authentication_login.yaml +38 -0
- data/lib/cisco_node_utils/cmd_ref/aaa_authorization_service.yaml +40 -0
- data/lib/cisco_node_utils/cmd_ref/acl.yaml +48 -0
- data/lib/cisco_node_utils/cmd_ref/banner.yaml +11 -0
- data/lib/cisco_node_utils/cmd_ref/bfd_global.yaml +117 -0
- data/lib/cisco_node_utils/cmd_ref/bgp.yaml +383 -0
- data/lib/cisco_node_utils/cmd_ref/bgp_af.yaml +223 -0
- data/lib/cisco_node_utils/cmd_ref/bgp_af_aa.yaml +38 -0
- data/lib/cisco_node_utils/cmd_ref/bgp_neighbor.yaml +174 -0
- data/lib/cisco_node_utils/cmd_ref/bgp_neighbor_af.yaml +236 -0
- data/lib/cisco_node_utils/cmd_ref/bridge_domain.yaml +49 -0
- data/lib/cisco_node_utils/cmd_ref/bridge_domain_vni.yaml +33 -0
- data/lib/cisco_node_utils/cmd_ref/dhcp_relay_global.yaml +128 -0
- data/lib/cisco_node_utils/cmd_ref/dnsclient.yaml +55 -0
- data/lib/cisco_node_utils/cmd_ref/encapsulation.yaml +25 -0
- data/lib/cisco_node_utils/cmd_ref/evpn_multicast.yaml +12 -0
- data/lib/cisco_node_utils/cmd_ref/evpn_multisite.yaml +18 -0
- data/lib/cisco_node_utils/cmd_ref/evpn_stormcontrol.yaml +18 -0
- data/lib/cisco_node_utils/cmd_ref/evpn_vni.yaml +48 -0
- data/lib/cisco_node_utils/cmd_ref/fabricpath.yaml +183 -0
- data/lib/cisco_node_utils/cmd_ref/fabricpath_topology.yaml +40 -0
- data/lib/cisco_node_utils/cmd_ref/feature.yaml +126 -0
- data/lib/cisco_node_utils/cmd_ref/hostname.yaml +8 -0
- data/lib/cisco_node_utils/cmd_ref/hsrp_global.yaml +25 -0
- data/lib/cisco_node_utils/cmd_ref/images.yaml +8 -0
- data/lib/cisco_node_utils/cmd_ref/interface.yaml +781 -0
- data/lib/cisco_node_utils/cmd_ref/interface_channel_group.yaml +45 -0
- data/lib/cisco_node_utils/cmd_ref/interface_evpn_multisite.yaml +17 -0
- data/lib/cisco_node_utils/cmd_ref/interface_hsrp_group.yaml +120 -0
- data/lib/cisco_node_utils/cmd_ref/interface_ospf.yaml +112 -0
- data/lib/cisco_node_utils/cmd_ref/interface_portchannel.yaml +87 -0
- data/lib/cisco_node_utils/cmd_ref/interface_service_vni.yaml +42 -0
- data/lib/cisco_node_utils/cmd_ref/inventory.yaml +45 -0
- data/lib/cisco_node_utils/cmd_ref/ip_multicast.yaml +22 -0
- data/lib/cisco_node_utils/cmd_ref/itd_device_group.yaml +83 -0
- data/lib/cisco_node_utils/cmd_ref/itd_service.yaml +119 -0
- data/lib/cisco_node_utils/cmd_ref/memory.yaml +24 -0
- data/lib/cisco_node_utils/cmd_ref/ntp_auth_key.yaml +10 -0
- data/lib/cisco_node_utils/cmd_ref/ntp_config.yaml +27 -0
- data/lib/cisco_node_utils/cmd_ref/ntp_server.yaml +34 -0
- data/lib/cisco_node_utils/cmd_ref/object_group.yaml +32 -0
- data/lib/cisco_node_utils/cmd_ref/ospf.yaml +91 -0
- data/lib/cisco_node_utils/cmd_ref/ospf_area.yaml +91 -0
- data/lib/cisco_node_utils/cmd_ref/ospf_area_vlink.yaml +88 -0
- data/lib/cisco_node_utils/cmd_ref/overlay_global.yaml +37 -0
- data/lib/cisco_node_utils/cmd_ref/pim.yaml +43 -0
- data/lib/cisco_node_utils/cmd_ref/portchannel_global.yaml +86 -0
- data/lib/cisco_node_utils/cmd_ref/radius_global.yaml +37 -0
- data/lib/cisco_node_utils/cmd_ref/radius_server.yaml +100 -0
- data/lib/cisco_node_utils/cmd_ref/radius_server_group.yaml +19 -0
- data/lib/cisco_node_utils/cmd_ref/route_map.yaml +601 -0
- data/lib/cisco_node_utils/cmd_ref/show_system.yaml +9 -0
- data/lib/cisco_node_utils/cmd_ref/show_version.yaml +84 -0
- data/lib/cisco_node_utils/cmd_ref/snmp_community.yaml +81 -0
- data/lib/cisco_node_utils/cmd_ref/snmp_group.yaml +9 -0
- data/lib/cisco_node_utils/cmd_ref/snmp_notification_receiver.yaml +74 -0
- data/lib/cisco_node_utils/cmd_ref/snmp_server.yaml +91 -0
- data/lib/cisco_node_utils/cmd_ref/snmp_user.yaml +57 -0
- data/lib/cisco_node_utils/cmd_ref/snmpnotification.yaml +23 -0
- data/lib/cisco_node_utils/cmd_ref/span_session.yaml +65 -0
- data/lib/cisco_node_utils/cmd_ref/stp_global.yaml +235 -0
- data/lib/cisco_node_utils/cmd_ref/syslog_facility.yaml +10 -0
- data/lib/cisco_node_utils/cmd_ref/syslog_server.yaml +34 -0
- data/lib/cisco_node_utils/cmd_ref/syslog_settings.yaml +45 -0
- data/lib/cisco_node_utils/cmd_ref/system.yaml +7 -0
- data/lib/cisco_node_utils/cmd_ref/tacacs_global.yaml +37 -0
- data/lib/cisco_node_utils/cmd_ref/tacacs_server.yaml +63 -0
- data/lib/cisco_node_utils/cmd_ref/tacacs_server_group.yaml +45 -0
- data/lib/cisco_node_utils/cmd_ref/tacacs_server_host.yaml +64 -0
- data/lib/cisco_node_utils/cmd_ref/upgrade.yaml +38 -0
- data/lib/cisco_node_utils/cmd_ref/vdc.yaml +52 -0
- data/lib/cisco_node_utils/cmd_ref/virtual_service.yaml +8 -0
- data/lib/cisco_node_utils/cmd_ref/vlan.yaml +106 -0
- data/lib/cisco_node_utils/cmd_ref/vpc.yaml +233 -0
- data/lib/cisco_node_utils/cmd_ref/vrf.yaml +86 -0
- data/lib/cisco_node_utils/cmd_ref/vrf_af.yaml +139 -0
- data/lib/cisco_node_utils/cmd_ref/vtp.yaml +32 -0
- data/lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml +114 -0
- data/lib/cisco_node_utils/cmd_ref/vxlan_vtep_vni.yaml +71 -0
- data/lib/cisco_node_utils/cmd_ref/yang.yaml +7 -0
- data/lib/cisco_node_utils/cmd_ref/yum.yaml +68 -0
- data/lib/cisco_node_utils/command_reference.rb +724 -0
- data/lib/cisco_node_utils/configparser_lib.rb +195 -0
- data/lib/cisco_node_utils/constants.rb +40 -0
- data/lib/cisco_node_utils/dhcp_relay_global.rb +302 -0
- data/lib/cisco_node_utils/dns_domain.rb +93 -0
- data/lib/cisco_node_utils/domain_name.rb +82 -0
- data/lib/cisco_node_utils/encapsulation.rb +112 -0
- data/lib/cisco_node_utils/environment.rb +110 -0
- data/lib/cisco_node_utils/evpn_multicast.rb +66 -0
- data/lib/cisco_node_utils/evpn_multisite.rb +96 -0
- data/lib/cisco_node_utils/evpn_stormcontrol.rb +84 -0
- data/lib/cisco_node_utils/evpn_vni.rb +159 -0
- data/lib/cisco_node_utils/exceptions.rb +140 -0
- data/lib/cisco_node_utils/fabricpath_global.rb +405 -0
- data/lib/cisco_node_utils/fabricpath_topology.rb +137 -0
- data/lib/cisco_node_utils/feature.rb +377 -0
- data/lib/cisco_node_utils/hostname.rb +62 -0
- data/lib/cisco_node_utils/hsrp_global.rb +97 -0
- data/lib/cisco_node_utils/interface.rb +2128 -0
- data/lib/cisco_node_utils/interface_channel_group.rb +142 -0
- data/lib/cisco_node_utils/interface_evpn_multisite.rb +72 -0
- data/lib/cisco_node_utils/interface_hsrp_group.rb +557 -0
- data/lib/cisco_node_utils/interface_ospf.rb +378 -0
- data/lib/cisco_node_utils/interface_portchannel.rb +180 -0
- data/lib/cisco_node_utils/interface_service_vni.rb +132 -0
- data/lib/cisco_node_utils/ip_multicast.rb +90 -0
- data/lib/cisco_node_utils/itd_device_group.rb +228 -0
- data/lib/cisco_node_utils/itd_device_group_node.rb +144 -0
- data/lib/cisco_node_utils/itd_service.rb +511 -0
- data/lib/cisco_node_utils/logger.rb +78 -0
- data/lib/cisco_node_utils/name_server.rb +64 -0
- data/lib/cisco_node_utils/node.rb +443 -0
- data/lib/cisco_node_utils/node_util.rb +111 -0
- data/lib/cisco_node_utils/ntp_auth_key.rb +67 -0
- data/lib/cisco_node_utils/ntp_config.rb +83 -0
- data/lib/cisco_node_utils/ntp_server.rb +86 -0
- data/lib/cisco_node_utils/object_group.rb +75 -0
- data/lib/cisco_node_utils/object_group_entry.rb +143 -0
- data/lib/cisco_node_utils/overlay_global.rb +142 -0
- data/lib/cisco_node_utils/pim.rb +131 -0
- data/lib/cisco_node_utils/pim_group_list.rb +109 -0
- data/lib/cisco_node_utils/pim_rp_address.rb +103 -0
- data/lib/cisco_node_utils/platform.rb +217 -0
- data/lib/cisco_node_utils/portchannel_global.rb +347 -0
- data/lib/cisco_node_utils/radius_global.rb +165 -0
- data/lib/cisco_node_utils/radius_server.rb +421 -0
- data/lib/cisco_node_utils/radius_server_group.rb +117 -0
- data/lib/cisco_node_utils/route_map.rb +2540 -0
- data/lib/cisco_node_utils/router_ospf.rb +77 -0
- data/lib/cisco_node_utils/router_ospf_area.rb +416 -0
- data/lib/cisco_node_utils/router_ospf_area_vlink.rb +313 -0
- data/lib/cisco_node_utils/router_ospf_vrf.rb +342 -0
- data/lib/cisco_node_utils/snmp_notification_receiver.rb +176 -0
- data/lib/cisco_node_utils/snmpcommunity.rb +109 -0
- data/lib/cisco_node_utils/snmpgroup.rb +54 -0
- data/lib/cisco_node_utils/snmpnotification.rb +57 -0
- data/lib/cisco_node_utils/snmpserver.rb +132 -0
- data/lib/cisco_node_utils/snmpuser.rb +403 -0
- data/lib/cisco_node_utils/span_session.rb +149 -0
- data/lib/cisco_node_utils/stp_global.rb +676 -0
- data/lib/cisco_node_utils/syslog_facility.rb +64 -0
- data/lib/cisco_node_utils/syslog_server.rb +146 -0
- data/lib/cisco_node_utils/syslog_settings.rb +174 -0
- data/lib/cisco_node_utils/tacacs_global.rb +137 -0
- data/lib/cisco_node_utils/tacacs_server.rb +173 -0
- data/lib/cisco_node_utils/tacacs_server_group.rb +149 -0
- data/lib/cisco_node_utils/tacacs_server_host.rb +216 -0
- data/lib/cisco_node_utils/upgrade.rb +122 -0
- data/lib/cisco_node_utils/vdc.rb +118 -0
- data/lib/cisco_node_utils/version.rb +21 -0
- data/lib/cisco_node_utils/vlan.rb +301 -0
- data/lib/cisco_node_utils/vpc.rb +466 -0
- data/lib/cisco_node_utils/vrf.rb +192 -0
- data/lib/cisco_node_utils/vrf_af.rb +327 -0
- data/lib/cisco_node_utils/vtp.rb +125 -0
- data/lib/cisco_node_utils/vxlan_vtep.rb +286 -0
- data/lib/cisco_node_utils/vxlan_vtep_vni.rb +331 -0
- data/lib/cisco_node_utils/yang.rb +160 -0
- data/lib/cisco_node_utils/yum.rb +213 -0
- data/lib/cisco_node_utils.rb +21 -0
- data/lib/minitest/environment_plugin.rb +31 -0
- data/lib/minitest/log_level_plugin.rb +41 -0
- data/spec/client_spec.rb +7 -0
- data/spec/environment_spec.rb +384 -0
- data/spec/grpc_client_spec.rb +23 -0
- data/spec/isolate/all_clients_spec.rb +9 -0
- data/spec/isolate/grpc_only_spec.rb +16 -0
- data/spec/isolate/no_clients_spec.rb +26 -0
- data/spec/isolate/nxapi_only_spec.rb +16 -0
- data/spec/nxapi_client_spec.rb +42 -0
- data/spec/schema.yaml +82 -0
- data/spec/shared_examples_for_clients.rb +14 -0
- data/spec/spec_helper.rb +91 -0
- data/spec/whitespace_spec.rb +10 -0
- data/spec/yaml_spec.rb +42 -0
- data/tests/.rubocop.yml +18 -0
- data/tests/CSCuxdublin-1.0.0-7.0.3.I3.1.lib32_n9000.rpm +0 -0
- data/tests/basetest.rb +243 -0
- data/tests/ciscotest.rb +577 -0
- data/tests/cmd_config.yaml +75 -0
- data/tests/cmd_config_invalid.yaml +16 -0
- data/tests/n9000_sample-1.0.0-7.0.3.x86_64.rpm +0 -0
- data/tests/noop.rb +7 -0
- data/tests/platform_info.rb +63 -0
- data/tests/tacacs_server.yaml.example +6 -0
- data/tests/test_aaa_authentication_login.rb +243 -0
- data/tests/test_aaa_authentication_login_service.rb +761 -0
- data/tests/test_aaa_authorization_service.rb +874 -0
- data/tests/test_ace.rb +304 -0
- data/tests/test_acl.rb +185 -0
- data/tests/test_banner.rb +85 -0
- data/tests/test_bfd_global.rb +272 -0
- data/tests/test_bgp_af.rb +875 -0
- data/tests/test_bgp_af_aa.rb +108 -0
- data/tests/test_bgp_neighbor.rb +596 -0
- data/tests/test_bgp_neighbor_af.rb +781 -0
- data/tests/test_bridge_domain.rb +198 -0
- data/tests/test_bridge_domain_vni.rb +109 -0
- data/tests/test_client_utils.rb +111 -0
- data/tests/test_cmn_utils.rb +76 -0
- data/tests/test_command_config.rb +206 -0
- data/tests/test_command_reference.rb +669 -0
- data/tests/test_dhcp_relay_global.rb +286 -0
- data/tests/test_dns_domain.rb +123 -0
- data/tests/test_domain_name.rb +96 -0
- data/tests/test_encapsulation.rb +75 -0
- data/tests/test_evpn_multicast.rb +65 -0
- data/tests/test_evpn_multisite.rb +70 -0
- data/tests/test_evpn_stormcontrol.rb +56 -0
- data/tests/test_evpn_vni.rb +131 -0
- data/tests/test_fabricpath_global.rb +246 -0
- data/tests/test_fabricpath_topology.rb +77 -0
- data/tests/test_feature.rb +272 -0
- data/tests/test_grpc.rb +166 -0
- data/tests/test_hostname.rb +64 -0
- data/tests/test_hsrp_global.rb +79 -0
- data/tests/test_interface.rb +1958 -0
- data/tests/test_interface_bdi.rb +80 -0
- data/tests/test_interface_channel_group.rb +131 -0
- data/tests/test_interface_evpn_multisite.rb +94 -0
- data/tests/test_interface_hsrp.rb +134 -0
- data/tests/test_interface_hsrp_group.rb +570 -0
- data/tests/test_interface_ospf.rb +820 -0
- data/tests/test_interface_portchannel.rb +135 -0
- data/tests/test_interface_private_vlan.rb +365 -0
- data/tests/test_interface_service_vni.rb +203 -0
- data/tests/test_interface_svi.rb +210 -0
- data/tests/test_interface_switchport.rb +468 -0
- data/tests/test_ip_multicast.rb +80 -0
- data/tests/test_itd_device_group.rb +145 -0
- data/tests/test_itd_device_group_node.rb +199 -0
- data/tests/test_itd_service.rb +314 -0
- data/tests/test_logger.rb +43 -0
- data/tests/test_name_server.rb +94 -0
- data/tests/test_node.rb +50 -0
- data/tests/test_node_ext.rb +406 -0
- data/tests/test_node_util.rb +119 -0
- data/tests/test_ntp_auth_key.rb +77 -0
- data/tests/test_ntp_config.rb +100 -0
- data/tests/test_ntp_server.rb +146 -0
- data/tests/test_nxapi.rb +236 -0
- data/tests/test_object_group.rb +122 -0
- data/tests/test_overlay_global.rb +108 -0
- data/tests/test_pim.rb +203 -0
- data/tests/test_pim_group_list.rb +147 -0
- data/tests/test_pim_rp_address.rb +155 -0
- data/tests/test_platform.rb +254 -0
- data/tests/test_portchannel_global.rb +322 -0
- data/tests/test_radius_global.rb +108 -0
- data/tests/test_radius_server.rb +377 -0
- data/tests/test_radius_server_group.rb +151 -0
- data/tests/test_route_map.rb +1479 -0
- data/tests/test_router_bgp.rb +1325 -0
- data/tests/test_router_ospf.rb +56 -0
- data/tests/test_router_ospf_area.rb +433 -0
- data/tests/test_router_ospf_area_vlink.rb +298 -0
- data/tests/test_router_ospf_vrf.rb +690 -0
- data/tests/test_snmp_notification_receiver.rb +169 -0
- data/tests/test_snmpcommunity.rb +422 -0
- data/tests/test_snmpgroup.rb +71 -0
- data/tests/test_snmpnotification.rb +91 -0
- data/tests/test_snmpserver.rb +251 -0
- data/tests/test_snmpuser.rb +666 -0
- data/tests/test_span_session.rb +155 -0
- data/tests/test_stp_global.rb +575 -0
- data/tests/test_syslog_facility.rb +80 -0
- data/tests/test_syslog_server.rb +119 -0
- data/tests/test_syslog_settings.rb +123 -0
- data/tests/test_tacacs_global.rb +109 -0
- data/tests/test_tacacs_server.rb +436 -0
- data/tests/test_tacacs_server_group.rb +434 -0
- data/tests/test_tacacs_server_host.rb +427 -0
- data/tests/test_upgrade.rb +105 -0
- data/tests/test_vdc.rb +64 -0
- data/tests/test_vlan.rb +386 -0
- data/tests/test_vlan_private.rb +656 -0
- data/tests/test_vpc.rb +548 -0
- data/tests/test_vrf.rb +248 -0
- data/tests/test_vrf_af.rb +288 -0
- data/tests/test_vtp.rb +278 -0
- data/tests/test_vxlan_vtep.rb +327 -0
- data/tests/test_vxlan_vtep_vni.rb +326 -0
- data/tests/test_yang.rb +369 -0
- data/tests/test_yum.rb +109 -0
- data/tests/upgrade_info.yaml.example +3 -0
- data/tests/yum_package.yaml +94 -0
- metadata +534 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
#
|
|
2
|
+
# NXAPI implementation of VXLAN_VTEP class
|
|
3
|
+
#
|
|
4
|
+
# November 2015, Deepak Cherian
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2015-2018 Cisco and/or its affiliates.
|
|
7
|
+
#
|
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
# you may not use this file except in compliance with the License.
|
|
10
|
+
# You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
|
|
20
|
+
require_relative 'node_util'
|
|
21
|
+
require_relative 'vrf'
|
|
22
|
+
|
|
23
|
+
module Cisco
|
|
24
|
+
# node_utils class for vxlan_vtep
|
|
25
|
+
class VxlanVtep < NodeUtil
|
|
26
|
+
attr_reader :name
|
|
27
|
+
|
|
28
|
+
def initialize(name, instantiate=true)
|
|
29
|
+
fail TypeError unless name.is_a?(String)
|
|
30
|
+
fail ArgumentError unless name.length > 0
|
|
31
|
+
@name = name.downcase
|
|
32
|
+
|
|
33
|
+
create if instantiate
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def self.vteps
|
|
37
|
+
hash = {}
|
|
38
|
+
return hash unless Feature.nv_overlay_enabled?
|
|
39
|
+
vtep_list = config_get('vxlan_vtep', 'all_interfaces')
|
|
40
|
+
return hash if vtep_list.nil?
|
|
41
|
+
|
|
42
|
+
vtep_list.each do |id|
|
|
43
|
+
id = id.downcase
|
|
44
|
+
hash[id] = VxlanVtep.new(id, false)
|
|
45
|
+
end
|
|
46
|
+
hash
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def self.mt_full_support
|
|
50
|
+
config_get('vxlan_vtep', 'mt_full_support')
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def self.mt_lite_support
|
|
54
|
+
config_get('vxlan_vtep', 'mt_lite_support')
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def create
|
|
58
|
+
if FabricpathGlobal.fabricpath_feature == :enabled &&
|
|
59
|
+
node.product_id[/N(5|6)K/]
|
|
60
|
+
fail 'VxLAN cannot be enabled with Fabricpath configured'
|
|
61
|
+
end
|
|
62
|
+
Feature.nv_overlay_enable
|
|
63
|
+
Feature.vn_segment_vlan_based_enable if VxlanVtep.mt_lite_support
|
|
64
|
+
# re-use the "interface command ref hooks"
|
|
65
|
+
config_set('interface', 'create', name: @name)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def destroy
|
|
69
|
+
# re-use the "interface command ref hooks"
|
|
70
|
+
config_set('interface', 'destroy', name: @name)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def ==(other)
|
|
74
|
+
name == other.name
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
########################################################
|
|
78
|
+
# PROPERTIES #
|
|
79
|
+
########################################################
|
|
80
|
+
|
|
81
|
+
def description
|
|
82
|
+
config_get('interface', 'description', name: @name, show_name: @name)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def description=(desc)
|
|
86
|
+
fail TypeError unless desc.is_a?(String)
|
|
87
|
+
state = desc.empty? ? 'no' : ''
|
|
88
|
+
config_set('interface', 'description',
|
|
89
|
+
name: @name, state: state, desc: desc)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def default_description
|
|
93
|
+
config_get_default('interface', 'description')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def host_reachability
|
|
97
|
+
hr = config_get('vxlan_vtep', 'host_reachability', name: @name)
|
|
98
|
+
hr == 'bgp' ? 'evpn' : hr
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def host_reachability=(val)
|
|
102
|
+
set_args = { name: @name, proto: 'bgp' }
|
|
103
|
+
if val.to_s == 'flood' && host_reachability == 'evpn'
|
|
104
|
+
set_args[:state] = 'no'
|
|
105
|
+
elsif val.to_s == 'evpn'
|
|
106
|
+
set_args[:state] = ''
|
|
107
|
+
else
|
|
108
|
+
return
|
|
109
|
+
end
|
|
110
|
+
config_set('vxlan_vtep', 'host_reachability', set_args)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def default_host_reachability
|
|
114
|
+
config_get_default('vxlan_vtep', 'host_reachability')
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def source_interface
|
|
118
|
+
config_get('vxlan_vtep', 'source_intf', name: @name)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def source_interface_set(val)
|
|
122
|
+
set_args = { name: @name, lpbk_intf: val }
|
|
123
|
+
set_args[:state] = val.empty? ? 'no' : ''
|
|
124
|
+
config_set('vxlan_vtep', 'source_intf', set_args)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def source_interface=(val)
|
|
128
|
+
# The source interface can only be changed if the nve
|
|
129
|
+
# interface is in a shutdown state.
|
|
130
|
+
current_state = shutdown
|
|
131
|
+
self.shutdown = true unless shutdown
|
|
132
|
+
source_interface_set(val)
|
|
133
|
+
self.shutdown = current_state
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def default_source_interface
|
|
137
|
+
config_get_default('vxlan_vtep', 'source_intf')
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def source_interface_hold_down_time
|
|
141
|
+
config_get('vxlan_vtep', 'source_intf_hold_down_time', name: @name)
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def source_interface_hold_down_time=(time)
|
|
145
|
+
state = time == default_source_interface_hold_down_time ? 'no' : ''
|
|
146
|
+
# Cli rejects removing hold-down-time without an argument, so make
|
|
147
|
+
# sure it is configured before attempting to remove it
|
|
148
|
+
if state == 'no'
|
|
149
|
+
time = source_interface_hold_down_time
|
|
150
|
+
unless time == default_source_interface_hold_down_time
|
|
151
|
+
config_set('vxlan_vtep', 'source_intf_hold_down_time', name: @name,
|
|
152
|
+
state: state, time: time)
|
|
153
|
+
end
|
|
154
|
+
else
|
|
155
|
+
config_set('vxlan_vtep', 'source_intf_hold_down_time', name: @name,
|
|
156
|
+
state: state, time: time)
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
def default_source_interface_hold_down_time
|
|
161
|
+
config_get_default('vxlan_vtep', 'source_intf_hold_down_time')
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def shutdown
|
|
165
|
+
config_get('vxlan_vtep', 'shutdown', name: @name)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
def shutdown=(bool)
|
|
169
|
+
state = (bool ? '' : 'no')
|
|
170
|
+
config_set('vxlan_vtep', 'shutdown', name: @name, state: state)
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def default_shutdown
|
|
174
|
+
config_get_default('vxlan_vtep', 'shutdown')
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
def multisite_border_gateway_interface
|
|
178
|
+
config_get('vxlan_vtep', 'multisite_bg_intf', name: @name)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
def multisite_border_gateway_interface=(val)
|
|
182
|
+
set_args = { name: @name }
|
|
183
|
+
set_args[:state] = val.empty? ? 'no' : ''
|
|
184
|
+
# rubocop:disable LineLength
|
|
185
|
+
set_args[:lpbk_intf] = val.empty? ? multisite_border_gateway_interface : val
|
|
186
|
+
# rubocop:enable LineLength
|
|
187
|
+
if set_args[:state] == 'no'
|
|
188
|
+
intf = multisite_border_gateway_interface
|
|
189
|
+
unless intf == default_multisite_border_gateway_interface
|
|
190
|
+
config_set('vxlan_vtep', 'multisite_bg_intf', set_args)
|
|
191
|
+
end
|
|
192
|
+
else
|
|
193
|
+
config_set('vxlan_vtep', 'multisite_bg_intf', set_args)
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
def default_multisite_border_gateway_interface
|
|
198
|
+
config_get_default('vxlan_vtep', 'multisite_bg_intf')
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def global_ingress_replication_bgp
|
|
202
|
+
config_get('vxlan_vtep', 'global_ingress_replication_bgp', name: @name)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
def global_ingress_replication_bgp=(state)
|
|
206
|
+
set_args = { name: @name }
|
|
207
|
+
if state
|
|
208
|
+
set_args[:state] = ''
|
|
209
|
+
# Host reachability must be enabled for this property
|
|
210
|
+
unless VxlanVtep.new(@name).host_reachability == 'evpn'
|
|
211
|
+
fail "Dependency: vxlan_vtep host_reachability must be 'evpn'."
|
|
212
|
+
end
|
|
213
|
+
config_set('vxlan_vtep', 'global_ingress_replication_bgp', set_args)
|
|
214
|
+
else
|
|
215
|
+
set_args[:state] = 'no'
|
|
216
|
+
config_set('vxlan_vtep',
|
|
217
|
+
'global_ingress_replication_bgp', set_args) if
|
|
218
|
+
global_ingress_replication_bgp
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
def default_global_ingress_replication_bgp
|
|
223
|
+
config_get_default('vxlan_vtep', 'global_ingress_replication_bgp')
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
def global_suppress_arp
|
|
227
|
+
config_get('vxlan_vtep', 'global_suppress_arp', name: @name)
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
def global_suppress_arp=(state)
|
|
231
|
+
set_args = { name: @name }
|
|
232
|
+
if state
|
|
233
|
+
set_args[:state] = ''
|
|
234
|
+
# Host reachability must be enabled for this property
|
|
235
|
+
unless VxlanVtep.new(@name).host_reachability == 'evpn'
|
|
236
|
+
fail "Dependency: vxlan_vtep host_reachability must be 'evpn'."
|
|
237
|
+
end
|
|
238
|
+
Feature.nv_overlay_evpn_enable if
|
|
239
|
+
Feature.nv_overlay_evpn_supported? && !Feature.nv_overlay_evpn_enabled?
|
|
240
|
+
config_set('vxlan_vtep', 'global_suppress_arp', set_args)
|
|
241
|
+
else
|
|
242
|
+
set_args[:state] = 'no'
|
|
243
|
+
config_set('vxlan_vtep',
|
|
244
|
+
'global_suppress_arp', set_args) if global_suppress_arp
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
def default_global_suppress_arp
|
|
249
|
+
config_get_default('vxlan_vtep', 'global_suppress_arp')
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
def global_mcast_group_l2
|
|
253
|
+
config_get('vxlan_vtep', 'global_mcast_group_l2', name: @name)
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
def global_mcast_group_l2=(val)
|
|
257
|
+
if val
|
|
258
|
+
set_args = { name: @name, ip: val, state: '' }
|
|
259
|
+
else
|
|
260
|
+
set_args = { name: @name, ip: '', state: 'no' }
|
|
261
|
+
end
|
|
262
|
+
config_set('vxlan_vtep', 'global_mcast_group_l2', set_args)
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
def default_global_mcast_group_l2
|
|
266
|
+
config_get_default('vxlan_vtep', 'global_mcast_group_l2')
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
def global_mcast_group_l3
|
|
270
|
+
config_get('vxlan_vtep', 'global_mcast_group_l3', name: @name)
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
def global_mcast_group_l3=(val)
|
|
274
|
+
if val
|
|
275
|
+
set_args = { name: @name, ip: val, state: '' }
|
|
276
|
+
else
|
|
277
|
+
set_args = { name: @name, ip: '', state: 'no' }
|
|
278
|
+
end
|
|
279
|
+
config_set('vxlan_vtep', 'global_mcast_group_l3', set_args)
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
def default_global_mcast_group_l3
|
|
283
|
+
config_get_default('vxlan_vtep', 'global_mcast_group_l3')
|
|
284
|
+
end
|
|
285
|
+
end # Class
|
|
286
|
+
end # Module
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
#
|
|
2
|
+
# NXAPI implementation of VxlanVtepVni class
|
|
3
|
+
#
|
|
4
|
+
# November 2015 Michael G Wiebe
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2015-2018 Cisco and/or its affiliates.
|
|
7
|
+
#
|
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
# you may not use this file except in compliance with the License.
|
|
10
|
+
# You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
|
|
20
|
+
require_relative 'cisco_cmn_utils'
|
|
21
|
+
require_relative 'node_util'
|
|
22
|
+
require_relative 'vxlan_vtep'
|
|
23
|
+
|
|
24
|
+
module Cisco
|
|
25
|
+
# VxlanVtepVni - node utility for vxlan vtep vni members.
|
|
26
|
+
class VxlanVtepVni < NodeUtil
|
|
27
|
+
attr_reader :name, :vni, :assoc_vrf
|
|
28
|
+
|
|
29
|
+
def initialize(name, vni, assoc_vrf=false, instantiate=true)
|
|
30
|
+
@name = name
|
|
31
|
+
@vni = vni
|
|
32
|
+
@assoc_vrf = assoc_vrf
|
|
33
|
+
|
|
34
|
+
set_args_keys_default
|
|
35
|
+
create if instantiate
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def self.vnis
|
|
39
|
+
hash = {}
|
|
40
|
+
VxlanVtep.vteps.each do |name, _obj|
|
|
41
|
+
hash[name] = {}
|
|
42
|
+
get_args = { name: name }
|
|
43
|
+
vni_list = config_get('vxlan_vtep_vni', 'all_vnis', get_args)
|
|
44
|
+
next if vni_list.nil?
|
|
45
|
+
vni_list.each do |vni, assoc_vrf|
|
|
46
|
+
assoc_vrf = assoc_vrf.nil? ? false : true
|
|
47
|
+
hash[name][vni] = VxlanVtepVni.new(name, vni, assoc_vrf, false)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
hash
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def ==(other)
|
|
54
|
+
(name == other.name) && (vni == other.vni) &&
|
|
55
|
+
(assoc_vrf == other.assoc_vrf)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def set_args_keys_default
|
|
59
|
+
keys = { name: @name, vni: @vni }
|
|
60
|
+
keys[:assoc_vrf] = @assoc_vrf ? 'associate-vrf' : ''
|
|
61
|
+
@get_args = @set_args = keys
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# rubocop:disable Style/AccessorMethodName
|
|
65
|
+
def set_args_keys(hash={})
|
|
66
|
+
set_args_keys_default
|
|
67
|
+
@set_args = @get_args.merge!(hash) unless hash.empty?
|
|
68
|
+
end
|
|
69
|
+
# rubocop:enable Style/AccessorMethodNamefor
|
|
70
|
+
|
|
71
|
+
def create_with_associate_vrf?
|
|
72
|
+
!@set_args[:assoc_vrf].eql?('')
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def destroy_existing(key)
|
|
76
|
+
getargs = { name: @name, vni: @vni, state: '' }
|
|
77
|
+
return unless config_get('vxlan_vtep', key, getargs)
|
|
78
|
+
getargs[:assoc_vrf] = key.eql?('vni_with_vrf') ? 'associate-vrf' : ''
|
|
79
|
+
getargs[:state] = 'no'
|
|
80
|
+
config_set('vxlan_vtep', 'vni', getargs)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def create
|
|
84
|
+
# The configuration for this resource can be either of the following:
|
|
85
|
+
# - member nve 5000
|
|
86
|
+
# - member nve 5000 associate-vrf
|
|
87
|
+
# They are mutually exclusive and one must be removed before the other
|
|
88
|
+
# can be configured.
|
|
89
|
+
set_args_keys(state: '')
|
|
90
|
+
if create_with_associate_vrf?
|
|
91
|
+
destroy_existing('vni_without_vrf')
|
|
92
|
+
else
|
|
93
|
+
destroy_existing('vni_with_vrf')
|
|
94
|
+
end
|
|
95
|
+
config_set('vxlan_vtep', 'vni', @set_args)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def destroy
|
|
99
|
+
set_args_keys(state: 'no')
|
|
100
|
+
config_set('vxlan_vtep', 'vni', @set_args)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
########################################################
|
|
104
|
+
# PROPERTIES #
|
|
105
|
+
########################################################
|
|
106
|
+
|
|
107
|
+
def ingress_replication_supported?
|
|
108
|
+
node.cmd_ref.supports?('vxlan_vtep_vni', 'ingress_replication')
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def ingress_replication
|
|
112
|
+
config_get('vxlan_vtep_vni', 'ingress_replication', @get_args)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def set_host_reachability(vtep_name, protocol)
|
|
116
|
+
# This is a helper method for the ingress_replication setter.
|
|
117
|
+
# In later versions of Nexus, a check was added to make sure
|
|
118
|
+
# the host_reachability setting is correct for the desired
|
|
119
|
+
# ingress_replication setting.
|
|
120
|
+
#
|
|
121
|
+
case protocol
|
|
122
|
+
when 'bgp'
|
|
123
|
+
host_reachability = 'evpn'
|
|
124
|
+
when 'static'
|
|
125
|
+
host_reachability = 'flood'
|
|
126
|
+
else
|
|
127
|
+
fail "Protocol #{protocol} currently not supported"
|
|
128
|
+
end
|
|
129
|
+
VxlanVtep.new(vtep_name).host_reachability = host_reachability
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def remove_add_ingress_replication(protocol)
|
|
133
|
+
# Note: ingress-replication is not supported on all platforms.
|
|
134
|
+
# Use to_s.empty check to also handle nil check.
|
|
135
|
+
unless ingress_replication.to_s.empty?
|
|
136
|
+
set_args_keys(state: 'no', protocol: ingress_replication)
|
|
137
|
+
config_set('vxlan_vtep_vni', 'ingress_replication', @set_args)
|
|
138
|
+
end
|
|
139
|
+
set_host_reachability(@set_args[:name], protocol)
|
|
140
|
+
set_args_keys(state: '', protocol: protocol)
|
|
141
|
+
config_set('vxlan_vtep_vni', 'ingress_replication', @set_args)
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def ingress_replication=(protocol)
|
|
145
|
+
return if protocol.to_s == ingress_replication
|
|
146
|
+
# Only set ingress_replicatin to the default value if it's not already.
|
|
147
|
+
if protocol.to_s == default_ingress_replication &&
|
|
148
|
+
(ingress_replication != default_ingress_replication)
|
|
149
|
+
set_args_keys(state: 'no', protocol: ingress_replication)
|
|
150
|
+
config_set('vxlan_vtep_vni', 'ingress_replication', @set_args)
|
|
151
|
+
else
|
|
152
|
+
# Multicast group and ingress replication are mutually exclusive
|
|
153
|
+
# properties, so remove multicast_group first
|
|
154
|
+
unless multicast_group.empty?
|
|
155
|
+
set_args_keys(state: 'no', ip_start: '', ip_end: '')
|
|
156
|
+
config_set('vxlan_vtep_vni', 'multicast_group', @set_args)
|
|
157
|
+
end
|
|
158
|
+
remove_add_ingress_replication(protocol.to_s)
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
def default_ingress_replication
|
|
163
|
+
config_get_default('vxlan_vtep_vni', 'ingress_replication')
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def multicast_group
|
|
167
|
+
g1, g2 = config_get('vxlan_vtep_vni', 'multicast_group', @get_args)
|
|
168
|
+
g2.nil? ? g1 : g1 + ' ' + g2
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def remove_add_multicast_group(ip_start, ip_end)
|
|
172
|
+
set_args_keys(state: 'no', ip_start: '', ip_end: '')
|
|
173
|
+
config_set('vxlan_vtep_vni', 'multicast_group', @set_args)
|
|
174
|
+
set_args_keys(state: '', ip_start: ip_start, ip_end: ip_end)
|
|
175
|
+
config_set('vxlan_vtep_vni', 'multicast_group', @set_args)
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
def multicast_group=(range)
|
|
179
|
+
if range == default_multicast_group
|
|
180
|
+
# Due to CSCux78514, trying to remove multicast-group in CLI
|
|
181
|
+
# when ingress replication is configured results in removing
|
|
182
|
+
# ingress replication from nvgen. So be careful and negate
|
|
183
|
+
# Multicast-group only is it is configured.
|
|
184
|
+
unless multicast_group.empty?
|
|
185
|
+
set_args_keys(state: 'no', ip_start: '', ip_end: '')
|
|
186
|
+
config_set('vxlan_vtep_vni', 'multicast_group', @set_args)
|
|
187
|
+
end
|
|
188
|
+
else
|
|
189
|
+
ip_start, ip_end = range.split(' ')
|
|
190
|
+
ip_end = '' if ip_end.nil?
|
|
191
|
+
# Since multicast group and ingress replication are exclusive
|
|
192
|
+
# properties, remove ingress replication first
|
|
193
|
+
if ingress_replication_supported? && !ingress_replication.empty?
|
|
194
|
+
set_args_keys(state: 'no', protocol: ingress_replication)
|
|
195
|
+
config_set('vxlan_vtep_vni', 'ingress_replication', @set_args)
|
|
196
|
+
end
|
|
197
|
+
remove_add_multicast_group(ip_start, ip_end)
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def default_multicast_group
|
|
202
|
+
config_get_default('vxlan_vtep_vni', 'multicast_group')
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
def peer_list
|
|
206
|
+
config_get('vxlan_vtep_vni', 'peer_list', @get_args)
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
def peer_list=(should_list)
|
|
210
|
+
delta_hash = Utils.delta_add_remove(should_list, peer_list)
|
|
211
|
+
return if delta_hash.values.flatten.empty?
|
|
212
|
+
[:add, :remove].each do |action|
|
|
213
|
+
Cisco::Logger.debug('peer_list' \
|
|
214
|
+
"#{@get_args}\n #{action}: #{delta_hash[action]}")
|
|
215
|
+
delta_hash[action].each do |peer|
|
|
216
|
+
state = (action == :add) ? '' : 'no'
|
|
217
|
+
@set_args[:state] = state
|
|
218
|
+
@set_args[:peer] = peer
|
|
219
|
+
config_set('vxlan_vtep_vni', 'peer_list', @set_args)
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
def default_peer_list
|
|
225
|
+
config_get_default('vxlan_vtep_vni', 'peer_list')
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
def suppress_arp
|
|
229
|
+
config_get('vxlan_vtep_vni', 'suppress_arp', @get_args)
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
def suppress_arp=(state)
|
|
233
|
+
if state
|
|
234
|
+
set_args_keys(state: '')
|
|
235
|
+
# Host reachability must be enabled for this property
|
|
236
|
+
unless VxlanVtep.new(@name).host_reachability == 'evpn'
|
|
237
|
+
fail "Dependency: vxlan_vtep host_reachability must be 'evpn'."
|
|
238
|
+
end
|
|
239
|
+
config_set('vxlan_vtep_vni', 'suppress_arp', @set_args)
|
|
240
|
+
else
|
|
241
|
+
set_args_keys(state: 'no')
|
|
242
|
+
# Remove suppress-arp only if it is configured. Suppress-arp needs
|
|
243
|
+
# free TCAM region for arp-ether ACL. Customers who don't need
|
|
244
|
+
# suppress-arp, needn't see cli failures warning about TCAM regions
|
|
245
|
+
# issued due to 'no suppress-arp'. Note that for suppress-arp, default
|
|
246
|
+
# is 'false' which is no suppress-arp
|
|
247
|
+
config_set('vxlan_vtep_vni', 'suppress_arp', @set_args) if suppress_arp
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
def default_suppress_arp
|
|
252
|
+
config_get_default('vxlan_vtep_vni', 'suppress_arp')
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
def suppress_arp_disable
|
|
256
|
+
# suppress_arp_disable is really a boolean kind, however,
|
|
257
|
+
# since the get is looking for a string with 'disable'
|
|
258
|
+
# we have to treat it as string first and then massage it
|
|
259
|
+
# to boolean
|
|
260
|
+
str = config_get('vxlan_vtep_vni', 'suppress_arp_disable', @get_args)
|
|
261
|
+
str.nil? ? false : true
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
def suppress_arp_disable=(state)
|
|
265
|
+
if state
|
|
266
|
+
set_args_keys(state: '')
|
|
267
|
+
# Host reachability must be enabled for this property
|
|
268
|
+
unless VxlanVtep.new(@name).host_reachability == 'evpn'
|
|
269
|
+
fail "Dependency: vxlan_vtep host_reachability must be 'evpn'."
|
|
270
|
+
end
|
|
271
|
+
Feature.nv_overlay_evpn_enable if
|
|
272
|
+
Feature.nv_overlay_evpn_supported? && !Feature.nv_overlay_evpn_enabled?
|
|
273
|
+
config_set('vxlan_vtep_vni', 'suppress_arp_disable', @set_args)
|
|
274
|
+
else
|
|
275
|
+
set_args_keys(state: 'no')
|
|
276
|
+
# Remove suppress-arp-disable only if it is configured.
|
|
277
|
+
config_set('vxlan_vtep_vni', 'suppress_arp_disable', @set_args) if
|
|
278
|
+
suppress_arp_disable
|
|
279
|
+
end
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
def default_suppress_arp_disable
|
|
283
|
+
config_get_default('vxlan_vtep_vni', 'suppress_arp_disable')
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
def suppress_uuc
|
|
287
|
+
config_get('vxlan_vtep_vni', 'suppress_uuc', @get_args)
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
def suppress_uuc=(state)
|
|
291
|
+
if state
|
|
292
|
+
set_args_keys(state: '')
|
|
293
|
+
# Host reachability must be enabled for this property
|
|
294
|
+
unless VxlanVtep.new(@name).host_reachability == 'evpn'
|
|
295
|
+
fail "Dependency: vxlan_vtep host_reachability must be 'evpn'"
|
|
296
|
+
end
|
|
297
|
+
config_set('vxlan_vtep_vni', 'suppress_uuc', @set_args)
|
|
298
|
+
else
|
|
299
|
+
set_args_keys(state: 'no')
|
|
300
|
+
# Remove suppress-uuc only if it is configured. Note that for
|
|
301
|
+
# suppress-uuc, default is 'false' which is no suppress-uuc.
|
|
302
|
+
config_set('vxlan_vtep_vni', 'suppress_uuc', @set_args) if suppress_uuc
|
|
303
|
+
end
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
def default_suppress_uuc
|
|
307
|
+
config_get_default('vxlan_vtep_vni', 'suppress_uuc')
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
def multisite_ingress_replication
|
|
311
|
+
config_get('vxlan_vtep_vni', 'multisite_ingress_replication', @get_args)
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
def multisite_ingress_replication=(state)
|
|
315
|
+
@set_args[:state] = state ? '' : 'no'
|
|
316
|
+
if @set_args[:state] == 'no'
|
|
317
|
+
unless multisite_ingress_replication ==
|
|
318
|
+
default_multisite_ingress_replication
|
|
319
|
+
config_set('vxlan_vtep_vni', 'multisite_ingress_replication',
|
|
320
|
+
@set_args)
|
|
321
|
+
end
|
|
322
|
+
else
|
|
323
|
+
config_set('vxlan_vtep_vni', 'multisite_ingress_replication', @set_args)
|
|
324
|
+
end
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
def default_multisite_ingress_replication
|
|
328
|
+
config_get_default('vxlan_vtep_vni', 'multisite_ingress_replication')
|
|
329
|
+
end
|
|
330
|
+
end
|
|
331
|
+
end
|