From 9bf7da3d0d8080e67b95a402d27b1f5c71effb79 Mon Sep 17 00:00:00 2001 From: Thomas Ryan Date: Tue, 22 Oct 2024 13:39:20 -0400 Subject: [PATCH] Releasing v24.10 --- Makefile | 5 +- pkgs/clean-pkg/changelog/2024/october.rst | 22 + ...hangeBootVariable_stage_20240918204515.rst | 7 + .../sdk_generator/output/github_clean.json | 74 +- .../src/genie/libs/clean/__init__.py | 2 +- .../libs/clean/recovery/iosxe/recovery.py | 2 +- .../libs/clean/stages/iosxe/image_handler.py | 268 +- .../genie/libs/clean/stages/iosxe/stages.py | 3696 +++++++++++------ .../stages/iosxe/tests/test_image_handler.py | 40 +- .../stages/iosxe/tests/test_install_image.py | 32 +- .../stages/iosxe/tests/test_install_smu.py | 56 + pkgs/conf-pkg/changelog/2024/october.rst | 18 + pkgs/conf-pkg/src/genie/libs/conf/__init__.py | 2 +- pkgs/conf-pkg/src/genie/libs/conf/bgp/bgp.py | 53 + .../src/genie/libs/conf/bgp/nxos/bgp.py | 50 +- .../libs/conf/bgp/nxos/tests/test_bgp.py | 162 + .../libs/conf/interface/nxos/interface.py | 7 + .../interface/nxos/tests/test_interface.py | 8 +- .../src/genie/libs/conf/ospf/nxos/ospf.py | 4 + .../libs/conf/ospf/nxos/tests/test_ospf.py | 40 +- .../conf-pkg/src/genie/libs/conf/ospf/ospf.py | 6 + .../conf/segment_routing/nxos/__init__.py | 7 + .../segment_routing/nxos/segment_routing.py | 69 + .../segment_routing/nxos/tests/__init__.py | 0 .../nxos/tests/test_segment_routing.py | 177 + .../conf/segment_routing/segment_routing.py | 7 +- .../changelog/2024/october.rst | 0 .../genie/libs/filetransferutils/__init__.py | 2 +- pkgs/health-pkg/changelog/2024/october.rst | 0 .../src/genie/libs/health/__init__.py | 2 +- pkgs/ops-pkg/changelog/2024/october.rst | 0 pkgs/ops-pkg/src/genie/libs/ops/__init__.py | 2 +- pkgs/robot-pkg/changelog/2024/october.rst | 0 .../src/genie/libs/robot/__init__.py | 2 +- pkgs/sdk-pkg/changelog/2024/october.rst | 110 + ...figure_rep_fastrep_apis_20240902145357.rst | 12 + .../sdk_generator/output/github_apis.json | 1683 +++++--- .../output/github_verifications.json | 40 +- pkgs/sdk-pkg/setup.py | 6 +- pkgs/sdk-pkg/src/genie/libs/sdk/__init__.py | 2 +- .../libs/sdk/apis/iosxe/aaa/configure.py | 134 +- .../libs/sdk/apis/iosxe/bgp/configure.py | 85 +- .../cat9k/c9500/spanning_tree/__init__.py | 0 .../cat9k/c9500/spanning_tree/configure.py | 69 + .../cat9k/c9610/spanning_tree/configure.py | 29 + .../genie/libs/sdk/apis/iosxe/dhcp/execute.py | 17 + .../libs/sdk/apis/iosxe/evpn/configure.py | 354 +- .../libs/sdk/apis/iosxe/flow/configure.py | 48 +- .../genie/libs/sdk/apis/iosxe/flow/execute.py | 66 +- .../sdk/apis/iosxe/ie3k/platform/verify.py | 26 + .../sdk/apis/iosxe/interface/configure.py | 274 +- .../libs/sdk/apis/iosxe/interface/execute.py | 19 +- .../libs/sdk/apis/iosxe/interface/get.py | 32 +- .../libs/sdk/apis/iosxe/ospf/configure.py | 53 +- .../libs/sdk/apis/iosxe/platform/configure.py | 82 +- .../libs/sdk/apis/iosxe/platform/execute.py | 50 +- .../apis/iosxe/policy_class_map/configure.py | 43 +- .../libs/sdk/apis/iosxe/qos/configure.py | 29 +- .../genie/libs/sdk/apis/iosxe/rep/__init__.py | 0 .../libs/sdk/apis/iosxe/rep/configure.py | 211 + .../genie/libs/sdk/apis/iosxe/rommon/utils.py | 26 +- .../sdk/apis/iosxe/route_map/configure.py | 5 +- .../libs/sdk/apis/iosxe/snmp/configure.py | 39 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 36 + ...n_default_start_stop_group_tacacs_group.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 36 + ...m_default_start_stop_group_tacacs_group.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 36 + ...igure_aaa_authorization_config_commands.py | 35 + ...st_api_configure_common_criteria_policy.py | 30 + .../configure_bgp_l2vpn_route_map/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 39 + .../test_api_configure_bgp_l2vpn_route_map.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 39 + ...figure_bgp_l2vpn_route_reflector_client.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 25 +- ...figure_bgp_router_id_peergroup_neighbor.py | 15 +- .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 39 + ...st_api_configure_redistribute_connected.py | 35 + .../mock_data/iosxe/mock_data.yaml | 626 +-- ...est_api_get_running_config_section_dict.py | 391 +- .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 39 + ...st_api_configure_spanning_tree_portfast.py | 45 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 39 + ..._api_unconfigure_spanning_tree_portfast.py | 45 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 39 + ..._api_unconfigure_spanning_tree_portfast.py | 45 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 39 + ...api_clear_ip_dhcp_snooping_track_server.py | 35 + .../mock_data/iosxe/mock_data.yaml | 21 +- .../test_api_clear_bgp_l2vpn_evpn.py | 8 +- .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 25 +- ...e_evpn_default_gateway_advertise_global.py | 13 +- .../mock_data/iosxe/mock_data.yaml | 24 +- .../test_api_configure_evpn_instance_evi.py | 10 +- .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 25 +- ...nfigure_evpn_l2_instance_bd_association.py | 15 +- .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 38 + ...onfigure_evpn_l2_profile_bd_association.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + ...nfigure_evpn_l3_instance_bd_association.py | 35 + .../configure_evpn_profile/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 41 + .../test_api_configure_evpn_profile.py | 35 + .../configure_l2vpn_evpn/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 25 +- .../test_api_configure_l2vpn_evpn.py | 13 +- .../mock_data/iosxe/mock_data.yaml | 23 +- ...nfigure_l2vpn_evpn_flooding_suppression.py | 8 +- .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + ...re_vlan_service_instance_bd_association.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 38 + ...onfigure_evpn_l2_profile_bd_association.py | 35 + .../unconfigure_evpn_profile/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 41 + .../test_api_unconfigure_evpn_profile.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + ...re_vlan_service_instance_bd_association.py | 35 + .../clear_monitor_capture/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 39 + .../test_api_clear_monitor_capture.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 39 + ...api_execute_monitor_capture_access_list.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 39 + ..._execute_monitor_capture_limit_duration.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 39 + ...ecute_monitor_capture_vlan_in_match_any.py | 35 + .../verify/verify_boot_variable/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 41 + .../test_api_verify_boot_variable.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 39 + ...re_interface_rep_segment_edge_preferred.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 39 + ...gure_interface_rep_segment_edge_primary.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + ...pi_configure_interface_rep_stcn_segment.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + ...st_api_configure_interface_rep_stcn_stp.py | 35 + .../configure_ppp_multilink/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + .../test_api_configure_ppp_multilink.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 38 + ...rvice_policy_type_queueing_on_interface.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + ...re_interface_rep_segment_edge_preferred.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + ...gure_interface_rep_segment_edge_primary.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + ..._unconfigure_interface_rep_stcn_segment.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + ..._api_unconfigure_interface_rep_stcn_stp.py | 35 + .../unconfigure_port_channel/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 36 + .../test_api_unconfigure_port_channel.py | 35 + .../unconfigure_ppp_multilink/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + .../test_api_unconfigure_ppp_multilink.py | 35 + .../execute_test_fru_fake_insert/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 38 + .../test_api_execute_test_fru_fake_insert.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 238 ++ ...i_get_interface_traffic_packet_counters.py | 53 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + ...st_api_configure_ospf_network_broadcast.py | 35 + .../configure_ospf_priority/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + .../test_api_configure_ospf_priority.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + ...onfigure_key_config_key_newpass_oldpass.py | 35 + .../configure_parser_view/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 46 + .../test_api_configure_parser_view.py | 35 + .../unconfigure_parser_view/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 36 + .../test_api_unconfigure_parser_view.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 40 + ...latform_software_fed_switch_phy_options.py | 37 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + ...figure_class_map_access_group_on_device.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + ...i_configure_traffic_class_for_class_map.py | 35 + .../__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 38 + ...gure_ip_access_list_with_dscp_on_device.py | 35 + .../configure_fast_rep_segment/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 53 + .../test_api_configure_fast_rep_segment.py | 35 + .../configure_rep_segment/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 39 + .../test_api_configure_rep_segment.py | 35 + .../configure/configure_rep_ztp/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 36 + .../test_api_configure_rep_ztp.py | 35 + .../unconfigure_fast_rep_segment/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 53 + .../test_api_unconfigure_fast_rep_segment.py | 35 + .../unconfigure_rep_segment/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 61 + .../test_api_unconfigure_rep_segment.py | 35 + .../configure/unconfigure_rep_ztp/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 36 + .../test_api_unconfigure_rep_ztp.py | 35 + .../mock_data/iosxe/mock_data.yaml | 29 +- .../test_api_configure_route_map_permit.py | 8 +- .../configure_snmp_server_host/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + .../test_api_configure_snmp_server_host.py | 35 + .../unconfigure_snmp_server_host/__init__.py | 0 .../mock_data/iosxe/mock_data.yaml | 37 + .../test_api_unconfigure_snmp_server_host.py | 35 + .../genie/libs/sdk/apis/tests/test_utils.py | 1 + pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py | 87 + .../libs/abstracted_libs/iosxe/processors.py | 85 +- .../sdk/libs/abstracted_libs/iosxe/restore.py | 1 + .../sdk/libs/abstracted_libs/processors.py | 393 +- .../src/genie/libs/sdk/powercycler/base.py | 5 +- .../libs/sdk/triggers/blitz/actions_helper.py | 2 +- 252 files changed, 11182 insertions(+), 3265 deletions(-) create mode 100644 pkgs/clean-pkg/changelog/2024/october.rst create mode 100644 pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_smu.py create mode 100644 pkgs/conf-pkg/changelog/2024/october.rst create mode 100644 pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/__init__.py create mode 100644 pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/segment_routing.py create mode 100644 pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/tests/__init__.py create mode 100644 pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/tests/test_segment_routing.py create mode 100644 pkgs/filetransferutils-pkg/changelog/2024/october.rst create mode 100644 pkgs/health-pkg/changelog/2024/october.rst create mode 100644 pkgs/ops-pkg/changelog/2024/october.rst create mode 100644 pkgs/robot-pkg/changelog/2024/october.rst create mode 100644 pkgs/sdk-pkg/changelog/2024/october.rst create mode 100644 pkgs/sdk-pkg/changelog/changelog_add_iosxe_configure_rep_fastrep_apis_20240902145357.rst create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9500/spanning_tree/__init__.py create mode 100755 pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9500/spanning_tree/configure.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/platform/verify.py mode change 100644 => 100755 pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py create mode 100755 pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rep/__init__.py create mode 100755 pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rep/configure.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_connection_default_start_stop_group_tacacs_group/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_connection_default_start_stop_group_tacacs_group/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_connection_default_start_stop_group_tacacs_group/test_api_configure_aaa_accounting_connection_default_start_stop_group_tacacs_group.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_system_default_start_stop_group_tacacs_group/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_system_default_start_stop_group_tacacs_group/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_system_default_start_stop_group_tacacs_group/test_api_configure_aaa_accounting_system_default_start_stop_group_tacacs_group.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_authorization_config_commands/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_authorization_config_commands/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_authorization_config_commands/test_api_configure_aaa_authorization_config_commands.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_map/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_map/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_map/test_api_configure_bgp_l2vpn_route_map.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_reflector_client/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_reflector_client/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_reflector_client/test_api_configure_bgp_l2vpn_route_reflector_client.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_router_id_peergroup_neighbor/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_redistribute_connected/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_redistribute_connected/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_redistribute_connected/test_api_configure_redistribute_connected.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/configure_spanning_tree_portfast/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/configure_spanning_tree_portfast/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/configure_spanning_tree_portfast/test_api_configure_spanning_tree_portfast.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/unconfigure_spanning_tree_portfast/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/unconfigure_spanning_tree_portfast/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/unconfigure_spanning_tree_portfast/test_api_unconfigure_spanning_tree_portfast.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9610/spanning_tree/configure/unconfigure_spanning_tree_portfast/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9610/spanning_tree/configure/unconfigure_spanning_tree_portfast/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9610/spanning_tree/configure/unconfigure_spanning_tree_portfast/test_api_unconfigure_spanning_tree_portfast.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/execute/clear_ip_dhcp_snooping_track_server/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/execute/clear_ip_dhcp_snooping_track_server/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/execute/clear_ip_dhcp_snooping_track_server/test_api_clear_ip_dhcp_snooping_track_server.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_default_gateway_advertise_global/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_instance_bd_association/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_profile_bd_association/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_profile_bd_association/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_profile_bd_association/test_api_configure_evpn_l2_profile_bd_association.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l3_instance_bd_association/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l3_instance_bd_association/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l3_instance_bd_association/test_api_configure_evpn_l3_instance_bd_association.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_profile/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_profile/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_profile/test_api_configure_evpn_profile.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_vlan_service_instance_bd_association/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_vlan_service_instance_bd_association/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_vlan_service_instance_bd_association/test_api_configure_vlan_service_instance_bd_association.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_l2_profile_bd_association/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_l2_profile_bd_association/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_l2_profile_bd_association/test_api_unconfigure_evpn_l2_profile_bd_association.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_profile/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_profile/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_profile/test_api_unconfigure_evpn_profile.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_vlan_service_instance_bd_association/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_vlan_service_instance_bd_association/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_vlan_service_instance_bd_association/test_api_unconfigure_vlan_service_instance_bd_association.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/clear_monitor_capture/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/clear_monitor_capture/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/clear_monitor_capture/test_api_clear_monitor_capture.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_access_list/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_access_list/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_access_list/test_api_execute_monitor_capture_access_list.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_limit_duration/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_limit_duration/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_limit_duration/test_api_execute_monitor_capture_limit_duration.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_vlan_in_match_any/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_vlan_in_match_any/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_vlan_in_match_any/test_api_execute_monitor_capture_vlan_in_match_any.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ie3k/platform/verify/verify_boot_variable/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ie3k/platform/verify/verify_boot_variable/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ie3k/platform/verify/verify_boot_variable/test_api_verify_boot_variable.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_preferred/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_preferred/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_preferred/test_api_configure_interface_rep_segment_edge_preferred.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_primary/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_primary/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_primary/test_api_configure_interface_rep_segment_edge_primary.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_segment/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_segment/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_segment/test_api_configure_interface_rep_stcn_segment.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_stp/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_stp/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_stp/test_api_configure_interface_rep_stcn_stp.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ppp_multilink/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ppp_multilink/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ppp_multilink/test_api_configure_ppp_multilink.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_service_policy_type_queueing_on_interface/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_service_policy_type_queueing_on_interface/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_service_policy_type_queueing_on_interface/test_api_configure_service_policy_type_queueing_on_interface.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_preferred/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_preferred/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_preferred/test_api_unconfigure_interface_rep_segment_edge_preferred.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_primary/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_primary/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_primary/test_api_unconfigure_interface_rep_segment_edge_primary.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_segment/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_segment/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_segment/test_api_unconfigure_interface_rep_stcn_segment.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_stp/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_stp/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_stp/test_api_unconfigure_interface_rep_stcn_stp.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_port_channel/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_port_channel/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_port_channel/test_api_unconfigure_port_channel.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_ppp_multilink/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_ppp_multilink/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_ppp_multilink/test_api_unconfigure_ppp_multilink.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/execute/execute_test_fru_fake_insert/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/execute/execute_test_fru_fake_insert/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/execute/execute_test_fru_fake_insert/test_api_execute_test_fru_fake_insert.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/get/get_interface_traffic_packet_counters/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/get/get_interface_traffic_packet_counters/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/get/get_interface_traffic_packet_counters/test_api_get_interface_traffic_packet_counters.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_network_broadcast/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_network_broadcast/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_network_broadcast/test_api_configure_ospf_network_broadcast.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_priority/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_priority/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_priority/test_api_configure_ospf_priority.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_key_config_key_newpass_oldpass/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_key_config_key_newpass_oldpass/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_key_config_key_newpass_oldpass/test_api_configure_key_config_key_newpass_oldpass.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_parser_view/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_parser_view/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_parser_view/test_api_configure_parser_view.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_parser_view/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_parser_view/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_parser_view/test_api_unconfigure_parser_view.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/platform_software_fed_switch_phy_options/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/platform_software_fed_switch_phy_options/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/platform_software_fed_switch_phy_options/test_api_platform_software_fed_switch_phy_options.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_class_map_access_group_on_device/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_class_map_access_group_on_device/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_class_map_access_group_on_device/test_api_configure_class_map_access_group_on_device.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_traffic_class_for_class_map/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_traffic_class_for_class_map/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_traffic_class_for_class_map/test_api_configure_traffic_class_for_class_map.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/qos/configure/configure_ip_access_list_with_dscp_on_device/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/qos/configure/configure_ip_access_list_with_dscp_on_device/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/qos/configure/configure_ip_access_list_with_dscp_on_device/test_api_configure_ip_access_list_with_dscp_on_device.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_fast_rep_segment/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_fast_rep_segment/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_fast_rep_segment/test_api_configure_fast_rep_segment.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_segment/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_segment/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_segment/test_api_configure_rep_segment.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_ztp/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_ztp/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_ztp/test_api_configure_rep_ztp.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_fast_rep_segment/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_fast_rep_segment/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_fast_rep_segment/test_api_unconfigure_fast_rep_segment.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_segment/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_segment/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_segment/test_api_unconfigure_rep_segment.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_ztp/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_ztp/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_ztp/test_api_unconfigure_rep_ztp.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_host/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_host/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_host/test_api_configure_snmp_server_host.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/unconfigure_snmp_server_host/__init__.py create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/unconfigure_snmp_server_host/mock_data/iosxe/mock_data.yaml create mode 100644 pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/unconfigure_snmp_server_host/test_api_unconfigure_snmp_server_host.py diff --git a/Makefile b/Makefile index 53172f414..7c6a406f7 100644 --- a/Makefile +++ b/Makefile @@ -45,9 +45,8 @@ CYTHON_CMD = compileAll # Development pkg requirements RELATED_PKGS = genie.libs.health genie.libs.clean genie.libs.conf genie.libs.ops genie.libs.robot genie.libs.sdk RELATED_PKGS += genie.libs.filetransferutils -# pinning the version of pysnmp-lextudio and pyasn1 to fix the type error when using execute_power_cycle_device api # Adding pyasyncore pkg to fix pysnmp scripts for python 3.12 -DEPENDENCIES = restview psutil Sphinx wheel asynctest pysnmp-lextudio==6.1.2 pyasn1==0.4.8 pyasyncore +DEPENDENCIES = restview psutil Sphinx wheel asynctest 'pysnmp>=6.1.4,<6.2' pyasn1==0.4.8 DEPENDENCIES += sphinx-rtd-theme==1.1.0 pyftpdlib tftpy\<0.8.1 robotframework DEPENDENCIES += Cython==3.0.0 requests ruamel.yaml grpcio protobuf jinja2 # Internal variables. @@ -322,7 +321,7 @@ json: @echo "--------------------------------------------------------------------" @echo "Generating libs json file" @echo "" - @python3 -c "from genie.json.make_json import make_genielibs; make_genielibs()" + @python3 -W ignore::SyntaxWarning -c "from genie.json.make_json import make_genielibs; make_genielibs()" @echo "" @echo "Done." @echo "" diff --git a/pkgs/clean-pkg/changelog/2024/october.rst b/pkgs/clean-pkg/changelog/2024/october.rst new file mode 100644 index 000000000..d61968d6f --- /dev/null +++ b/pkgs/clean-pkg/changelog/2024/october.rst @@ -0,0 +1,22 @@ +-------------------------------------------------------------------------------- + New +-------------------------------------------------------------------------------- + +* clean-pkg + * iosxe + * image_handler + * Update clean schema to handle smu images + * Added new clean stages `install_smu`, `install_remove_smu` + + +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- + +* clean + * Modified recovery_worker + * Changed to use `device_rommon_boot` for TFTP booting + * Modified device_rommon_boot + * Changed it to try and use TFTP_BOOT environment variable if TFTP path is too long + + diff --git a/pkgs/clean-pkg/changelog/changelog_modify_iosxe_ChangeBootVariable_stage_20240918204515.rst b/pkgs/clean-pkg/changelog/changelog_modify_iosxe_ChangeBootVariable_stage_20240918204515.rst index 646742385..800f00e3f 100644 --- a/pkgs/clean-pkg/changelog/changelog_modify_iosxe_ChangeBootVariable_stage_20240918204515.rst +++ b/pkgs/clean-pkg/changelog/changelog_modify_iosxe_ChangeBootVariable_stage_20240918204515.rst @@ -1,3 +1,10 @@ +-------------------------------------------------------------------------------- + New +-------------------------------------------------------------------------------- +* NXOS + * Added: + * Segment Routing MPLS Support + -------------------------------------------------------------------------------- Fix -------------------------------------------------------------------------------- diff --git a/pkgs/clean-pkg/sdk_generator/output/github_clean.json b/pkgs/clean-pkg/sdk_generator/output/github_clean.json index c37ac04b6..4c9b37dcd 100644 --- a/pkgs/clean-pkg/sdk_generator/output/github_clean.json +++ b/pkgs/clean-pkg/sdk_generator/output/github_clean.json @@ -122,7 +122,7 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/ios/stages.py#L16" }, "iosxe": { - "doc": "This stage configures boot variables of the device using the following steps:\n\n - Delete existing boot variables.\n - Configure boot variables using the provided 'images'.\n - Set the configuration-register using the provided 'config_register'.\n - Write memory.\n - Verify the boot variables are as expected.\n - Verify the configuration-register is as expected.\n\nStage Schema\n------------\nchange_boot_variable:\n\n images (list): Image files to use when configuring the boot variables.\n\n timeout (int, optional): Execute timeout in seconds. Defaults to 300.\n\n config_register (str, optional): Value to set config-register for\n reload. Defaults to 0x2102.\n\n current_running_image (bool, optional): Set the boot variable to the currently\n running image from the show version command instead of the image provided.\n Defaults to False.\n\nExample\n-------\nchange_boot_variable:\n images:\n - harddisk:/image.bin\n timeout: 150\n", + "doc": "This stage configures boot variables of the device using the following steps:\n\n - Delete existing boot variables.\n - Configure boot variables using the provided 'images'.\n - Set the configuration-register using the provided 'config_register'.\n - Write memory.\n - Verify the boot variables are as expected.\n - Verify the configuration-register is as expected.\n\n Stage Schema\n ------------\n change_boot_variable:\n\n images (list): Image files to use when configuring the boot variables.\n\n timeout (int, optional): Execute timeout in seconds. Defaults to 300.\n\n config_register (str, optional): Value to set config-register for\n reload. Defaults to 0x2102.\n\n current_running_image (bool, optional): Set the boot variable to the currently\n running image from the show version command instead of the image provided.\n Defaults to False.\n\n Example\n -------\n change_boot_variable:\n images:\n - harddisk:/image.bin\n timeout: 150\n ", "folders": { "cat9k": { "doc": "This stage configures boot variables of the device using the following steps:\n\n - Delete existing boot variables.\n - Configure boot variables using the provided 'images'.\n - Write memory.\n - Verify the boot variables are as expected.\n\nStage Schema\n------------\nchange_boot_variable:\n\n images (list): Image files to use when configuring the boot variables.\n\n timeout (int, optional): Execute timeout in seconds. Defaults to 300.\n\n current_running_image (bool, optional): Set the boot variable to the currently\n running image from the show version command instead of the image provided.\n Defaults to False.\n\nExample\n-------\nchange_boot_variable:\n images:\n - harddisk:/image.bin\n timeout: 150\n", @@ -163,7 +163,7 @@ "os": "iosxe" }, "uid": "ChangeBootVariable", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L45" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L46" }, "nxos": { "doc": "This stage configures boot variables of the device using the following steps:\n\n - Delete existing boot variables.\n - Configure boot variables using the provided 'images'.\n - Write memory.\n - Verify the boot variables are as expected.\n\nStage Schema\n------------\nchange_boot_variable:\n\n images:\n\n kickstart (list, optional): The kickstart image file\n\n system (list): The system image file\n\n copy_vdc_all (bool, optional): If True copy onto all VDCs. Defaults to False.\n\n timeout (int, optional): Execute timeout in seconds. Defaults to 300.\n\n max_time (int, optional): Maximum time in seconds allowed for verifications.\n Defaults to 300.\n\n check_interval (int, optional): How often to check verifications in seconds.\n Defaults to 60.\n\n standby_copy_max_time (int, optional): Maximum time in seconds allowed for\n copying to standby RP. Defaults to 300.\n\n standby_copy_check_interval (int, optional): How often to check if the copy\n to the standby RP is complete. Defaults to 20.\n\n current_running_image (bool, optional): Set the boot variable to the currently\n running image from the show version command instead of the image provided.\n Defaults to False.\n\nExample\n-------\nchange_boot_variable:\n images:\n kickstart: bootflash:/kisckstart.gbin\n system: bootflash:/system.gbin\n copy_vdc_all: True\n timeout: 150\n max_time: 300\n check_interval: 20\n standby_copy_max_time: 100\n standby_copy_check_interval: 10\n", @@ -245,7 +245,7 @@ "os": "iosxe" }, "uid": "ConfigureReplace", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2120" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L3073" } } }, @@ -281,7 +281,7 @@ "doc": "This stage connects to the device that is being cleaned.\n\nStage Schema\n------------\nconnect:\n\n via (str, optional): Which connection to use from the testbed file. Uses the\n default connection if not specified.\n\n timeout (int, optional): The timeout for the connection to complete in seconds.\n Defaults to 200.\n\n retry_timeout (int, optional): Overall timeout for retry mechanism in seconds.\n Defaults to 0 which means no retry.\n\n retry_interval (int, optional): Interval for retry mechanism in seconds. Defaults\n to 0 which means no retry.\n\nExample\n-------\nconnect:\n timeout: 60\n", "folders": { "iosxe": { - "doc": "This stage connects to the device that is being cleaned.\nStage Schema\n------------\nconnect:\n via (str, optional): Which connection to use from the testbed file. Uses the\n default connection if not specified.\n alias (str, optional): Which connection alias to use from the testbed file.\n timeout (int, optional): The timeout for the connection to complete in seconds.\n Defaults to 200.\n retry_timeout (int, optional): Overall timeout for retry mechanism in seconds.\n Defaults to 0 which means no retry.\n retry_interval (int, optional): Interval for retry mechanism in seconds. Defaults\n to 0 which means no retry.\nExample\n-------\nconnect:\n timeout: 60\n", + "doc": "This stage connects to the device that is being cleaned.\n Stage Schema\n ------------\n connect:\n via (str, optional): Which connection to use from the testbed file. Uses the\n default connection if not specified.\n alias (str, optional): Which connection alias to use from the testbed file.\n timeout (int, optional): The timeout for the connection to complete in seconds.\n Defaults to 200.\n retry_timeout (int, optional): Overall timeout for retry mechanism in seconds.\n Defaults to 0 which means no retry.\n retry_interval (int, optional): Interval for retry mechanism in seconds. Defaults\n to 0 which means no retry.\n Example\n -------\n connect:\n timeout: 60\n ", "folders": { "sdwan": { "doc": "This stage connects to the device that is being cleaned.\n\nStage Schema\n------------\nconnect:\n\n via (str, optional): Which connection to use from the testbed file. Uses the\n default connection if not specified.\n\n timeout (int, optional): The timeout for the connection to complete in seconds.\n Defaults to 200.\n\n retry_timeout (int, optional): Overall timeout for retry mechanism in seconds.\n Defaults to 0 which means no retry.\n\n retry_interval (int, optional): Interval for retry mechanism in seconds. Defaults\n to 0 which means no retry.\n\nExample\n-------\nconnect:\n timeout: 60\n", @@ -300,7 +300,7 @@ "os": "iosxe" }, "uid": "Connect", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2176" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L3152" }, "linux": { "folders": { @@ -347,14 +347,14 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/apic/stages.py#L519" }, "iosxe": { - "doc": "This stage will copy an image to a device from a networked location.\n\nStage Schema\n------------\ncopy_to_device:\n\n origin:\n\n files (list): Image files location on the server.\n\n hostname (str): Hostname or address of the server.\n\n destination:\n\n directory (str): Directory on the device to copy the images to.\n\n standby_directory (str, optional): Standby directory on the device\n to copy the images to. Defaults to None.\n\n protocol (str): Protocol used for copy operation.\n\n connection_alias (str): Connection alias to use\n\n verify_num_images (bool, optional): Verify number of images provided by\n user for clean is correct. Defaults to True.\n\n verify_running_image (bool, optional): Compare the image filename with the running\n image version on device. If a match is found, the copy stage will be skipped.\n Defaults to True.\n\n expected_num_images (int, optional): Number of images expected to be\n provided by user for clean. Defaults to 1.\n\n vrf (str, optional): Vrf used to copy. Defaults to an empty string.\n\n timeout (int, optional): Copy operation timeout in seconds. Defaults to 300.\n\n compact (bool, optional): Compact copy mode if supported by the device.\n Defaults to False.\n\n protected_files (list, optional): File patterns that should not be deleted.\n Defaults to None.\n\n overwrite (bool, optional): Overwrite the file if a file with the same\n name already exists. Defaults to False.\n\n skip_deletion (bool, optional): Do not delete any files even if there isn't\n any space on device. Defaults to False.\n\n copy_attempts (int, optional): Number of times to attempt copying image\n files. Defaults to 1 (no retry).\n\n copy_attempts_sleep (int, optional): Number of seconds to sleep between\n copy_attempts. Defaults to 30.\n\n check_file_stability (bool, optional): Verifies that the file size is not\n changing. This ensures the image is not actively being copied.\n Defaults to False.\n\n stability_check_tries (int, optional): Max number of checks that can be\n done when checking file stability. Defaults to 3.\n\n stability_check_delay (int, optional): Delay between tries when checking\n file stability in seconds. Defaults to 2.\n\n min_free_space_percent ('int', optional) : Percentage of total disk space\n that must be free. If specified the percentage is not free then the\n stage will attempt to delete unprotected files to reach the minimum\n percentage. Defaults to None.\n\n use_kstack (bool, optional): Use faster version of copy with limited options.\n Defaults to False.\n\n interface (str, optional): The interface to use for file transfers, may be needed\n for copying files on some IOSXE platforms, such as ASR1K when using a VRF\n Defaults to None\n\n unique_file_name (bool, optional): Appends a random six-digit number to\n the end of the image name. Defaults to False.\n\n unique_number: (int, optional): Appends the provided number to the end of\n the image name. Defaults to None. Requires unique_file_name is True\n to be applied.\n\n rename_images: (str, optional): Rename the image to the provided name.\n If multiple files exist then an incrementing number is also appended.\n Defaults to None\n\n prompt_recovery(bool, optional): Enable the prompt recovery when the execution\n command timeout. Defaults to False.\n\nExample\n-------\ncopy_to_device:\n origin:\n hostname: server-1\n files:\n - /home/cisco/asr1k.bin\n destination:\n directory: harddisk:/\n protocol: sftp\n timeout: 300\n", + "doc": "This stage will copy an image to a device from a networked location.\n\n Stage Schema\n ------------\n copy_to_device:\n\n origin:\n\n files (list): Image files location on the server.\n\n hostname (str): Hostname or address of the server.\n\n destination:\n\n directory (str): Directory on the device to copy the images to.\n\n standby_directory (str, optional): Standby directory on the device\n to copy the images to. Defaults to None.\n\n protocol (str): Protocol used for copy operation.\n\n connection_alias (str): Connection alias to use\n\n verify_num_images (bool, optional): Verify number of images provided by\n user for clean is correct. Defaults to True.\n\n verify_running_image (bool, optional): Compare the image filename with the running\n image version on device. If a match is found, the copy stage will be skipped.\n Defaults to True.\n\n expected_num_images (int, optional): Number of images expected to be\n provided by user for clean. Defaults to 1.\n\n vrf (str, optional): Vrf used to copy. Defaults to an empty string.\n\n timeout (int, optional): Copy operation timeout in seconds. Defaults to 300.\n\n compact (bool, optional): Compact copy mode if supported by the device.\n Defaults to False.\n\n protected_files (list, optional): File patterns that should not be deleted.\n Defaults to None.\n\n overwrite (bool, optional): Overwrite the file if a file with the same\n name already exists. Defaults to False.\n\n skip_deletion (bool, optional): Do not delete any files even if there isn't\n any space on device. Defaults to False.\n\n copy_attempts (int, optional): Number of times to attempt copying image\n files. Defaults to 1 (no retry).\n\n copy_attempts_sleep (int, optional): Number of seconds to sleep between\n copy_attempts. Defaults to 30.\n\n check_file_stability (bool, optional): Verifies that the file size is not\n changing. This ensures the image is not actively being copied.\n Defaults to False.\n\n stability_check_tries (int, optional): Max number of checks that can be\n done when checking file stability. Defaults to 3.\n\n stability_check_delay (int, optional): Delay between tries when checking\n file stability in seconds. Defaults to 2.\n\n min_free_space_percent ('int', optional) : Percentage of total disk space\n that must be free. If specified the percentage is not free then the\n stage will attempt to delete unprotected files to reach the minimum\n percentage. Defaults to None.\n\n use_kstack (bool, optional): Use faster version of copy with limited options.\n Defaults to False.\n\n interface (str, optional): The interface to use for file transfers, may be needed\n for copying files on some IOSXE platforms, such as ASR1K when using a VRF\n Defaults to None\n\n unique_file_name (bool, optional): Appends a random six-digit number to\n the end of the image name. Defaults to False.\n\n unique_number: (int, optional): Appends the provided number to the end of\n the image name. Defaults to None. Requires unique_file_name is True\n to be applied.\n\n rename_images: (str, optional): Rename the image to the provided name.\n If multiple files exist then an incrementing number is also appended.\n Defaults to None\n\n prompt_recovery(bool, optional): Enable the prompt recovery when the execution\n command timeout. Defaults to False.\n\n Example\n -------\n copy_to_device:\n origin:\n hostname: server-1\n files:\n - /home/cisco/asr1k.bin\n destination:\n directory: harddisk:/\n protocol: sftp\n timeout: 300\n ", "module_name": "stages.iosxe.stages", "package": "genie.libs.clean", "tokens": { "os": "iosxe" }, "uid": "CopyToDevice", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1475" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2175" } }, "module_name": "stages.stages", @@ -492,7 +492,7 @@ "InstallImage": { "folders": { "iosxe": { - "doc": "This stage installs a provided image onto the device using the install\nCLI. It also handles the automatic reloading of your device after the\ninstall is complete.\n\nStage Schema\n------------\ninstall_image:\n images (list): Image to install\n\n directory (str): directory where packages.conf is created\n\n\n save_system_config (bool, optional): Whether or not to save the system\n config if it was modified. Defaults to False.\n\n skip_save_running_config (bool, optional): Skip the step to save the the running\n configuration to the startup config.\n\n install_timeout (int, optional): Maximum time in seconds to wait for install\n process to finish. Defaults to 500.\n\n reload_timeout (int, optional): Maximum time in seconds to wait for reload\n process to finish. Defaults to 800.\n\n verify_running_image (bool, optional): Compare the image filename with the running\n image version on device. If a match is found, the stage will be skipped.\n Defaults to True.\n\n reload_service_args (optional):\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n error_pattern (list, optional): List of regex strings to check for errors.\n Default: [r\"FAILED:.*?$\",]\n\n : \n Any other arguments that the Unicon reload service supports\n\nExample\n-------\ninstall_image:\n images:\n - /auto/some-location/that-this/image/stay-isr-image.bin\n save_system_config: True\n install_timeout: 1000\n reload_timeout: 1000\n\n", + "doc": "This stage installs a provided image onto the device using the install\n CLI. It also handles the automatic reloading of your device after the\n install is complete.\n\n Stage Schema\n ------------\n install_image:\n images (list): Image to install\n\n directory (str): directory where packages.conf is created\n\n\n save_system_config (bool, optional): Whether or not to save the system\n config if it was modified. Defaults to False.\n\n skip_save_running_config (bool, optional): Skip the step to save the the running\n configuration to the startup config.\n\n install_timeout (int, optional): Maximum time in seconds to wait for install\n process to finish. Defaults to 500.\n\n reload_timeout (int, optional): Maximum time in seconds to wait for reload\n process to finish. Defaults to 800.\n\n verify_running_image (bool, optional): Compare the image filename with the running\n image version on device. If a match is found, the stage will be skipped.\n Defaults to True.\n\n reload_service_args (optional):\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n error_pattern (list, optional): List of regex strings to check for errors.\n Default: [r\"FAILED:.*?$\",]\n\n : \n Any other arguments that the Unicon reload service supports\n\n Example\n -------\n install_image:\n images:\n - /auto/some-location/that-this/image/stay-isr-image.bin\n save_system_config: True\n install_timeout: 1000\n reload_timeout: 1000\n\n ", "folders": { "cat3k": { "doc": "This stage installs a provided image onto the device using the install\nCLI. It also handles the automatic reloading of your device after the\ninstall is complete.\n\nStage Schema\n------------\ninstall_image:\n images (list): Image to install\n\n save_system_config (bool, optional): Whether or not to save the system\n config if it was modified. Defaults to False.\n\n install_timeout (int, optional): Maximum time in seconds to wait for install\n process to finish. Defaults to 500.\n\n reload_timeout (int, optional): Maximum time in seconds to wait for reload\n process to finish. Defaults to 800.\n\nExample\n-------\ninstall_image:\n images:\n - /auto/some-location/that-this/image/stay-isr-image.bin\n save_system_config: True\n install_timeout: 1000\n reload_timeout: 1000\n\n", @@ -521,7 +521,7 @@ "os": "iosxe" }, "uid": "InstallImage", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L554" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L679" }, "iosxr": { "folders": { @@ -576,28 +576,56 @@ "InstallPackages": { "folders": { "iosxe": { - "doc": "This stage installs the provided packages using the install CLI.\n\nStage Schema\n------------\ninstall_packages:\n packages (list): Packages to install.\n\n save_system_config (bool, optional): Whether or not to save the system\n config if it was modified. Defaults to False.\n\n install_timeout (int, optional): Maximum time to wait for install\n process to finish. Defaults to 300.\n\nExample\n-------\ninstall_packages:\n packages:\n - /auto/some-location/that-this/image/stay-isr-image.bin\n save_system_config: True\n install_timeout: 1000\n\n", + "doc": "This stage installs the provided packages using the install CLI.\n\n Stage Schema\n ------------\n install_packages:\n packages (list): Packages to install.\n\n save_system_config (bool, optional): Whether or not to save the system\n config if it was modified. Defaults to False.\n\n install_timeout (int, optional): Maximum time to wait for install\n process to finish. Defaults to 300.\n\n Example\n -------\n install_packages:\n packages:\n - /auto/some-location/that-this/image/stay-isr-image.bin\n save_system_config: True\n install_timeout: 1000\n\n ", "module_name": "stages.iosxe.stages", "package": "genie.libs.clean", "tokens": { "os": "iosxe" }, "uid": "InstallPackages", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L815" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1437" } } }, "InstallRemoveInactive": { "folders": { "iosxe": { - "doc": "This stage removes partially installed packages/images left\non the device. If a super package is left partially installed,\nwe cannot attempt to install another until it is removed.\n\nStage Schema\n------------\ninstall_image:\n images (list, optional):\n image to not removed by stage.\n\n timeout (int, optional): Maximum time to wait for remove process to\n finish. Defaults to 180.\n\n force_remove (bool, optional): Whether or not to remove the inactive\n package irrespective of availability of passed image. Defaults to True.\n\nExample\n-------\ninstall_remove_inactive:\n timeout: 180\n\n", + "doc": "This stage removes partially installed packages/images left\n on the device. If a super package is left partially installed,\n we cannot attempt to install another until it is removed.\n\n Stage Schema\n ------------\n install_remove_inactive:\n images (list, optional):\n image to not removed by stage.\n\n timeout (int, optional): Maximum time to wait for remove process to\n finish. Defaults to 180.\n\n force_remove (bool, optional): Whether or not to remove the inactive\n package irrespective of availability of passed image. Defaults to True.\n\n Example\n -------\n install_remove_inactive:\n timeout: 180\n\n ", "module_name": "stages.iosxe.stages", "package": "genie.libs.clean", "tokens": { "os": "iosxe" }, "uid": "InstallRemoveInactive", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L471" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L586" + } + } + }, + "InstallRemoveSmu": { + "folders": { + "iosxe": { + "doc": "This stage removes smu images from the device.\n If the SMU is installed, it will be de-activated first.\n\n Stage Schema\n ------------\n install_remove_smu:\n\n timeout (int, optional): Maximum time to wait for remove process to\n finish. Defaults to 180.\n\n force_remove (bool, optional): Whether or not to remove the inactive\n package irrespective of availability of passed image. Defaults to True.\n\n Example\n -------\n install_remove_smu:\n timeout: 180\n\n ", + "module_name": "stages.iosxe.stages", + "package": "genie.libs.clean", + "tokens": { + "os": "iosxe" + }, + "uid": "InstallRemoveSmu", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1001" + } + } + }, + "InstallSmu": { + "folders": { + "iosxe": { + "doc": "This stage installs a provided smu image onto the device using the install\n CLI. It also handles the automatic reloading of your device after the\n install is complete.\n\n Stage Schema\n ------------\n install_smu:\n images (list): Image to install\n\n install_timeout (int, optional): Maximum time in seconds to wait for install\n process to finish. Defaults to 500.\n\n reload_timeout (int, optional): Maximum time in seconds to wait for reload\n process to finish. Defaults to 800.\n\n reload_service_args (optional):\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n error_pattern (list, optional): List of regex strings to check for errors.\n Default: [r\"FAILED:.*?$\",]\n\n : \n Any other arguments that the Unicon reload service supports\n\n Example\n -------\n install_smu:\n images:\n - /auto/some-location/that-this/image/smu-image.bin\n install_timeout: 1000\n reload_timeout: 1000\n\n ", + "module_name": "stages.iosxe.stages", + "package": "genie.libs.clean", + "tokens": { + "os": "iosxe" + }, + "uid": "InstallSmu", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1234" } } }, @@ -691,14 +719,14 @@ "doc": " This stage reloads the device.\n\nStage Schema\n------------\nreload:\n\n reload_service_args (optional):\n\n timeout (int, optional): Maximum time in seconds allowed for the reload.\n Defaults to 800.\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n error_pattern (list, optional): List of regex patterns to check for errors.\n Defaults to an empty list (no error checking).\n\n : \n Any other arguments that the Unicon reload service supports\n\n check_modules:\n\n check (bool, optional): Enable the checking of modules after reload.\n Defaults to True.\n\n timeout (int, optional): Maximum time in seconds allowed for verifying\n the modules are in a stable state. Defaults to 180.\n\n interval (int, optional): How often to check the module states in\n seconds. Defaults to 30.\n\n reconnect_via (str, optional): Specify which connection to use after reloading.\n Defaults to the 'default' connection in the testbed yaml file.\n\n\nExample\n-------\nreload:\n reload_service_args:\n timeout: 600\n reload_creds: clean_reload_creds\n prompt_recovery: True\n check_modules:\n check: False\n", "folders": { "iosxe": { - "doc": " This stage reloads the device.\n\nStage Schema\n------------\nreload:\n license: (optional)\n check: (bool, optional): Enable the checking license inconsistency and fix\n\n reload_service_args (optional):\n\n timeout (int, optional): Maximum time in seconds allowed for the reload.\n Defaults to 800.\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n\n : \n Any other arguments that the Unicon reload service supports\n\n check_modules:\n\n check (bool, optional): Enable the checking of modules after reload.\n Defaults to True.\n\n timeout (int, optional): Maximum time in seconds allowed for verifying\n the modules are in a stable state. Defaults to 180.\n\n interval (int, optional): How often to check the module states in\n seconds. Defaults to 30.\n\n reconnect_via (str, optional): Specify which connection to use after reloading.\n Defaults to the 'default' connection in the testbed yaml file.\n\n attempt_manual_boot (bool, optional): Enable to attempt manual boot when reload fails.\n Defaults to True.\n\nExample\n-------\nreload:\n reload_service_args:\n timeout: 600\n reload_creds: clean_reload_creds\n prompt_recovery: True\n check_modules:\n check: False\n", + "doc": "This stage reloads the device.\n\n Stage Schema\n ------------\n reload:\n license: (optional)\n check: (bool, optional): Enable the checking license inconsistency and fix\n\n reload_service_args (optional):\n\n timeout (int, optional): Maximum time in seconds allowed for the reload.\n Defaults to 800.\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n\n : \n Any other arguments that the Unicon reload service supports\n\n check_modules:\n\n check (bool, optional): Enable the checking of modules after reload.\n Defaults to True.\n\n timeout (int, optional): Maximum time in seconds allowed for verifying\n the modules are in a stable state. Defaults to 180.\n\n interval (int, optional): How often to check the module states in\n seconds. Defaults to 30.\n\n reconnect_via (str, optional): Specify which connection to use after reloading.\n Defaults to the 'default' connection in the testbed yaml file.\n\n attempt_manual_boot (bool, optional): Enable to attempt manual boot when reload fails.\n Defaults to True.\n\n Example\n -------\n reload:\n reload_service_args:\n timeout: 600\n reload_creds: clean_reload_creds\n prompt_recovery: True\n check_modules:\n check: False\n ", "module_name": "stages.iosxe.stages", "package": "genie.libs.clean", "tokens": { "os": "iosxe" }, "uid": "Reload", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L899" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1535" } }, "module_name": "stages.stages", @@ -709,14 +737,14 @@ "ResetConfiguration": { "folders": { "iosxe": { - "doc": " Reset device configuration by using config replace operation with a minimal configuration.\n\n This clean stage generates a minimal configuration from the running config and stores\n it in the base_config.txt file on bootflash. Then uses configure replace command to\n override the running configuration.\n\n If the file `base_config.txt` exists on flash, the contents will be overwritten.\n\nStage Schema\n------------\nreset_configuration:\n timeout (int, optional): The timeout for device configuration to complete in seconds.\n Defaults to 120.\n\nExample:\n\n reset_configuration:\n\n order:\n - connect\n - reset_configuration\n ", + "doc": "Reset device configuration by using config replace operation with a minimal configuration.\n\n This clean stage generates a minimal configuration from the running config and stores\n it in the base_config.txt file on bootflash. Then uses configure replace command to\n override the running configuration.\n\n If the file `base_config.txt` exists on flash, the contents will be overwritten.\n\n Stage Schema\n ------------\n reset_configuration:\n timeout (int, optional): The timeout for device configuration to complete in seconds.\n Defaults to 120.\n\n Example:\n\n reset_configuration:\n\n order:\n - connect\n - reset_configuration\n ", "module_name": "stages.iosxe.stages", "package": "genie.libs.clean", "tokens": { "os": "iosxe" }, "uid": "ResetConfiguration", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2374" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L3388" } } }, @@ -731,7 +759,7 @@ "RommonBoot": { "folders": { "iosxe": { - "doc": "This stage boots an image onto the device through rommon. Using either\na local image or one from a tftp server.\n\nStage Schema\n------------\nrommon_boot:\n\n image (list): Image to boot with\n\n tftp (optional): If specified boot via tftp otherwise boot using local\n image.\n\n ip_address (list, optional): Management ip address to configure to reach to the\n tftp server\n\n subnet_mask (str, optional): Management subnet mask\n\n gateway (str, optional): Management gateway\n\n tftp_server (str, optional): Tftp server that is reachable with management interface\n\n\n recovery_password (str): Enable password for device\n required after bootup. Defaults to None.\n\n recovery_enable_password (str): Enable password for device\n required after bootup. Defaults to None.\n\n recovery_username (str): Enable username for device\n required after bootup. Defaults to None.\n\n save_system_config (bool, optional): Whether or not to save the\n system config if it was modified. Defaults to True.\n\n timeout (int, optional): Max time allowed for the booting process.\n Defaults to 600.\n\n config_reg_timeout (int, optional): Max time to set config-register.\n Defaults to 30.\n\n config_register (str, optional): Specify a custom config register for rommon booting.\n Defaults to 0x0.\n\n rommon_timeout (int, optional): Timeout after bringing the device to rommon. Default to 15 sec.\n\n reconnect_timeout (int, optional): Timeout to reconnect the device after booting. Default to 90 sec.\n\nExample\n-------\nrommon_boot:\n image:\n - /auto/some-location/that-this/image/stay-isr-image.bin\n tftp:\n ip_address: [10.1.7.126, 10.1.7.127]\n gateway: 10.1.7.1\n subnet_mask: 255.255.255.0\n tftp_server: 11.1.7.251\n recovery_password: nbv_12345\n recovery_username: user_12345\n recovery_enable_password: en\n save_system_config: False\n timeout: 600\n config_reg_timeout: 10\n config_register: 0x0\n\nThere is more than one ip address, one for each supervisor.\n\nTo pass tftp information and tftp server ip from the testbed, refer the example below\n\n\ntestbed:\n name:\n name:\n passwords:\n tacacs: test\n enable: test\n servers:\n tftp:\n tftp:\n address: 10.x.x.x\n credentials:\n default:\n username: user\n password: 1234\ndevices:\n uut1:\n management:\n address:\n ipv4: '10.1.1.1/16'\n gateway:\n ipv4: '10.1.0.1'\n\n", + "doc": "This stage boots an image onto the device through rommon. Using either\n a local image or one from a tftp server.\n\n Stage Schema\n ------------\n rommon_boot:\n\n image (list): Image to boot with\n\n tftp (optional): If specified boot via tftp otherwise boot using local\n image.\n\n ip_address (list, optional): Management ip address to configure to reach to the\n tftp server\n\n subnet_mask (str, optional): Management subnet mask\n\n gateway (str, optional): Management gateway\n\n tftp_server (str, optional): Tftp server that is reachable with management interface\n\n\n recovery_password (str): Enable password for device\n required after bootup. Defaults to None.\n\n recovery_enable_password (str): Enable password for device\n required after bootup. Defaults to None.\n\n recovery_username (str): Enable username for device\n required after bootup. Defaults to None.\n\n save_system_config (bool, optional): Whether or not to save the\n system config if it was modified. Defaults to True.\n\n timeout (int, optional): Max time allowed for the booting process.\n Defaults to 600.\n\n config_reg_timeout (int, optional): Max time to set config-register.\n Defaults to 30.\n\n config_register (str, optional): Specify a custom config register for rommon booting.\n Defaults to 0x0.\n\n rommon_timeout (int, optional): Timeout after bringing the device to rommon. Default to 15 sec.\n\n reconnect_timeout (int, optional): Timeout to reconnect the device after booting. Default to 90 sec.\n\n Example\n -------\n rommon_boot:\n image:\n - /auto/some-location/that-this/image/stay-isr-image.bin\n tftp:\n ip_address: [10.1.7.126, 10.1.7.127]\n gateway: 10.1.7.1\n subnet_mask: 255.255.255.0\n tftp_server: 11.1.7.251\n recovery_password: nbv_12345\n recovery_username: user_12345\n recovery_enable_password: en\n save_system_config: False\n timeout: 600\n config_reg_timeout: 10\n config_register: 0x0\n\n There is more than one ip address, one for each supervisor.\n\n To pass tftp information and tftp server ip from the testbed, refer the example below\n\n config_register (str, optional): Specify a custom config register for rommon booting.\n Defaults to 0x0.\n\n testbed:\n name:\n name:\n passwords:\n tacacs: test\n enable: test\n servers:\n tftp:\n tftp:\n address: 10.x.x.x\n credentials:\n default:\n username: user\n password: 1234\n devices:\n uut1:\n management:\n address:\n ipv4: '10.1.1.1/16'\n gateway:\n ipv4: '10.1.0.1'\n\n ", "folders": { "cat9k": { "doc": "This stage boots an image onto the device through rommon. Using either\na local image or one from a tftp server.\n\nStage Schema\n------------\nrommon_boot:\n\n image (list): Image to boot with\n\n tftp (optional): If specified boot via tftp otherwise boot using local\n image.\n\n ip_address (list, optional): Management ip address to configure to reach to the\n tftp server\n\n subnet_mask (str, optional): Management subnet mask\n\n gateway (str, optional): Management gateway\n\n tftp_server (str, optional): Tftp server that is reachable with management interface\n \n recovery_password (str): Enable password for device\n required after bootup. Defaults to None.\n\n recovery_enable_password (str): Enable password for device\n required after bootup. Defaults to None.\n\n recovery_username (str): Enable username for device\n required after bootup. Defaults to None.\n\n save_system_config (bool, optional): Whether or not to save the\n system config if it was modified. Defaults to True.\n\n timeout (int, optional): Max time allowed for the booting process.\n Defaults to 600.\n\n config_reg_timeout (int, optional): Max time to set config-register.\n Defaults to 30.\n\nExample\n-------\nrommon_boot:\n image:\n - /auto/some-location/that-this/image/stay-isr-image.bin\n tftp:\n ip_address: [10.1.7.126, 10.1.7.127]\n gateway: 10.1.7.1\n subnet_mask: 255.255.255.0\n tftp_server: 11.1.7.251\n recovery_password: nbv_12345\n recovery_username: user_12345\n recovery_enable_password: en\n save_system_config: False\n timeout: 600\n config_reg_timeout: 10\n\nThere is more than one ip address, one for each supervisor.\n\nTo pass tftp information and tftp server ip from the testbed, refer the example below\n\n\ntestbed:\n name: \n passwords: \n tacacs: test\n enable: test\n servers:\n tftp: \n address: 10.x.x.x\n credentials:\n default:\n username: user\n password: 1234\ndevices:\n uut1:\n management:\n address:\n ipv4: '10.1.1.1/16'\n gateway:\n ipv4: '10.1.0.1'\n\n", @@ -750,7 +778,7 @@ "os": "iosxe" }, "uid": "RommonBoot", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1213" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1889" } } }, @@ -778,14 +806,14 @@ "SetControllerMode": { "folders": { "iosxe": { - "doc": "Set controller mode\n\nStage Schema\n------------\nset_controller_mode:\n\n mode (str, optional): `enable` or `disable`. Defaults to `enable`\n\n reload_timeout (int, optional): maximum time to wait for reload.\n Defaults to 600 secs\n\n delete_inactive_versions (bool, optional): delete non active version after\n changing image. Defaults to True\n\nExample\n-------\nset_controller_mode:\n mode: enable\n reload_timeout: 600\n delete_inactive_versions: True\n", + "doc": "Set controller mode\n\n Stage Schema\n ------------\n set_controller_mode:\n\n mode (str, optional): `enable` or `disable`. Defaults to `enable`\n\n reload_timeout (int, optional): maximum time to wait for reload.\n Defaults to 600 secs\n\n delete_inactive_versions (bool, optional): delete non active version after\n changing image. Defaults to True\n\n Example\n -------\n set_controller_mode:\n mode: enable\n reload_timeout: 600\n delete_inactive_versions: True\n ", "module_name": "stages.iosxe.stages", "package": "genie.libs.clean", "tokens": { "os": "iosxe" }, "uid": "SetControllerMode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2562" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L3605" } } }, @@ -827,7 +855,7 @@ "TftpBoot": { "folders": { "iosxe": { - "doc": "This stage boots a new image onto your device using the tftp booting\nmethod.\n\nStage Schema\n------------\ntftp_boot:\n\n image (list): Image to boot with\n\n ip_address (list): Management ip address to configure to reach to the\n tftp server\n\n subnet_mask (str): Management subnet mask\n\n gateway (str): Management gateway\n\n tftp_server (str): Tftp server that is reachable with management interface\n\n recovery_password (str): Enable password for device\n required after bootup. Defaults to None.\n\n recovery_en_password (str): Enable password for device\n required after bootup. Defaults to None.\n\n recovery_username (str): Enable username for device\n required after bootup. Defaults to None.\n\n save_system_config (bool, optional): Whether or not to save the\n system config if it was modified. Defaults to True.\n\n timeout (int, optional): Max time during which tftp boot must\n complete. Defaults to 600.\n\n config_reg_timeout (int, optional): Max time to set config-register.\n Defaults to 30.\n\n image_length_limit(int, optional): Maximum length of characters for image.\n Defaults to 110.\n\n ether_port(int, optional): port to set for tftp boot. Defaults to None.\n\nExample\n-------\ntftp_boot:\n image:\n - /auto/some-location/that-this/image/stay-isr-image.bin\n ip_address: [10.1.7.126, 10.1.7.127]\n gateway: 10.1.7.1\n subnet_mask: 255.255.255.0\n tftp_server: 11.1.7.251\n recovery_password: nbv_12345\n recovery_username: user_12345\n recovery_en_password: en\n save_system_config: False\n timeout: 600\n config_reg_timeout: 10\n image_length_limit: 90\n ether_port: 0\n\nThere is more than one ip address, one for each supervisor.\n", + "doc": "This stage boots a new image onto your device using the tftp booting\n method.\n\n Stage Schema\n ------------\n tftp_boot:\n\n image (list): Image to boot with\n\n ip_address (list): Management ip address to configure to reach to the\n tftp server\n\n subnet_mask (str): Management subnet mask\n\n gateway (str): Management gateway\n\n tftp_server (str): Tftp server that is reachable with management interface\n\n recovery_password (str): Enable password for device\n required after bootup. Defaults to None.\n\n recovery_en_password (str): Enable password for device\n required after bootup. Defaults to None.\n\n recovery_username (str): Enable username for device\n required after bootup. Defaults to None.\n\n save_system_config (bool, optional): Whether or not to save the\n system config if it was modified. Defaults to True.\n\n timeout (int, optional): Max time during which tftp boot must\n complete. Defaults to 600.\n\n config_reg_timeout (int, optional): Max time to set config-register.\n Defaults to 30.\n\n image_length_limit(int, optional): Maximum length of characters for image.\n Defaults to 110.\n\n ether_port(int, optional): port to set for tftp boot. Defaults to None.\n\n Example\n -------\n tftp_boot:\n image:\n - /auto/some-location/that-this/image/stay-isr-image.bin\n ip_address: [10.1.7.126, 10.1.7.127]\n gateway: 10.1.7.1\n subnet_mask: 255.255.255.0\n tftp_server: 11.1.7.251\n recovery_password: nbv_12345\n recovery_username: user_12345\n recovery_en_password: en\n save_system_config: False\n timeout: 600\n config_reg_timeout: 10\n image_length_limit: 90\n ether_port: 0\n\n There is more than one ip address, one for each supervisor.\n ", "folders": { "cat9k": { "doc": "This stage boots a new image onto your device using the tftp booting\nmethod.\n\nStage Schema\n------------\ntftp_boot:\n\n image (list): Image to boot with\n\n ip_address (list): Management ip address to configure to reach to the\n tftp server\n\n subnet_mask (str): Management subnet mask\n\n gateway (str): Management gateway\n\n tftp_server (str): Tftp server that is reachable with management interface\n\n recovery_password (str): Enable password for device\n required after bootup. Defaults to None.\n\n recovery_username (str): Enable username for device\n required after bootup. Defaults to None.\n\n save_system_config (bool, optional): Whether or not to save the\n system config if it was modified. Defaults to True.\n\n timeout (int, optional): Max time during which tftp boot must\n complete. Defaults to 1000 seconds.\n\n image_length_limit(int, optional): Maximum length of characters for image.\n Defaults to 110.\n\nExample\n-------\ntftp_boot:\n image:\n - /auto/some-location/that-this/image/stay-isr-image.bin\n ip_address: [10.1.7.126, 10.1.7.127]\n gateway: 10.1.7.1\n subnet_mask: 255.255.255.0\n tftp_server: 11.1.7.251\n recovery_password: nbv_12345\n recovery_username: user_123\n save_system_config: False\n timeout: 1000\n image_length_limit: 90\n\nThere is more than one ip address, one for each supervisor.\n", @@ -856,7 +884,7 @@ "os": "iosxe" }, "uid": "TftpBoot", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L202" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L231" }, "iosxr": { "doc": "This stage boots a new image onto your device using the tftp booting\nmethod.\n\nStage Schema\n------------\ntftp_boot:\n\n image (list): Image to boot with\n\n ip_address (list): Management ip address to configure to reach to the\n tftp server\n\n subnet_mask (str): Management subnet mask\n\n gateway (str): Management gateway\n\n tftp_server (str): Tftp server that is reachable with management interface\n\n timeout (int, optional): Max time during which tftp boot must\n complete. Defaults to 600.\n\n config_reg_timeout (int, optional): Max time to set config-register.\n Defaults to 30.\n\n device_reload_sleep (int, optional): Time in seconds to wait after\n reloading the device. Defaults to 20.\n\n recovery_username (str, optional): Enable username for device\n required after bootup. Defaults to None.\n\n recovery_password (str, optional): Enable password for device\n required after bootup. Defaults to None.\n\nExample\n-------\ntftp_boot:\n image:\n - /auto/some-location/that-this/image/asr9k-mini-px.vm\n ip_address: [10.1.7.126, 10.1.7.127]\n gateway: 10.1.7.1\n subnet_mask: 255.255.255.0\n tftp_server: 11.1.7.251\n timeout: 1200\n config_reg_timeout: 60\n device_reload_sleep: 300\n recovery_username: admin\n recovery_password: nbv_12345\n\nNote: There is more than one ip address, one for each supervisor.\n", diff --git a/pkgs/clean-pkg/src/genie/libs/clean/__init__.py b/pkgs/clean-pkg/src/genie/libs/clean/__init__.py index d9610ab10..a49e5fb46 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/__init__.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/__init__.py @@ -8,7 +8,7 @@ ''' # metadata -__version__ = '24.9' +__version__ = '24.10' __author__ = 'Cisco Systems Inc.' __contact__ = ['asg-genie-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2019, Cisco Systems Inc.' diff --git a/pkgs/clean-pkg/src/genie/libs/clean/recovery/iosxe/recovery.py b/pkgs/clean-pkg/src/genie/libs/clean/recovery/iosxe/recovery.py index c6ce1a583..fcc16ea37 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/recovery/iosxe/recovery.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/recovery/iosxe/recovery.py @@ -58,7 +58,7 @@ def recovery_worker(start, device, console_activity_pattern=None, if kwargs.get('golden_image'): device_recovery(spawn, timeout, *args, **kwargs) elif kwargs.get('tftp_boot'): - tftp_device_recovery(spawn, timeout, device, *args, **kwargs) + device.api.device_rommon_boot(tftp_boot=kwargs.get('tftp_boot')) spawn.close() diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/image_handler.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/image_handler.py index 215d233dd..7ccc1e14f 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/image_handler.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/image_handler.py @@ -1,4 +1,4 @@ -'''IOSXE: Image Handler Class''' +"""IOSXE: Image Handler Class""" import yaml @@ -18,6 +18,7 @@ class ImageLoader(object): ------------ images: - /path/to/image.bin +- /path/to/smu.bin - /path/to/optional_package1 - /path/to/optional_package2 @@ -26,6 +27,8 @@ class ImageLoader(object): images: image: - /path/to/image.bin + smu: <<< optional + - /path/to/smu.bin packages: <<< optional - /path/to/optional_package1 - /path/to/optional_package2 @@ -38,6 +41,9 @@ class ImageLoader(object): image: file: - /path/to/image.bin + smu: <<< optional + file: + - /path/to/smu.bin packages: <<< optional file: - /path/to/optional_package1 @@ -51,16 +57,21 @@ class ImageLoader(object): {}""" def load(self, images): - if (not self.valid_structure_1(images) and - not self.valid_structure_2(images) and - not self.valid_structure_3(images)): + if ( + not self.valid_structure_1(images) + and not self.valid_structure_2(images) + and not self.valid_structure_3(images) + ): - raise Exception(self.EXPECTED_IMAGE_STRUCTURE_MSG.format( - yaml.dump({'images': images}))) + raise Exception( + self.EXPECTED_IMAGE_STRUCTURE_MSG.format(yaml.dump({"images": images})) + ) def valid_structure_1(self, images): schema = ListOf(str) + smus = [] + packages = [] try: Schema(schema).validate(images) @@ -68,11 +79,21 @@ def valid_structure_1(self, images): return False if len(images) == 1: - setattr(self, 'image', images) + setattr(self, "image", images) return True if len(images) >= 2: - setattr(self, 'image', images[:1]) - setattr(self, 'packages', images[1:]) + setattr(self, "image", images[:1]) + + for image in images[1:]: + + if "smu" in image: + smus.append(image) + setattr(self, "smu", smus) + continue + + packages.append(image) + setattr(self, "packages", packages) + return True else: return False @@ -80,9 +101,10 @@ def valid_structure_1(self, images): def valid_structure_2(self, images): schema = { - 'image': ListOf(str), - Optional('packages'): ListOf(str), - Optional('other'): ListOf(str) + "image": ListOf(str), + Optional("smu"): ListOf(str), + Optional("packages"): ListOf(str), + Optional("other"): ListOf(str), } try: @@ -90,31 +112,28 @@ def valid_structure_2(self, images): except Exception: return False - if len(images['image']) != 1: + if len(images["image"]) != 1: return False else: - setattr(self, 'image', images['image']) + setattr(self, "image", images["image"]) - if 'packages' in images: - setattr(self, 'packages', images['packages']) + if "smu" in images: + setattr(self, "smu", images["smu"]) - setattr(self, 'other', images.get('other', [])) + if "packages" in images: + setattr(self, "packages", images["packages"]) - return True + setattr(self, "other", images.get("other", [])) + return True def valid_structure_3(self, images): schema = { - 'image': { - 'file': ListOf(str) - }, - Optional('packages'): { - 'file': ListOf(str) - }, - Optional('other'): { - 'file': ListOf(str) - } + "image": {"file": ListOf(str)}, + Optional("smu"): {"file": ListOf(str)}, + Optional("packages"): {"file": ListOf(str)}, + Optional("other"): {"file": ListOf(str)}, } try: @@ -122,15 +141,18 @@ def valid_structure_3(self, images): except Exception: return False - if len(images['image']['file']) != 1: + if len(images["image"]["file"]) != 1: return False else: - setattr(self, 'image', images['image']['file']) + setattr(self, "image", images["image"]["file"]) - if 'packages' in images: - setattr(self, 'packages', images['packages']['file']) + if "smu" in images: + setattr(self, "smu", images["smu"]["file"]) - setattr(self, 'other', images.get('other', {}).get('file', [])) + if "packages" in images: + setattr(self, "packages", images["packages"]["file"]) + + setattr(self, "other", images.get("other", {}).get("file", [])) return True @@ -140,6 +162,7 @@ class ImageHandler(BaseImageHandler, ImageLoader): def __init__(self, device, images, *args, **kwargs): # Set default + self.smu = [] self.packages = [] self.other = [] @@ -148,132 +171,165 @@ def __init__(self, device, images, *args, **kwargs): ImageLoader.load(self, images) # Temp workaround for XPRESSO - self.image = [self.image[0].replace('file://', '')] - if hasattr(self, 'packages'): - self.packages = [x.replace('file://', '') for x in self.packages] + self.image = [self.image[0].replace("file://", "")] + + if hasattr(self, "smu"): + self.smu = [x.replace("file://", "") for x in self.smu] - if hasattr(self, 'other'): - self.other = [x.replace('file://', '') for x in self.other] + if hasattr(self, "packages"): + self.packages = [x.replace("file://", "") for x in self.packages] - self.original_image = [self.image[0].replace('file://', '')] + if hasattr(self, "other"): + self.other = [x.replace("file://", "") for x in self.other] + + self.original_image = [self.image[0].replace("file://", "")] super().__init__(device, *args, **kwargs) def update_image_references(self, section): # section.parameters['image_mapping'] shall be saved in any # stage that modifies the image name/path - if 'image_mapping' in section.parameters: + if "image_mapping" in section.parameters: for index, image in enumerate(self.image): # change the saved image to the new image name/path - self.image[index] = section.parameters['image_mapping'].get(image, image) + self.image[index] = section.parameters["image_mapping"].get( + image, image + ) + + for index, smu in enumerate(self.smu): + # change the saved smu image to the new smu image name/path + self.smu[index] = section.parameters["image_mapping"].get(smu, smu) for index, package in enumerate(self.packages): # change the saved package to the new package name/path - self.packages[index] = section.parameters['image_mapping'].get(package, package) - - if hasattr(self, 'other'): - for index,image in enumerate(self.other): - self.other[index] = section.parameters['image_mapping'].get(image, self.other[index]) - - def update_tftp_boot(self, number=''): - '''Update clean section 'tftp_boot' with image information''' - tftp_boot = self.device.clean.setdefault('tftp_boot'+number, {}) + self.packages[index] = section.parameters["image_mapping"].get( + package, package + ) + + if hasattr(self, "other"): + for index, image in enumerate(self.other): + self.other[index] = section.parameters["image_mapping"].get( + image, self.other[index] + ) + + def update_tftp_boot(self, number=""): + """Update clean section 'tftp_boot' with image information""" + tftp_boot = self.device.clean.setdefault("tftp_boot" + number, {}) if self.override_stage_images: - tftp_boot.update({'image': self.image}) + tftp_boot.update({"image": self.image}) else: - tftp_boot.setdefault('image', self.image) + tftp_boot.setdefault("image", self.image) - def update_copy_to_linux(self, number=''): - '''Update clean section 'copy_to_linux' with image information''' + def update_copy_to_linux(self, number=""): + """Update clean section 'copy_to_linux' with image information""" - origin = self.device.clean.setdefault('copy_to_linux' + number, {}). \ - setdefault('origin', {}) + origin = self.device.clean.setdefault("copy_to_linux" + number, {}).setdefault( + "origin", {} + ) if self.override_stage_images: - origin.update({'files': self.image + self.packages + self.other}) + origin.update({"files": self.image + self.smu + self.packages + self.other}) else: - origin.setdefault('files', self.image + self.packages + self.other) + origin.setdefault( + "files", self.image + self.smu + self.packages + self.other + ) - def update_copy_to_device(self, number=''): - '''Update clean stage 'copy_to_device' with image information''' + def update_copy_to_device(self, number=""): + """Update clean stage 'copy_to_device' with image information""" - origin = self.device.clean.setdefault('copy_to_device' + number, {}). \ - setdefault('origin', {}) + origin = self.device.clean.setdefault("copy_to_device" + number, {}).setdefault( + "origin", {} + ) if self.override_stage_images: - origin.update({'files': self.image + self.packages + self.other}) + origin.update({"files": self.image + self.smu + self.packages + self.other}) else: - origin.setdefault('files', self.image + self.packages + self.other) + origin.setdefault( + "files", self.image + self.smu + self.packages + self.other + ) - def update_change_boot_variable(self, number=''): - '''Update clean stage 'change_boot_variable' with image information''' + def update_change_boot_variable(self, number=""): + """Update clean stage 'change_boot_variable' with image information""" - change_boot_variable = self.device.clean.setdefault('change_boot_variable'+number, {}) + change_boot_variable = self.device.clean.setdefault( + "change_boot_variable" + number, {} + ) if self.override_stage_images: - change_boot_variable.update({'images': self.image}) + change_boot_variable.update({"images": self.image}) else: - change_boot_variable.setdefault('images', self.image) + change_boot_variable.setdefault("images", self.image) - def update_expand_image(self, number=''): - '''Update clean stage 'expand_image' with image information''' + def update_expand_image(self, number=""): + """Update clean stage 'expand_image' with image information""" - expand_image = self.device.clean.setdefault('expand_image'+number, {}) + expand_image = self.device.clean.setdefault("expand_image" + number, {}) if self.override_stage_images: - expand_image.update({'image': self.image}) + expand_image.update({"image": self.image}) else: - expand_image.setdefault('image', self.image) + expand_image.setdefault("image", self.image) - def update_verify_running_image(self, number=''): - '''Update clean stage 'verify_running_image' with image information''' - verify_running_image = self.device.clean. \ - setdefault('verify_running_image' + number, {}) + def update_verify_running_image(self, number=""): + """Update clean stage 'verify_running_image' with image information""" + verify_running_image = self.device.clean.setdefault( + "verify_running_image" + number, {} + ) - if verify_running_image.get('verify_md5'): + if verify_running_image.get("verify_md5"): if self.override_stage_images: - verify_running_image.update({'images': self.original_image}) + verify_running_image.update({"images": self.original_image}) else: - verify_running_image.setdefault('images', self.original_image) + verify_running_image.setdefault("images", self.original_image) else: if self.override_stage_images: - verify_running_image.update({'images': self.image}) + verify_running_image.update({"images": self.image}) else: - verify_running_image.setdefault('images', self.image) + verify_running_image.setdefault("images", self.image) - def update_install_image(self, number=''): - '''Update clean stage 'install_image' with image information''' + def update_install_image(self, number=""): + """Update clean stage 'install_image' with image information""" - install_image = self.device.clean.setdefault('install_image'+number, {}) + install_image = self.device.clean.setdefault("install_image" + number, {}) if self.override_stage_images: - install_image.update({'images': self.image}) + install_image.update({"images": self.image}) else: - install_image.setdefault('images', self.image) + install_image.setdefault("images", self.image) - def update_install_packages(self, number=''): - '''Update clean stage 'install_packages' with package information''' + def update_install_smu(self, number=""): + """Update clean stage 'install_smu' with smu image information""" - install_packages = self.device.clean.setdefault('install_packages'+number, {}) + install_smu = self.device.clean.setdefault("install_smu" + number, {}) if self.override_stage_images: - install_packages.update({'packages': self.packages}) + install_smu.update({"images": self.smu}) else: - install_packages.setdefault('packages', self.packages) + install_smu.setdefault("images", self.smu) - def update_reload(self, number=''): - '''Update reload stage reload_service_args.image with image information + def update_install_packages(self, number=""): + """Update clean stage 'install_packages' with package information""" - Only updates image info if `copy_to_device` stage was executed. - ''' - if 'copy_to_device' in self.history and self.image: - reload_service_args = self.device.clean.setdefault('reload'+number, {}).\ - setdefault('reload_service_args', {}) - reload_service_args['image'] = self.image[0] + install_packages = self.device.clean.setdefault("install_packages" + number, {}) + if self.override_stage_images: + install_packages.update({"packages": self.packages}) + else: + install_packages.setdefault("packages", self.packages) - def update_install_remove_inactive(self, number=''): - '''Update install_remove_inactive stage images with image information + def update_reload(self, number=""): + """Update reload stage reload_service_args.image with image information - ''' - install_remove_inactive = self.device.clean.setdefault('install_remove_inactive'+number, {}) + Only updates image info if `copy_to_device` stage was executed. + """ + if "copy_to_device" in self.history and self.image: + reload_service_args = self.device.clean.setdefault( + "reload" + number, {} + ).setdefault("reload_service_args", {}) + reload_service_args["image"] = self.image[0] + + def update_install_remove_inactive(self, number=""): + """Update install_remove_inactive stage images with image information""" + install_remove_inactive = self.device.clean.setdefault( + "install_remove_inactive" + number, {} + ) if self.override_stage_images: - install_remove_inactive.update({'images': self.image}) + install_remove_inactive.update({"images": self.image}) else: - install_remove_inactive.setdefault('images', self.image) \ No newline at end of file + install_remove_inactive.setdefault("images", self.image) diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py index 9a295eb69..aa637b267 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py @@ -1,6 +1,6 @@ -''' +""" IOSXE specific clean stages -''' +""" # Python import re @@ -30,7 +30,8 @@ find_clean_variable, verify_num_images_provided, remove_string_from_image, - raise_) + raise_, +) # Unicon from unicon.eal.dialogs import Statement, Dialog @@ -45,120 +46,136 @@ class ChangeBootVariable(BaseStage): """This stage configures boot variables of the device using the following steps: - - Delete existing boot variables. - - Configure boot variables using the provided 'images'. - - Set the configuration-register using the provided 'config_register'. - - Write memory. - - Verify the boot variables are as expected. - - Verify the configuration-register is as expected. + - Delete existing boot variables. + - Configure boot variables using the provided 'images'. + - Set the configuration-register using the provided 'config_register'. + - Write memory. + - Verify the boot variables are as expected. + - Verify the configuration-register is as expected. -Stage Schema ------------- -change_boot_variable: + Stage Schema + ------------ + change_boot_variable: - images (list): Image files to use when configuring the boot variables. + images (list): Image files to use when configuring the boot variables. - timeout (int, optional): Execute timeout in seconds. Defaults to 300. + timeout (int, optional): Execute timeout in seconds. Defaults to 300. - config_register (str, optional): Value to set config-register for - reload. Defaults to 0x2102. + config_register (str, optional): Value to set config-register for + reload. Defaults to 0x2102. - current_running_image (bool, optional): Set the boot variable to the currently - running image from the show version command instead of the image provided. - Defaults to False. + current_running_image (bool, optional): Set the boot variable to the currently + running image from the show version command instead of the image provided. + Defaults to False. -Example -------- -change_boot_variable: - images: - - harddisk:/image.bin - timeout: 150 -""" + Example + ------- + change_boot_variable: + images: + - harddisk:/image.bin + timeout: 150 + """ # ================= # Argument Defaults # ================= TIMEOUT = 300 - CONFIG_REGISTER = '0x2102' + CONFIG_REGISTER = "0x2102" CURRENT_RUNNING_IMAGE = False # ============ # Stage Schema # ============ schema = { - Optional('images'): list, - Optional('timeout'): int, - Optional('config_register'): str, - Optional('current_running_image'): bool, - + Optional("images"): list, + Optional("timeout"): int, + Optional("config_register"): str, + Optional("current_running_image"): bool, # Deprecated - Optional('check_interval'): int, - Optional('max_time'): int, - Optional('write_memory'): bool, + Optional("check_interval"): int, + Optional("max_time"): int, + Optional("write_memory"): bool, } # ============================== # Execution order of Stage steps # ============================== exec_order = [ - 'delete_boot_variable', - 'configure_boot_variable', - 'set_configuration_register', - 'write_memory', - 'verify_boot_variable', - 'verify_configuration_register' + "delete_boot_variable", + "configure_boot_variable", + "set_configuration_register", + "write_memory", + "verify_boot_variable", + "verify_configuration_register", ] def delete_boot_variable(self, steps, device): - with steps.start("Delete any configured boot variables on {}".format( - device.name)) as step: + with steps.start( + "Delete any configured boot variables on {}".format(device.name) + ) as step: try: - device.configure('no boot system') + device.configure("no boot system") except Exception as e: - step.failed("Failed to delete configured boot variables", - from_exception=e) + step.failed( + "Failed to delete configured boot variables", from_exception=e + ) else: step.passed("Successfully deleted configured boot variables") - def configure_boot_variable(self, steps, device, images, timeout=TIMEOUT, - current_running_image=CURRENT_RUNNING_IMAGE): + def configure_boot_variable( + self, + steps, + device, + images, + timeout=TIMEOUT, + current_running_image=CURRENT_RUNNING_IMAGE, + ): - with steps.start("Set boot variable to images provided for {}".format( - device.name)) as step: + with steps.start( + "Set boot variable to images provided for {}".format(device.name) + ) as step: if current_running_image: - log.info("Retrieving and using the running image due to " - "'current_running_image: True'") + log.info( + "Retrieving and using the running image due to " + "'current_running_image: True'" + ) try: - output = device.parse('show version') - images = self.running_images = [output['version']['system_image']] + output = device.parse("show version") + images = self.running_images = [output["version"]["system_image"]] except Exception as e: - step.failed("Failed to retrieve the running image. Cannot " - "set boot variables", - from_exception=e) + step.failed( + "Failed to retrieve the running image. Cannot " + "set boot variables", + from_exception=e, + ) try: device.api.execute_set_boot_variable( - boot_images=images, timeout=timeout) + boot_images=images, timeout=timeout + ) except Exception as e: - step.failed("Failed to set boot variables to images provided", - from_exception=e) + step.failed( + "Failed to set boot variables to images provided", from_exception=e + ) else: step.passed("Successfully set boot variables to images provided") - def set_configuration_register(self, steps, device, - config_register=CONFIG_REGISTER, timeout=TIMEOUT): - with steps.start("Set config register to boot new image on {}".format( - device.name)) as step: + def set_configuration_register( + self, steps, device, config_register=CONFIG_REGISTER, timeout=TIMEOUT + ): + with steps.start( + "Set config register to boot new image on {}".format(device.name) + ) as step: try: device.api.execute_set_config_register( - config_register=config_register, timeout=timeout) + config_register=config_register, timeout=timeout + ) except Exception as e: - step.failed("Failed to set config-register", - from_exception=e) + step.failed("Failed to set config-register", from_exception=e) else: step.passed("Successfully set config register") @@ -167,15 +184,24 @@ def write_memory(self, steps, device, timeout=TIMEOUT): try: device.api.execute_write_memory(timeout=timeout) except Exception as e: - step.failed("Failed to execute 'write memory'", - from_exception=e) + step.failed("Failed to execute 'write memory'", from_exception=e) else: step.passed("Successfully executed 'write memory'") - def verify_boot_variable(self, steps, device, images, - current_running_image=CURRENT_RUNNING_IMAGE): - with steps.start("Verify next reload boot variables are correctly set " - "on {}".format(device.name)) as step: + def verify_boot_variable( + self, steps, device, images, current_running_image=CURRENT_RUNNING_IMAGE + ): + with steps.start( + "Verify next reload boot variables are correctly set " + "on {}".format(device.name) + ) as step: + + if current_running_image: + log.info( + "Verifying next reload boot variables Using the running image due to " + "'current_running_image: True'" + ) + images = self.running_images if current_running_image: log.info("Verifying next reload boot variables Using the running image due to " @@ -187,13 +213,16 @@ def verify_boot_variable(self, steps, device, images, else: step.passed("Boot variables are correctly set") - def verify_configuration_register(self, steps, device, - config_register=CONFIG_REGISTER): - with steps.start("Verify config-register is as expected on {}".format( - device.name)) as step: + def verify_configuration_register( + self, steps, device, config_register=CONFIG_REGISTER + ): + with steps.start( + "Verify config-register is as expected on {}".format(device.name) + ) as step: if not device.api.verify_config_register( - config_register=config_register, next_reload=True): + config_register=config_register, next_reload=True + ): step.failed("Config-register is not as expected") else: step.passed("Config-register is as expected") @@ -201,259 +230,342 @@ def verify_configuration_register(self, steps, device, class TftpBoot(BaseStage): """This stage boots a new image onto your device using the tftp booting -method. + method. -Stage Schema ------------- -tftp_boot: + Stage Schema + ------------ + tftp_boot: - image (list): Image to boot with + image (list): Image to boot with - ip_address (list): Management ip address to configure to reach to the - tftp server + ip_address (list): Management ip address to configure to reach to the + tftp server - subnet_mask (str): Management subnet mask + subnet_mask (str): Management subnet mask - gateway (str): Management gateway + gateway (str): Management gateway - tftp_server (str): Tftp server that is reachable with management interface + tftp_server (str): Tftp server that is reachable with management interface - recovery_password (str): Enable password for device - required after bootup. Defaults to None. + recovery_password (str): Enable password for device + required after bootup. Defaults to None. - recovery_en_password (str): Enable password for device - required after bootup. Defaults to None. + recovery_en_password (str): Enable password for device + required after bootup. Defaults to None. - recovery_username (str): Enable username for device - required after bootup. Defaults to None. + recovery_username (str): Enable username for device + required after bootup. Defaults to None. - save_system_config (bool, optional): Whether or not to save the - system config if it was modified. Defaults to True. + save_system_config (bool, optional): Whether or not to save the + system config if it was modified. Defaults to True. - timeout (int, optional): Max time during which tftp boot must - complete. Defaults to 600. + timeout (int, optional): Max time during which tftp boot must + complete. Defaults to 600. - config_reg_timeout (int, optional): Max time to set config-register. - Defaults to 30. + config_reg_timeout (int, optional): Max time to set config-register. + Defaults to 30. - image_length_limit(int, optional): Maximum length of characters for image. - Defaults to 110. + image_length_limit(int, optional): Maximum length of characters for image. + Defaults to 110. - ether_port(int, optional): port to set for tftp boot. Defaults to None. + ether_port(int, optional): port to set for tftp boot. Defaults to None. -Example -------- -tftp_boot: - image: - - /auto/some-location/that-this/image/stay-isr-image.bin - ip_address: [10.1.7.126, 10.1.7.127] - gateway: 10.1.7.1 - subnet_mask: 255.255.255.0 - tftp_server: 11.1.7.251 - recovery_password: nbv_12345 - recovery_username: user_12345 - recovery_en_password: en - save_system_config: False - timeout: 600 - config_reg_timeout: 10 - image_length_limit: 90 - ether_port: 0 + Example + ------- + tftp_boot: + image: + - /auto/some-location/that-this/image/stay-isr-image.bin + ip_address: [10.1.7.126, 10.1.7.127] + gateway: 10.1.7.1 + subnet_mask: 255.255.255.0 + tftp_server: 11.1.7.251 + recovery_password: nbv_12345 + recovery_username: user_12345 + recovery_en_password: en + save_system_config: False + timeout: 600 + config_reg_timeout: 10 + image_length_limit: 90 + ether_port: 0 -There is more than one ip address, one for each supervisor. -""" + There is more than one ip address, one for each supervisor. + """ # ================= # Argument Defaults # ================= RECOVERY_PASSWORD = None - RECOVERY_EN_PASSWORD=None + RECOVERY_EN_PASSWORD = None RECOVERY_USERNAME = None SAVE_SYSTEM_CONFIG = False TIMEOUT = 1200 CONFIG_REG_TIMEOUT = 30 - CONFIG_REG_ROMMON = '0x0' - CONFIG_REG_NORMAL = '0x2101' + CONFIG_REG_ROMMON = "0x0" + CONFIG_REG_NORMAL = "0x2101" IMAGE_LENGTH_LIMIT = 110 ETHER_PORT = None # ============ # Stage Schema # ============ schema = { - 'image': list, - 'ip_address': list, - 'subnet_mask': str, - 'gateway': str, - 'tftp_server': str, - 'recovery_password': str, - 'recovery_username': str, - Optional('recovery_en_password'): str, - Optional('save_system_config'): bool, - Optional('timeout'): int, - Optional('config_reg_timeout'): int, - Optional('image_length_limit'): int, - Optional('ether_port') : int + "image": list, + "ip_address": list, + "subnet_mask": str, + "gateway": str, + "tftp_server": str, + "recovery_password": str, + "recovery_username": str, + Optional("recovery_en_password"): str, + Optional("save_system_config"): bool, + Optional("timeout"): int, + Optional("config_reg_timeout"): int, + Optional("image_length_limit"): int, + Optional("ether_port"): int, } # ============================== # Execution order of Stage steps # ============================== exec_order = [ - 'check_image_length', - 'set_config_register', - 'go_to_rommon', - 'tftp_boot', - 'reconnect', - 'reset_config_register', - 'write_memory' + "check_image_length", + "set_config_register", + "go_to_rommon", + "tftp_boot", + "reconnect", + "reset_config_register", + "write_memory", ] - def check_image_length(self ,steps, image, image_length_limit=IMAGE_LENGTH_LIMIT): - log.warning('The next release will REMOVE the following keys from the tftp_boot schema:\n' - 'recovery_password, recovery_username, recovery_en_password, ether_port, save_system_config\n' - 'Please update the clean YAML file accordingly.' - ) + def check_image_length(self, steps, image, image_length_limit=IMAGE_LENGTH_LIMIT): + log.warning( + "The next release will REMOVE the following keys from the tftp_boot schema:\n" + "recovery_password, recovery_username, recovery_en_password, ether_port, save_system_config\n" + "Please update the clean YAML file accordingly." + ) with steps.start("Check the length of image: {}".format(image[0])) as step: if len(image[0]) > image_length_limit: - step.failed(f"The length of image path {image[0]} is more than the limit of" - f" {image_length_limit} characters.") + step.failed( + f"The length of image path {image[0]} is more than the limit of" + f" {image_length_limit} characters." + ) else: - step.passed(f"The length of image {image[0]} is within the {image_length_limit} character limit.") + step.passed( + f"The length of image {image[0]} is within the {image_length_limit} character limit." + ) - def set_config_register(self, steps, device, config_reg_rommon=CONFIG_REG_ROMMON, - config_reg_timeout=CONFIG_REG_TIMEOUT): - with steps.start("Set config-register to 0x0 on {}".format(device.name)) as step: + def set_config_register( + self, + steps, + device, + config_reg_rommon=CONFIG_REG_ROMMON, + config_reg_timeout=CONFIG_REG_TIMEOUT, + ): + with steps.start( + "Set config-register to 0x0 on {}".format(device.name) + ) as step: try: device.api.execute_set_config_register( - config_register=config_reg_rommon, timeout=config_reg_timeout) + config_register=config_reg_rommon, timeout=config_reg_timeout + ) except Exception as e: - step.failed("Unable to set config-register to 0x0 prior to TFTP" - " boot on {}".format(device.name), ) + step.failed( + "Unable to set config-register to 0x0 prior to TFTP" + " boot on {}".format(device.name), + ) def go_to_rommon(self, steps, device, save_system_config=SAVE_SYSTEM_CONFIG): - with steps.start("Bring device {} down to rommon> prompt prior to TFTP boot". \ - format(device.name)) as step: - - reload_dialog = Dialog([ - Statement(pattern=r".*System configuration has been modified\. Save\? \[yes\/no\].*", - action='sendline(yes)' if save_system_config else 'sendline(no)', - loop_continue=True, - continue_timer=False), - Statement(pattern=r".*Proceed with reload\? \[confirm\].*", - action='sendline()', - loop_continue=False, - continue_timer=False), - Statement(pattern=r".*Continue to reload\? \(yes\/\[no\]\)\:.*", - action='sendline(yes)', - loop_continue=False, - continue_timer=False), - Statement(pattern=r".*(Proceed|Continue) (with|to) reload\? (\[confirm\]|\(yes\/\[no\]\)\:).*", - action='sendline()', - loop_continue=False, - continue_timer=False), - ]) + with steps.start( + "Bring device {} down to rommon> prompt prior to TFTP boot".format( + device.name + ) + ) as step: + + reload_dialog = Dialog( + [ + Statement( + pattern=r".*System configuration has been modified\. Save\? \[yes\/no\].*", + action=( + "sendline(yes)" if save_system_config else "sendline(no)" + ), + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r".*Proceed with reload\? \[confirm\].*", + action="sendline()", + loop_continue=False, + continue_timer=False, + ), + Statement( + pattern=r".*Continue to reload\? \(yes\/\[no\]\)\:.*", + action="sendline(yes)", + loop_continue=False, + continue_timer=False, + ), + Statement( + pattern=r".*(Proceed|Continue) (with|to) reload\? (\[confirm\]|\(yes\/\[no\]\)\:).*", + action="sendline()", + loop_continue=False, + continue_timer=False, + ), + ] + ) # Using sendline, as we dont want unicon boot to kick in and send "boot" # to the device. Cannot use device.reload() directly as in case of HA, # we need both sup to do the commands - device.sendline('reload') + device.sendline("reload") reload_dialog.process(device.spawn) if device.is_ha: + def reload_check(device, target): - device.expect(['(.*Initializing Hardware.*|^(.*)((rommon(.*))+>|switch *:).*$)'], - target=target, timeout=90) + device.expect( + [ + "(.*Initializing Hardware.*|^(.*)((rommon(.*))+>|switch *:).*$)" + ], + target=target, + timeout=90, + ) # check if device is a stack device(stack with 2 memebrs is similar to HA devices) if len(device.subconnections) > 2: - pcall(reload_check, - cargs= (device,), - iargs=[[alias] for alias in device.connections.defaults.connections]) + pcall( + reload_check, + cargs=(device,), + iargs=[ + [alias] for alias in device.connections.defaults.connections + ], + ) else: - pcall(reload_check, - ckwargs={'device': device}, - ikwargs=[{'target': 'active'}, - {'target': 'standby'}]) + pcall( + reload_check, + ckwargs={"device": device}, + ikwargs=[{"target": "active"}, {"target": "standby"}], + ) else: - device.expect(['(.*Initializing Hardware.*|^(.*)((rommon(.*))+>|switch *:).*$)'], timeout=60) + device.expect( + ["(.*Initializing Hardware.*|^(.*)((rommon(.*))+>|switch *:).*$)"], + timeout=60, + ) log.info("Device is reloading") device.destroy_all() - def tftp_boot(self, steps, device, ip_address, subnet_mask, gateway, tftp_server, - image, timeout=TIMEOUT, recovery_password=RECOVERY_PASSWORD, - recovery_username=RECOVERY_USERNAME,recovery_en_password=RECOVERY_EN_PASSWORD, ether_port=ETHER_PORT ): + def tftp_boot( + self, + steps, + device, + ip_address, + subnet_mask, + gateway, + tftp_server, + image, + timeout=TIMEOUT, + recovery_password=RECOVERY_PASSWORD, + recovery_username=RECOVERY_USERNAME, + recovery_en_password=RECOVERY_EN_PASSWORD, + ether_port=ETHER_PORT, + ): with steps.start("Begin TFTP boot of device {}".format(device.name)) as step: # Need to instantiate to get the device.start # The device.start only works because of a|b device.instantiate(connection_timeout=timeout) - tftp_boot = {'ip_address': ip_address, - 'subnet_mask': subnet_mask, - 'gateway': gateway, - 'tftp_server': tftp_server, - 'image': image, - 'ether_port':ether_port} + tftp_boot = { + "ip_address": ip_address, + "subnet_mask": subnet_mask, + "gateway": gateway, + "tftp_server": tftp_server, + "image": image, + "ether_port": ether_port, + } try: abstract = Lookup.from_device(device, package=clean) # Item is needed to be able to know in which parallel child # device.start only gets filled with single rp devices # for multiple rp devices we need to use subconnections - if device.is_ha and hasattr(device, 'subconnections'): + if device.is_ha and hasattr(device, "subconnections"): start = [i.start[0] for i in device.subconnections] else: start = device.start - result = pcall(abstract.recovery.recovery.recovery_worker, - start=start, - ikwargs=[{'item': i} for i, _ in enumerate(start)], - ckwargs= \ - {'device': device, - 'timeout': timeout, - 'tftp_boot': tftp_boot, - 'break_count': 0, - # Irrelevant as we will not use this pattern anyway - # But needed for the recovery - 'console_activity_pattern': '\\.\\.\\.\\.', - 'golden_image': None, - 'recovery_username': recovery_username, - 'recovery_en_password':recovery_en_password, - 'recovery_password': recovery_password}) + result = pcall( + abstract.recovery.recovery.recovery_worker, + start=start, + ikwargs=[{"item": i} for i, _ in enumerate(start)], + ckwargs={ + "device": device, + "timeout": timeout, + "tftp_boot": tftp_boot, + "break_count": 0, + # Irrelevant as we will not use this pattern anyway + # But needed for the recovery + "console_activity_pattern": "\\.\\.\\.\\.", + "golden_image": None, + "recovery_username": recovery_username, + "recovery_en_password": recovery_en_password, + "recovery_password": recovery_password, + }, + ) except Exception as e: log.error(str(e)) - step.failed("Failed to TFTP boot the device '{}'". \ - format(device.name), ) + step.failed( + "Failed to TFTP boot the device '{}'".format(device.name), + ) else: - log.info("Successfully performed TFTP boot on device '{}'". \ - format(device.name)) + log.info( + "Successfully performed TFTP boot on device '{}'".format( + device.name + ) + ) def reconnect(self, steps, device): - with steps.start("Reconnect to device {} after TFTP boot". \ - format(device.name)) as step: - if getattr(device, 'chassis_type', None) and device.chassis_type.lower() == 'stack': + with steps.start( + "Reconnect to device {} after TFTP boot".format(device.name) + ) as step: + if ( + getattr(device, "chassis_type", None) + and device.chassis_type.lower() == "stack" + ): log.info("Sleep for 90 seconds in order to sync ") time.sleep(90) if not _disconnect_reconnect(device): # If that still doesnt work, Thats all we got - step.failed("Cannot reconnect to the device {d} after TFTP boot". - format(d=device.name), ) + step.failed( + "Cannot reconnect to the device {d} after TFTP boot".format( + d=device.name + ), + ) else: - log.info("Success - Have recovered and reconnected to device '{}'". \ - format(device.name)) - - def reset_config_register(self, steps, device, - config_reg_timeout=CONFIG_REG_TIMEOUT, - config_reg_normal=CONFIG_REG_NORMAL): - with steps.start("Reset config-register to 0x2101 on {}". \ - format(device.name)) as step: + log.info( + "Success - Have recovered and reconnected to device '{}'".format( + device.name + ) + ) + + def reset_config_register( + self, + steps, + device, + config_reg_timeout=CONFIG_REG_TIMEOUT, + config_reg_normal=CONFIG_REG_NORMAL, + ): + with steps.start( + "Reset config-register to 0x2101 on {}".format(device.name) + ) as step: try: device.api.execute_set_config_register( - config_register=config_reg_normal, timeout=config_reg_timeout) + config_register=config_reg_normal, timeout=config_reg_timeout + ) except Exception as e: log.error(str(e)) - step.failed("Unable to reset config-register to 0x2101 after TFTP" - " boot on {}".format(device.name), ) + step.failed( + "Unable to reset config-register to 0x2101 after TFTP" + " boot on {}".format(device.name), + ) def write_memory(self, steps, device): with steps.start("Execute 'write memory' on {}".format(device.name)) as step: @@ -461,36 +573,39 @@ def write_memory(self, steps, device): device.api.execute_write_memory() except Exception as e: log.error(str(e)) - step.failed("Unable to execute 'write memory' after TFTP boot " - "on {}".format(device.name), ) + step.failed( + "Unable to execute 'write memory' after TFTP boot " + "on {}".format(device.name), + ) else: - step.passed("Successfully performed TFTP boot on device {}". \ - format(device.name)) + step.passed( + "Successfully performed TFTP boot on device {}".format(device.name) + ) class InstallRemoveInactive(BaseStage): """This stage removes partially installed packages/images left -on the device. If a super package is left partially installed, -we cannot attempt to install another until it is removed. + on the device. If a super package is left partially installed, + we cannot attempt to install another until it is removed. -Stage Schema ------------- -install_image: - images (list, optional): - image to not removed by stage. + Stage Schema + ------------ + install_remove_inactive: + images (list, optional): + image to not removed by stage. - timeout (int, optional): Maximum time to wait for remove process to - finish. Defaults to 180. + timeout (int, optional): Maximum time to wait for remove process to + finish. Defaults to 180. - force_remove (bool, optional): Whether or not to remove the inactive - package irrespective of availability of passed image. Defaults to True. + force_remove (bool, optional): Whether or not to remove the inactive + package irrespective of availability of passed image. Defaults to True. -Example -------- -install_remove_inactive: - timeout: 180 + Example + ------- + install_remove_inactive: + timeout: 180 -""" + """ # ================= # Argument Defaults @@ -502,109 +617,120 @@ class InstallRemoveInactive(BaseStage): # Stage Schema # ============ schema = { - Optional('images'): list, - Optional('timeout'): int, - Optional('force_remove'): bool, + Optional("images"): list, + Optional("timeout"): int, + Optional("force_remove"): bool, } # ============================== # Execution order of Stage steps # ============================== - exec_order = [ - 'remove_inactive_pkgs' - ] - + exec_order = ["remove_inactive_pkgs"] - def remove_inactive_pkgs(self, steps, device, images, timeout=TIMEOUT, force_remove=FORCE_REMOVE): + def remove_inactive_pkgs( + self, steps, device, images, timeout=TIMEOUT, force_remove=FORCE_REMOVE + ): with steps.start("Removing inactive packages") as step: def _check_for_system_image(spawn, system_image=None, force_remove=None): if force_remove is True: - log.warning(f'Sending yes to delete files without checking {system_image} in among the files to be deleted.') - spawn.sendline('y') + log.warning( + f"Sending yes to delete files without checking {system_image} in among the files to be deleted." + ) + spawn.sendline("y") return if system_image and re.search(f"{system_image}\r", spawn.buffer): - log.debug(f'{system_image} is among the files to be deleted. send no so the {system_image} is not deleted. ') - spawn.sendline('n') + log.debug( + f"{system_image} is among the files to be deleted. send no so the {system_image} is not deleted. " + ) + spawn.sendline("n") else: - log.debug(f'{system_image} is not among the files to be deleted. Hence, send yes to delete files.') - spawn.sendline('y') + log.debug( + f"{system_image} is not among the files to be deleted. Hence, send yes to delete files." + ) + spawn.sendline("y") # split the image on the [:/] and pick up the image name - image = re.split(r'[:/]', images[0])[-1] - - install_remove_inactive_dialog = Dialog([ - Statement( - pattern=r".*Do you want to remove the above files\? \[y\/n\]", - action=_check_for_system_image, - args={'system_image': image, 'force_remove': force_remove}, - loop_continue=False, - continue_timer=False), - ]) + image = re.split(r"[:/]", images[0])[-1] + + install_remove_inactive_dialog = Dialog( + [ + Statement( + pattern=r".*Do you want to remove the above files\? \[y\/n\]", + action=_check_for_system_image, + args={"system_image": image, "force_remove": force_remove}, + loop_continue=False, + continue_timer=False, + ), + ] + ) try: - device.execute('install remove inactive', - service_dialog=install_remove_inactive_dialog, - timeout=timeout) + device.execute( + "install remove inactive", + service_dialog=install_remove_inactive_dialog, + timeout=timeout, + ) except Exception as e: - step.failed("Failed to remove inactive packages", - from_exception=e) + step.failed("Failed to remove inactive packages", from_exception=e) + class InstallImage(BaseStage): """This stage installs a provided image onto the device using the install -CLI. It also handles the automatic reloading of your device after the -install is complete. + CLI. It also handles the automatic reloading of your device after the + install is complete. -Stage Schema ------------- -install_image: - images (list): Image to install + Stage Schema + ------------ + install_image: + images (list): Image to install - directory (str): directory where packages.conf is created + directory (str): directory where packages.conf is created - save_system_config (bool, optional): Whether or not to save the system - config if it was modified. Defaults to False. + save_system_config (bool, optional): Whether or not to save the system + config if it was modified. Defaults to False. - skip_save_running_config (bool, optional): Skip the step to save the the running - configuration to the startup config. + skip_save_running_config (bool, optional): Skip the step to save the the running + configuration to the startup config. - install_timeout (int, optional): Maximum time in seconds to wait for install - process to finish. Defaults to 500. + install_timeout (int, optional): Maximum time in seconds to wait for install + process to finish. Defaults to 500. - reload_timeout (int, optional): Maximum time in seconds to wait for reload - process to finish. Defaults to 800. + reload_timeout (int, optional): Maximum time in seconds to wait for reload + process to finish. Defaults to 800. - verify_running_image (bool, optional): Compare the image filename with the running - image version on device. If a match is found, the stage will be skipped. - Defaults to True. + verify_running_image (bool, optional): Compare the image filename with the running + image version on device. If a match is found, the stage will be skipped. + Defaults to True. - reload_service_args (optional): + reload_service_args (optional): - reload_creds (str, optional): The credential to use after the reload is - complete. The credential name comes from the testbed yaml file. - Defaults to the 'default' credential. + reload_creds (str, optional): The credential to use after the reload is + complete. The credential name comes from the testbed yaml file. + Defaults to the 'default' credential. - prompt_recovery (bool, optional): Enable or disable the prompt recovery - feature of unicon. Defaults to True. + prompt_recovery (bool, optional): Enable or disable the prompt recovery + feature of unicon. Defaults to True. - error_pattern (list, optional): List of regex strings to check for errors. - Default: [r"FAILED:.*?$",] + error_pattern (list, optional): List of regex strings to check for errors. + Default: [r"FAILED:.*?$",] - : - Any other arguments that the Unicon reload service supports + : + Any other arguments that the Unicon reload service supports -Example -------- -install_image: - images: - - /auto/some-location/that-this/image/stay-isr-image.bin - save_system_config: True - install_timeout: 1000 - reload_timeout: 1000 + Example + ------- + install_image: + images: + - /auto/some-location/that-this/image/stay-isr-image.bin + save_system_config: True + install_timeout: 1000 + reload_timeout: 1000 + + """ -""" # ================= # Argument Defaults # ================= @@ -612,9 +738,11 @@ class InstallImage(BaseStage): INSTALL_TIMEOUT = 500 RELOAD_TIMEOUT = 800 RELOAD_SERVICE_ARGS = { - 'reload_creds': 'default', - 'prompt_recovery': True, - 'error_pattern': [r"FAILED:.*?$",], + "reload_creds": "default", + "prompt_recovery": True, + "error_pattern": [ + r"FAILED:.*?$", + ], } ISSU = False SKIP_BOOT_VARIABLE = False @@ -625,36 +753,42 @@ class InstallImage(BaseStage): # Stage Schema # ============ schema = { - Optional('images'): list, - Optional('directory'): str, - Optional('save_system_config'): bool, - Optional('install_timeout'): int, - Optional('reload_timeout'): int, - Optional('issu'): bool, - Optional('skip_boot_variable'): bool, - Optional('skip_save_running_config'): bool, - Optional('verify_running_image', description="Compare the image filename with the running image version on device. If a match is found, the stage will be skipped", default=VERIFY_RUNNING_IMAGE): bool, - Optional('reload_service_args'): { - Optional('reload_creds'): str, - Optional('prompt_recovery'): bool, - Optional('error_pattern'): list, - Any(): Any() - } + Optional("images"): list, + Optional("directory"): str, + Optional("save_system_config"): bool, + Optional("install_timeout"): int, + Optional("reload_timeout"): int, + Optional("issu"): bool, + Optional("skip_boot_variable"): bool, + Optional("skip_save_running_config"): bool, + Optional( + "verify_running_image", + description="Compare the image filename with the running image version on device. If a match is found, the stage will be skipped", + default=VERIFY_RUNNING_IMAGE, + ): bool, + Optional("reload_service_args"): { + Optional("reload_creds"): str, + Optional("prompt_recovery"): bool, + Optional("error_pattern"): list, + Any(): Any(), + }, } # ============================== # Execution order of Stage steps # ============================== exec_order = [ - 'verify_running_image', - 'delete_boot_variable', - 'set_boot_variable', - 'save_running_config', - 'verify_boot_variable', - 'install_image' + "verify_running_image", + "delete_boot_variable", + "set_boot_variable", + "save_running_config", + "verify_boot_variable", + "install_image", ] - def verify_running_image(self, steps, device, images, verify_running_image=VERIFY_RUNNING_IMAGE): + def verify_running_image( + self, steps, device, images, verify_running_image=VERIFY_RUNNING_IMAGE + ): # Check the running image if verify_running_image: # Verify the image running in the device @@ -666,7 +800,9 @@ def verify_running_image(self, steps, device, images, verify_running_image=VERIF # if the device is in bundle mode this step will not be executed. if "BUNDLE" in Dq(out).get_values("mode"): - step.skipped(f"The device is in bundle mode. Skipping the verify running image check.") + step.skipped( + f"The device is in bundle mode. Skipping the verify running image check." + ) else: # Match the build_label if present, otherwise the xe_version # If neither is found, fail to match the image @@ -675,51 +811,74 @@ def verify_running_image(self, steps, device, images, verify_running_image=VERIF image_version = build_label or xe_version image_match = re.search(image_version, images[0]) if image_match and image_match.group(): - image_mapping = self.history['InstallImage'].parameters.setdefault('image_mapping', {}) + image_mapping = self.history[ + "InstallImage" + ].parameters.setdefault("image_mapping", {}) system_image = device.api.get_running_image() image_mapping.update({images[0]: system_image}) - self.skipped(f"The image file provided is same as the current running image {image_version} on the device.\n\ - Skipping the install image stage.") + self.skipped( + f"The image file provided is same as the current running image {image_version} on the device.\n\ + Skipping the install image stage." + ) - def delete_boot_variable(self, steps, device, issu=ISSU, skip_boot_variable=SKIP_BOOT_VARIABLE): + def delete_boot_variable( + self, steps, device, issu=ISSU, skip_boot_variable=SKIP_BOOT_VARIABLE + ): with steps.start("Delete all boot variables") as step: if issu or skip_boot_variable: step.skipped() else: try: - device.configure('no boot system') + device.configure("no boot system") except Exception as e: - step.failed("Failed to delete configured boot variables", - from_exception=e) + step.failed( + "Failed to delete configured boot variables", from_exception=e + ) - def set_boot_variable(self, steps, device, directory=None, issu=ISSU, skip_boot_variable=SKIP_BOOT_VARIABLE): + def set_boot_variable( + self, + steps, + device, + directory=None, + issu=ISSU, + skip_boot_variable=SKIP_BOOT_VARIABLE, + ): with steps.start("Configure system boot variable for 'install mode'") as step: if issu or skip_boot_variable: step.skipped() else: # Figure out the directory that the image files get unpacked to if not directory: - output = device.parse(f'dir') - directory = output['dir']['dir'] - output = device.parse('dir') + output = device.parse(f"dir") + directory = output["dir"]["dir"] + output = device.parse("dir") else: - output = device.parse(f'dir {directory}') - files = output.get('dir', {}).get(directory, {}).get('files', {}) + output = device.parse(f"dir {directory}") + files = output.get("dir", {}).get(directory, {}).get("files", {}) - if not files.get('packages.conf'): + if not files.get("packages.conf"): # create packages.conf, if it does not exist device.tclsh('puts [open "%spackages.conf" w+] {}' % directory) # packages.conf is hardcoded because install mode boots using an # unpacked packages.conf file - self.new_boot_var = directory+'packages.conf' + self.new_boot_var = directory + "packages.conf" try: device.api.execute_set_boot_variable( - boot_images=[self.new_boot_var], timeout=60) + boot_images=[self.new_boot_var], timeout=60 + ) + except Exception as e: + step.failed( + "Failed to configure the boot variable", from_exception=e + ) + + log.info(f'Unconfigure the ignore startup config on {device.name}') + try: + device.api.unconfigure_ignore_startup_config() except Exception as e: - step.failed("Failed to configure the boot variable", - from_exception=e) + step.failed(f"Failed to unconfigure ignore startup config on the device {device.name}", + from_exception=e) def save_running_config(self, steps, device, skip_save_running_config=SKIP_SAVE_RUNNING_CONFIG): with steps.start("Save the running config to the startup config") as step: @@ -727,11 +886,10 @@ def save_running_config(self, steps, device, skip_save_running_config=SKIP_SAVE_ step.skipped() return try: - device.api.execute_copy_run_to_start( - max_time=60, check_interval=30) + device.api.execute_copy_run_to_start(max_time=60, check_interval=30) except Exception as e: - step.failed("Failed to save the running config", - from_exception=e) + step.failed("Failed to save the running config", from_exception=e) + def verify_boot_variable(self, steps, device, issu=ISSU, skip_boot_variable=SKIP_BOOT_VARIABLE): # Verify next reload boot variables are correctly set @@ -742,17 +900,25 @@ def verify_boot_variable(self, steps, device, issu=ISSU, skip_boot_variable=SKIP if not device.api.verify_boot_variable(boot_images=[self.new_boot_var]): step.failed(f"Boot variables are not correctly set to " f"{self.new_boot_var}") + log.info(f'verify the ignore startup config') + if not device.api.verify_ignore_startup_config(): + step.failed(f"Failed to verify unconfigure the ignore startup config on {device.name}") - def install_image(self, steps, device, images, - save_system_config=SAVE_SYSTEM_CONFIG, - install_timeout=INSTALL_TIMEOUT, - reload_service_args=None, - issu=ISSU): + def install_image( + self, + steps, + device, + images, + save_system_config=SAVE_SYSTEM_CONFIG, + install_timeout=INSTALL_TIMEOUT, + reload_service_args=None, + issu=ISSU, + ): # Set default reload args reload_args = self.RELOAD_SERVICE_ARGS.copy() # Disable device recovery for reload - reload_args.update({'device_recovery': False}) + reload_args.update({"device_recovery": False}) # If user provides custom values, update the default with the user # provided. if reload_service_args: @@ -761,80 +927,537 @@ def install_image(self, steps, device, images, with steps.start(f"Installing image '{images[0]}'") as step: current_image = device.api.get_running_image() if current_image == images[0]: - step.skipped('Images is already installed on the device.') - - install_add_one_shot_dialog = Dialog([ - Statement(pattern=r".*Press Quit\(q\) to exit, you may save " - r"configuration and re-enter the command\. " - r"\[y\/n\/q\]", - action='sendline(y)' if save_system_config else 'sendline(n)', - loop_continue=True, - continue_timer=False), - Statement(pattern=r".*Please confirm you have changed boot config " - r"to \S+ \[y\/n\]", - action='sendline(y)', - loop_continue=True, - continue_timer=False), - Statement(pattern=r".*Same Image File-No Change", - loop_continue=False, - continue_timer=False), - Statement(pattern=r".*reload of the system\. " - r"Do you want to proceed\? \[y\/n\]", - action='sendline(y)', - loop_continue=True, - continue_timer=False), - Statement(pattern=r"FAILED:.*?$", - action=None, - loop_continue=False, - continue_timer=False), - ]) + step.skipped("Images is already installed on the device.") + + install_add_one_shot_dialog = Dialog( + [ + Statement( + pattern=r".*Press Quit\(q\) to exit, you may save " + r"configuration and re-enter the command\. " + r"\[y\/n\/q\]", + action="sendline(y)" if save_system_config else "sendline(n)", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r".*Please confirm you have changed boot config " + r"to \S+ \[y\/n\]", + action="sendline(y)", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r".*Same Image File-No Change", + loop_continue=False, + continue_timer=False, + ), + Statement( + pattern=r".*reload of the system\. " + r"Do you want to proceed\? \[y\/n\]", + action="sendline(y)", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r"FAILED:.*?$", + action=None, + loop_continue=False, + continue_timer=False, + ), + ] + ) try: - reload_args.update({ - 'timeout': install_timeout, - 'reply': install_add_one_shot_dialog - }) + reload_args.update( + {"timeout": install_timeout, "reply": install_add_one_shot_dialog} + ) if issu: - device.reload('install add file {} activate issu commit prompt-level none'.format(images[0]), - **reload_args) + device.reload( + "install add file {} activate issu commit prompt-level none".format( + images[0] + ), + **reload_args, + ) else: - device.reload('install add file {} activate commit prompt-level none'.format(images[0]), - **reload_args) + device.reload( + "install add file {} activate commit prompt-level none".format( + images[0] + ), + **reload_args, + ) - device.execute('install commit') + device.execute("install commit") except Exception as e: step.failed("Failed to install the image", from_exception=e) - image_mapping = self.history['InstallImage'].parameters.setdefault( - 'image_mapping', {}) - if hasattr(self, 'new_boot_var'): + image_mapping = self.history["InstallImage"].parameters.setdefault( + "image_mapping", {} + ) + if hasattr(self, "new_boot_var"): image_mapping.update({images[0]: self.new_boot_var}) +class InstallRemoveSmu(BaseStage): + """This stage removes smu images from the device. + If the SMU is installed, it will be de-activated first. + + Stage Schema + ------------ + install_remove_smu: + + timeout (int, optional): Maximum time to wait for remove process to + finish. Defaults to 180. + + force_remove (bool, optional): Whether or not to remove the inactive + package irrespective of availability of passed image. Defaults to True. + + Example + ------- + install_remove_smu: + timeout: 180 + + """ + + # ================= + # Argument Defaults + # ================= + TIMEOUT = 180 + FORCE_REMOVE = True + RELOAD_TIMEOUT = 800 + RELOAD_SERVICE_ARGS = { + "reload_creds": "default", + "prompt_recovery": True, + "error_pattern": [ + r"FAILED:.*?$", + ], + } + + # ============ + # Stage Schema + # ============ + schema = { + Optional("timeout"): int, + Optional("force_remove"): bool, + Optional("reload_timeout"): int, + Optional("reload_service_args"): { + Optional("reload_creds"): str, + Optional("prompt_recovery"): bool, + Optional("error_pattern"): list, + Any(): Any(), + }, + } + + # ============================== + # Execution order of Stage steps + # ============================== + exec_order = ["remove_smu_image"] + + def remove_smu_image( + self, + steps, + device, + reload_timeout=RELOAD_TIMEOUT, + timeout=TIMEOUT, + reload_service_args=None, + force_remove=FORCE_REMOVE, + ): + + with steps.start("Removing SMU image") as step: + + def _check_for_system_image( + spawn, system_image=None, force_remove=None + ): + if force_remove is True: + log.warning( + f"Sending yes to delete files without checking {system_image} in among the files to be deleted." + ) + spawn.sendline("y") + return + + if system_image and re.search(f"{system_image}\r", spawn.buffer): + log.debug( + f"{system_image} is among the files to be deleted. send no so the {system_image} is not deleted. " + ) + spawn.sendline("n") + else: + log.debug( + f"{system_image} is not among the files to be deleted. Hence, send yes to delete files." + ) + spawn.sendline("y") + + # Set default reload args + reload_args = self.RELOAD_SERVICE_ARGS.copy() + # Disable device recovery for reload + reload_args.update({"device_recovery": False}) + # If user provides custom values, update the default with the user + # provided. + if reload_service_args: + reload_args.update(reload_service_args) + + with steps.start("Checking status of SMU image") as step: + try: + output = device.parse("show install summary") + location = list(output.get("location").keys())[0] + for pkg in output.get("location").get(location).get("pkg_state"): + file_state = output["location"][location]["pkg_state"][pkg][ + "state" + ] + file_type = output["location"][location]["pkg_state"][pkg][ + "type" + ] + image = output["location"][location]["pkg_state"][pkg][ + "filename_version" + ] + if file_state == "C" and file_type == "SMU": + log.info("The installed SMU image is in committed state") + break + elif file_state == "D" and file_type == "SMU": + log.info("The installed SMU image is in deactivated state") + break + except Exception as e: + step.failed("Failed to check status of smu image", from_exception=e) + else: + if file_state == "C" and file_type == "IMG": + step.skipped("No smu image to remove") + + if file_state == "C" and file_type == "SMU": + with steps.start(f"Deactivate the smu image '{image}'") as step: + try: + install_smu_dialog = Dialog( + [ + Statement( + pattern=r".*reload of the system\. " + r"Do you want to proceed\? \[y\/n\]", + action="sendline(y)", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r"FAILED:.*?$", + action=None, + loop_continue=False, + continue_timer=False, + ), + Statement( + pattern=r"^.*RETURN to get started", + action="sendline()", + loop_continue=False, + continue_timer=False, + ), + ] + ) + + reload_args.update( + {"timeout": reload_timeout, "reply": install_smu_dialog} + ) + device.reload( + f"install deactivate file {image}", **reload_args + ) + device.parse("show install summary") + except Exception as e: + step.failed( + "Failed to deactivate SMU image", from_exception=e + ) + + with steps.start("commit the smu image") as step: + try: + output = device.parse("show install summary") + location = list(output.get("location").keys())[0] + for pkg in ( + output.get("location").get(location).get("pkg_state") + ): + file_state = output["location"][location]["pkg_state"][ + pkg + ]["state"] + if file_state == "D": + device.execute("install commit") + device.execute("show install summary") + log.info("The image is in inactivate state") + except Exception as e: + step.failed("Failed to commit SMU image", from_exception=e) + + with steps.start("Remove inactive smu image") as step: + try: + install_remove_smu_inactive_dialog = Dialog( + [ + Statement( + pattern=r".*Do you want to remove the above files\? \[y\/n\]", + action=_check_for_system_image, + args={"system_image": image, "force_remove": force_remove}, + loop_continue=False, + continue_timer=False, + ), + ] + ) + device.execute( + "install remove inactive", + service_dialog=install_remove_smu_inactive_dialog, + timeout=timeout, + ) + except Exception as e: + step.failed("Failed to remove inactive smu image", from_exception=e) + + elif file_state == "D" and file_type == "SMU": + with steps.start("commit the smu image") as step: + try: + device.execute("install commit") + device.execute("show install summary") + log.info("The image is in inactivate state") + except Exception as e: + step.failed("Failed to commit SMU image", from_exception=e) + + with steps.start("Remove inactive smu image") as step: + try: + install_remove_smu_inactive_dialog = Dialog( + [ + Statement( + pattern=r".*Do you want to remove the above files\? \[y\/n\]", + action=_check_for_system_image, + args={"system_image": image, "force_remove": force_remove}, + loop_continue=False, + continue_timer=False, + ), + ] + ) + device.execute( + "install remove inactive", + service_dialog=install_remove_smu_inactive_dialog, + timeout=timeout, + ) + except Exception as e: + step.failed("Failed to remove inactive packages", from_exception=e) + else: + step.skipped("SMU image is in inactive state") + + +class InstallSmu(BaseStage): + """This stage installs a provided smu image onto the device using the install + CLI. It also handles the automatic reloading of your device after the + install is complete. + + Stage Schema + ------------ + install_smu: + images (list): Image to install + + install_timeout (int, optional): Maximum time in seconds to wait for install + process to finish. Defaults to 500. + + reload_timeout (int, optional): Maximum time in seconds to wait for reload + process to finish. Defaults to 800. + + reload_service_args (optional): + + reload_creds (str, optional): The credential to use after the reload is + complete. The credential name comes from the testbed yaml file. + Defaults to the 'default' credential. + + prompt_recovery (bool, optional): Enable or disable the prompt recovery + feature of unicon. Defaults to True. + + error_pattern (list, optional): List of regex strings to check for errors. + Default: [r"FAILED:.*?$",] + + : + Any other arguments that the Unicon reload service supports + + Example + ------- + install_smu: + images: + - /auto/some-location/that-this/image/smu-image.bin + install_timeout: 1000 + reload_timeout: 1000 + + """ + + # ================= + # Argument Defaults + # ================= + SKIP_SAVE_RUNNING_CONFIG = False + INSTALL_TIMEOUT = 500 + RELOAD_TIMEOUT = 800 + RELOAD_SERVICE_ARGS = { + "reload_creds": "default", + "prompt_recovery": True, + "error_pattern": [ + r"FAILED:.*?$", + ], + } + + # ============ + # Stage Schema + # ============ + schema = { + Optional("images"): list, + Optional("install_timeout"): int, + Optional("reload_timeout"): int, + Optional("reload_service_args"): { + Optional("reload_creds"): str, + Optional("prompt_recovery"): bool, + Optional("error_pattern"): list, + Any(): Any(), + }, + } + + # ============================== + # Execution order of Stage steps + # ============================== + exec_order = ["save_running_config", "install_smu"] + + def save_running_config( + self, steps, device, skip_save_running_config=SKIP_SAVE_RUNNING_CONFIG + ): + with steps.start("Save the running config to the startup config") as step: + if skip_save_running_config: + step.skipped() + return + try: + device.api.execute_copy_run_to_start(max_time=60, check_interval=30) + except Exception as e: + step.failed("Failed to save the running config", from_exception=e) + + def install_smu( + self, + steps, + device, + images, + install_timeout=INSTALL_TIMEOUT, + reload_service_args=None, + ): + + with steps.start("Installing smu image") as step: + + if not images: + step.skipped("No smu image provided, skipping install_smu stage") + if "smu" not in images[0]: + step.skipped("No smu image provided, skipping install_smu stage") + + # Set default reload args + reload_args = self.RELOAD_SERVICE_ARGS.copy() + # Disable device recovery for reload + reload_args.update({"device_recovery": False}) + + # If user provides custom values, update the default with the user + # provided. + if reload_service_args: + reload_args.update(reload_service_args) + + install_smu_dialog = Dialog( + [ + Statement( + pattern=r".*reload of the system\. " + r"Do you want to proceed\? \[y\/n\]", + action="sendline(y)", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r"FAILED:.*?$", + action=None, + loop_continue=False, + continue_timer=False, + ), + Statement( + pattern=r"^.*RETURN to get started", + action="sendline()", + loop_continue=False, + continue_timer=False, + ), + ] + ) + + with steps.start(f"Add SMU image : '{images[0]}'") as step: + try: + device.execute("install add file {}".format(images[0])) + except Exception as e: + step.failed("Failed to add SMU image", from_exception=e) + + with steps.start("Verify SMU image is added successfully") as step: + try: + output = device.parse("show install summary") + location = list(output.get("location").keys())[0] + for pkg in output.get("location").get(location).get("pkg_state"): + file_state = output["location"][location]["pkg_state"][pkg][ + "state" + ] + file_type = output["location"][location]["pkg_state"][pkg][ + "type" + ] + try: + if file_state == "I" and file_type == "SMU": + log.info("The installed SMU image is in inactive state") + except Exception as e: + step.failed("Failed to add the SMU image", from_exception=e) + except Exception as e: + step.failed("Failed to verify SMU image", from_exception=e) + + with steps.start(f"Activate the SMU file with image '{images[0]}'") as step: + try: + reload_args.update( + {"timeout": install_timeout, "reply": install_smu_dialog} + ) + device.reload( + "install activate file {}".format(images[0]), **reload_args + ) + device.execute("show version") + device.execute("show install summary") + except Exception as e: + step.failed("Failed to activate SMU image", from_exception=e) + + with steps.start("Commit the SMU file with image") as step: + try: + output = device.parse("show install active") + location = list(output.get("location").keys())[0] + for pkg in output.get("location").get(location).get("pkg_state"): + file_state = output["location"][location]["pkg_state"][pkg][ + "state" + ] + if file_state == "U": + device.execute("install commit") + log.info("The image is activated and uncommitted") + except Exception as e: + step.failed("Failed to activate SMU image", from_exception=e) + + with steps.start("Check if SMU is applied succesfully") as step: + try: + output = device.parse("show install summary") + for pkg in output.get("location").get(location).get("pkg_state"): + file_state = output["location"][location]["pkg_state"][pkg][ + "state" + ] + if file_state == "C": + log.info("Applied SMU successfully") + + except Exception as e: + step.failed("Failed to apply SMU image", from_exception=e) + + class InstallPackages(BaseStage): """This stage installs the provided packages using the install CLI. -Stage Schema ------------- -install_packages: - packages (list): Packages to install. + Stage Schema + ------------ + install_packages: + packages (list): Packages to install. - save_system_config (bool, optional): Whether or not to save the system - config if it was modified. Defaults to False. + save_system_config (bool, optional): Whether or not to save the system + config if it was modified. Defaults to False. - install_timeout (int, optional): Maximum time to wait for install - process to finish. Defaults to 300. + install_timeout (int, optional): Maximum time to wait for install + process to finish. Defaults to 300. -Example -------- -install_packages: - packages: - - /auto/some-location/that-this/image/stay-isr-image.bin - save_system_config: True - install_timeout: 1000 + Example + ------- + install_packages: + packages: + - /auto/some-location/that-this/image/stay-isr-image.bin + save_system_config: True + install_timeout: 1000 + + """ -""" # ================= # Argument Defaults # ================= @@ -845,125 +1468,137 @@ class InstallPackages(BaseStage): # Stage Schema # ============ schema = { - Optional('packages'): list, - Optional('save_system_config'): bool, - Optional('install_timeout'): int, + Optional("packages"): list, + Optional("save_system_config"): bool, + Optional("install_timeout"): int, } # ============================== # Execution order of Stage steps # ============================== - exec_order = [ - 'install_package' - ] + exec_order = ["install_package"] - def install_package(self, steps, device, packages, - save_system_config=SAVE_SYSTEM_CONFIG, - install_timeout=INSTALL_TIMEOUT): - - install_add_one_shot_dialog = Dialog([ - Statement(pattern=r".*Press Quit\(q\) to exit, you may save " - r"configuration and re-enter the command\. " - r"\[y\/n\/q\]", - action='sendline(y)' if save_system_config else 'sendline(n)', - loop_continue=True, - continue_timer=False), - Statement(pattern=r".*Please confirm you have changed boot config " - r"to \S+ \[y\/n\]", - action='sendline(y)', - loop_continue=True, - continue_timer=False), - Statement(pattern=r".*This operation may require a reload of the " - r"system\. Do you want to proceed\? \[y\/n\]", - action='sendline(y)', - loop_continue=True, - continue_timer=False), - ]) + def install_package( + self, + steps, + device, + packages, + save_system_config=SAVE_SYSTEM_CONFIG, + install_timeout=INSTALL_TIMEOUT, + ): + + install_add_one_shot_dialog = Dialog( + [ + Statement( + pattern=r".*Press Quit\(q\) to exit, you may save " + r"configuration and re-enter the command\. " + r"\[y\/n\/q\]", + action="sendline(y)" if save_system_config else "sendline(n)", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r".*Please confirm you have changed boot config " + r"to \S+ \[y\/n\]", + action="sendline(y)", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r".*This operation may require a reload of the " + r"system\. Do you want to proceed\? \[y\/n\]", + action="sendline(y)", + loop_continue=True, + continue_timer=False, + ), + ] + ) for pkg in packages: - with steps.start("Installing package '{pkg}' onto {dev}".format( - pkg=pkg, dev=device.hostname)) as step: + with steps.start( + "Installing package '{pkg}' onto {dev}".format( + pkg=pkg, dev=device.hostname + ) + ) as step: try: device.execute( - 'install add file {} activate commit'.format(pkg), + "install add file {} activate commit".format(pkg), reply=install_add_one_shot_dialog, - error_pattern=['FAILED:'], - timeout=install_timeout + error_pattern=["FAILED:"], + timeout=install_timeout, ) except Exception as e: - step.failed("Failed to install the package", - from_exception=e) + step.failed("Failed to install the package", from_exception=e) class Reload(BaseStage): - """ This stage reloads the device. + """This stage reloads the device. -Stage Schema ------------- -reload: - license: (optional) - check: (bool, optional): Enable the checking license inconsistency and fix + Stage Schema + ------------ + reload: + license: (optional) + check: (bool, optional): Enable the checking license inconsistency and fix - reload_service_args (optional): + reload_service_args (optional): - timeout (int, optional): Maximum time in seconds allowed for the reload. - Defaults to 800. + timeout (int, optional): Maximum time in seconds allowed for the reload. + Defaults to 800. - reload_creds (str, optional): The credential to use after the reload is - complete. The credential name comes from the testbed yaml file. - Defaults to the 'default' credential. + reload_creds (str, optional): The credential to use after the reload is + complete. The credential name comes from the testbed yaml file. + Defaults to the 'default' credential. - prompt_recovery (bool, optional): Enable or disable the prompt recovery - feature of unicon. Defaults to True. + prompt_recovery (bool, optional): Enable or disable the prompt recovery + feature of unicon. Defaults to True. - : - Any other arguments that the Unicon reload service supports + : + Any other arguments that the Unicon reload service supports - check_modules: + check_modules: - check (bool, optional): Enable the checking of modules after reload. - Defaults to True. + check (bool, optional): Enable the checking of modules after reload. + Defaults to True. - timeout (int, optional): Maximum time in seconds allowed for verifying - the modules are in a stable state. Defaults to 180. + timeout (int, optional): Maximum time in seconds allowed for verifying + the modules are in a stable state. Defaults to 180. - interval (int, optional): How often to check the module states in - seconds. Defaults to 30. + interval (int, optional): How often to check the module states in + seconds. Defaults to 30. - reconnect_via (str, optional): Specify which connection to use after reloading. - Defaults to the 'default' connection in the testbed yaml file. + reconnect_via (str, optional): Specify which connection to use after reloading. + Defaults to the 'default' connection in the testbed yaml file. - attempt_manual_boot (bool, optional): Enable to attempt manual boot when reload fails. - Defaults to True. + attempt_manual_boot (bool, optional): Enable to attempt manual boot when reload fails. + Defaults to True. + + Example + ------- + reload: + reload_service_args: + timeout: 600 + reload_creds: clean_reload_creds + prompt_recovery: True + check_modules: + check: False + """ -Example -------- -reload: - reload_service_args: - timeout: 600 - reload_creds: clean_reload_creds - prompt_recovery: True - check_modules: - check: False -""" # ================= # Argument Defaults # ================= - LICENSE = { - 'check': False - } + LICENSE = {"check": False} RELOAD_SERVICE_ARGS = { - 'timeout': 800, - 'reload_creds': 'default', - 'prompt_recovery': True, + "timeout": 800, + "reload_creds": "default", + "prompt_recovery": True, } CHECK_MODULES = { - 'check': True, - 'timeout': 180, - 'interval': 30, - 'ignore_modules': None, + "check": True, + "timeout": 180, + "interval": 30, + "ignore_modules": None, } RECONNECT_VIA = None ATTEMPT_MANUAL_BOOT = True @@ -972,37 +1607,35 @@ class Reload(BaseStage): # Stage Schema # ============ schema = { - Optional('license'): { - Optional('check'): bool - }, - Optional('check_modules'): { - Optional('check'): bool, - Optional('timeout'): int, - Optional('interval'): int, - Optional('ignore_modules'): list + Optional("license"): {Optional("check"): bool}, + Optional("check_modules"): { + Optional("check"): bool, + Optional("timeout"): int, + Optional("interval"): int, + Optional("ignore_modules"): list, }, - Optional('reload_service_args'): { - Optional('timeout'): int, - Optional('reload_creds'): str, - Optional('prompt_recovery'): bool, - Any(): Any() + Optional("reload_service_args"): { + Optional("timeout"): int, + Optional("reload_creds"): str, + Optional("prompt_recovery"): bool, + Any(): Any(), }, - Optional('reconnect_via'): str, - Optional('attempt_manual_boot'): bool, - + Optional("reconnect_via"): str, + Optional("attempt_manual_boot"): bool, } # ============================== # Execution order of Stage steps # ============================== - exec_order = [ - 'reload', - 'license', - 'disconnect_and_reconnect', - 'check_modules' - ] + exec_order = ["reload", "license", "disconnect_and_reconnect", "check_modules"] - def reload(self, steps, device, reload_service_args=None, attempt_manual_boot=ATTEMPT_MANUAL_BOOT): + def reload( + self, + steps, + device, + reload_service_args=None, + attempt_manual_boot=ATTEMPT_MANUAL_BOOT, + ): if reload_service_args is None: # If user provides no custom values, take the defaults @@ -1016,40 +1649,44 @@ def reload(self, steps, device, reload_service_args=None, attempt_manual_boot=AT # custom exception for reload class ReloadError(BaseException): - """Exception raised for errors that are specific to reload. - """ + """Exception raised for errors that are specific to reload.""" + pass def break_reload(device): - """ Breaks the reload process on a device - """ + """Breaks the reload process on a device""" log.info(f"Boot variable does not exist!!! Breaking the reload process.") # Send No to exit from reload process - device.sendline('N') + device.sendline("N") # Throw custom reload error from base exception. - raise ReloadError('Exiting the reload process.') + raise ReloadError("Exiting the reload process.") # Disable device_recovey for reload in unicon - self.reload_service_args.update({'device_recovery':False}) - reload_dialog = Dialog([ - Statement(pattern=r".*Do you wish to proceed with reload anyway\[confirm\].*", - action='sendline(y)', + self.reload_service_args.update({"device_recovery": False}) + reload_dialog = Dialog( + [ + Statement( + pattern=r".*Do you wish to proceed with reload anyway\[confirm\].*", + action="sendline(y)", loop_continue=True, - continue_timer=False)]) + continue_timer=False, + ) + ] + ) if attempt_manual_boot: reload_dialog.append( - Statement(pattern=r".*Boot variable either does not exist or buffer is too small.*", + Statement( + pattern=r".*Boot variable either does not exist or buffer is too small.*", action=break_reload, - args={'device': device}, + args={"device": device}, loop_continue=False, - continue_timer=False), + continue_timer=False, + ), ) - self.reload_service_args.update({ - 'reply': reload_dialog - }) + self.reload_service_args.update({"reply": reload_dialog}) with steps.start(f"Reload {device.name}") as step: @@ -1058,43 +1695,53 @@ def break_reload(device): except ReloadError as e: # Get the current system image try: - output = device.parse('show version') - system_image = output['version']['system_image'] + output = device.parse("show version") + system_image = output["version"]["system_image"] except Exception as e: - log.exception(f"Failed to get the system image from device {device.name}, Error: {e}") + log.exception( + f"Failed to get the system image from device {device.name}, Error: {e}" + ) config_reg = None # capture the current boot settings to restore it on later stage try: - output = device.parse('show boot') - config_reg = output.get('active', {}).get('configuration_register') + output = device.parse("show boot") + config_reg = output.get("active", {}).get("configuration_register") except Exception as e: - log.exception(f"Failed to get the boot information for {device.name}, Error: {e}") + log.exception( + f"Failed to get the boot information for {device.name}, Error: {e}" + ) # Bring the device state to rommon device.rommon() # If the device is HA then update context for standy rp - cmd = f'boot {system_image}' - if device.is_ha and hasattr(device, 'subconnections'): + cmd = f"boot {system_image}" + if device.is_ha and hasattr(device, "subconnections"): for con in device.subconnections: - if con.role=='standby': - con.context['boot_cmd'] = cmd + if con.role == "standby": + con.context["boot_cmd"] = cmd with steps.start(f"Reload using manual boot for {device.name}") as step: try: device.reload(reload_command=cmd) except Exception as e: - step.failed(f"Failed to reload within {self.reload_service_args['timeout']} " - f"seconds.", from_exception=e) + step.failed( + f"Failed to reload within {self.reload_service_args['timeout']} " + f"seconds.", + from_exception=e, + ) # Restore the boot settings if config_reg: device.api.execute_set_config_register(config_register=config_reg) except Exception as e: - step.failed(f"Failed to reload within {self.reload_service_args['timeout']} " - f"seconds.", from_exception=e) + step.failed( + f"Failed to reload within {self.reload_service_args['timeout']} " + f"seconds.", + from_exception=e, + ) def license(self, steps, device, license=None): @@ -1103,22 +1750,27 @@ def license(self, steps, device, license=None): with steps.start(f"Check license inconsistency on {device.name}") as step: - if license['check']: - out = device.parse('show version') - if out.q.get_values('license_level', 0) == out.q.get_values('next_reload_license_level', 0): - step.passed('No license inconsistency.') + if license["check"]: + out = device.parse("show version") + if out.q.get_values("license_level", 0) == out.q.get_values( + "next_reload_license_level", 0 + ): + step.passed("No license inconsistency.") else: try: device.reload(**self.reload_service_args) except Exception as e: - step.failed(f"Failed to reload within {self.reload_service_args['timeout']} " - f"seconds.", from_exception=e) + step.failed( + f"Failed to reload within {self.reload_service_args['timeout']} " + f"seconds.", + from_exception=e, + ) else: step.skipped("License check is not enabled.") - - def disconnect_and_reconnect(self, steps, device, reload_service_args=None, - reconnect_via=RECONNECT_VIA): + def disconnect_and_reconnect( + self, steps, device, reload_service_args=None, reconnect_via=RECONNECT_VIA + ): if reload_service_args is None: # If user provides no custom values, take the defaults @@ -1135,48 +1787,71 @@ def disconnect_and_reconnect(self, steps, device, reload_service_args=None, try: device.destroy() except Exception: - log.warning("Failed to destroy the device connection but " - "attempting to continue", exc_info=True) + log.warning( + "Failed to destroy the device connection but " + "attempting to continue", + exc_info=True, + ) connect_kwargs = { - 'learn_hostname': True, - 'prompt_recovery': reload_service_args['prompt_recovery'] - } + "learn_hostname": True, + "prompt_recovery": reload_service_args["prompt_recovery"], + } if reconnect_via: - connect_kwargs.update({'via': reconnect_via}) + connect_kwargs.update({"via": reconnect_via}) device.instantiate(**connect_kwargs) rommon_to_disable = None try: - if device.is_ha and hasattr(device, 'subconnections'): + if device.is_ha and hasattr(device, "subconnections"): if isinstance(device.subconnections, list): - rommon_to_disable = device.subconnections[0].state_machine.get_path('rommon', 'disable') + rommon_to_disable = device.subconnections[ + 0 + ].state_machine.get_path("rommon", "disable") else: - rommon_to_disable = device.state_machine.get_path('rommon', 'disable') + rommon_to_disable = device.state_machine.get_path( + "rommon", "disable" + ) except ValueError: - log.warning('There is no path between rommon and disable states.') + log.warning("There is no path between rommon and disable states.") except IndexError: - log.warning('There is no connection in device.subconnections') - if rommon_to_disable and hasattr(rommon_to_disable, 'command'): + log.warning("There is no connection in device.subconnections") + if rommon_to_disable and hasattr(rommon_to_disable, "command"): original_command = rommon_to_disable.command if device.is_ha: - index = device.subconnections[0].state_machine.paths.index(rommon_to_disable) + index = device.subconnections[0].state_machine.paths.index( + rommon_to_disable + ) for subcon in device.subconnections: - subcon.state_machine.paths[index].command = lambda state,spawn,context: raise_(Exception(f'Device {device.name} is still ' - f'in rommon state after reload.')) + subcon.state_machine.paths[index].command = ( + lambda state, spawn, context: raise_( + Exception( + f"Device {device.name} is still " + f"in rommon state after reload." + ) + ) + ) else: index = device.state_machine.paths.index(rommon_to_disable) - device.state_machine.paths[index].command = lambda state,spawn,context: raise_(Exception(f'Device {device.name} is still ' - f'in rommon state after reload.')) + device.state_machine.paths[index].command = ( + lambda state, spawn, context: raise_( + Exception( + f"Device {device.name} is still " + f"in rommon state after reload." + ) + ) + ) try: device.connect() except Exception as e: step.failed("Failed to reconnect", from_exception=e) - if hasattr(device, 'platform') and device.platform != 'sdwan': - if rommon_to_disable and hasattr(rommon_to_disable, 'command'): + if hasattr(device, "platform") and device.platform != "sdwan": + if rommon_to_disable and hasattr(rommon_to_disable, "command"): if device.is_ha: - index = device.subconnections[0].state_machine.paths.index(rommon_to_disable) + index = device.subconnections[0].state_machine.paths.index( + rommon_to_disable + ) for subcon in device.subconnections: subcon.state_machine.paths[index].command = original_command else: @@ -1195,115 +1870,118 @@ def check_modules(self, steps, device, check_modules=None): self.CHECK_MODULES.update(check_modules) check_modules = self.CHECK_MODULES - if check_modules['check']: + if check_modules["check"]: - with steps.start(f"Checking the modules on '{device.name}' are in a " - f"stable state") as step: + with steps.start( + f"Checking the modules on '{device.name}' are in a " f"stable state" + ) as step: try: device.api.verify_module_status( - timeout=check_modules['timeout'], - interval=check_modules['interval'], - ignore_modules=check_modules['ignore_modules']) + timeout=check_modules["timeout"], + interval=check_modules["interval"], + ignore_modules=check_modules["ignore_modules"], + ) except Exception as e: - step.failed("Modules are not in a stable state", - from_exception=e) + step.failed("Modules are not in a stable state", from_exception=e) class RommonBoot(BaseStage): """This stage boots an image onto the device through rommon. Using either -a local image or one from a tftp server. + a local image or one from a tftp server. -Stage Schema ------------- -rommon_boot: + Stage Schema + ------------ + rommon_boot: - image (list): Image to boot with + image (list): Image to boot with - tftp (optional): If specified boot via tftp otherwise boot using local - image. + tftp (optional): If specified boot via tftp otherwise boot using local + image. - ip_address (list, optional): Management ip address to configure to reach to the - tftp server + ip_address (list, optional): Management ip address to configure to reach to the + tftp server - subnet_mask (str, optional): Management subnet mask + subnet_mask (str, optional): Management subnet mask - gateway (str, optional): Management gateway + gateway (str, optional): Management gateway - tftp_server (str, optional): Tftp server that is reachable with management interface + tftp_server (str, optional): Tftp server that is reachable with management interface - recovery_password (str): Enable password for device - required after bootup. Defaults to None. + recovery_password (str): Enable password for device + required after bootup. Defaults to None. - recovery_enable_password (str): Enable password for device - required after bootup. Defaults to None. + recovery_enable_password (str): Enable password for device + required after bootup. Defaults to None. - recovery_username (str): Enable username for device - required after bootup. Defaults to None. + recovery_username (str): Enable username for device + required after bootup. Defaults to None. - save_system_config (bool, optional): Whether or not to save the - system config if it was modified. Defaults to True. + save_system_config (bool, optional): Whether or not to save the + system config if it was modified. Defaults to True. - timeout (int, optional): Max time allowed for the booting process. - Defaults to 600. + timeout (int, optional): Max time allowed for the booting process. + Defaults to 600. - config_reg_timeout (int, optional): Max time to set config-register. - Defaults to 30. + config_reg_timeout (int, optional): Max time to set config-register. + Defaults to 30. - config_register (str, optional): Specify a custom config register for rommon booting. - Defaults to 0x0. + config_register (str, optional): Specify a custom config register for rommon booting. + Defaults to 0x0. - rommon_timeout (int, optional): Timeout after bringing the device to rommon. Default to 15 sec. + rommon_timeout (int, optional): Timeout after bringing the device to rommon. Default to 15 sec. - reconnect_timeout (int, optional): Timeout to reconnect the device after booting. Default to 90 sec. + reconnect_timeout (int, optional): Timeout to reconnect the device after booting. Default to 90 sec. -Example -------- -rommon_boot: - image: - - /auto/some-location/that-this/image/stay-isr-image.bin - tftp: - ip_address: [10.1.7.126, 10.1.7.127] - gateway: 10.1.7.1 - subnet_mask: 255.255.255.0 - tftp_server: 11.1.7.251 - recovery_password: nbv_12345 - recovery_username: user_12345 - recovery_enable_password: en - save_system_config: False - timeout: 600 - config_reg_timeout: 10 - config_register: 0x0 - -There is more than one ip address, one for each supervisor. - -To pass tftp information and tftp server ip from the testbed, refer the example below - - -testbed: - name: - name: - passwords: - tacacs: test - enable: test - servers: - tftp: - tftp: - address: 10.x.x.x - credentials: - default: - username: user - password: 1234 -devices: - uut1: - management: - address: - ipv4: '10.1.1.1/16' - gateway: - ipv4: '10.1.0.1' + Example + ------- + rommon_boot: + image: + - /auto/some-location/that-this/image/stay-isr-image.bin + tftp: + ip_address: [10.1.7.126, 10.1.7.127] + gateway: 10.1.7.1 + subnet_mask: 255.255.255.0 + tftp_server: 11.1.7.251 + recovery_password: nbv_12345 + recovery_username: user_12345 + recovery_enable_password: en + save_system_config: False + timeout: 600 + config_reg_timeout: 10 + config_register: 0x0 -""" + There is more than one ip address, one for each supervisor. + + To pass tftp information and tftp server ip from the testbed, refer the example below + + config_register (str, optional): Specify a custom config register for rommon booting. + Defaults to 0x0. + + testbed: + name: + name: + passwords: + tacacs: test + enable: test + servers: + tftp: + tftp: + address: 10.x.x.x + credentials: + default: + username: user + password: 1234 + devices: + uut1: + management: + address: + ipv4: '10.1.1.1/16' + gateway: + ipv4: '10.1.0.1' + + """ # ================= # Argument Defaults @@ -1322,41 +2000,43 @@ class RommonBoot(BaseStage): # Stage Schema # ============ schema = { - 'image': list, - Optional('tftp'): { - Optional('ip_address'): list, - Optional('subnet_mask'): str, - Optional('gateway'): str, - Optional('tftp_server'): str + "image": list, + Optional("tftp"): { + Optional("ip_address"): list, + Optional("subnet_mask"): str, + Optional("gateway"): str, + Optional("tftp_server"): str, }, - Optional('save_system_config'): bool, - Optional('recovery_password'): str, - Optional('recovery_username'): str, - Optional('recovery_enable_password'): str, - Optional('timeout'): int, - Optional('ether_port'): int, - Optional('rommon_timeout'): int, - Optional('config_register'): str, + Optional("save_system_config"): bool, + Optional("recovery_password"): str, + Optional("recovery_username"): str, + Optional("recovery_enable_password"): str, + Optional("timeout"): int, + Optional("ether_port"): int, + Optional("rommon_timeout"): int, + Optional("config_register"): str, } # ============================== # Execution order of Stage steps # ============================== exec_order = [ - 'delete_boot_variables', - 'write_memory', - 'go_to_rommon', - 'rommon_boot', - 'reconnect', - 'enable_device_autoboot' + "delete_boot_variables", + "write_memory", + "go_to_rommon", + "rommon_boot", + "reconnect", + "enable_device_autoboot", ] def delete_boot_variables(self, steps, device): with steps.start("Delete configured boot variables") as step: try: - device.configure('no boot system') + device.configure("no boot system") except Exception as e: - step.failed("Failed to delete configured boot variables", from_exception=e) + step.failed( + "Failed to delete configured boot variables", from_exception=e + ) def write_memory(self, steps, device): with steps.start("Write memory") as step: @@ -1365,28 +2045,42 @@ def write_memory(self, steps, device): except Exception as e: step.failed("Failed to write memory", from_exception=e) - def go_to_rommon(self, steps, device, config_register=CONFIG_REGISTER, rommon_timeout=ROMMON_TIMEOUT): + def go_to_rommon( + self, + steps, + device, + config_register=CONFIG_REGISTER, + rommon_timeout=ROMMON_TIMEOUT, + ): with steps.start("Bring device down to rommon mode") as step: try: device.rommon(config_register=config_register) except Exception as e: step.failed("Failed to bring device to rommon!", from_exception=e) - log.info("Device is reloading") device.destroy_all() - def rommon_boot(self, steps, device, image, tftp=None, timeout=TIMEOUT, recovery_password=RECOVERY_PASSWORD, - recovery_username=RECOVERY_USERNAME, recovery_enable_password=RECOVERY_ENABLE_PASSWORD, ether_port=ETHER_PORT): + def rommon_boot( + self, + steps, + device, + image, + tftp=None, + timeout=TIMEOUT, + recovery_password=RECOVERY_PASSWORD, + recovery_username=RECOVERY_USERNAME, + recovery_enable_password=RECOVERY_ENABLE_PASSWORD, + ether_port=ETHER_PORT, + ): with steps.start("Boot device from rommon") as step: if tftp is not None: # Check if management attribute in device object, if not set to empty dict - if not hasattr(device, 'management'): + if not hasattr(device, "management"): setattr(device, "management", {}) - # Getting the tftp information, if the info not provided by user, it takes from testbed - address = device.management.get('address', {}).get('ipv4', '') + address = device.management.get("address", {}).get("ipv4", "") if isinstance(address, IPv4Interface): ip_address = [str(address.ip)] subnet_mask = str(address.netmask) @@ -1395,8 +2089,12 @@ def rommon_boot(self, steps, device, image, tftp=None, timeout=TIMEOUT, recovery subnet_mask = str(address.netmask) tftp.setdefault("ip_address", ip_address) tftp.setdefault("subnet_mask", subnet_mask) - tftp.setdefault("gateway", str(device.management.get('gateway', {}).get('ipv4'))) - tftp.setdefault("tftp_server", device.testbed.servers.get('tftp', {}).get('address')) + tftp.setdefault( + "gateway", str(device.management.get("gateway", {}).get("ipv4")) + ) + tftp.setdefault( + "tftp_server", device.testbed.servers.get("tftp", {}).get("address") + ) log.info("checking if all the tftp information is given by the user") if tftp and not all(tftp.values()): @@ -1404,47 +2102,45 @@ def rommon_boot(self, steps, device, image, tftp=None, timeout=TIMEOUT, recovery # setting tftp empty if ttfp information is missing tftp = {} - # Need to instantiate to get the device.start # The device.start only works because of a|b device.instantiate(connection_timeout=timeout) try: - abstract = Lookup.from_device(device, packages={'clean': clean}) + abstract = Lookup.from_device(device, packages={"clean": clean}) except Exception as e: step.failed("Abstraction lookup failed", from_exception=e) # device.start only gets filled with single rp devices # for multiple rp devices we need to use subconnections - if device.is_ha and hasattr(device, 'subconnections'): + if device.is_ha and hasattr(device, "subconnections"): start = [i.start[0] for i in device.subconnections] else: start = device.start - common_kwargs = { - 'device': device, - 'timeout': timeout - } + common_kwargs = {"device": device, "timeout": timeout} if tftp: - tftp.update({'image': image, 'ether_port': ether_port}) - common_kwargs.update({'tftp_boot': tftp}) + tftp.update({"image": image, "ether_port": ether_port}) + common_kwargs.update({"tftp_boot": tftp}) else: - common_kwargs.update({'golden_image': image}) + common_kwargs.update({"golden_image": image}) # Update recovery username and password - common_kwargs.update({ - 'recovery_username': recovery_username, - 'recovery_en_password':recovery_enable_password, - 'recovery_password': recovery_password - }) + common_kwargs.update( + { + "recovery_username": recovery_username, + "recovery_en_password": recovery_enable_password, + "recovery_password": recovery_password, + } + ) try: pcall( targets=abstract.clean.recovery.recovery.recovery_worker, start=start, - ikwargs=[{'item': i} for i, _ in enumerate(start)], - ckwargs=common_kwargs + ikwargs=[{"item": i} for i, _ in enumerate(start)], + ckwargs=common_kwargs, ) except Exception as e: step.failed("Failed to boot the device from rommon", from_exception=e) @@ -1452,7 +2148,10 @@ def rommon_boot(self, steps, device, image, tftp=None, timeout=TIMEOUT, recovery def reconnect(self, steps, device, reconnect_timeout=RECONNECT_TIMEOUT): with steps.start("Reconnect to device") as step: - if getattr(device, 'chassis_type', None) and device.chassis_type.lower() == 'stack': + if ( + getattr(device, "chassis_type", None) + and device.chassis_type.lower() == "stack" + ): log.info(f"Sleep for {reconnect_timeout} seconds in order to sync") time.sleep(reconnect_timeout) @@ -1462,120 +2161,122 @@ def reconnect(self, steps, device, reconnect_timeout=RECONNECT_TIMEOUT): def enable_device_autoboot(self, steps, device): with steps.start("Enable autoboot after reconnect") as step: - if hasattr(device.api, "configure_autoboot"): try: device.api.configure_autoboot() except Exception as e: - step.failed("Failed to configure autoboot on the device", from_exception=e) + step.failed( + "Failed to configure autoboot on the device", from_exception=e + ) else: - step.skipped('No autoboot API available') + step.skipped("No autoboot API available") class CopyToDevice(BaseStage): """This stage will copy an image to a device from a networked location. -Stage Schema ------------- -copy_to_device: + Stage Schema + ------------ + copy_to_device: - origin: + origin: - files (list): Image files location on the server. + files (list): Image files location on the server. - hostname (str): Hostname or address of the server. + hostname (str): Hostname or address of the server. - destination: + destination: - directory (str): Directory on the device to copy the images to. + directory (str): Directory on the device to copy the images to. - standby_directory (str, optional): Standby directory on the device - to copy the images to. Defaults to None. + standby_directory (str, optional): Standby directory on the device + to copy the images to. Defaults to None. - protocol (str): Protocol used for copy operation. + protocol (str): Protocol used for copy operation. - connection_alias (str): Connection alias to use + connection_alias (str): Connection alias to use - verify_num_images (bool, optional): Verify number of images provided by - user for clean is correct. Defaults to True. + verify_num_images (bool, optional): Verify number of images provided by + user for clean is correct. Defaults to True. - verify_running_image (bool, optional): Compare the image filename with the running - image version on device. If a match is found, the copy stage will be skipped. - Defaults to True. + verify_running_image (bool, optional): Compare the image filename with the running + image version on device. If a match is found, the copy stage will be skipped. + Defaults to True. - expected_num_images (int, optional): Number of images expected to be - provided by user for clean. Defaults to 1. + expected_num_images (int, optional): Number of images expected to be + provided by user for clean. Defaults to 1. - vrf (str, optional): Vrf used to copy. Defaults to an empty string. + vrf (str, optional): Vrf used to copy. Defaults to an empty string. - timeout (int, optional): Copy operation timeout in seconds. Defaults to 300. + timeout (int, optional): Copy operation timeout in seconds. Defaults to 300. - compact (bool, optional): Compact copy mode if supported by the device. - Defaults to False. + compact (bool, optional): Compact copy mode if supported by the device. + Defaults to False. - protected_files (list, optional): File patterns that should not be deleted. - Defaults to None. + protected_files (list, optional): File patterns that should not be deleted. + Defaults to None. - overwrite (bool, optional): Overwrite the file if a file with the same - name already exists. Defaults to False. + overwrite (bool, optional): Overwrite the file if a file with the same + name already exists. Defaults to False. - skip_deletion (bool, optional): Do not delete any files even if there isn't - any space on device. Defaults to False. + skip_deletion (bool, optional): Do not delete any files even if there isn't + any space on device. Defaults to False. - copy_attempts (int, optional): Number of times to attempt copying image - files. Defaults to 1 (no retry). + copy_attempts (int, optional): Number of times to attempt copying image + files. Defaults to 1 (no retry). - copy_attempts_sleep (int, optional): Number of seconds to sleep between - copy_attempts. Defaults to 30. + copy_attempts_sleep (int, optional): Number of seconds to sleep between + copy_attempts. Defaults to 30. - check_file_stability (bool, optional): Verifies that the file size is not - changing. This ensures the image is not actively being copied. - Defaults to False. + check_file_stability (bool, optional): Verifies that the file size is not + changing. This ensures the image is not actively being copied. + Defaults to False. - stability_check_tries (int, optional): Max number of checks that can be - done when checking file stability. Defaults to 3. + stability_check_tries (int, optional): Max number of checks that can be + done when checking file stability. Defaults to 3. - stability_check_delay (int, optional): Delay between tries when checking - file stability in seconds. Defaults to 2. + stability_check_delay (int, optional): Delay between tries when checking + file stability in seconds. Defaults to 2. - min_free_space_percent ('int', optional) : Percentage of total disk space - that must be free. If specified the percentage is not free then the - stage will attempt to delete unprotected files to reach the minimum - percentage. Defaults to None. + min_free_space_percent ('int', optional) : Percentage of total disk space + that must be free. If specified the percentage is not free then the + stage will attempt to delete unprotected files to reach the minimum + percentage. Defaults to None. - use_kstack (bool, optional): Use faster version of copy with limited options. - Defaults to False. + use_kstack (bool, optional): Use faster version of copy with limited options. + Defaults to False. - interface (str, optional): The interface to use for file transfers, may be needed - for copying files on some IOSXE platforms, such as ASR1K when using a VRF - Defaults to None + interface (str, optional): The interface to use for file transfers, may be needed + for copying files on some IOSXE platforms, such as ASR1K when using a VRF + Defaults to None - unique_file_name (bool, optional): Appends a random six-digit number to - the end of the image name. Defaults to False. + unique_file_name (bool, optional): Appends a random six-digit number to + the end of the image name. Defaults to False. - unique_number: (int, optional): Appends the provided number to the end of - the image name. Defaults to None. Requires unique_file_name is True - to be applied. + unique_number: (int, optional): Appends the provided number to the end of + the image name. Defaults to None. Requires unique_file_name is True + to be applied. - rename_images: (str, optional): Rename the image to the provided name. - If multiple files exist then an incrementing number is also appended. - Defaults to None + rename_images: (str, optional): Rename the image to the provided name. + If multiple files exist then an incrementing number is also appended. + Defaults to None - prompt_recovery(bool, optional): Enable the prompt recovery when the execution - command timeout. Defaults to False. + prompt_recovery(bool, optional): Enable the prompt recovery when the execution + command timeout. Defaults to False. + + Example + ------- + copy_to_device: + origin: + hostname: server-1 + files: + - /home/cisco/asr1k.bin + destination: + directory: harddisk:/ + protocol: sftp + timeout: 300 + """ -Example -------- -copy_to_device: - origin: - hostname: server-1 - files: - - /home/cisco/asr1k.bin - destination: - directory: harddisk:/ - protocol: sftp - timeout: 300 -""" # ================= # Argument Defaults # ================= @@ -1584,7 +2285,7 @@ class CopyToDevice(BaseStage): EXPECTED_NUM_IMAGES = 1 # must be '' instead of None to prevent NXOS from # defaulting to 'management' - VRF = '' + VRF = "" TIMEOUT = 300 COMPACT = False USE_KSTACK = False @@ -1602,91 +2303,192 @@ class CopyToDevice(BaseStage): UNIQUE_NUMBER = None RENAME_IMAGES = None PROMPT_RECOVERY = False - PROTOCOL = 'http' - CONNECTION_ALIAS = 'default' + PROTOCOL = "http" + CONNECTION_ALIAS = "default" # ============ # Stage Schema # ============ schema = { - 'origin': { - Optional('files', description="Image files location on the server."): list, - Optional('hostname', description="Hostname or address of the server."): str + "origin": { + Optional("files", description="Image files location on the server."): list, + Optional("hostname", description="Hostname or address of the server."): str, }, - 'destination': { - Required('directory', description="Directory on the device to copy the images to."): str, - Optional('standby_directory', description="Standby directory on the device to copy the images to"): str, - Optional('stack_directory', description="Stack directories on the device to copy the images to"): list + "destination": { + Required( + "directory", + description="Directory on the device to copy the images to.", + ): str, + Optional( + "standby_directory", + description="Standby directory on the device to copy the images to", + ): str, + Optional( + "stack_directory", + description="Stack directories on the device to copy the images to", + ): list, }, - Optional('protocol', description="Protocol used for copy operation.", default=PROTOCOL): str, - Optional('connection_alias', description='Connection alias to use', default='default'): str, - Optional('verify_num_images', description="Verify number of images provided by user for clean is correct.", default=VERIFY_NUM_IMAGES): bool, - Optional('verify_running_image', description="Compare the image filename with the running image version on device. If a match is found, the copy stage will be skipped", default=VERIFY_RUNNING_IMAGE): bool, - Optional('expected_num_images', description="Number of images expected to be provided by user for clean.", default=EXPECTED_NUM_IMAGES): int, - Optional('vrf', description="Vrf used to copy. Defaults to an empty string.", default=VRF): str, - Optional('timeout', description="Copy operation timeout in seconds.", default=TIMEOUT): int, - Optional('compact', description="Compact copy mode if supported by the device.", default=COMPACT): bool, - Optional('use_kstack', description="Use faster version of copy with limited options.", default=USE_KSTACK): bool, - Optional('protected_files', description="File patterns that should not be deleted.", default=PROTECTED_FILES): list, - Optional('overwrite', description="Overwrite the file if a file with the same name already exists.", default=OVERWRITE): bool, - Optional('skip_deletion', description="Do not delete any files even if there isn't any space on device.", default=SKIP_DELETION): bool, - Optional('copy_attempts', description="Number of times to attempt copying image files.", default=COPY_ATTEMPTS): int, - Optional('copy_attempts_sleep', description="Number of seconds to sleep between copy_attempts.", default=COPY_ATTEMPTS_SLEEP): int, - Optional('check_file_stability', description="Verifies that the file size is not changing. This ensures the image is not actively being copied.", default=CHECK_FILE_STABILITY): bool, - Optional('stability_check_tries', description="Max number of checks that can be done when checking file stability.", default=STABILITY_CHECK_TRIES): int, - Optional('stability_check_delay', description="Delay between tries when checking file stability in seconds.", default=STABILITY_CHECK_DELAY): int, - Optional('min_free_space_percent', description="Percentage of total disk space that must be free. If specified the percentage is not free then the stage will attempt to delete unprotected files to reach the minimum percentage.", default=MIN_FREE_SPACE_PERCENT): int, - Optional('interface', description="The interface to use for file transfers, may be needed for copying files on some IOSXE platforms, such as ASR1K when using a VRF.", default=INTERFACE): str, - Optional('unique_file_name', description="Appends a random six-digit number to the end of the image name.", default=UNIQUE_FILE_NAME): bool, - Optional('unique_number', description="Appends the provided number to the end of the image name. Requires unique_file_name is True to be applied.", default=UNIQUE_NUMBER): int, - Optional('rename_images', description="Rename the image to the provided name. If multiple files exist then an incrementing number is also appended.", default=RENAME_IMAGES): str, - Optional('prompt_recovery', description="Enable the prompt recovery when the execution command timeout.", default=PROMPT_RECOVERY): bool + Optional( + "protocol", + description="Protocol used for copy operation.", + default=PROTOCOL, + ): str, + Optional( + "connection_alias", description="Connection alias to use", default="default" + ): str, + Optional( + "verify_num_images", + description="Verify number of images provided by user for clean is correct.", + default=VERIFY_NUM_IMAGES, + ): bool, + Optional( + "verify_running_image", + description="Compare the image filename with the running image version on device. If a match is found, the copy stage will be skipped", + default=VERIFY_RUNNING_IMAGE, + ): bool, + Optional( + "expected_num_images", + description="Number of images expected to be provided by user for clean.", + default=EXPECTED_NUM_IMAGES, + ): int, + Optional( + "vrf", + description="Vrf used to copy. Defaults to an empty string.", + default=VRF, + ): str, + Optional( + "timeout", description="Copy operation timeout in seconds.", default=TIMEOUT + ): int, + Optional( + "compact", + description="Compact copy mode if supported by the device.", + default=COMPACT, + ): bool, + Optional( + "use_kstack", + description="Use faster version of copy with limited options.", + default=USE_KSTACK, + ): bool, + Optional( + "protected_files", + description="File patterns that should not be deleted.", + default=PROTECTED_FILES, + ): list, + Optional( + "overwrite", + description="Overwrite the file if a file with the same name already exists.", + default=OVERWRITE, + ): bool, + Optional( + "skip_deletion", + description="Do not delete any files even if there isn't any space on device.", + default=SKIP_DELETION, + ): bool, + Optional( + "copy_attempts", + description="Number of times to attempt copying image files.", + default=COPY_ATTEMPTS, + ): int, + Optional( + "copy_attempts_sleep", + description="Number of seconds to sleep between copy_attempts.", + default=COPY_ATTEMPTS_SLEEP, + ): int, + Optional( + "check_file_stability", + description="Verifies that the file size is not changing. This ensures the image is not actively being copied.", + default=CHECK_FILE_STABILITY, + ): bool, + Optional( + "stability_check_tries", + description="Max number of checks that can be done when checking file stability.", + default=STABILITY_CHECK_TRIES, + ): int, + Optional( + "stability_check_delay", + description="Delay between tries when checking file stability in seconds.", + default=STABILITY_CHECK_DELAY, + ): int, + Optional( + "min_free_space_percent", + description="Percentage of total disk space that must be free. If specified the percentage is not free then the stage will attempt to delete unprotected files to reach the minimum percentage.", + default=MIN_FREE_SPACE_PERCENT, + ): int, + Optional( + "interface", + description="The interface to use for file transfers, may be needed for copying files on some IOSXE platforms, such as ASR1K when using a VRF.", + default=INTERFACE, + ): str, + Optional( + "unique_file_name", + description="Appends a random six-digit number to the end of the image name.", + default=UNIQUE_FILE_NAME, + ): bool, + Optional( + "unique_number", + description="Appends the provided number to the end of the image name. Requires unique_file_name is True to be applied.", + default=UNIQUE_NUMBER, + ): int, + Optional( + "rename_images", + description="Rename the image to the provided name. If multiple files exist then an incrementing number is also appended.", + default=RENAME_IMAGES, + ): str, + Optional( + "prompt_recovery", + description="Enable the prompt recovery when the execution command timeout.", + default=PROMPT_RECOVERY, + ): bool, } # ============================== # Execution order of Stage steps # ============================== - exec_order = [ - 'copy_to_device' - ] - - def copy_to_device(self, steps, device, origin, destination, - protocol=PROTOCOL, - connection_alias=CONNECTION_ALIAS, - verify_num_images=VERIFY_NUM_IMAGES, - expected_num_images=EXPECTED_NUM_IMAGES, - vrf=VRF, - timeout=TIMEOUT, - compact=COMPACT, - use_kstack=USE_KSTACK, - protected_files=PROTECTED_FILES, - overwrite=OVERWRITE, - skip_deletion=SKIP_DELETION, - copy_attempts=COPY_ATTEMPTS, - copy_attempts_sleep=COPY_ATTEMPTS_SLEEP, - check_file_stability=CHECK_FILE_STABILITY, - stability_check_tries=STABILITY_CHECK_TRIES, - stability_check_delay=STABILITY_CHECK_DELAY, - min_free_space_percent=MIN_FREE_SPACE_PERCENT, - interface=INTERFACE, - unique_file_name=UNIQUE_FILE_NAME, - unique_number=UNIQUE_NUMBER, - rename_images=RENAME_IMAGES, - prompt_recovery=PROMPT_RECOVERY, - verify_running_image=VERIFY_RUNNING_IMAGE, - **kwargs - ): - log.info("Section steps:\n1- Verify correct number of images provided" - "\n2- Get filesize of image files" - "\n3- Check if image files already exist on device" - "\n4- (Optional) Verify stability of image files" - "\n5- Verify free space on device else delete unprotected files" - "\n6- Copy image files to device" - "\n7- Verify copied image files are present on device") + exec_order = ["copy_to_device"] + def copy_to_device( + self, + steps, + device, + origin, + destination, + protocol=PROTOCOL, + connection_alias=CONNECTION_ALIAS, + verify_num_images=VERIFY_NUM_IMAGES, + expected_num_images=EXPECTED_NUM_IMAGES, + vrf=VRF, + timeout=TIMEOUT, + compact=COMPACT, + use_kstack=USE_KSTACK, + protected_files=PROTECTED_FILES, + overwrite=OVERWRITE, + skip_deletion=SKIP_DELETION, + copy_attempts=COPY_ATTEMPTS, + copy_attempts_sleep=COPY_ATTEMPTS_SLEEP, + check_file_stability=CHECK_FILE_STABILITY, + stability_check_tries=STABILITY_CHECK_TRIES, + stability_check_delay=STABILITY_CHECK_DELAY, + min_free_space_percent=MIN_FREE_SPACE_PERCENT, + interface=INTERFACE, + unique_file_name=UNIQUE_FILE_NAME, + unique_number=UNIQUE_NUMBER, + rename_images=RENAME_IMAGES, + prompt_recovery=PROMPT_RECOVERY, + verify_running_image=VERIFY_RUNNING_IMAGE, + **kwargs, + ): + log.info( + "Section steps:\n1- Verify correct number of images provided" + "\n2- Get filesize of image files" + "\n3- Check if image files already exist on device" + "\n4- (Optional) Verify stability of image files" + "\n5- Verify free space on device else delete unprotected files" + "\n6- Copy image files to device" + "\n7- Verify copied image files are present on device" + ) if connection_alias: - log.info(f'Using connection alias {connection_alias}') + log.info(f"Using connection alias {connection_alias}") with device.temp_default_alias(connection_alias): @@ -1697,48 +2499,58 @@ def copy_to_device(self, steps, device, origin, destination, file_utils = FileUtils(testbed=device.testbed) # Get args - server = origin.get('hostname') + server = origin.get("hostname") - image_files = origin['files'] + image_files = origin["files"] if server: # Check remote server info present in testbed YAML if not file_utils.get_server_block(server): self.failed( "Server '{}' was provided in the clean yaml file but " - "doesn't exist in the testbed file.\n".format(server)) + "doesn't exist in the testbed file.\n".format(server) + ) - string_to_remove = file_utils.get_server_block(server).get('path', '') - image_files = remove_string_from_image(images=origin['files'], - string=string_to_remove) + string_to_remove = file_utils.get_server_block(server).get("path", "") + image_files = remove_string_from_image( + images=origin["files"], string=string_to_remove + ) # Set active node destination directory - destination_act = destination['directory'] + destination_act = destination["directory"] # Set standby node destination directory - if 'standby_directory' in destination: - destination_stby = destination['standby_directory'] + if "standby_directory" in destination: + destination_stby = destination["standby_directory"] destinations = [destination_stby, destination_act] else: destination_stby = None destinations = [destination_act] - if 'stack_directory' in destination: - destination_stack = destination['stack_directory'] + if "stack_directory" in destination: + destination_stack = destination["stack_directory"] for member_dir in destination_stack: destinations.append(member_dir) + # update the expected images to 2 if SMU image is given + # else defaults to 1 + for image in image_files: + if "smu" in image: + expected_num_images = len(image_files) + break + # Check image files provided if verify_num_images: # Verify correct number of images provided with steps.start("Verify correct number of images provided") as step: if not verify_num_images_provided( - image_list=image_files, - expected_images=expected_num_images): + image_list=image_files, expected_images=expected_num_images + ): step.failed( "Incorrect number of images provided. Please " "provide {} expected image(s) under destination" - ".path in clean yaml file.\n".format(expected_num_images)) + ".path in clean yaml file.\n".format(expected_num_images) + ) else: step.passed("Correct number of images provided") @@ -1750,7 +2562,6 @@ def copy_to_device(self, steps, device, origin, destination, file_size = None - # Check the running image if verify_running_image: # Verify the image running in the device @@ -1761,13 +2572,23 @@ def copy_to_device(self, steps, device, origin, destination, step.failed("Failed to verify the running image") # To get the system image - dest_file_path = out.get("version", {}).get('system_image', "") + dest_file_path = out.get("version", {}).get("system_image", "") # if the device is in bundle mode and user passed install_image stage this step will not be executed. - if "BUNDLE" in Dq(out).get_values("mode") and "install_image" in device.clean.order: - step.skipped(f"The device is in bundle mode and install_image stage is passed in clean file. Skipping the verify running image check.") - elif 'packages.conf' in dest_file_path and any('change_boot_variable' in order_name for order_name in device.clean.order): - step.passed(f"The device is in install mode and change_boot_variable stage is passed in clean file. Continuing with the copy process.") + + if "BUNDLE" in Dq(out).get_values( + "mode" + ) and "install_image" in device.clean.get("order", []): + step.skipped( + f"The device is in bundle mode and install_image stage is passed in clean file. Skipping the verify running image check." + ) + elif "packages.conf" in dest_file_path and any( + "change_boot_variable" in order_name + for order_name in device.clean.get("order", []) + ): + step.passed( + f"The device is in install mode and change_boot_variable stage is passed in clean file. Continuing with the copy process." + ) else: # Match the build_label if present, otherwise the xe_version # If neither is found, fail to match the image @@ -1778,142 +2599,189 @@ def copy_to_device(self, steps, device, origin, destination, if image_match and image_match.group(): # update image mapping 'as-if' we had copied the file for dest in destinations: - dest_file_path = os.path.join(dest, os.path.basename(file)) - image_mapping = self.history['CopyToDevice'].parameters.setdefault('image_mapping', {}) - image_mapping.update({origin['files'][index]: dest_file_path}) - - self.skipped(f"The image file provided is same as the current running image {image_version} on the device.\n\ - Setting the destination image to {dest_file_path}. Skipping the copy process.") + dest_file_path = os.path.join( + dest, os.path.basename(file) + ) + image_mapping = self.history[ + "CopyToDevice" + ].parameters.setdefault("image_mapping", {}) + image_mapping.update( + {origin["files"][index]: dest_file_path} + ) + + self.skipped( + f"The image file provided is same as the current running image {image_version} on the device.\n\ + Setting the destination image to {dest_file_path}. Skipping the copy process." + ) # try to get file size from file directly with steps.start(f"Get filesize of '{file}'") as step: try: file_size = os.stat(file).st_size except Exception: - step.passx('Failed to get file size') + step.passx("Failed to get file size") if not file_size and server: # Get filesize of image files on remote server - with steps.start("Get filesize of '{}' on remote server '{}'".\ - format(file, server)) as step: + with steps.start( + "Get filesize of '{}' on remote server '{}'".format( + file, server + ) + ) as step: try: file_size = device.api.get_file_size_from_server( server=file_utils.get_hostname(server), path=file, protocol=protocol, timeout=timeout, - fu_session=file_utils) + fu_session=file_utils, + ) except FileNotFoundError: step.failed( - "Can not find file {} on server {}. Terminating clean". - format(file, server)) + "Can not find file {} on server {}. Terminating clean".format( + file, server + ) + ) except Exception as e: log.warning(str(e)) # Something went wrong, set file_size to -1 file_size = -1 unknown_size = True - err_msg = "\nUnable to get filesize for file '{}' on "\ - "remote server {}".format(file, server) + err_msg = ( + "\nUnable to get filesize for file '{}' on " + "remote server {}".format(file, server) + ) if overwrite: err_msg += " - will copy file to device" step.passx(err_msg) else: - step.passed("Verified filesize of file '{}' to be " - "{} bytes".format(file, file_size)) + step.passed( + "Verified filesize of file '{}' to be " + "{} bytes".format(file, file_size) + ) else: - log.info(f'Local file has size {file_size}') + log.info(f"Local file has size {file_size}") for dest in destinations: # Check if file with same name and size exists on device dest_file_path = os.path.join(dest, os.path.basename(file)) - image_mapping = self.history[ - 'CopyToDevice'].parameters.setdefault('image_mapping', {}) - image_mapping.update({origin['files'][index]: dest_file_path}) - with steps.start("Check if file '{}' exists on device {} {}".\ - format(dest_file_path, device.name, dest)) as step: + image_mapping = self.history["CopyToDevice"].parameters.setdefault( + "image_mapping", {} + ) + image_mapping.update({origin["files"][index]: dest_file_path}) + with steps.start( + "Check if file '{}' exists on device {} {}".format( + dest_file_path, device.name, dest + ) + ) as step: # Execute 'dir' before copying image files - dir_before = device.execute('dir {}'.format(dest)) + dir_before = device.execute("dir {}".format(dest)) # Check if file exists try: exist = device.api.verify_file_exists( file=dest_file_path, size=file_size, - dir_output=dir_before) + dir_output=dir_before, + ) except Exception as e: exist = False - log.warning("Unable to check if image '{}' exists on device {} {}." - "Error: {}".format(dest_file_path, - device.name, - dest, - str(e))) - - if (not exist) or (exist and overwrite) or (exist and (unique_file_name or unique_number or rename_images)): + log.warning( + "Unable to check if image '{}' exists on device {} {}." + "Error: {}".format( + dest_file_path, device.name, dest, str(e) + ) + ) + + if ( + (not exist) + or (exist and overwrite) + or ( + exist + and (unique_file_name or unique_number or rename_images) + ) + ): # Update list of files to copy file_copy_info = { file: { - 'size': file_size, - 'dest_path': dest_file_path, - 'exist': exist + "size": file_size, + "dest_path": dest_file_path, + "exist": exist, } } files_to_copy.update(file_copy_info) # Print message to user - step.passed("Proceeding with copying image {} to device {}".\ - format(dest_file_path, device.name)) + step.passed( + "Proceeding with copying image {} to device {}".format( + dest_file_path, device.name + ) + ) else: step.passed( "Image '{}' already exists on device {} {}, " - "skipping copy".format(file, device.name, dest)) + "skipping copy".format(file, device.name, dest) + ) # Check if any file copy is in progress if check_file_stability: for file in files_to_copy: - with steps.start("Verify stability of file '{}'".\ - format(file)) as step: + with steps.start( + "Verify stability of file '{}'".format(file) + ) as step: # Check file stability try: - stable = device.api.verify_file_size_stable_on_server( - file=file, - server=file_utils.get_hostname(server), - protocol=protocol, - fu_session=file_utils, - delay=stability_check_delay, - max_tries=stability_check_tries) + stable = ( + device.api.verify_file_size_stable_on_server( + file=file, + server=file_utils.get_hostname(server), + protocol=protocol, + fu_session=file_utils, + delay=stability_check_delay, + max_tries=stability_check_tries, + ) + ) if not stable: step.failed( "The size of file '{}' on server is not " - "stable\n".format(file), ) + "stable\n".format(file), + ) else: step.passed( - "Size of file '{}' is stable".format(file)) + "Size of file '{}' is stable".format(file) + ) except NotImplementedError: # cannot check using tftp step.passx( - "Unable to check file stability over {protocol}" - .format(protocol=protocol)) + "Unable to check file stability over {protocol}".format( + protocol=protocol + ) + ) except Exception as e: log.error(str(e)) step.failed( "Error while verifying file stability on " - "server\n") + "server\n" + ) # Verify available space on the device is sufficient for image copy, delete # unprotected files if needed, copy file to the device # unless overwrite: False if files_to_copy: with steps.start( - "Verify sufficient free space on device '{}' '{}' or delete" - " unprotected files".format(device.name, - dest)) as step: + "Verify sufficient free space on device '{}' '{}' or delete" + " unprotected files".format(device.name, dest) + ) as step: if unknown_size: total_size = -1 - log.warning("Amount of space required cannot be confirmed, " - "copying the files on the device '{}' '{}' may fail".\ - format(device.name, dest)) + log.warning( + "Amount of space required cannot be confirmed, " + "copying the files on the device '{}' '{}' may fail".format( + device.name, dest + ) + ) if not protected_files: protected_files = [] @@ -1922,9 +2790,9 @@ def copy_to_device(self, steps, device, origin, destination, if not skip_deletion: # TODO: add golden images, config to protected files once we have golden section golden_config = find_clean_variable( - self, 'golden_config') - golden_image = find_clean_variable( - self, 'golden_image') + self, "golden_config" + ) + golden_image = find_clean_variable(self, "golden_image") if golden_config: protected_files.extend(golden_config) @@ -1932,9 +2800,10 @@ def copy_to_device(self, steps, device, origin, destination, protected_files.extend(golden_image) # Only calculate size of file being copied - total_size = sum(0 if file_data['exist'] \ - else file_data['size'] for \ - file_data in files_to_copy.values()) + total_size = sum( + 0 if file_data["exist"] else file_data["size"] + for file_data in files_to_copy.values() + ) try: free_space = device.api.free_up_disk_space( @@ -1944,39 +2813,58 @@ def copy_to_device(self, steps, device, origin, destination, protected_files=protected_files, min_free_space_percent=min_free_space_percent, dir_output=dir_before, - allow_deletion_failure=True) + allow_deletion_failure=True, + ) if not free_space: - step.failed("Unable to create enough space for " - "image on device {} {}".\ - format(device.name, dest)) + step.failed( + "Unable to create enough space for " + "image on device {} {}".format( + device.name, dest + ) + ) else: step.passed( "Device {} {} has sufficient space to " - "copy images".format(device.name, dest)) + "copy images".format(device.name, dest) + ) except Exception as e: log.error(str(e)) - step.failed("Error while creating free space for " - "image on device {} {}".\ - format(device.name, dest)) + step.failed( + "Error while creating free space for " + "image on device {} {}".format( + device.name, dest + ) + ) # Copy the file to the devices for file, file_data in files_to_copy.items(): - with steps.start("Copying image file {} to device {} {}".\ - format(file, device.name, dest)) as step: + with steps.start( + "Copying image file {} to device {} {}".format( + file, device.name, dest + ) + ) as step: # Copy file unless overwrite is False - if not overwrite and file_data['exist'] and not (unique_file_name or unique_number or rename_images): + if ( + not overwrite + and file_data["exist"] + and not ( + unique_file_name or unique_number or rename_images + ) + ): step.skipped( "File with the same name size exists on " "the device {} {}, skipped copying".format( - device.name, dest)) + device.name, dest + ) + ) for i in range(1, copy_attempts + 1): if unique_file_name or unique_number or rename_images: - log.info('renaming files for copying') + log.info("renaming files for copying") if rename_images: - rename_images = rename_images + '_' + str(index) + rename_images = rename_images + "_" + str(index) try: new_name = device.api.modify_filename( @@ -1986,94 +2874,135 @@ def copy_to_device(self, steps, device, origin, destination, protocol=protocol, unique_file_name=unique_file_name, unique_number=unique_number, - new_name=rename_images) + new_name=rename_images, + ) except Exception as e: step.failed( - "Can not change file name. Terminating clean:\n{e}".format(e=e)) + "Can not change file name. Terminating clean:\n{e}".format( + e=e + ) + ) - log.info(f'Renamed {os.path.basename(file)} to {new_name}') + log.info( + f"Renamed {os.path.basename(file)} to {new_name}" + ) renamed_local_path = os.path.join(dest, new_name) - renamed_file_data = {x: y for x,y in file_data.items()} - renamed_file_data['dest_path'] = renamed_local_path + renamed_file_data = { + x: y for x, y in file_data.items() + } + renamed_file_data["dest_path"] = renamed_local_path - self.history['CopyToDevice'].parameters['image_mapping'][file] = renamed_local_path + self.history["CopyToDevice"].parameters[ + "image_mapping" + ][file] = renamed_local_path try: - res = device.api.\ - copy_to_device(protocol=protocol, - server=file_utils.get_hostname(server) if server else None, - remote_path=file, - local_path=renamed_local_path, - vrf=vrf, - timeout=timeout, - compact=compact, - use_kstack=use_kstack, - interface=interface, - overwrite=overwrite, - prompt_recovery=prompt_recovery, - **kwargs) + res = device.api.copy_to_device( + protocol=protocol, + server=( + file_utils.get_hostname(server) + if server + else None + ), + remote_path=file, + local_path=renamed_local_path, + vrf=vrf, + timeout=timeout, + compact=compact, + use_kstack=use_kstack, + interface=interface, + overwrite=overwrite, + prompt_recovery=prompt_recovery, + **kwargs, + ) if not res: - raise Exception('Failed to copy file to device') + raise Exception( + "Failed to copy file to device" + ) except Exception as e: # Retry attempt if user specified if i < copy_attempts: - log.warning("Attempt #{}: Unable to copy {} to '{} {}' due to:\n{}".\ - format(i, file, device.name, dest, e)) - log.info("Sleeping for {} seconds before retrying" - .format(copy_attempts_sleep)) + log.warning( + "Attempt #{}: Unable to copy {} to '{} {}' due to:\n{}".format( + i, file, device.name, dest, e + ) + ) + log.info( + "Sleeping for {} seconds before retrying".format( + copy_attempts_sleep + ) + ) time.sleep(copy_attempts_sleep) continue else: log.error(str(e)) step.failed( "Failed to copy image '{}' to '{}' on device" - " '{}'\n".format(file, dest, - device.name), ) + " '{}'\n".format( + file, dest, device.name + ), + ) else: try: - res = device.api. \ - copy_to_device(protocol=protocol, - server=file_utils.get_hostname(server) if server else None, - remote_path=file, - local_path=file_data['dest_path'], - vrf=vrf, - timeout=timeout, - compact=compact, - use_kstack=use_kstack, - interface=interface, - overwrite=overwrite, - prompt_recovery=prompt_recovery, - **kwargs) + res = device.api.copy_to_device( + protocol=protocol, + server=( + file_utils.get_hostname(server) + if server + else None + ), + remote_path=file, + local_path=file_data["dest_path"], + vrf=vrf, + timeout=timeout, + compact=compact, + use_kstack=use_kstack, + interface=interface, + overwrite=overwrite, + prompt_recovery=prompt_recovery, + **kwargs, + ) if not res: - raise Exception('Failed to copy file to device') + raise Exception( + "Failed to copy file to device" + ) except Exception as e: # Retry attempt if user specified if i < copy_attempts: - log.warning("Attempt #{}: Unable to copy {} to '{} {}' due to:\n{}". \ - format(i, file, device.name, dest, e)) - log.info("Sleeping for {} seconds before retrying" - .format(copy_attempts_sleep)) + log.warning( + "Attempt #{}: Unable to copy {} to '{} {}' due to:\n{}".format( + i, file, device.name, dest, e + ) + ) + log.info( + "Sleeping for {} seconds before retrying".format( + copy_attempts_sleep + ) + ) time.sleep(copy_attempts_sleep) continue else: log.error(str(e)) step.failed( "Failed to copy image '{}' to '{}' on device" - " '{}'\n".format(file, dest, - device.name), ) + " '{}'\n".format( + file, dest, device.name + ), + ) log.info( "File {} has been copied to {} on device {}" - " successfully".format(file, dest, - device.name)) + " successfully".format(file, dest, device.name) + ) success_copy_ha = True break # Save the file copied path and size info for future use - history = self.history['CopyToDevice'].parameters.\ - setdefault('files_copied', {}) + history = self.history[ + "CopyToDevice" + ].parameters.setdefault("files_copied", {}) if unique_file_name or unique_number or rename_images: history.update({file: renamed_file_data}) @@ -2082,40 +3011,64 @@ def copy_to_device(self, steps, device, origin, destination, with steps.start("Verify images successfully copied") as step: # If nothing copied don't need to verify, skip - if 'files_copied' not in self.history[ - 'CopyToDevice'].parameters: + if ( + "files_copied" + not in self.history["CopyToDevice"].parameters + ): step.skipped( "Image files were not copied for {} {} in previous steps, " - "skipping verification steps".format(device.name, dest)) + "skipping verification steps".format(device.name, dest) + ) # Execute 'dir' after copying image files - dir_after = device.execute('dir {}'.format(dest)) - - for name, image_data in self.history['CopyToDevice'].\ - parameters['files_copied'].items(): - with step.start("Verify image '{}' copied to {} on device {}".\ - format(image_data['dest_path'], dest, device.name)) as substep: + dir_after = device.execute("dir {}".format(dest)) + + for name, image_data in ( + self.history["CopyToDevice"] + .parameters["files_copied"] + .items() + ): + with step.start( + "Verify image '{}' copied to {} on device {}".format( + image_data["dest_path"], dest, device.name + ) + ) as substep: # if size is -1 it means it failed to get the size - if not device.api.verify_file_exists(file=image_data['dest_path'], - size=image_data['size'], - dir_output=dir_after): + if not device.api.verify_file_exists( + file=image_data["dest_path"], + size=image_data["size"], + dir_output=dir_after, + ): substep.failed( "Either the file failed to copy OR the local file size is different " - "than the origin file size on the device {}.".format(device.name)) + "than the origin file size on the device {}.".format( + device.name + ) + ) else: file_name = os.path.basename(file) if file_name not in protected_files: protected_files.append(file_name) - log.info('{file_name} added to protected list'.format(file_name=file_name)) - if image_data['size'] != -1: + log.info( + "{file_name} added to protected list".format( + file_name=file_name + ) + ) + if image_data["size"] != -1: substep.passed( "File was successfully copied to device {}. " - "Local file size is the same as the origin file size.".\ - format(device.name)) + "Local file size is the same as the origin file size.".format( + device.name + ) + ) else: substep.skipped( "File has been copied to device {}.Cannot verify integrity as " - "the original file size is unknown.".format(device.name)) + "the original file size is unknown.".format( + device.name + ) + ) + class ConfigureReplace(BaseStage): """This stage does a configure replace on the device.""" @@ -2131,21 +3084,30 @@ class ConfigureReplace(BaseStage): # Stage Schema # ============ schema = { - 'path': str, - 'file': str, - Optional('config_replace_options'): str, - Optional('known_warnings'): list, - Optional('timeout'): int, + "path": str, + "file": str, + Optional("config_replace_options"): str, + Optional("known_warnings"): list, + Optional("timeout"): int, } # ============================== # Execution order of Stage steps # ============================== exec_order = [ - 'configure_replace', + "configure_replace", ] - def configure_replace(self, steps, device, path, file, config_replace_options=CONFIG_REPLACE_OPTIONS, known_warnings=KNOWN_WARNINGS, timeout=TIMEOUT): + def configure_replace( + self, + steps, + device, + path, + file, + config_replace_options=CONFIG_REPLACE_OPTIONS, + known_warnings=KNOWN_WARNINGS, + timeout=TIMEOUT, + ): """This step does a configure replace on the device.""" if known_warnings is None: @@ -2153,10 +3115,22 @@ def configure_replace(self, steps, device, path, file, config_replace_options=CO with steps.start(f"Configure replace on '{device.name}'") as step: try: - output = device.api.configure_replace(path=path, file=file, config_replace_options=config_replace_options, timeout=timeout) - pattern = r'\*+\n*!List of Rollback Commands:(?P.*?)end\n\*+' + output = device.api.configure_replace( + path=path, + file=file, + config_replace_options=config_replace_options, + timeout=timeout, + ) + pattern = ( + r"\*+\n*!List of Rollback Commands:(?P.*?)end\n\*+" + ) if re.search(pattern, output, re.DOTALL): - rejected_cmds = re.search(pattern, output, re.DOTALL).group('rejected_cmds').strip().split('\n') + rejected_cmds = ( + re.search(pattern, output, re.DOTALL) + .group("rejected_cmds") + .strip() + .split("\n") + ) else: rejected_cmds = [] if rejected_cmds: @@ -2164,7 +3138,9 @@ def configure_replace(self, steps, device, path, file, config_replace_options=CO step.passx("Configure replace warnings are expected") else: log.warning(f"Rejected commands: {rejected_cmds}") - log.warning(f"Unexpected warnings: {set(rejected_cmds) - set(known_warnings)}") + log.warning( + f"Unexpected warnings: {set(rejected_cmds) - set(known_warnings)}" + ) step.failed("Configure replace warnings are not expected") else: step.passed("Configure replace passed without rejection") @@ -2175,23 +3151,23 @@ def configure_replace(self, steps, device, path, file, config_replace_options=CO class Connect(BaseStage): """This stage connects to the device that is being cleaned. -Stage Schema ------------- -connect: - via (str, optional): Which connection to use from the testbed file. Uses the - default connection if not specified. - alias (str, optional): Which connection alias to use from the testbed file. - timeout (int, optional): The timeout for the connection to complete in seconds. - Defaults to 200. - retry_timeout (int, optional): Overall timeout for retry mechanism in seconds. - Defaults to 0 which means no retry. - retry_interval (int, optional): Interval for retry mechanism in seconds. Defaults - to 0 which means no retry. -Example -------- -connect: - timeout: 60 -""" + Stage Schema + ------------ + connect: + via (str, optional): Which connection to use from the testbed file. Uses the + default connection if not specified. + alias (str, optional): Which connection alias to use from the testbed file. + timeout (int, optional): The timeout for the connection to complete in seconds. + Defaults to 200. + retry_timeout (int, optional): Overall timeout for retry mechanism in seconds. + Defaults to 0 which means no retry. + retry_interval (int, optional): Interval for retry mechanism in seconds. Defaults + to 0 which means no retry. + Example + ------- + connect: + timeout: 60 + """ # ================= # Argument Defaults @@ -2206,26 +3182,47 @@ class Connect(BaseStage): # Stage Schema # ============ schema = { - Optional('via', description="Which connection to use from the testbed file. Uses the default connection if not specified."): str, - Optional('alias', description="Which connection alias to use."): str, - Optional('timeout', description=f"The timeout for the connection to complete in seconds. Defaults to {TIMEOUT}.", default=TIMEOUT): Or(str, int), - Optional('retry_timeout', description=f"Overall timeout for retry mechanism in seconds. Defaults to {RETRY_TIMEOUT} which means no retry.", default=RETRY_TIMEOUT): Or(str, int, float), - Optional('retry_interval', description=f"Interval for retry mechanism in seconds. Defaults to {RETRY_INTERVAL} which means no retry.", default=RETRY_INTERVAL): Or(str, int, float), + Optional( + "via", + description="Which connection to use from the testbed file. Uses the default connection if not specified.", + ): str, + Optional("alias", description="Which connection alias to use."): str, + Optional( + "timeout", + description=f"The timeout for the connection to complete in seconds. Defaults to {TIMEOUT}.", + default=TIMEOUT, + ): Or(str, int), + Optional( + "retry_timeout", + description=f"Overall timeout for retry mechanism in seconds. Defaults to {RETRY_TIMEOUT} which means no retry.", + default=RETRY_TIMEOUT, + ): Or(str, int, float), + Optional( + "retry_interval", + description=f"Interval for retry mechanism in seconds. Defaults to {RETRY_INTERVAL} which means no retry.", + default=RETRY_INTERVAL, + ): Or(str, int, float), } # ============================== # Execution order of Stage steps # ============================== - exec_order = [ - 'connect' - ] + exec_order = ["connect"] - def connect(self, steps, device, via=VIA, alias=ALIAS, timeout=TIMEOUT, - retry_timeout=RETRY_TIMEOUT, retry_interval=RETRY_INTERVAL): + def connect( + self, + steps, + device, + via=VIA, + alias=ALIAS, + timeout=TIMEOUT, + retry_timeout=RETRY_TIMEOUT, + retry_interval=RETRY_INTERVAL, + ): with steps.start("Connecting to the device") as step: - log.info('Checking connection to device: %s' % device.name) + log.info("Checking connection to device: %s" % device.name) # Create a timeout that will loop retry_timeout = Timeout(float(retry_timeout), float(retry_interval)) retry_timeout.one_more_time = True @@ -2238,12 +3235,14 @@ def connect(self, steps, device, via=VIA, alias=ALIAS, timeout=TIMEOUT, # mit=True is used to make sure we do not initialize the connection # and we can check if the device is in rommon. - device.instantiate(connection_timeout=timeout, - learn_hostname=True, - prompt_recovery=True, - via=via, - alias=alias, - mit=True) + device.instantiate( + connection_timeout=timeout, + learn_hostname=True, + prompt_recovery=True, + via=via, + alias=alias, + mit=True, + ) try: if alias: @@ -2256,8 +3255,8 @@ def connect(self, steps, device, via=VIA, alias=ALIAS, timeout=TIMEOUT, device.api.configure_management_console() step.passed("Successfully connected".format(device.name)) except UniconAuthenticationError as e: - log.info(f'Could not connect to device because of {e}') - log.info('Starting device password recovery.') + log.info(f"Could not connect to device because of {e}") + log.info("Starting device password recovery.") try: device.api.password_recovery(timeout=timeout) except Exception as e: @@ -2277,123 +3276,139 @@ def connect(self, steps, device, via=VIA, alias=ALIAS, timeout=TIMEOUT, step.failed("Could not connect. Scroll up for tracebacks.") - with steps.start(f'Checking the current state of the device: {device.name}') as step: + with steps.start( + f"Checking the current state of the device: {device.name}" + ) as step: - log.info(f'Checking the current state of the device: {device.name}') + log.info(f"Checking the current state of the device: {device.name}") state = "" try: # To check the state for HA devices - if device.is_ha and hasattr(device, 'subconnections'): + if device.is_ha and hasattr(device, "subconnections"): # To allocate handles for HA devices if isinstance(device.subconnections, list): - states = list(set([con.state_machine.current_state for con in device.subconnections])) - if 'rommon' in states: + states = list( + set( + [ + con.state_machine.current_state + for con in device.subconnections + ] + ) + ) + if "rommon" in states: # To get the subconnections and designate handles - state = 'rommon' + state = "rommon" subcons = list(device._subconnections.items()) - if len(subcons)>1: + if len(subcons) > 1: subcon1_alias, subcon1 = subcons[0] subcon2_alias, subcon2 = subcons[1] device._set_active_alias(subcon1_alias) device._set_standby_alias(subcon2_alias) device.default._handles_designated = True else: - log.warning(f'There is only one subconnection in the HA device') + log.warning( + f"There is only one subconnection in the HA device" + ) else: # To check the state for single rp device state = device.state_machine.current_state except Exception as e: - log.warning(f'There is no connection in device.subconnections: {e}') + log.warning(f"There is no connection in device.subconnections: {e}") if state == "rommon": with steps.start("Setting the rommon variables") as step: - log.info('Setting the rommon variables for TFTP boot') + log.info("Setting the rommon variables for TFTP boot") try: - if device.is_ha and hasattr(device, 'subconnections'): + if device.is_ha and hasattr(device, "subconnections"): device.api.configure_rommon_tftp_ha() else: device.api.configure_rommon_tftp() except Exception as e: - step.passx(f'Failed to set rommon variables. {e}') + step.passx(f"Failed to set rommon variables. {e}") else: log.info("Successfully set the rommon variables") with steps.start("Configuring the manual boot") as step: - log.info('Configuring the manual boot') + log.info("Configuring the manual boot") try: - if device.is_ha and hasattr(device, 'subconnections'): + if device.is_ha and hasattr(device, "subconnections"): states_list = [] # Switch to enable mode if one of the rps are disable mode. for con in device.subconnections: - if con.state_machine.current_state=='disable': - con.state_machine.go_to('enable', con.spawn) + if con.state_machine.current_state == "disable": + con.state_machine.go_to("enable", con.spawn) states_list.append(con.state_machine.current_state) - # if one rp in enable mode and another rp in rommon set boot manual on enable rp. - if 'enable' in states_list and 'rommon' in states_list: - device.subconnections[states_list.index('enable')].configure('boot manual') + # if one rp in enable mode and another rp in rommon set boot manual on enable rp. + if "enable" in states_list and "rommon" in states_list: + device.subconnections[ + states_list.index("enable") + ].configure("boot manual") else: - log.info("Both rps are in rommon mode. Skipping the manual boot configuration") + log.info( + "Both rps are in rommon mode. Skipping the manual boot configuration" + ) except Exception as e: - step.passx(f'Failed to configure manual boot. {e}') + step.passx(f"Failed to configure manual boot. {e}") else: log.info("Successfully configured manual boot") with steps.start("Booting the device from rommon") as step: - log.info('Booting the device from rommon') + log.info("Booting the device from rommon") try: # Gets the recovery details from clean yaml device.api.device_rommon_boot() except Exception as e: - step.passx(f'Failed to boot device from rommon. {e}') + step.passx(f"Failed to boot device from rommon. {e}") else: log.info("Successfully booted the device from rommon.") # set mit to False to initialize the connection - device.default.mit=False + device.default.mit = False device.default.learn_hostname = False with steps.start("Initialize the device connection") as step: try: device.connection_provider.init_connection() except Exception as e: - step.failed(f'Failed to initialize the connection. {e}') + step.failed(f"Failed to initialize the connection. {e}") else: step.passed("Successfully connected to the device") class ResetConfiguration(BaseStage): - """ Reset device configuration by using config replace operation with a minimal configuration. + """Reset device configuration by using config replace operation with a minimal configuration. - This clean stage generates a minimal configuration from the running config and stores - it in the base_config.txt file on bootflash. Then uses configure replace command to - override the running configuration. + This clean stage generates a minimal configuration from the running config and stores + it in the base_config.txt file on bootflash. Then uses configure replace command to + override the running configuration. - If the file `base_config.txt` exists on flash, the contents will be overwritten. + If the file `base_config.txt` exists on flash, the contents will be overwritten. -Stage Schema ------------- -reset_configuration: - timeout (int, optional): The timeout for device configuration to complete in seconds. - Defaults to 120. + Stage Schema + ------------ + reset_configuration: + timeout (int, optional): The timeout for device configuration to complete in seconds. + Defaults to 120. -Example: + Example: - reset_configuration: + reset_configuration: - order: - - connect - - reset_configuration + order: + - connect + - reset_configuration """ + # ================= # Argument Defaults # ================= @@ -2403,27 +3418,30 @@ class ResetConfiguration(BaseStage): # Stage Schema # ============ schema = { - Optional('timeout', description="Timeout for device configuration. Default: 120 seconds."): int, + Optional( + "timeout", + description="Timeout for device configuration. Default: 120 seconds.", + ): int, } - exec_order = [ - 'create_config_file', - 'reset_configuration', - 'show_running_config' - ] + exec_order = ["create_config_file", "reset_configuration", "show_running_config"] def _recurse_config_dict_to_text(self, config_dict, level=0, indent=1): - output = '' + output = "" for key, value in config_dict.items(): if not value: # special handling for 'quit' statements in crypto config - if key == 'quit': - output = '\n \tquit' + if key == "quit": + output = "\n \tquit" else: - output += '\n' + ' ' * level * indent + key + output += "\n" + " " * level * indent + key else: - output += '\n' + ' ' * level * indent + key + \ - self._recurse_config_dict_to_text(value, level + 1) + output += ( + "\n" + + " " * level * indent + + key + + self._recurse_config_dict_to_text(value, level + 1) + ) return output def _generate_config_text(self, config_dict): @@ -2437,14 +3455,17 @@ def _filter_config_dict(self, config_dict, new_config_dict, KEEP): break elif re.search(key, k) and KEEP[key]: # filter in section - self._filter_config_dict(config_dict[k], new_config_dict[k], KEEP[key]) + self._filter_config_dict( + config_dict[k], new_config_dict[k], KEEP[key] + ) break else: new_config_dict.pop(k, None) def _generate_default_config(self, device, config_dict): - DEFAULTS = dedent("""\ + DEFAULTS = dedent( + """\ ! ! Last configuration change ! @@ -2454,53 +3475,47 @@ def _generate_default_config(self, device, config_dict): service timestamps log datetime msec """.format( device=device - )) + ) + ) KEEP = { - '^interface GigabitEthernet0(/0)?$': { - '^vrf forwarding': {}, - '^negotiation auto': {} - }, - '^vrf definition Mgmt-(intf|vrf)': {}, - '^switch 1 provision': {}, - '^stackwise-virtual': {}, - '^platform hardware throughput level': {}, - '^ignition': {}, - '^canbus baudrate': {}, - '^crypto pki trustpoint': {}, - '^crypto pki certificate chain': {}, - '^license udi': {}, - '^license boot level': {}, - '^class-map match-any system': {}, - '^policy-map system': {}, - '^interface Vlan1$': { - '^no ip address': {}, - '^shutdown': {} + "^interface GigabitEthernet0(/0)?$": { + "^vrf forwarding": {}, + "^negotiation auto": {}, }, - '^transceiver type all': {}, - '^redundancy': {}, - '^control-plane': {}, - '^spanning-tree extend system-id': {}, - '^spanning-tree mode rapid-pvst': {}, - '^diagnostic bootup level minimal': {}, - '^memory free low-watermark processor': {}, - '^boot system': {}, - '^aaa new-model': {}, - '^class-map match-any non-client-nrt-class': {}, - '^aaa session-id common': {}, - '^username': {}, - '^login on-success log': {}, - '^interface Async': {}, - '^ip forward-protocol nd': {}, - '^ip ssh bulk-mode': {}, - '^line con': { - '^speed': {} - }, - '^line vty': { - '^transport input': {} - }, - '^ip http server': {}, - '^ip http secure-server': {} + "^vrf definition Mgmt-(intf|vrf)": {}, + "^switch 1 provision": {}, + "^stackwise-virtual": {}, + "^platform hardware throughput level": {}, + "^ignition": {}, + "^canbus baudrate": {}, + "^crypto pki trustpoint": {}, + "^crypto pki certificate chain": {}, + "^license udi": {}, + "^license boot level": {}, + "^class-map match-any system": {}, + "^policy-map system": {}, + "^interface Vlan1$": {"^no ip address": {}, "^shutdown": {}}, + "^transceiver type all": {}, + "^redundancy": {}, + "^control-plane": {}, + "^spanning-tree extend system-id": {}, + "^spanning-tree mode rapid-pvst": {}, + "^diagnostic bootup level minimal": {}, + "^memory free low-watermark processor": {}, + "^boot system": {}, + "^aaa new-model": {}, + "^class-map match-any non-client-nrt-class": {}, + "^aaa session-id common": {}, + "^username": {}, + "^login on-success log": {}, + "^interface Async": {}, + "^ip forward-protocol nd": {}, + "^ip ssh bulk-mode": {}, + "^line con": {"^speed": {}}, + "^line vty": {"^transport input": {}}, + "^ip http server": {}, + "^ip http secure-server": {}, } new_config_dict = copy.deepcopy(config_dict) @@ -2509,24 +3524,30 @@ def _generate_default_config(self, device, config_dict): config_text = self._generate_config_text(new_config_dict) - config_text = DEFAULTS + config_text + '\nend' + config_text = DEFAULTS + config_text + "\nend" return config_text def create_config_file(self, steps, device, timeout=TIMEOUT): - with steps.start('Getting current config') as step: + with steps.start("Getting current config") as step: # Use lstrip to avoid stripping trailing whitespace from config lines, # this is required for config replace to work with pki certs. config_dict = device.api.get_running_config_dict(lstrip=True) log.debug(json.dumps(config_dict, indent=4)) - with steps.start('Creating minimal configuration file') as step: + with steps.start("Creating minimal configuration file") as step: config_text = self._generate_default_config(device, config_dict) config_lines = config_text.splitlines() # Write the configuration into a file on the device using TCL shell. device.tclsh() - lines = ['puts [open "base_config.txt" w+] {',] + config_lines + ['}'] + lines = ( + [ + 'puts [open "base_config.txt" w+] {', + ] + + config_lines + + ["}"] + ) for line in lines: device.sendline(line) # Instead of waiting for each line to be processed, just keep @@ -2535,97 +3556,118 @@ def create_config_file(self, steps, device, timeout=TIMEOUT): # like unicon configure() service if needed. device.spawn.read_update_buffer() # Wait until all config data has been processed by the device - device.expect(device.state_machine.get_state( - device.state_machine.current_state).pattern, timeout) + device.expect( + device.state_machine.get_state( + device.state_machine.current_state + ).pattern, + timeout, + ) device.enable() def reset_configuration(self, steps, device, timeout=TIMEOUT): - dialog = Dialog([ - [r'.*?Enter Y if you are sure you want to proceed. \? \[no]:\s*$', 'sendline(y)', None, True, False], - [r'.*?Overwriting with a file sized 50% or less than running config\'s. Proceed\? \[no]:\s*$', 'sendline(yes)', None, True, False], - ]) + dialog = Dialog( + [ + [ + r".*?Enter Y if you are sure you want to proceed. \? \[no]:\s*$", + "sendline(y)", + None, + True, + False, + ], + [ + r".*?Overwriting with a file sized 50% or less than running config\'s. Proceed\? \[no]:\s*$", + "sendline(yes)", + None, + True, + False, + ], + ] + ) # Configure the hostname explicitly - device.configure(f'hostname {device.name}') + device.configure(f"hostname {device.name}") - with steps.start('Resetting configuration using config replace') as step: - output = device.execute('config replace bootflash:base_config.txt', reply=dialog, timeout=timeout) - if 'Rollback aborted' in output: - step.passx('Rollback aborted') + with steps.start("Resetting configuration using config replace") as step: + output = device.execute( + "config replace bootflash:base_config.txt", + reply=dialog, + timeout=timeout, + ) + if "Rollback aborted" in output: + step.passx("Rollback aborted") def show_running_config(self, steps, device): - with steps.start('Capturing running config') as step: - device.execute('show running-config') + with steps.start("Capturing running config") as step: + device.execute("show running-config") class SetControllerMode(BaseStage): """Set controller mode -Stage Schema ------------- -set_controller_mode: + Stage Schema + ------------ + set_controller_mode: - mode (str, optional): `enable` or `disable`. Defaults to `enable` + mode (str, optional): `enable` or `disable`. Defaults to `enable` - reload_timeout (int, optional): maximum time to wait for reload. - Defaults to 600 secs + reload_timeout (int, optional): maximum time to wait for reload. + Defaults to 600 secs - delete_inactive_versions (bool, optional): delete non active version after - changing image. Defaults to True + delete_inactive_versions (bool, optional): delete non active version after + changing image. Defaults to True -Example -------- -set_controller_mode: - mode: enable - reload_timeout: 600 - delete_inactive_versions: True -""" + Example + ------- + set_controller_mode: + mode: enable + reload_timeout: 600 + delete_inactive_versions: True + """ # ================= # Argument Defaults # ================= - MODE = 'enable' + MODE = "enable" RELOAD_TIMEOUT = 600 DELETE_INACTIVE_VERSIONS = True - # ============ # Stage Schema # ============ schema = { - Optional('mode'): str, - Optional('reload_timeout'): int, - Optional('delete_inactive_versions'): bool, + Optional("mode"): str, + Optional("reload_timeout"): int, + Optional("delete_inactive_versions"): bool, } # ============================== # Execution order of Stage steps # ============================== exec_order = [ - 'set_controller_mode', 'confirm_and_set_default', - 'delete_inactive_versions' + "set_controller_mode", + "confirm_and_set_default", + "delete_inactive_versions", ] def set_controller_mode( - self, - steps, - device, - mode=MODE, - reload_timeout=RELOAD_TIMEOUT): + self, steps, device, mode=MODE, reload_timeout=RELOAD_TIMEOUT + ): # Check if we're already in the desired mode version_data = device.parse("show version") # For those versions of IOSXE where version is a str try: - router_operating_mode = version_data.get('version', {}).get('router_operating_mode') + router_operating_mode = version_data.get("version", {}).get( + "router_operating_mode" + ) except AttributeError: router_operating_mode = None - if router_operating_mode == 'Autonomous' and mode == 'disable': + if router_operating_mode == "Autonomous" and mode == "disable": self.skipped("Router already in Autonomous mode") - elif router_operating_mode == 'Controller-Managed' and mode == 'enable': + elif router_operating_mode == "Controller-Managed" and mode == "enable": self.skipped("Router already in Controller-Managed mode") with steps.start("setting controller mode") as step: @@ -2648,125 +3690,139 @@ def set_controller_mode( # Router# pnpa service discovery stop generic_statments = GenericStatements() - controller_mode_dialog = Dialog([ - Statement(pattern=r'Continue\? \[confirm\]', - action='sendline()', - loop_continue=True, - continue_timer=False), - Statement(pattern=r'Do you want to abort\? \(yes/\[no\]\):', - action='sendline(no)', - loop_continue=True, - continue_timer=False), - Statement(pattern=r'Username:', - action='sendline(admin)', - loop_continue=True, - continue_timer=False), - Statement(pattern=r'Password:', - action='sendline(admin)', - loop_continue=True, - continue_timer=False), - Statement(pattern=r'Enter new password:', - action=f'sendline({password})', - loop_continue=True, - continue_timer=False), - Statement(pattern=r'Confirm password:', - action=f'sendline({password})', - loop_continue=True, - continue_timer=False), - Statement( - pattern=r'Press RETURN to get started.*', - action=f'sendline()', - loop_continue=True, - continue_timer=False), - Statement( - pattern= - r'(.*?)Would you like to enter the initial configuration dialog\? \[yes/no\]:\s*', - action=f'sendline(no)', - loop_continue=True, - continue_timer=False), - - Statement( - pattern= - r'(.*?)Would you like to enter the initial configuration dialog\? \[yes/no\]:\s*', - action=f'sendline(no)', - loop_continue=True, - continue_timer=False), - - - generic_statments.syslog_msg_stmt, - - generic_statments.enable_secret_stmt, - - generic_statments.enter_your_selection_stmt, - - ]) + controller_mode_dialog = Dialog( + [ + Statement( + pattern=r"Continue\? \[confirm\]", + action="sendline()", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r"Do you want to abort\? \(yes/\[no\]\):", + action="sendline(no)", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r"Username:", + action="sendline(admin)", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r"Password:", + action="sendline(admin)", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r"Enter new password:", + action=f"sendline({password})", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r"Confirm password:", + action=f"sendline({password})", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r"Press RETURN to get started.*", + action=f"sendline()", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r"(.*?)Would you like to enter the initial configuration dialog\? \[yes/no\]:\s*", + action=f"sendline(no)", + loop_continue=True, + continue_timer=False, + ), + Statement( + pattern=r"(.*?)Would you like to enter the initial configuration dialog\? \[yes/no\]:\s*", + action=f"sendline(no)", + loop_continue=True, + continue_timer=False, + ), + generic_statments.syslog_msg_stmt, + generic_statments.enable_secret_stmt, + generic_statments.enter_your_selection_stmt, + ] + ) try: - device.execute(f'controller-mode {mode}', - timeout=reload_timeout, - service_dialog=controller_mode_dialog, - allow_state_change = True) + device.execute( + f"controller-mode {mode}", + timeout=reload_timeout, + service_dialog=controller_mode_dialog, + allow_state_change=True, + ) except SubCommandFailure: - self.skipped("Unable to configure controller-mode. Is it a " - "feature of this device?") + self.skipped( + "Unable to configure controller-mode. Is it a " + "feature of this device?" + ) - def confirm_and_set_default( - self, - steps, - device, - mode=MODE): + def confirm_and_set_default(self, steps, device, mode=MODE): with steps.start("upgrade-confirm and set-default") as step: if device.connected: device.destroy_all() - if mode == 'disable': - self.output = device.connect(learn_tokens=True, overwrite_testbed_tokens=True) + if mode == "disable": + self.output = device.connect( + learn_tokens=True, overwrite_testbed_tokens=True + ) else: self.output = device.connect() - parsed_output = device.parse('show sdwan software') + parsed_output = device.parse("show sdwan software") active_version = parsed_output.q.contains_key_value( - 'active', 'true').get_values('version', 0) + "active", "true" + ).get_values("version", 0) self.non_active_version = parsed_output.q.contains_key_value( - 'active', 'false').get_values('version') + "active", "false" + ).get_values("version") if active_version: commands = [ - 'request platform software sdwan software upgrade-confirm', - f'request platform software sdwan software set-default {active_version}', - 'show sdwan software' + "request platform software sdwan software upgrade-confirm", + f"request platform software sdwan software set-default {active_version}", + "show sdwan software", ] device.execute(commands) else: - step.failed('Active version was not confirmed.') + step.failed("Active version was not confirmed.") with steps.start("Verify controller mode") as step: - if 'Controller-Managed' in self.output and mode == 'enable': - step.passed( - "Device booted up with controller-mode successfully.") - elif 'Autonomous' in self.output and mode == 'disable': - step.passed( - "Device booted up with autonomous-mode successfully.") - elif 'Controller-Managed' in self.output and mode == 'disable': - step.failed( - "Device couldn't boot up with autonomous-mode") - elif 'Autonomous' in self.output and mode == 'enable': - step.failed( - "Device couldn't boot up with controller-mode") + if "Controller-Managed" in self.output and mode == "enable": + step.passed("Device booted up with controller-mode successfully.") + elif "Autonomous" in self.output and mode == "disable": + step.passed("Device booted up with autonomous-mode successfully.") + elif "Controller-Managed" in self.output and mode == "disable": + step.failed("Device couldn't boot up with autonomous-mode") + elif "Autonomous" in self.output and mode == "enable": + step.failed("Device couldn't boot up with controller-mode") else: - step.failed(f"Something went wrong configuring `controller-mode {mode}`") + step.failed( + f"Something went wrong configuring `controller-mode {mode}`" + ) def delete_inactive_versions( - self, - steps, - device, - delete_inactive_versions=DELETE_INACTIVE_VERSIONS, - mode=MODE): + self, + steps, + device, + delete_inactive_versions=DELETE_INACTIVE_VERSIONS, + mode=MODE, + ): with steps.start("deleting non active version") as step: - if mode == 'disable': - step.skipped("Disabling the controller mode skipping the step as not needed. ") + if mode == "disable": + step.skipped( + "Disabling the controller mode skipping the step as not needed. " + ) else: if delete_inactive_versions and self.non_active_version: diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_image_handler.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_image_handler.py index 20a6cbde4..3f2fcdf52 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_image_handler.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_image_handler.py @@ -8,10 +8,13 @@ class ValidStructures(unittest.TestCase): IMAGE = '/path/to/image.bin' + SMU = '/path/to/smu.bin' PACKAGE_1 = '/path/to/package1.bin' PACKAGE_2 = '/path/to/package2.bin' + EXPECTED_IMAGE = [IMAGE] + EXPECTED_SMU = [SMU] EXPECTED_SINGLE_PKG = [PACKAGE_1] EXPECTED_DOUBLE_PKG = [PACKAGE_1, PACKAGE_2] @@ -21,26 +24,31 @@ def setUp(self): def test_structure_1_without_package(self): images = [ self.IMAGE, + self.SMU ] image_handler = ImageHandler(self.device, images) self.assertEqual(image_handler.image, self.EXPECTED_IMAGE) + self.assertEqual(image_handler.smu, self.EXPECTED_SMU) def test_structure_1_with_package(self): images = [ self.IMAGE, + self.SMU, self.PACKAGE_1 ] image_handler = ImageHandler(self.device, images) self.assertEqual(image_handler.image, self.EXPECTED_IMAGE) + self.assertEqual(image_handler.smu, self.EXPECTED_SMU) self.assertEqual(image_handler.packages, self.EXPECTED_SINGLE_PKG) def test_structure_1_with_packages(self): images = [ self.IMAGE, + self.SMU, self.PACKAGE_1, self.PACKAGE_2 ] @@ -48,6 +56,7 @@ def test_structure_1_with_packages(self): image_handler = ImageHandler(self.device, images) self.assertEqual(image_handler.image, self.EXPECTED_IMAGE) + self.assertEqual(image_handler.smu, self.EXPECTED_SMU) self.assertEqual(image_handler.packages, self.EXPECTED_DOUBLE_PKG) def test_structure_2_without_packages(self): @@ -55,17 +64,24 @@ def test_structure_2_without_packages(self): 'image': [ self.IMAGE ], + 'smu': [ + self.SMU + ] } image_handler = ImageHandler(self.device, images) self.assertEqual(image_handler.image, self.EXPECTED_IMAGE) + self.assertEqual(image_handler.smu, self.EXPECTED_SMU) def test_structure_2_with_package(self): images = { 'image': [ self.IMAGE ], + 'smu': [ + self.SMU + ], 'packages': [ self.PACKAGE_1 ] @@ -74,6 +90,7 @@ def test_structure_2_with_package(self): image_handler = ImageHandler(self.device, images) self.assertEqual(image_handler.image, self.EXPECTED_IMAGE) + self.assertEqual(image_handler.smu, self.EXPECTED_SMU) self.assertEqual(image_handler.packages, self.EXPECTED_SINGLE_PKG) def test_structure_2_with_packages(self): @@ -81,6 +98,9 @@ def test_structure_2_with_packages(self): 'image': [ self.IMAGE ], + 'smu': [ + self.SMU + ], 'packages': [ self.PACKAGE_1, self.PACKAGE_2 @@ -90,6 +110,7 @@ def test_structure_2_with_packages(self): image_handler = ImageHandler(self.device, images) self.assertEqual(image_handler.image, self.EXPECTED_IMAGE) + self.assertEqual(image_handler.smu, self.EXPECTED_SMU) self.assertEqual(image_handler.packages, self.EXPECTED_DOUBLE_PKG) def test_structure_3_without_packages(self): @@ -98,12 +119,18 @@ def test_structure_3_without_packages(self): 'file': [ self.IMAGE ] + }, + 'smu': { + 'file': [ + self.SMU + ] } } image_handler = ImageHandler(self.device, images) self.assertEqual(image_handler.image, self.EXPECTED_IMAGE) + self.assertEqual(image_handler.smu, self.EXPECTED_SMU) def test_structure_3_with_package(self): images = { @@ -112,6 +139,11 @@ def test_structure_3_with_package(self): self.IMAGE ] }, + 'smu': { + 'file': [ + self.SMU + ] + }, 'packages': { 'file': [ self.PACKAGE_1 @@ -122,6 +154,7 @@ def test_structure_3_with_package(self): image_handler = ImageHandler(self.device, images) self.assertEqual(image_handler.image, self.EXPECTED_IMAGE) + self.assertEqual(image_handler.smu, self.EXPECTED_SMU) self.assertEqual(image_handler.packages, self.EXPECTED_SINGLE_PKG) def test_structure_3_with_packages(self): @@ -131,6 +164,11 @@ def test_structure_3_with_packages(self): self.IMAGE ] }, + 'smu': { + 'file': [ + self.SMU + ] + }, 'packages': { 'file': [ self.PACKAGE_1, @@ -142,9 +180,9 @@ def test_structure_3_with_packages(self): image_handler = ImageHandler(self.device, images) self.assertEqual(image_handler.image, self.EXPECTED_IMAGE) + self.assertEqual(image_handler.smu, self.EXPECTED_SMU) self.assertEqual(image_handler.packages, self.EXPECTED_DOUBLE_PKG) - class InvalidStructures(unittest.TestCase): def setUp(self): diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_image.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_image.py index cd3b1b2ae..5241f3b7c 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_image.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_image.py @@ -95,7 +95,7 @@ def mock_execute(*args, **kwargs): # And we want the execute_set_boot_variable api to be mocked. # This simulates the pass case. self.device.api.execute_set_boot_variable = Mock() - + self.device.api.unconfigure_ignore_startup_config = Mock() # Call the method to be tested (clean step inside class) self.cls.set_boot_variable( steps=steps, device=self.device @@ -234,6 +234,7 @@ def test_pass(self): # And we want the verify_boot_variable api to be mocked. # This simulates the pass case. self.device.execute = Mock(return_value=data1['show boot']) + self.device.api.verify_ignore_startup_config = Mock() # Call the method to be tested (clean step inside class) self.cls.verify_boot_variable( @@ -241,7 +242,36 @@ def test_pass(self): ) # Check that the result is expected self.assertEqual(Passed, steps.details[0].result) + + def test_verify_ignore_config_fail(self): + # Make sure we have a unique Steps() object for result verification + steps = Steps() + self.cls.new_boot_var = 'bootflash:cat9k_iosxe.BLD_V173_THROTTLE_LATEST_20200421_032634.SSA.bin' + data1 = {'show boot': ''' + starfleet-1#show boot + BOOT variable = bootflash:cat9k_iosxe.BLD_V173_THROTTLE_LATEST_20200421_032634.SSA.bin; + Configuration Register is 0x102 + MANUAL_BOOT variable = no + BAUD variable = 9600 + ENABLE_BREAK variable does not exist + BOOTMODE variable does not exist + IPXE_TIMEOUT variable does not exist + CONFIG_FILE variable = + ''' + } + + # And we want the verify_boot_variable api to be mocked. + # This simulates the pass case. + self.device.execute = Mock(return_value=data1['show boot']) + self.device.api.verify_ignore_startup_config = Mock(return_value=False) + + # Call the method to be tested (clean step inside class) + with self.assertRaises(TerminateStepSignal): + self.cls.verify_boot_variable( + steps=steps, device=self.device) + # Check the overall result is as expected + self.assertEqual(Failed, steps.details[0].result) def test_fail_to_verify_boot_variables(self): # Make sure we have a unique Steps() object for result verification diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_smu.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_smu.py new file mode 100644 index 000000000..c53749d32 --- /dev/null +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_smu.py @@ -0,0 +1,56 @@ +import logging +import unittest + +from unittest.mock import Mock, MagicMock, call, ANY + +from genie.libs.clean.stages.iosxe.stages import InstallSmu +from genie.libs.clean.stages.tests.utils import create_test_device + + +from pyats.aetest.steps import Steps +from pyats.results import Passed, Skipped + +# Disable logging. It may be useful to comment this out when developing tests. +logging.disable(logging.CRITICAL) + + +class Installimage(unittest.TestCase): + + def setUp(self): + # Instantiate class object + self.cls = InstallSmu() + + # Instantiate device object. This also sets up commonly needed + # attributes and Mock objects associated with the device. + self.device = create_test_device('PE1', os='iosxe') + + def test_iosxe_install_image_pass(self): + steps = Steps() + cls = InstallSmu() + cls.history = MagicMock() + + device = Mock() + device.reload = Mock() + device.parse = Mock(return_value= + {'location': {'Switch 1': {'pkg_state': + {1: {'type': 'IMG', 'state': 'C', 'filename_version': '17.17.01.0.207986'}, + 2: {'type': 'SMU', 'state': 'I', 'filename_version': 'flash:cat9k_iosxe.BLD_POLARIS_DEV_LATEST_20240908_003038.0.NODEFECT.SSA.smu.bin'}}, + 'auto_abort_timer': 'inactive'}}}) + + cls.install_smu(steps=steps, device=device, images=['sftp://server/image.smu.bin']) + + device.reload.assert_has_calls([ + call('install activate file sftp://server/image.smu.bin', reply=ANY, + reload_creds='default', prompt_recovery=True, error_pattern=['FAILED:.*?$'], + timeout=500, device_recovery=False) + ]) + self.assertEqual(Passed, steps.details[0].result) + + def test_iosxe_install_smu_image_skip(self): + steps = Steps() + cls = InstallSmu() + cls.history = MagicMock() + device = Mock() + # skip the stage if the provide image is not a smu image + cls.install_smu(steps=steps, device=device, images=['sftp://server/image.bin']) + self.assertEqual(Skipped, steps.details[0].result) \ No newline at end of file diff --git a/pkgs/conf-pkg/changelog/2024/october.rst b/pkgs/conf-pkg/changelog/2024/october.rst new file mode 100644 index 000000000..b52fb535c --- /dev/null +++ b/pkgs/conf-pkg/changelog/2024/october.rst @@ -0,0 +1,18 @@ +-------------------------------------------------------------------------------- + New +-------------------------------------------------------------------------------- + +* nxos + * Added + * Segment Routing MPLS Support + + +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- + +* iosxe + * Modified ChangeBootVariable + * Modified verify_boot_variable to verify next reload boot variables using running image if current_running_image is True + + diff --git a/pkgs/conf-pkg/src/genie/libs/conf/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/__init__.py index 003535d38..917f591ad 100644 --- a/pkgs/conf-pkg/src/genie/libs/conf/__init__.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/__init__.py @@ -12,7 +12,7 @@ ''' # metadata -__version__ = '24.9' +__version__ = '24.10' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/conf-pkg/src/genie/libs/conf/bgp/bgp.py b/pkgs/conf-pkg/src/genie/libs/conf/bgp/bgp.py index 1e8db4d93..a3228e9cb 100644 --- a/pkgs/conf-pkg/src/genie/libs/conf/bgp/bgp.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/bgp/bgp.py @@ -338,6 +338,16 @@ class PP_AF_NAME(Enum): default=None, type=(None, managedattribute.test_istype(bool))) + bestpath_multipath_relax = managedattribute( + name='bestpath_multipath_relax', + default=None, + type=(None, managedattribute.test_istype(bool))) + + allocate_index = managedattribute( + name='allocate_index', + default=None, + type=(None, managedattribute.test_istype(int))) + cluster_id = managedattribute( name='cluster_id', default=None, @@ -664,6 +674,11 @@ class AF_LABEL_ALLOCATION_MODE(Enum): default=None, type=(None, managedattribute.test_istype(bool))) + af_v4_allocate_label_all = managedattribute( + name='af_v4_allocate_label_all', + default=None, + type=(None, managedattribute.test_istype(bool))) + af_retain_rt_all = managedattribute( name='af_retain_rt_all', default=None, @@ -685,6 +700,24 @@ class AF_LABEL_ALLOCATION_MODE(Enum): default=None, type=(None, managedattribute.test_istype(bool)) ) + + af_additional_paths_install_backup = managedattribute( + name='af_additional_paths_install_backup', + default=None, + type=(None, managedattribute.test_istype(bool)) + ) + + af_additional_paths_install_backup = managedattribute( + name='af_additional_paths_install_backup', + default=None, + type=(None, managedattribute.test_istype(bool)) + ) + af_allocate_label_option_b = managedattribute( + name='af_allocate_label_option_b', + default=None, + type=(None, managedattribute.test_istype(bool)) + ) + # ==== Neighbor section ====================== class NBR_TRANSPORT_CONNECTION_MODE(Enum): active = 'active' @@ -951,6 +984,26 @@ class NBR_AF_SEND_COMMUNITY(Enum): default=None, type=(None, managedattribute.test_istype(str))) + nbr_af_weight = managedattribute( + name='nbr_af_weight', + default=None, + type=(None, managedattribute.test_istype(int))) + + nbr_af_encap_mpls = managedattribute( + name='nbr_af_encap_mpls', + default=None, + type=(None, managedattribute.test_istype(bool))) + + nbr_af_import_l2vpn_evpn_reoriginate = managedattribute( + name='nbr_af_import_l2vpn_evpn_reoriginate', + default=None, + type=(None, managedattribute.test_istype(bool))) + + nbr_af_import_vpn_unicast_reoriginate = managedattribute( + name='nbr_af_import_vpn_unicast_reoriginate', + default=None, + type=(None, managedattribute.test_istype(bool))) + ha_mode = managedattribute( name='ha_mode', default=None, diff --git a/pkgs/conf-pkg/src/genie/libs/conf/bgp/nxos/bgp.py b/pkgs/conf-pkg/src/genie/libs/conf/bgp/nxos/bgp.py index e1e58918b..a6b961ef4 100644 --- a/pkgs/conf-pkg/src/genie/libs/conf/bgp/nxos/bgp.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/bgp/nxos/bgp.py @@ -401,6 +401,17 @@ def build_config(self, apply=True, attributes=None, unconfig=False, if attributes.value('bestpath_med_missing_at_worst'): configurations.append_line(attributes.format( 'bestpath med missing-as-worst')) + # nxos: router bgp 100 / [instance someword] / + # [vrf someword] /bestpath multipath-relax + if attributes.value('bestpath_multipath_relax'): + configurations.append_line(attributes.format( + 'bestpath as-path multipath-relax')) + + # nxos: router bgp 100 / [instance someword] / + # [vrf someword] /allocate-index allocate_index + if attributes.value('allocate_index'): + configurations.append_line(attributes.format( + 'allocate-index {allocate_index}')) # nxos: router bgp 100 / [instance someword] / # [vrf someword] / cluster-id @@ -794,12 +805,18 @@ def build_config(self, apply=True, attributes=None, configurations.append_line(attributes.format( 'network {af_v6_network_number}')) - # nxos: address-family ipv4 unicast/ + # nxos: address-family ipv6 unicast/ # af_v6_allocate_label_all if attributes.value('af_v6_allocate_label_all'): configurations.append_line(attributes.format( 'allocate-label all')) + # nxos: address-family ipv4 unicast/ + # af_v4_allocate_label_all + if attributes.value('af_v4_allocate_label_all'): + configurations.append_line(attributes.format( + 'allocate-label all')) + # nxos: address-family ipv4 unicast/ # retain route-target all if attributes.value('af_retain_rt_all'): @@ -822,6 +839,18 @@ def build_config(self, apply=True, attributes=None, if attributes.value('af_advertise_l2_evpn'): configurations.append_line(attributes.format( 'advertise l2vpn evpn')) + + #additional-paths install backup + if attributes.value('af_additional_paths_install_backup'): + configurations.append_line(attributes.format( + 'additional-paths install backup')) + #allocate-label option-b + if attributes.value('af_allocate_label_option_b') is False: + configurations.append_line(attributes.format( + 'no allocate-label option-b')) + elif attributes.value('af_allocate_label_option_b') is True: + configurations.append_line(attributes.format( + 'allocate-label option-b')) return str(configurations) def build_unconfig(self, apply=True, attributes=None, @@ -1183,6 +1212,25 @@ def build_config(self, apply=True, attributes=None, if attributes.value('nbr_af_rewrite_mvpn_rt_asn'): configurations.append_line( attributes.format('rewrite-rt-asn')) + #encapsulation mpls + if attributes.value('nbr_af_encap_mpls'): + configurations.append_line( + attributes.format('encapsulation mpls')) + + #weight + if attributes.value('nbr_af_weight'): + configurations.append_line( + attributes.format('weight {nbr_af_weight}')) + + #import l2vpn evpn reoriginate + if attributes.value('nbr_af_import_l2vpn_evpn_reoriginate'): + configurations.append_line( + attributes.format('import l2vpn evpn reoriginate')) + + #import vpn unicast reoriginate + if attributes.value('nbr_af_import_vpn_unicast_reoriginate'): + configurations.append_line( + attributes.format('import vpn unicast reoriginate')) return str(configurations) diff --git a/pkgs/conf-pkg/src/genie/libs/conf/bgp/nxos/tests/test_bgp.py b/pkgs/conf-pkg/src/genie/libs/conf/bgp/nxos/tests/test_bgp.py index 3ff56c989..99362ba7e 100755 --- a/pkgs/conf-pkg/src/genie/libs/conf/bgp/nxos/tests/test_bgp.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/bgp/nxos/tests/test_bgp.py @@ -864,7 +864,169 @@ def test_feature_bgp_config(self): self.assertCountEqual(cfgs.keys(), [dev1.name]) self.assertEqual(str(cfgs[dev1.name]), "feature bgp") + def test_cfg_bgp(self): + Genie.testbed = testbed = Testbed() + dev1 = Device(testbed=testbed, name='PE1', os='nxos') + bgp = Bgp(bgp_id=100) + + # Defining attributes + af_name = 'ipv4 unicast' + vrf = Vrf('default') + neighbor_id='150.101.30.30' + bgp.device_attr[dev1].vrf_attr[vrf].bestpath_multipath_relax = True + bgp.device_attr[dev1].vrf_attr[vrf].address_family_attr[af_name].af_additional_paths_install_backup = True + bgp.device_attr[dev1].vrf_attr[vrf].address_family_attr[af_name].af_v4_allocate_label_all = True + bgp.device_attr[dev1].vrf_attr[vrf].address_family_attr['vpnv4 unicast'].af_allocate_label_option_b = True + bgp.device_attr[dev1].vrf_attr[vrf].address_family_attr['vpnv6 unicast'].af_allocate_label_option_b = True + bgp.device_attr[dev1].vrf_attr[vrf].neighbor_attr[neighbor_id] + bgp.device_attr[dev1].vrf_attr[vrf].neighbor_attr[neighbor_id].address_family_attr['l2vpn evpn'].nbr_af_encap_mpls = True + bgp.device_attr[dev1].vrf_attr[vrf].neighbor_attr[neighbor_id].address_family_attr['l2vpn evpn'].nbr_af_import_vpn_unicast_reoriginate = True + bgp.device_attr[dev1].vrf_attr[vrf].neighbor_attr[neighbor_id].address_family_attr['vpnv4 unicast'].nbr_af_import_l2vpn_evpn_reoriginate = True + bgp.device_attr[dev1].vrf_attr[vrf].neighbor_attr[neighbor_id].address_family_attr['vpnv6 unicast'].nbr_af_import_l2vpn_evpn_reoriginate = True + bgp.device_attr[dev1].vrf_attr['vrf8'].bestpath_multipath_relax = True + bgp.device_attr[dev1].vrf_attr['vrf8'].allocate_index = 80 + bgp.device_attr[dev1].vrf_attr['vrf8'].neighbor_attr['101.100.30.30'] + bgp.device_attr[dev1].vrf_attr['vrf8'].neighbor_attr['101.100.30.30'].address_family_attr[af_name].nbr_af_weight = 10 + self.assertIs(bgp.testbed, testbed) + dev1.add_feature(bgp) + + cfgs = bgp.build_config(apply=False) + print(cfgs) + self.assertCountEqual(cfgs.keys(), [dev1.name]) + self.assertMultiLineEqual(str(cfgs[dev1.name]), '\n'.join( + ['router bgp 100', + ' bestpath as-path multipath-relax', + ' neighbor 150.101.30.30', + ' address-family l2vpn evpn', + ' encapsulation mpls', + ' import vpn unicast reoriginate', + ' exit', + ' address-family vpnv4 unicast', + ' import l2vpn evpn reoriginate', + ' exit', + ' address-family vpnv6 unicast', + ' import l2vpn evpn reoriginate', + ' exit', + ' exit', + ' address-family ipv4 unicast', + ' allocate-label all', + ' additional-paths install backup', + ' exit', + ' address-family vpnv4 unicast', + ' allocate-label option-b', + ' exit', + ' address-family vpnv6 unicast', + ' allocate-label option-b', + ' exit', + ' vrf vrf8', + ' bestpath as-path multipath-relax', + ' allocate-index 80', + ' neighbor 101.100.30.30', + ' address-family ipv4 unicast', + ' weight 10', + ' exit', + ' exit', + ' exit', + ' exit', + ])) + print('cfg of bgp new args') + print(cfgs[dev1.name]) + uncfgs = bgp.build_unconfig( + apply=False, + attributes={ + 'device_attr': { + '*': { + 'vrf_attr': { + '*': { + 'bestpath_multipath_relax': None, # Unconfigure multipath relax + 'neighbor_attr': { + '150.101.30.30': { # Neighbor to be unconfigured + 'address_family_attr': { + 'l2vpn evpn': { # Address family for neighbor + 'nbr_af_encap_mpls': None, # Unconfigure MPLS encapsulation + 'nbr_af_import_vpn_unicast_reoriginate': None + }, + 'vpnv4 unicast': { + 'nbr_af_import_l2vpn_evpn_reoriginate': None, + }, + 'vpnv6 unicast': { + 'nbr_af_import_l2vpn_evpn_reoriginate': None, + }, + } + } + }, + 'address_family_attr': { + 'ipv4 unicast': { + 'af_additional_paths_install_backup': None, # Unconfigure additional paths + 'af_v4_allocate_label_all': None # Unconfigure label allocation + }, + 'vpnv4 unicast': { + 'af_allocate_label_option_b': None # Unconfigure label option for vpnv4 + }, + 'vpnv6 unicast': { + 'af_allocate_label_option_b': None # Unconfigure label option for vpnv6 + } + } + }, + 'vrf8': { + 'bestpath_multipath_relax': None, # Unconfigure multipath relax for vrf8 + 'allocate_index': 80, # Unconfigure specific allocate index + 'neighbor_attr': { + '101.100.30.30': { # Neighbor to be unconfigured + 'address_family_attr': { + 'ipv4 unicast': { # Address family for neighbor + 'nbr_af_weight': 10 # Unconfigure MPLS encapsulation + } + } + } + } + } + } + } + } + } + ) + print('ucfg of bgp args') + print(uncfgs[dev1.name]) + self.assertCountEqual(uncfgs.keys(), [dev1.name]) + self.maxDiff = None + self.assertMultiLineEqual(str(uncfgs[dev1.name]), '\n'.join( + ['router bgp 100', + ' no bestpath as-path multipath-relax', + ' neighbor 150.101.30.30', + ' address-family l2vpn evpn', + ' no encapsulation mpls', + ' no import vpn unicast reoriginate', + ' exit', + ' address-family vpnv4 unicast', + ' no import l2vpn evpn reoriginate', + ' exit', + ' address-family vpnv6 unicast', + ' no import l2vpn evpn reoriginate', + ' exit', + ' exit', + ' address-family ipv4 unicast', + ' no allocate-label all', + ' no additional-paths install backup', + ' exit', + ' address-family vpnv4 unicast', + ' no allocate-label option-b', + ' exit', + ' address-family vpnv6 unicast', + ' no allocate-label option-b', + ' exit', + ' vrf vrf8', + ' no bestpath as-path multipath-relax', + ' no allocate-index 80', + ' neighbor 101.100.30.30', + ' address-family ipv4 unicast', + ' no weight 10', + ' exit', + ' exit', + ' exit', + ' exit', + ])) if __name__ == '__main__': unittest.main() diff --git a/pkgs/conf-pkg/src/genie/libs/conf/interface/nxos/interface.py b/pkgs/conf-pkg/src/genie/libs/conf/interface/nxos/interface.py index 6e6a9b83b..7ed75e62d 100644 --- a/pkgs/conf-pkg/src/genie/libs/conf/interface/nxos/interface.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/interface/nxos/interface.py @@ -381,6 +381,13 @@ def _build_config_interface_submode(self, configurations, \ attributes.format('fabric forwarding mode {}'.format(mode)), unconfig_cmd='no fabric forwarding mode {}'.format(mode)) + #mpls ip forwarding + if attributes.value('mpls_ip_forwarding'): + configurations.append_line( + attributes.format('mpls ip forwarding'), + unconfig_cmd='no mpls ip forwarding') + + # ip forward if attributes.value('ip_forward'): configurations.append_line( diff --git a/pkgs/conf-pkg/src/genie/libs/conf/interface/nxos/tests/test_interface.py b/pkgs/conf-pkg/src/genie/libs/conf/interface/nxos/tests/test_interface.py index c3a36b388..902899b8a 100755 --- a/pkgs/conf-pkg/src/genie/libs/conf/interface/nxos/tests/test_interface.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/interface/nxos/tests/test_interface.py @@ -27,6 +27,7 @@ def test_vxlan_interface(self): intf1.evpn_multisite_fabric_tracking = True intf1.evpn_multisite_dci_tracking = True intf1.fabric_forwarding_mode = 'anycast-gateway' + intf1.mpls_ip_forwarding = True intf1.ip_forward = True intf1.ipv6_addr_use_link_local_only = True @@ -38,18 +39,21 @@ def test_vxlan_interface(self): ' evpn multisite dci-tracking', ' evpn multisite fabric-tracking', ' fabric forwarding mode anycast-gateway', + ' mpls ip forwarding', ' ip forward', ' ipv6 address use-link-local-only', ' exit', ])) - + print('cfg: {0}'.format(cfg)) partial_uncfg = intf1.build_unconfig(apply=False,attributes={"evpn_multisite_fabric_tracking":True, "evpn_multisite_dci_tracking": True, - "ip_forward":True}) + "ip_forward":True,"mpls_ip_forwarding":True}) + print('cfg: {0}'.format(partial_uncfg)) self.assertMultiLineEqual(str(partial_uncfg), '\n'.join([ 'interface Ethernet0/0/1', ' no evpn multisite dci-tracking', ' no evpn multisite fabric-tracking', + ' no mpls ip forwarding', ' no ip forward', ' exit', ])) diff --git a/pkgs/conf-pkg/src/genie/libs/conf/ospf/nxos/ospf.py b/pkgs/conf-pkg/src/genie/libs/conf/ospf/nxos/ospf.py index 492089e36..3244d4f4d 100755 --- a/pkgs/conf-pkg/src/genie/libs/conf/ospf/nxos/ospf.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/ospf/nxos/ospf.py @@ -316,6 +316,10 @@ def build_config(self, apply=True, attributes=None, unconfig=False, **kwargs): if attributes.value('router_id'): configurations.append_line(attributes.format('router-id {router_id}')) + #segment-routing mpls + if attributes.value('segment_routing_mpls'): + configurations.append_line(attributes.format('segment-routing mpls')) + # router ospf 1 # distance 110 if attributes.value('pref_all'): diff --git a/pkgs/conf-pkg/src/genie/libs/conf/ospf/nxos/tests/test_ospf.py b/pkgs/conf-pkg/src/genie/libs/conf/ospf/nxos/tests/test_ospf.py index e88094d01..6bb40c831 100755 --- a/pkgs/conf-pkg/src/genie/libs/conf/ospf/nxos/tests/test_ospf.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/ospf/nxos/tests/test_ospf.py @@ -290,16 +290,17 @@ def test_ospf_config2(self): ospf1.device_attr[dev1].enabled = True # Add OSPF configurations to vrf default - ospf1.device_attr[dev1].vrf_attr[vrf0].instance = '1' - ospf1.device_attr[dev1].vrf_attr[vrf0].enable = True - ospf1.device_attr[dev1].vrf_attr[vrf0].router_id = '1.1.1.1' + ospf1.device_attr[dev1].vrf_attr['default'].instance = '1' + ospf1.device_attr[dev1].vrf_attr['default'].enable = True + ospf1.device_attr[dev1].vrf_attr['default'].router_id = '1.1.1.1' + ospf1.device_attr[dev1].vrf_attr['default'].segment_routing_mpls = True # Add OSPF to the device dev1.add_feature(ospf1) # Build config cfgs = ospf1.build_config(apply=False) - + print(cfgs[dev1.name]) # Check config strings built correctly self.assertMultiLineEqual( str(cfgs[dev1.name]), @@ -308,24 +309,37 @@ def test_ospf_config2(self): 'router ospf 1', ' no shutdown', ' router-id 1.1.1.1', + ' segment-routing mpls', ' exit', - ])) - - # Unconfigure router-id - ospf_uncfg = ospf1.build_unconfig(apply=False, attributes={ - 'device_attr': { - dev1.name: 'vrf_attr__default__router_id', - }}) - + ]) + ) + print('cfg new args added') + print(cfgs[dev1.name]) + ospf_uncfg = ospf1.build_unconfig( + apply=False, + attributes={ + 'device_attr': { + dev1.name: { + 'vrf_attr': { + 'default': { + 'router_id': None, # Unconfigure router-id + 'segment_routing_mpls': None # Unconfigure segment-routing mpls + } + } + } + } + } + ) + print(ospf_uncfg[dev1.name]) # Check unconfig strings built correctly self.assertMultiLineEqual( str(ospf_uncfg[dev1.name]), '\n'.join([ 'router ospf 1', ' no router-id 1.1.1.1', + ' no segment-routing mpls', ' exit', ])) - if __name__ == '__main__': unittest.main() diff --git a/pkgs/conf-pkg/src/genie/libs/conf/ospf/ospf.py b/pkgs/conf-pkg/src/genie/libs/conf/ospf/ospf.py index 91d9d269c..cc0a7e3b8 100755 --- a/pkgs/conf-pkg/src/genie/libs/conf/ospf/ospf.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/ospf/ospf.py @@ -294,6 +294,12 @@ class INTF_TYPE(Enum): default=None, type=(None, managedattribute.test_istype(str))) + # segment_routing_mpls + segment_routing_mpls = managedattribute( + name='segment_routing_mpls', + default=None, + type=(None, managedattribute.test_istype(bool))) + # pref_all pref_all = managedattribute( name='pref_all', diff --git a/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/__init__.py new file mode 100644 index 000000000..046fcc782 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/__init__.py @@ -0,0 +1,7 @@ +# Enable abstraction using this directory name as the abstraction token +try: + from genie import abstract + abstract.declare_token(os='nxos') +except Exception as e: + import warnings + warnings.warn('Could not declare abstraction token: ' + str(e)) diff --git a/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/segment_routing.py b/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/segment_routing.py new file mode 100644 index 000000000..7ddffdb68 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/segment_routing.py @@ -0,0 +1,69 @@ + +from abc import ABC +import warnings + +from genie.conf.base.attributes import UnsupportedAttributeWarning,\ + AttributesHelper +from genie.conf.base.cli import CliConfigBuilder +from genie.conf.base.config import CliConfig +from genie.libs.conf.address_family import AddressFamily, AddressFamilySubAttributes + + +class SegmentRouting(ABC): + + class DeviceAttributes(ABC): + + def build_config(self, apply=True, attributes=None, unconfig=False, **kwargs): + assert not kwargs, kwargs + attributes = AttributesHelper(self, attributes) + configurations = CliConfigBuilder(unconfig=unconfig) + # nxos: segment-routing mpls + with configurations.submode_context('segment-routing'): + if unconfig and attributes.iswildcard: + configurations.submode_unconfig() + if attributes.value('mpls') is True: + configurations.append_line('mpls') + if attributes.value('shutdown') is True: + configurations.append_line('shutdown') + + # nxos: segment-routing / mpls / global-block 16000 16001 + v = attributes.value('global_block') + if v is not None: + configurations.append_line('global-block {first} {last}'.format( + first=v.start, + last=v[-1]+1)) + v = attributes.value('timers_srgb_cleanup') + if v is not None: + configurations.append_line('timers srgb cleanup {cleanup_timer}'.format( + cleanup_timer=v)) + v = attributes.value('timers_srgb_retry') + if v is not None: + configurations.append_line('timers srgb retry {retry_timer}'.format( + retry_timer=v)) + + # nxos: segment-routing / mpls / connected-prefix-sid-map + if attributes.value('connected_prefix_sid_map'): + with configurations.submode_context('connected-prefix-sid-map',cancel_empty=True): + + for address_family,address_family_sub,address_family_attributes in \ + attributes.mapping_items('address_family_attr', keys=self.address_families, sort=True): + if address_family == AddressFamily.ipv4_unicast: + context_cli = 'address-family ipv4' + with configurations.submode_context(context_cli, cancel_empty=True): + for entry,attributes2 in address_family_attributes.sequence_values('connected_prefix_sid_map'): + if attributes2.value('index'): + configurations.append_line(attributes2.format('{prefix} index {index}')) + if attributes2.value('absolute'): + configurations.append_line(attributes2.format('{prefix} absolute {absolute}')) + + if apply: + if configurations: + self.device.configure(configurations, fail_invalid=True) + else: + if configurations: + return CliConfig(device=self.device, unconfig=unconfig, + cli_config=configurations, fail_invalid=True) + + def build_unconfig(self, apply=True, attributes=None, **kwargs): + return self.build_config(apply=apply, attributes=attributes, unconfig=True, **kwargs) + diff --git a/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/tests/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/tests/test_segment_routing.py b/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/tests/test_segment_routing.py new file mode 100644 index 000000000..a8eb49148 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/nxos/tests/test_segment_routing.py @@ -0,0 +1,177 @@ +#!/usr/bin/env python + +import unittest +from unittest.mock import Mock + +# Genie Imports +from genie.conf import Genie +from genie.conf.base import Testbed, Device +from genie.conf.base.attributes import UnsupportedAttributeWarning + +# SegmentRouting Imports +from genie.libs.conf.segment_routing import SegmentRouting, PrefixSidMapEntry + +from ipaddress import IPv4Network + +class TestSegmentRouting(unittest.TestCase): + """Unit tests for SegmentRouting configuration.""" + + def setUp(self): + """Set up the test environment before each test.""" + # Initialize the Genie testbed + testbed = Testbed() + Genie.testbed = testbed + + # Create a device with OS 'nxos' + self.dev = Device(name='node01', testbed=testbed, os='nxos') + + # Initialize SegmentRouting and add it to the device + self.sr = SegmentRouting() + self.dev.add_feature(self.sr) + + def test_segment_routing_config(self): + """ + Test SegmentRouting configuration by setting attributes directly. + """ + self.maxDiff = None # Allow full diff output on failure + + # Set SegmentRouting attributes directly + self.sr.device_attr[self.dev].mpls = True + self.sr.device_attr[self.dev].global_block = range(70000, 100000) + self.sr.device_attr[self.dev].timers_srgb_cleanup = 120 + self.sr.device_attr[self.dev].timers_srgb_retry = 240 + + # Access the address_family_attr for 'ipv4' + ipv4_af_attr = self.sr.device_attr[self.dev].address_family_attr['ipv4'] + + # Create PrefixSidMapEntry instances + entry1 = PrefixSidMapEntry(prefix=IPv4Network('99.1.1.4/32'), index=4) + entry2 = PrefixSidMapEntry(prefix=IPv4Network('98.1.1.1/32'), index=3) + entry3 = PrefixSidMapEntry(prefix=IPv4Network('10.1.1.4/32'), absolute=100) + + # Add entries to connected_prefix_sid_map using the provided method + ipv4_af_attr.add_connected_prefix_sid_map_entry(entry1) + ipv4_af_attr.add_connected_prefix_sid_map_entry(entry2) + ipv4_af_attr.add_connected_prefix_sid_map_entry(entry3) + + # **Remove the incorrect assignment** + # self.sr.device_attr[self.dev].connected_prefix_sid_map = ipv4_af_attr + self.sr.device_attr[self.dev].connected_prefix_sid_map = {entry1, entry2, entry3} + + # Build SegmentRouting configuration without applying + cfgs = self.sr.build_config(apply=False) + + # Define the expected configuration + expected_config = '\n'.join([ + 'segment-routing', + ' mpls', + ' global-block 70000 100000', + ' timers srgb cleanup 120', + ' timers srgb retry 240', + ' connected-prefix-sid-map', + ' address-family ipv4', + ' 98.1.1.1/32 index 3', + ' 99.1.1.4/32 index 4', + ' 10.1.1.4/32 absolute 100', + ' exit', + ' exit', + ' exit' + ]) + # Compare the generated configuration with the expected configuration + self.assertMultiLineEqual( + str(cfgs[self.dev.name]), + expected_config + ) + + def test_segment_routing_config_shutdown(self): + """ + Test SegmentRouting configuration by setting attributes directly. + """ + self.maxDiff = None # Allow full diff output on failure + + # Set SegmentRouting attributes directly + self.sr.device_attr[self.dev].mpls = True + self.sr.device_attr[self.dev].shutdown = True + self.sr.device_attr[self.dev].global_block = range(70000, 100000) + self.sr.device_attr[self.dev].timers_srgb_cleanup = 120 + self.sr.device_attr[self.dev].timers_srgb_retry = 240 + + # Create PrefixSidMapEntry instances + entry1 = PrefixSidMapEntry(prefix=IPv4Network('99.1.1.4/32'), index=4) + entry2 = PrefixSidMapEntry(prefix=IPv4Network('98.1.1.1/32'), index=3) + entry3 = PrefixSidMapEntry(prefix=IPv4Network('10.1.1.4/32'), absolute=100) + + self.sr.device_attr[self.dev].connected_prefix_sid_map = {entry1, entry2, entry3} + + # Build SegmentRouting configuration without applying + cfgs = self.sr.build_config(apply=False) + + # Define the expected configuration + expected_config = '\n'.join([ + 'segment-routing', + ' mpls', + ' shutdown', + ' global-block 70000 100000', + ' timers srgb cleanup 120', + ' timers srgb retry 240', + ' connected-prefix-sid-map', + ' address-family ipv4', + ' 98.1.1.1/32 index 3', + ' 99.1.1.4/32 index 4', + ' 10.1.1.4/32 absolute 100', + ' exit', + ' exit', + ' exit' + ]) + # Compare the generated configuration with the expected configuration + self.assertMultiLineEqual( + str(cfgs[self.dev.name]), + expected_config + ) + + def test_segment_routing_unconfig(self): + """ + Test unconfiguring SegmentRouting settings. + """ + self.maxDiff = None # Allow full diff output on failure + + # Define attributes to set first + attributes = { + 'device_attr': { + self.dev.name: { + 'mpls': True, + 'global_block': range(70000, 100000), + 'timers_srgb_cleanup': 120, + 'timers_srgb_retry': 240, + 'address_family_attr': { + 'ipv4': { + 'connected_prefix_sid_map': [ + {'prefix': '99.1.1.4/32', 'index': 4}, + {'prefix': '98.1.1.1/32', 'index': 3}, + {'prefix': '10.1.1.4/32', 'absolute': 100} + ] + } + } + } + } + } + + # Apply the attributes to configure SegmentRouting + self.sr.build_config(apply=False, attributes=attributes) + + # Now, attempt to unconfigure SegmentRouting + cfgs = self.sr.build_unconfig(apply=False) + + # Define the expected unconfiguration + expected_unconfig = '\n'.join([ + 'no segment-routing', + ]) + + # Compare the generated unconfiguration with the expected result + self.assertMultiLineEqual( + str(cfgs[self.dev.name]), + expected_unconfig + ) + +if __name__ == '__main__': + unittest.main() diff --git a/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/segment_routing.py b/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/segment_routing.py index a50289da2..c109e7236 100644 --- a/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/segment_routing.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/segment_routing/segment_routing.py @@ -39,9 +39,14 @@ class PrefixSidMapEntry(Base): name='attach', default=None, type=(None, managedattribute.test_istype(bool))) + + absolute = managedattribute( + name='absolute', + default=None, + type=(None, managedattribute.test_istype(int))) def __hash__(self): - return hash((self.prefix,self.index,self.range,self.attach)) + return hash((self.prefix,self.index,self.range,self.attach,self.absolute)) class SegmentRouting(Routing, DeviceFeature): diff --git a/pkgs/filetransferutils-pkg/changelog/2024/october.rst b/pkgs/filetransferutils-pkg/changelog/2024/october.rst new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py index 38bfc4729..3842fb6fd 100644 --- a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py +++ b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py @@ -9,7 +9,7 @@ ''' -__version__ = '24.9' +__version__ = '24.10' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/health-pkg/changelog/2024/october.rst b/pkgs/health-pkg/changelog/2024/october.rst new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/health-pkg/src/genie/libs/health/__init__.py b/pkgs/health-pkg/src/genie/libs/health/__init__.py index 80c8edd7e..96650ac18 100644 --- a/pkgs/health-pkg/src/genie/libs/health/__init__.py +++ b/pkgs/health-pkg/src/genie/libs/health/__init__.py @@ -8,7 +8,7 @@ ''' # metadata -__version__ = '24.9' +__version__ = '24.10' __author__ = 'Cisco Systems Inc.' __contact__ = ['asg-genie-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2020, Cisco Systems Inc.' diff --git a/pkgs/ops-pkg/changelog/2024/october.rst b/pkgs/ops-pkg/changelog/2024/october.rst new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/ops-pkg/src/genie/libs/ops/__init__.py b/pkgs/ops-pkg/src/genie/libs/ops/__init__.py index d25c59f7e..a208f77f6 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/__init__.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/__init__.py @@ -7,7 +7,7 @@ ''' # metadata -__version__ = '24.9' +__version__ = '24.10' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/robot-pkg/changelog/2024/october.rst b/pkgs/robot-pkg/changelog/2024/october.rst new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/robot-pkg/src/genie/libs/robot/__init__.py b/pkgs/robot-pkg/src/genie/libs/robot/__init__.py index 11840c113..84dfacf4e 100644 --- a/pkgs/robot-pkg/src/genie/libs/robot/__init__.py +++ b/pkgs/robot-pkg/src/genie/libs/robot/__init__.py @@ -8,7 +8,7 @@ ''' # metadata -__version__ = '24.9' +__version__ = '24.10' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/sdk-pkg/changelog/2024/october.rst b/pkgs/sdk-pkg/changelog/2024/october.rst new file mode 100644 index 000000000..5237a1b02 --- /dev/null +++ b/pkgs/sdk-pkg/changelog/2024/october.rst @@ -0,0 +1,110 @@ +-------------------------------------------------------------------------------- + New +-------------------------------------------------------------------------------- + +* iosxe + * Added configure_ppp_multilink + * added api to configure ppp multilink + * Added unconfigure_ppp_multilink + * added api to unconfigure ppp multilink + * Added configure_spanning_tree_portfast under c9500 + * New API to configures spanning-tree portfast under c9500 + * Added unconfigure_spanning_tree_portfast under c9500 + * New API to unconfigures spanning-tree portfast under c9500 + * Added unconfigure_spanning_tree_portfast under c9610 + * New API to unconfigures spanning-tree portfast under c9610 + * Added configure_key_config_key_newpass_oldpass + * API to change the master key password + * Added unconfigure_port_channel + * API to clear port-channel configuration + * Added new API to get interface traffic counters + * get_interface_traffic_counters + * Added API's to configure cli commands for QoS feature. + * API to configure_ip_access_list_with_dscp_on_device + * API to configure_class_map_access_group_on_device + * API to configure_service_policy_type_queueing_on_interface + * API to configure_traffic_class_for_class_map + * Added configure_aaa_authorization_config_commands + * API for configure aaa authorization config-commands + * Added configure_aaa_accounting_connection_default_start_stop_group_tacacs_group + * API for configure aaa accounting connection default start-stop group tacacs+ group {server_group_name} + * Added configure_aaa_accounting_system_default_start_stop_group_tacacs_group + * API for configure aaa accounting system default start-stop group tacacs+ group {server_group_name} + * Added clear_ip_dhcp_snooping_track_server + * API for clear ip dhcp snooping track server + * Added execute_monitor_capture_limit_duration + * Execute monitor_capture_limit_duration + * Added execute_monitor_capture_access_list + * Execute monitor_capture_access_list + * Added execute_monitor_capture_vlan_in_match_any + * Execute monitor_capture_vlan_in_match_any + * Added configure_bgp_l2vpn_route_reflector_client + * Added configure_bgp_l2vpn_route_map + * Added configure_vlan_service_instance_bd_association + * Added unconfigure_vlan_service_instance_bd_association + * Added configure_evpn_profile,unconfigure_evpn_profile + * Added configure_evpn_l2_profile_bd_association + * Added unconfigure_evpn_l2_profile_bd_association + * Added configure_evpn_l3_instance_bd_association + * Added configure_ospf_network_broadcast + * Added configure_ospf_priority + * Added clear_monitor_capture + * API for "monitor capture {capture_name} clear" command + * Added configure_interface_rep_stcn_segment + * rep stcn segment 1 + * Added unconfigure_interface_rep_stcn_segment + * no rep stcn segment 1 + * Added configure_interface_rep_stcn_stp + * rep stcn stp + * Added unconfigure_interface_rep_stcn_stp + * no rep stcn stp + * Added configure_rep_segment_edge_preferred + * rep segment 1 edge preferred + * Added unconfigure_rep_segment_edge_preferred + * no rep segment 1 edge preferred + * Added configure_rep_segment_edge_primary + * rep segment 1 edge primary + * Added unconfigure_interface_rep_segment_edge_primary + * no rep segment 1 edge primary + * Added configure_rep_ztp + * rep ztp + * Added unconfigure_rep_ztp + * no rep ztp + * Added API test_platform_software_fed_switch_phy_options + * Added API to test platform software fed switch active phy options + * Added configure_parser_view under c8000v + * New API to configure a parser view under c8000v + * Added unconfigure_parser_view under c8000v + * New API to unconfigure a parser view under c8000v + * Added API execute_test_fru_fake_insert + * Added execute_test_fru_fake_insert + * Added configure_snmp_server_host under c8000v + * New API to configure snmp-server host under c8000v + * Added unconfigure_snmp_server_host under c8000v + * New API to unconfigures snmp_server host under c8000v + + +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- + +* iosxe + * Modified `check_memory_leaks` processor + * changed to processor.passed/failed + * added `execute_reload` processor + * new processor to reload the device + * _condition_validator in Blitz + * Fixed debug message + * Modified configure_redistribute_connected to add route_map + * Modified configure_bgp_router_id_peergroup_neighbor to add listen_range and peer_group + * Fixed configure_evpn_instance_evi , default-gateway has to be appended with enable + * Added eth_tag to configure_evpn_l2_instance_bd_association + * Modified configure_route_map_permit to add match_interface + * Updated default argument trunk as True + * added trunk default argument in configure_rep_segment + +* nxos + * Added MPLS SR Support in conf model of interface,ospf & bgp + * Added BGP PIC Support in conf of BGP + + diff --git a/pkgs/sdk-pkg/changelog/changelog_add_iosxe_configure_rep_fastrep_apis_20240902145357.rst b/pkgs/sdk-pkg/changelog/changelog_add_iosxe_configure_rep_fastrep_apis_20240902145357.rst new file mode 100644 index 000000000..e17a2d423 --- /dev/null +++ b/pkgs/sdk-pkg/changelog/changelog_add_iosxe_configure_rep_fastrep_apis_20240902145357.rst @@ -0,0 +1,12 @@ +-------------------------------------------------------------------------------- + New +-------------------------------------------------------------------------------- +* IOSXE + * Added configure_rep + * New API to configure rep segment + * Added configure_fastrep + * New API to configure fastrep segment + * Added unconfigure_rep + * New API to unconfigure rep segment + * Added unconfigure_fastrep + * New API to unconfigure fastrep segment \ No newline at end of file diff --git a/pkgs/sdk-pkg/sdk_generator/output/github_apis.json b/pkgs/sdk-pkg/sdk_generator/output/github_apis.json index eb0a64d70..0f1dee8d0 100644 --- a/pkgs/sdk-pkg/sdk_generator/output/github_apis.json +++ b/pkgs/sdk-pkg/sdk_generator/output/github_apis.json @@ -317,7 +317,7 @@ "os": "iosxe" }, "uid": "change_nve_source_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L579" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L606" } } }, @@ -543,7 +543,7 @@ "os": "iosxe" }, "uid": "clear_bgp_l2vpn_evpn", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L707" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L734" } } }, @@ -1247,6 +1247,20 @@ } } }, + "clear_ip_dhcp_snooping_track_server": { + "folders": { + "iosxe": { + "doc": "execute 'clear ip dhcp snooping binding *' on device\n Args:\n device('obj'): device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.dhcp.execute", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "clear_ip_dhcp_snooping_track_server", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/execute.py#L80" + } + } + }, "clear_ip_eigrp_neighbor": { "folders": { "iosxe": { @@ -1739,7 +1753,7 @@ "os": "iosxe" }, "uid": "clear_macro_auto_confgis", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1999" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2000" } } }, @@ -1883,6 +1897,20 @@ } } }, + "clear_monitor_capture": { + "folders": { + "iosxe": { + "doc": "\n Execute monitor capture clear\n Example: monitor capture test clear\n Args:\n device ('obj'): Device Object\n capture_name ('str'): Name of Capture\n ", + "module_name": "iosxe.flow.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "clear_monitor_capture", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/configure.py#L1651" + } + } + }, "clear_mpls_counters": { "folders": { "iosxe": { @@ -1963,7 +1991,7 @@ "os": "iosxe" }, "uid": "clear_ospfv3_process_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2513" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2564" } } }, @@ -2241,7 +2269,7 @@ "os": "iosxe" }, "uid": "config_cns_agent_passwd", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3837" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3838" } } }, @@ -3459,6 +3487,20 @@ } } }, + "configure_aaa_accounting_connection_default_start_stop_group_tacacs_group": { + "folders": { + "iosxe": { + "doc": "\n Configure aaa accounting connection default start-stop group tacacs+ group \n Args:\n device ('obj'): Device object\n server_group_name ('str'): Name of server group\n Return:\n None\n Raise:\n SubCommandFailure: Failed to configure aaa accounting connection default start-stop group tacacs+ group \n ", + "module_name": "iosxe.aaa.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_aaa_accounting_connection_default_start_stop_group_tacacs_group", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py#L3107" + } + } + }, "configure_aaa_accounting_exec_default_start_stop_group": { "folders": { "iosxe": { @@ -3515,10 +3557,24 @@ } } }, + "configure_aaa_accounting_system_default_start_stop_group_tacacs_group": { + "folders": { + "iosxe": { + "doc": "\n Configure aaa accounting system default start-stop group tacacs+ group \n Args:\n device ('obj'): Device object\n server_group_name ('str'): Name of server group\n Return:\n None\n Raise:\n SubCommandFailure: Failed to configure aaa accounting system default start-stop group tacacs+ group \n ", + "module_name": "iosxe.aaa.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_aaa_accounting_system_default_start_stop_group_tacacs_group", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py#L3124" + } + } + }, "configure_aaa_accounting_update": { "folders": { "iosxe": { - "doc": "configure aaa accounting update periodic\n Args:\n device (`obj`): Device object\n action_type('str'): newinfo Only send accounting update records when we have new acct info.\n periodic Send accounting update records at regular intervals.\n\t periodic_interval('str'): <1-71582> Periodic intervals to send accounting update records(in minutes)\n Returns: \n None\n Raise:\n SubCommandFailure: Failed configure aaa accounting update periodic\n ", + "doc": "configure aaa accounting update periodic\n Args:\n device (`obj`): Device object\n action_type('str'): newinfo Only send accounting update records when we have new acct info.\n periodic Send accounting update records at regular intervals.\n\t periodic_interval('str'): <1-71582> Periodic intervals to send accounting update records(in minutes)\n Returns:\n None\n Raise:\n SubCommandFailure: Failed configure aaa accounting update periodic\n ", "module_name": "iosxe.aaa.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -3616,7 +3672,7 @@ "configure_aaa_authentication_enable_default_group_enable": { "folders": { "iosxe": { - "doc": "api for configuring aaa authentication enable default group enable\n\n Args:\n device ('obj') : Device object\n group_name ('str') : Group name required to configure \n Return:\n None\n Raise:\n SubCommandFailure: failed to configure aaa authentication enable default group enable\n ", + "doc": "api for configuring aaa authentication enable default group enable\n\n Args:\n device ('obj') : Device object\n group_name ('str') : Group name required to configure\n Return:\n None\n Raise:\n SubCommandFailure: failed to configure aaa authentication enable default group enable\n ", "module_name": "iosxe.aaa.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -3644,7 +3700,7 @@ "configure_aaa_authentication_login_default_group_local": { "folders": { "iosxe": { - "doc": "api for configuring aaa authentication login default group local\n\n Args:\n device ('obj') : Device object\n group_name ('str') : Group name required to configure \n Return:\n None\n Raise:\n SubCommandFailure: failed to configure aaa authentication login default group local\n ", + "doc": "api for configuring aaa authentication login default group local\n\n Args:\n device ('obj') : Device object\n group_name ('str') : Group name required to configure\n Return:\n None\n Raise:\n SubCommandFailure: failed to configure aaa authentication login default group local\n ", "module_name": "iosxe.aaa.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -3669,6 +3725,20 @@ } } }, + "configure_aaa_authorization_config_commands": { + "folders": { + "iosxe": { + "doc": "\n configure aaa authorization config-commands\n Args:\n device ('obj'): Device object\n Return:\n None\n Raise:\n SubCommandFailure: Failed to configure aaa authorization config-commands\n ", + "module_name": "iosxe.aaa.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_aaa_authorization_config_commands", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py#L3091" + } + } + }, "configure_aaa_authorization_exec_default": { "folders": { "iosxe": { @@ -3686,7 +3756,7 @@ "configure_aaa_authorization_exec_default_group_if_authenticated": { "folders": { "iosxe": { - "doc": "api for configuring aaa authorization exec default group if-authenticated\n\n Args:\n device ('obj') : Device object\n group_name ('str') : Group name required to configure \n Return:\n None\n Raise:\n SubCommandFailure: failed to configure aaa authorization exec default group if-authenticated\n ", + "doc": "api for configuring aaa authorization exec default group if-authenticated\n\n Args:\n device ('obj') : Device object\n group_name ('str') : Group name required to configure\n Return:\n None\n Raise:\n SubCommandFailure: failed to configure aaa authorization exec default group if-authenticated\n ", "module_name": "iosxe.aaa.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -3714,7 +3784,7 @@ "configure_aaa_authorization_network_default_group": { "folders": { "iosxe": { - "doc": "api for configuring aaa authorization network default group \n\n Args:\n device ('obj') : Device object\n group_name ('str') : Group name required to configure \n Return:\n None\n Raise:\n SubCommandFailure: failed to configure aaa network default group \n ", + "doc": "api for configuring aaa authorization network default group \n\n Args:\n device ('obj') : Device object\n group_name ('str') : Group name required to configure\n Return:\n None\n Raise:\n SubCommandFailure: failed to configure aaa network default group \n ", "module_name": "iosxe.aaa.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -3819,7 +3889,7 @@ "os": "iosxe" }, "uid": "configure_absolute_time_range", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5090" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5091" } } }, @@ -4141,7 +4211,7 @@ "os": "iosxe" }, "uid": "configure_action_string", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2606" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2607" } } }, @@ -4155,7 +4225,7 @@ "os": "iosxe" }, "uid": "configure_action_syslog_msg", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2580" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2581" } } }, @@ -4309,7 +4379,7 @@ "os": "iosxe" }, "uid": "configure_archive_default", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2116" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2117" } } }, @@ -4323,7 +4393,7 @@ "os": "iosxe" }, "uid": "configure_archive_logging", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L512" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L513" } } }, @@ -4337,7 +4407,7 @@ "os": "iosxe" }, "uid": "configure_archive_maximum", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2206" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2207" } } }, @@ -4351,7 +4421,7 @@ "os": "iosxe" }, "uid": "configure_archive_path", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2156" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2157" } } }, @@ -4365,7 +4435,7 @@ "os": "iosxe" }, "uid": "configure_archive_rollback", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2249" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2250" } } }, @@ -4379,7 +4449,7 @@ "os": "iosxe" }, "uid": "configure_archive_time_period", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2302" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2303" } } }, @@ -4393,7 +4463,7 @@ "os": "iosxe" }, "uid": "configure_archive_write_memory", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2347" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2348" } } }, @@ -4774,7 +4844,7 @@ "os": "iosxe" }, "uid": "configure_banner", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4382" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4383" } } }, @@ -4802,7 +4872,7 @@ "os": "iosxe" }, "uid": "configure_bba_group_session_auto_cleanup", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4585" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4586" } } }, @@ -4844,7 +4914,7 @@ "os": "iosxe" }, "uid": "configure_bgp_additional_paths", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L911" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L980" } } }, @@ -4858,7 +4928,7 @@ "os": "iosxe" }, "uid": "configure_bgp_address_advertisement", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L968" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1037" } } }, @@ -4872,7 +4942,7 @@ "os": "iosxe" }, "uid": "configure_bgp_address_family_attributes", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1048" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1121" } } }, @@ -4886,7 +4956,7 @@ "os": "iosxe" }, "uid": "configure_bgp_advertise_additional_paths", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L939" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1008" } } }, @@ -4900,7 +4970,7 @@ "os": "iosxe" }, "uid": "configure_bgp_advertise_l2vpn_evpn", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1814" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1893" } } }, @@ -4914,7 +4984,7 @@ "os": "iosxe" }, "uid": "configure_bgp_auto_summary", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2051" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2130" } } }, @@ -4928,7 +4998,7 @@ "os": "iosxe" }, "uid": "configure_bgp_best_path_as_path_multipath_relax", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2592" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2671" } } }, @@ -4942,7 +5012,7 @@ "os": "iosxe" }, "uid": "configure_bgp_eigrp_redistribution", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2538" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2617" } } }, @@ -4956,7 +5026,7 @@ "os": "iosxe" }, "uid": "configure_bgp_graceful_restart", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1117" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1190" } } }, @@ -4984,7 +5054,7 @@ "os": "iosxe" }, "uid": "configure_bgp_isis_redistribution", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2426" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2505" } } }, @@ -4998,7 +5068,7 @@ "os": "iosxe" }, "uid": "configure_bgp_l2vpn_evpn_rewrite_evpn_rt_asn", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1897" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1976" } } }, @@ -5016,6 +5086,34 @@ } } }, + "configure_bgp_l2vpn_route_map": { + "folders": { + "iosxe": { + "doc": " Activate bgp neighbor on bgp router\n\n Args:\n device ('obj') : Device to be configured\n address_family ('str') : Address family to be configured\n bgp_as ('str') : Bgp Id to be added to configuration\n neighbor_address ('str') : Address of neighbor to be added to configuration\n route_map ('str') : Name of the route map\n direction ('str') : Direction in which route map has to be applied\n address_family_modifier ('str') : the endpoint provisioning information to be distributed\n to BGP peers.\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing configure commands\n\n ", + "module_name": "iosxe.bgp.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_bgp_l2vpn_route_map", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L633" + } + } + }, + "configure_bgp_l2vpn_route_reflector_client": { + "folders": { + "iosxe": { + "doc": " Activate bgp neighbor on bgp router\n\n Args:\n device ('obj') : Device to be configured\n address_family ('str') : Address family to be configured\n bgp_as ('str') : Bgp Id to be added to configuration\n neighbor_address ('str') : Address of neighbor to be added to configuration\n address_family_modifier ('str') : the endpoint provisioning information to be distributed\n to BGP peers.\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing configure commands\n\n ", + "module_name": "iosxe.bgp.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_bgp_l2vpn_route_reflector_client", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L669" + } + } + }, "configure_bgp_log_neighbor_changes": { "folders": { "iosxe": { @@ -5026,7 +5124,7 @@ "os": "iosxe" }, "uid": "configure_bgp_log_neighbor_changes", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1141" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1214" } } }, @@ -5068,7 +5166,7 @@ "os": "iosxe" }, "uid": "configure_bgp_neighbor_advertisement_interval", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1844" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1923" } } }, @@ -5082,7 +5180,7 @@ "os": "iosxe" }, "uid": "configure_bgp_neighbor_as_override", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L875" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L944" } } }, @@ -5096,7 +5194,7 @@ "os": "iosxe" }, "uid": "configure_bgp_neighbor_filter_description", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2320" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2399" } } }, @@ -5110,7 +5208,7 @@ "os": "iosxe" }, "uid": "configure_bgp_neighbor_remote_as", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L816" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L885" } } }, @@ -5124,7 +5222,7 @@ "os": "iosxe" }, "uid": "configure_bgp_neighbor_remote_as_fall_over_as_with_peergroup", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2290" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2369" } } }, @@ -5138,7 +5236,7 @@ "os": "iosxe" }, "uid": "configure_bgp_neighbor_send_community", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1165" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1238" } } }, @@ -5152,7 +5250,7 @@ "os": "iosxe" }, "uid": "configure_bgp_redistribute_connected", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1402" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1475" } } }, @@ -5166,7 +5264,7 @@ "os": "iosxe" }, "uid": "configure_bgp_redistribute_internal", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2203" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2282" } } }, @@ -5180,7 +5278,7 @@ "os": "iosxe" }, "uid": "configure_bgp_redistribute_ospf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1290" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1363" } } }, @@ -5194,7 +5292,7 @@ "os": "iosxe" }, "uid": "configure_bgp_redistribute_static", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1780" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1859" } } }, @@ -5208,7 +5306,7 @@ "os": "iosxe" }, "uid": "configure_bgp_refresh_max_eor_time", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1728" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1807" } } }, @@ -5236,7 +5334,7 @@ "os": "iosxe" }, "uid": "configure_bgp_router_id_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1754" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1833" } } }, @@ -5250,21 +5348,21 @@ "os": "iosxe" }, "uid": "configure_bgp_router_id_neighbor_ip_peergroup_neighbor", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1669" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1748" } } }, "configure_bgp_router_id_peergroup_neighbor": { "folders": { "iosxe": { - "doc": " Configures router-id on BGP router\n\n Args:\n device('obj'): device to configure on\n bgp_as('str'): bgp id (autonomous system number) to configure\n neighborname('str'): neighbor peer-group-name to configure\n as_id('str'): ASN of the peer group to configure\n Return:\n None\n Raises:\n SubCommandFailure: Failed executing command\n ", + "doc": " Configures router-id on BGP router\n\n Args:\n device('obj'): device to configure on\n bgp_as('str'): bgp id (autonomous system number) to configure\n neighborname('str'): neighbor peer-group-name to configure\n as_id('str'): ASN of the peer group to configure\n listen_range('str'): Range of IP's that BGP listen\n peer_group('str'): peer_group_name\n Return:\n None\n Raises:\n SubCommandFailure: Failed executing command\n ", "module_name": "iosxe.bgp.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_bgp_router_id_peergroup_neighbor", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1633" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1706" } } }, @@ -5292,7 +5390,7 @@ "os": "iosxe" }, "uid": "configure_bgp_sso_route_refresh_enable", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1703" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1782" } } }, @@ -5306,7 +5404,7 @@ "os": "iosxe" }, "uid": "configure_bgp_template_peer_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1335" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1408" } } }, @@ -5320,7 +5418,7 @@ "os": "iosxe" }, "uid": "configure_bgp_template_peer_session", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1368" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1441" } } }, @@ -5334,7 +5432,7 @@ "os": "iosxe" }, "uid": "configure_bgp_update_delay", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1599" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1672" } } }, @@ -5348,7 +5446,7 @@ "os": "iosxe" }, "uid": "configure_bgp_vpn_import", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2475" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2554" } } }, @@ -5402,7 +5500,7 @@ "os": "iosxe" }, "uid": "configure_boot_manual_switch", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4166" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4167" } } }, @@ -5416,7 +5514,7 @@ "os": "iosxe" }, "uid": "configure_boot_system_image_file", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4515" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4516" } } }, @@ -5430,7 +5528,7 @@ "os": "iosxe" }, "uid": "configure_boot_system_switch_all_flash", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1247" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1248" } } }, @@ -5444,7 +5542,7 @@ "os": "iosxe" }, "uid": "configure_boot_system_switch_switchnumber", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3573" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3574" } } }, @@ -5479,7 +5577,7 @@ "os": "iosxe" }, "uid": "configure_bridge_domain", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4644" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4645" } } }, @@ -5493,7 +5591,7 @@ "os": "iosxe" }, "uid": "configure_broadband_aaa", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L275" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L276" } } }, @@ -5507,7 +5605,7 @@ "os": "iosxe" }, "uid": "configure_bulkstat_profile", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L947" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L948" } } }, @@ -5529,7 +5627,7 @@ "os": "iosxe" }, "uid": "configure_call_admission", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L221" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L222" } } }, @@ -5893,7 +5991,7 @@ "os": "iosxe" }, "uid": "configure_call_home_reporting", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3131" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3132" } } }, @@ -6063,7 +6161,7 @@ "os": "iosxe" }, "uid": "configure_cdp_run", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5948" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5949" } } }, @@ -6095,6 +6193,20 @@ } } }, + "configure_class_map_access_group_on_device": { + "folders": { + "iosxe": { + "doc": " Configure class-map access-group on device\n Args:\n device ('obj'): device to use\n class_map_name ('str'): class-map name on which we need to configure\n acc_list_number ('str') : access-list number/name\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.policy_class_map.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_class_map_access_group_on_device", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_class_map/configure.py#L95" + } + } + }, "configure_class_map_subscriber": { "folders": { "iosxe": { @@ -6161,7 +6273,7 @@ "os": "iosxe" }, "uid": "configure_clear_logging_onboard_slot_environment", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5367" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5368" } } }, @@ -6175,7 +6287,7 @@ "os": "iosxe" }, "uid": "configure_clear_logging_onboard_slot_temperature", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5400" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5401" } } }, @@ -6189,7 +6301,7 @@ "os": "iosxe" }, "uid": "configure_clear_logging_onboard_slot_voltage", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5334" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5335" } } }, @@ -6203,7 +6315,7 @@ "os": "iosxe" }, "uid": "configure_clear_logging_onboard_switch_environment", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1158" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1159" } } }, @@ -6217,7 +6329,7 @@ "os": "iosxe" }, "uid": "configure_clear_logging_onboard_switch_temperature", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1099" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1100" } } }, @@ -6231,7 +6343,7 @@ "os": "iosxe" }, "uid": "configure_clear_logging_onboard_switch_voltage", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1128" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1129" } } }, @@ -6273,7 +6385,7 @@ "os": "iosxe" }, "uid": "configure_clock_timezone", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1570" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1571" } } }, @@ -6301,7 +6413,7 @@ "os": "iosxe" }, "uid": "configure_commands_to_template", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1761" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1762" } } }, @@ -6441,7 +6553,7 @@ "os": "iosxe" }, "uid": "configure_cos", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4357" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4358" } } }, @@ -6616,14 +6728,14 @@ "configure_crypto_pki_server": { "folders": { "iosxe": { - "doc": " \n Configure crypto pki server\n Args:\n device ('obj'): Device object\n server_name ('str'): Name for the pki server\n auto_rollover_time('str'): Auto rollover time \n cdp_url_server ('str') : cdp url server (http | ldap)\n cdp_url_ip_path ('str') : cdp url ip path \n database_archive_type ('str') : Database archive type either pem or pkcs12\n archive_password ('str') : Database archive password\n archive_encryption_type ('int') : Database archive encryption type (0-9)\n database_level ('str') : Database level (complete|minimum|names)\n database_url_server ('str') : Database server (http | ldap) \n database_ip_path ('str') : Exact path for database file\n database_url_storage_location ('str') : Database url storage location (cnm|crl|crt etc.)\n database_url_publish ('bool') : Database url publish option for cnm, crl,crt\n database_user ('str') : Database username\n eku_options ('str') : eku options that needs to be configured (1 or more)\n grant_mode ('str') : Grant request mode (auto | none | ra-auto)\n grant_rollover_cert ('str') : Grant auto rollover certificate (ca-cert | ra-cert)\n grant_tp_list ('str') : grant trustpoints (upto 5 trustpoints)\n grant_trustpoint ('str') : Label of trustpoint holding trusted CA cert\n hash_type ('str') : Hash algorithm type (md5, sha1, sha256, sha384, sha512)\n issuer_name ('str') : Issuer name to be configured\n ca_cert_life ('str') : Ca certificate lifetime in format or \n cert_life ('str') : Certificate lifetime in format or \n crl_life ('str') : crl lifetime in format or \n enrol_req_life ('str') : enrollment request lifetime in format or \n mode ('str') : Modes (ra|sub-cs)\n mode_ra_transparent ('bool') : True if want to enable transparent in ra mode\n serial_number ('str') : serial number of last issued ceritificate \n enrollment_ip ('str') : Ip address for CA server enrollment URL\n enrollment_path ('str') : Path for CA server enrollment URL\n revoke_chk ('str') : Type of revocation check (none|crl|ocsp)\n key_len ('int') : Key length for RSA keypair \n port ('int') : Port number for CA server enrollment\n Returns:\n True/False\n ", - "module_name": "iosxe.pki.configure", + "doc": "Configures crypto pki server on device\n\n Args:\n device (`obj`): Device object\n domain_name ('str'): Name of the domain to be configured\n database_level ('str'): Database level to be configured\n issuer_name ('str'): Issuer name to be configured\n hash ('str'): Hash to be configured\n modulus_size ('str'): Modulus size to be configured\n Password ('str'): Password to be configured\n server_name ('str'): Name of the server to be configured\n\n Returns:\n None\n\n Raise:\n SubCommandFailure: Failed to configure crypto pki server on device\n ", + "module_name": "iosxe.eaptls.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_crypto_pki_server", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L13" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L159" } } }, @@ -6887,14 +6999,14 @@ "configure_default_spanning_tree": { "folders": { "iosxe": { - "doc": "Configure default spanning-tree\n Args:\n device ('obj'): Device object\n mode_type('str'): backbonefast Enable BackboneFast Feature\n bridge STP Bridge Assurance parameters\n cca enable/disable CCA routine\n dispute Enable STP dispute mechanism\n etherchannel Spanning tree etherchannel specific configuration\n extend Spanning Tree 802.1t extensions\n logging Enable Spanning tree logging\n loopguard Spanning tree loopguard options\n mode Spanning tree operating mode\n mst Multiple spanning tree configuration\n pathcost Spanning tree pathcost options\n portfast Spanning tree portfast options\n sso Stateful Switchover\n transmit STP transmit parameters\n uplinkfast Enable UplinkFast Feature\n vlan VLAN Switch Spanning Tree\n Return:\n None\n Raise:\n SubCommandFailure \n ", - "module_name": "iosxe.dot1x.configure", + "doc": " Configure spanning-tree mode mst\n Args:\n device ('obj'): Device object]\n spanning_tree ('str'): spanning tree \n mst ('str'): instance range, example: 0-3,5,7-9\n portfast ('str'): enable portfast\n range ('str'): vlan range, example: 1,3-5,7,9-11\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.spanning_tree.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_default_spanning_tree", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L2089" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py#L640" } } }, @@ -6936,7 +7048,7 @@ "os": "iosxe" }, "uid": "configure_default_stack_power_auto_off", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5744" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5745" } } }, @@ -6950,7 +7062,7 @@ "os": "iosxe" }, "uid": "configure_default_stack_power_ecomode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5649" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5650" } } }, @@ -6964,7 +7076,7 @@ "os": "iosxe" }, "uid": "configure_default_stack_power_switch_power_priority", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3399" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3400" } } }, @@ -7028,7 +7140,7 @@ "os": "iosxe" }, "uid": "configure_device_classifier", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L809" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L810" } } }, @@ -7042,7 +7154,7 @@ "os": "iosxe" }, "uid": "configure_device_classifier_command", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3993" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3994" } } }, @@ -7378,7 +7490,7 @@ "os": "iosxe" }, "uid": "configure_diagnostic_bootup_level_minimal", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4340" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4341" } } }, @@ -7392,7 +7504,7 @@ "os": "iosxe" }, "uid": "configure_diagnostic_monitor_interval_module", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6097" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6098" } } }, @@ -7406,7 +7518,7 @@ "os": "iosxe" }, "uid": "configure_diagnostic_monitor_module", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5976" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5977" } } }, @@ -7420,7 +7532,7 @@ "os": "iosxe" }, "uid": "configure_diagnostic_monitor_switch", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3217" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3218" } } }, @@ -7434,7 +7546,7 @@ "os": "iosxe" }, "uid": "configure_diagnostic_monitor_syslog", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3856" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3857" } } }, @@ -7448,7 +7560,7 @@ "os": "iosxe" }, "uid": "configure_diagnostic_schedule_module", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6027" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6028" } } }, @@ -7462,7 +7574,7 @@ "os": "iosxe" }, "uid": "configure_diagnostic_schedule_switch", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3269" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3270" } } }, @@ -7476,7 +7588,7 @@ "os": "iosxe" }, "uid": "configure_diagonistics_monitor_switch", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L343" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L344" } } }, @@ -7560,7 +7672,7 @@ "os": "iosxe" }, "uid": "configure_distribute_prefix_list_under_ospf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1811" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1862" } } }, @@ -8036,7 +8148,7 @@ "os": "iosxe" }, "uid": "configure_enable_http_server", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1518" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1519" } } }, @@ -8078,7 +8190,7 @@ "os": "iosxe" }, "uid": "configure_enable_secret_password", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3111" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3112" } } }, @@ -8162,7 +8274,7 @@ "os": "iosxe" }, "uid": "configure_event_manager", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5549" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5550" } } }, @@ -8176,7 +8288,7 @@ "os": "iosxe" }, "uid": "configure_event_manager_applet", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2958" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2959" } } }, @@ -8190,7 +8302,7 @@ "os": "iosxe" }, "uid": "configure_event_manager_applet_event_none", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2555" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2556" } } }, @@ -8218,14 +8330,14 @@ "os": "iosxe" }, "uid": "configure_evpn_ethernet_segment", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L962" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1098" } } }, "configure_evpn_evi_replication_type": { "folders": { "iosxe": { - "doc": " Config l2vpn evpn replication type on evi\n Args:\n device (`obj`): Device object\n evi ('int'): evi id\n srvinst ('str'): service instance type\n vlan-based|vlan-bundle|vlan-aware\n rep_type ('str'): replication type \n static | ingress\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Config l2vpn evpn replication type on evi\n Args:\n device (`obj`): Device object\n evi ('int'): evi id\n srvinst ('str'): service instance type\n vlan-based|vlan-bundle|vlan-aware\n rep_type ('str'): replication type\n static | ingress\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -8246,7 +8358,7 @@ "os": "iosxe" }, "uid": "configure_evpn_floodsuppress_dhcprelay_disable_globally", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L904" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1040" } } }, @@ -8260,14 +8372,14 @@ "os": "iosxe" }, "uid": "configure_evpn_instance", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L748" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L775" } } }, "configure_evpn_instance_encapsulation_type": { "folders": { "iosxe": { - "doc": " Config l2vpn evpn replication type on evi\n Args:\n device (`obj`): Device object\n evi ('int'): evi id\n srvinst ('str'): service instance type\n vlan-based|vlan-bundle|vlan-aware\n encap_type ('str): encapsulation \n vxlan | mpls \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Config l2vpn evpn replication type on evi\n Args:\n device (`obj`): Device object\n evi ('int'): evi id\n srvinst ('str'): service instance type\n vlan-based|vlan-bundle|vlan-aware\n encap_type ('str): encapsulation\n vxlan | mpls\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -8281,14 +8393,14 @@ "configure_evpn_instance_evi": { "folders": { "iosxe": { - "doc": " Configure evpn instance evi\n Args:\n device ('obj'): Device object\n evi ('int'): evi id\n srv_inst ('str'): service instance type\n vlan-based|vlan-bundle|vlan-aware\n conf_command_list('list',optional): L2VPN EVPN instance configuration commands, default value is None\n encap_type ('str',optional): encapsulation, default value is None\n vxlan | mpls \n mode_type ('str',optional): ip local-learning, default value is None\n disable | enable \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Configure evpn instance evi\n Args:\n device ('obj'): Device object\n evi ('int'): evi id\n srv_inst ('str'): service instance type\n vlan-based|vlan-bundle|vlan-aware\n conf_command_list('list',optional): L2VPN EVPN instance configuration commands, default value is None\n encap_type ('str',optional): encapsulation, default value is None\n vxlan | mpls\n mode_type ('str',optional): ip local-learning, default value is None\n disable | enable\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_evpn_instance_evi", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1072" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1208" } } }, @@ -8323,21 +8435,21 @@ "configure_evpn_l2_instance_bd_association": { "folders": { "iosxe": { - "doc": " Configure configure VLAN association to EVPN instance\n Args:\n device ('obj'): Device object\n bd_id ('int'): bridge-domain id\n evpn_instance('int'): EVPN Instance id\n vni_id('int'): VNI id, default is None\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Configure evpn instance association with bd\n Args:\n device ('obj'): Device object\n bd_id ('int'): bridge-domain id\n evpn_instance('int'): EVPN Instance id\n vni_id('int'): VNI id, default is None\n eth_tag('int'): Ethernet tag, default is None\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_evpn_l2_instance_bd_association", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L842" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L869" } } }, "configure_evpn_l2_instance_vlan_association": { "folders": { "iosxe": { - "doc": " Configure configure VLAN association to EVPN instance\n Args:\n device (`obj`): Device object\n vlan_id (`int`): Vlan id\n evpn_instance('int'): EVPN Instance id\n vni_id('int'): VNI id\n protected('bool'): protected knob True or False \n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", + "doc": " Configure configure VLAN association to EVPN instance\n Args:\n device (`obj`): Device object\n vlan_id (`int`): Vlan id\n evpn_instance('int'): EVPN Instance id\n vni_id('int'): VNI id\n protected('bool'): protected knob True or False\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -8348,6 +8460,34 @@ } } }, + "configure_evpn_l2_profile_bd_association": { + "folders": { + "iosxe": { + "doc": " Configure EVPN profile association with bd\n Args:\n device ('obj'): Device object\n bd_id ('int'): bridge-domain id\n evpn_name('str'): EVPN Instance Profile name\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.evpn.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_evpn_l2_profile_bd_association", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L938" + } + } + }, + "configure_evpn_l3_instance_bd_association": { + "folders": { + "iosxe": { + "doc": " configure BD association to EVPN l3 vni instance\n\n Args:\n device (`obj`): Device object\n bd_id (`int`): Bridge Domain id\n vni_id('int'): VNI id\n Returns:\n None\n\n Raises:\n SubCommandFailure\n\n ", + "module_name": "iosxe.evpn.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_evpn_l3_instance_bd_association", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L499" + } + } + }, "configure_evpn_l3_instance_vlan_association": { "folders": { "iosxe": { @@ -8362,10 +8502,24 @@ } } }, + "configure_evpn_profile": { + "folders": { + "iosxe": { + "doc": " Configure evpn profile\n Args:\n device ('obj'): Device object\n name ('str'): Name of the evpn profile\n srv_inst ('str'): service instance type\n vlan-bundle|vlan-aware\n evi_id('int',optional): <1-65535> EVPN evi id, default value is None\n l2vni ('int',optional): <4096-16777215> VxLAN L2VNI base, default value is None\n etherent_tag ('str',optional): EVPN Ethernet Tag, default value is None\n auto-vlan | auto-vni\n encap('str',optional): Encapsulation type\n vxlan | mpls\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.evpn.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_evpn_profile", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1292" + } + } + }, "configure_evpn_replication_type": { "folders": { "iosxe": { - "doc": " Config l2vpn evpn instance\n Args:\n device (`obj`): Device object\n rep_type ('str'): replication type \n static | ingress\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Config l2vpn evpn instance\n Args:\n device (`obj`): Device object\n rep_type ('str'): replication type\n static | ingress\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -8432,6 +8586,20 @@ } } }, + "configure_fast_rep_segment": { + "folders": { + "iosxe": { + "doc": "Configures fastREP \n Args:\n device ('obj'): Switch object\n intfs ('list'): List of interfaces to configure\n segmentnum ('str'): Segment number to configure\n vlan ('str', 'optional'): Vlan to configure\n edge_port ('bool' 'optional'): Configure edge port\n no_neighbor ('bool' 'optional'): Configure no neighbor\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.rep.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_fast_rep_segment", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rep/configure.py#L60" + } + } + }, "configure_fec_on_interface": { "folders": { "iosxe": { @@ -8491,7 +8659,7 @@ "configure_flow_monitor": { "folders": { "iosxe": { - "doc": " Config Flow Monitor on Device\n Args:\n device (`obj`): Device object\n monitor_name (`str`): Flow Monitor name\n exporter_name (`str`): Flow exporter name\n record_name (`str`): Flow record name\n timeout ('int'): Timeout\n \n Return:\n None\n\n Raise:\n SubCommandFailure: Failed configuring flow monitor\n ", + "doc": " Config Flow Monitor on Device\n Args:\n device (`obj`): Device object\n monitor_name (`str`): Flow Monitor name\n exporter_name (`str`): Flow exporter name\n record_name (`str`): Flow record name\n timeout ('int'): Timeout\n\n Return:\n None\n\n Raise:\n SubCommandFailure: Failed configuring flow monitor\n ", "folders": { "cat9k": { "folders": { @@ -8706,7 +8874,7 @@ "configure_fnf_flow_record_match_flow": { "folders": { "iosxe": { - "doc": " Configure Flow Record match flow on Device\n Args:\n device ('obj'): Device object\n record_name ('str'): Flow record name\n flow_name ('str'): cts or direction or observation\n cts_type ('str', optional): source or destination. Default is None\n\n Return:\n None\n \n Raise:\n SubCommandFailure: Failed configuring Flow Record on Device\n ", + "doc": " Configure Flow Record match flow on Device\n Args:\n device ('obj'): Device object\n record_name ('str'): Flow record name\n flow_name ('str'): cts or direction or observation\n cts_type ('str', optional): source or destination. Default is None\n\n Return:\n None\n\n Raise:\n SubCommandFailure: Failed configuring Flow Record on Device\n ", "module_name": "iosxe.flow.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -8909,7 +9077,7 @@ "os": "iosxe" }, "uid": "configure_graceful_reload", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4479" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4480" } } }, @@ -8923,7 +9091,7 @@ "os": "iosxe" }, "uid": "configure_graceful_reload_interval", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4320" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4321" } } }, @@ -9054,7 +9222,7 @@ "os": "iosxe" }, "uid": "configure_hw_module_logging_onboard", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5160" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5161" } } }, @@ -9068,7 +9236,7 @@ "os": "iosxe" }, "uid": "configure_hw_module_slot_breakout", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5784" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5785" } } }, @@ -9082,7 +9250,7 @@ "os": "iosxe" }, "uid": "configure_hw_module_slot_logging_onboard_environment", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5242" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5243" } } }, @@ -9096,7 +9264,7 @@ "os": "iosxe" }, "uid": "configure_hw_module_slot_logging_onboard_temperature", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5288" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5289" } } }, @@ -9110,7 +9278,7 @@ "os": "iosxe" }, "uid": "configure_hw_module_slot_logging_onboard_voltage", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5196" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5197" } } }, @@ -9138,7 +9306,7 @@ "os": "iosxe" }, "uid": "configure_hw_module_slot_upoe_plus", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5914" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5915" } } }, @@ -9152,7 +9320,7 @@ "os": "iosxe" }, "uid": "configure_hw_module_switch_number_auto_off_led", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5668" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5669" } } }, @@ -9166,7 +9334,7 @@ "os": "iosxe" }, "uid": "configure_hw_module_switch_number_ecomode_led", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5573" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5574" } } }, @@ -9194,7 +9362,7 @@ "os": "iosxe" }, "uid": "configure_hw_switch_logging_onboard", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1435" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1436" } } }, @@ -9208,7 +9376,7 @@ "os": "iosxe" }, "uid": "configure_hw_switch_switch_logging_onboard_environment", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1023" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1024" } } }, @@ -9222,7 +9390,7 @@ "os": "iosxe" }, "uid": "configure_hw_switch_switch_logging_onboard_temperature", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1061" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1062" } } }, @@ -9236,7 +9404,7 @@ "os": "iosxe" }, "uid": "configure_hw_switch_switch_logging_onboard_voltage", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L984" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L985" } } }, @@ -9472,7 +9640,7 @@ "os": "iosxe" }, "uid": "configure_interface_VirtualPortGroup", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1658" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1659" } } }, @@ -9724,7 +9892,7 @@ "os": "iosxe" }, "uid": "configure_interface_evpn_ethernet_segment", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L992" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1128" } } }, @@ -10130,7 +10298,7 @@ "os": "iosxe" }, "uid": "configure_interface_macro", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L589" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L590" } } }, @@ -10284,7 +10452,7 @@ "os": "iosxe" }, "uid": "configure_interface_ospfv3_ipsec_ah", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2150" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2201" } } }, @@ -10298,7 +10466,7 @@ "os": "iosxe" }, "uid": "configure_interface_ospfv3_ipsec_esp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2187" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2238" } } }, @@ -10431,7 +10599,7 @@ "configure_interface_range_no_shutdown": { "folders": { "iosxe": { - "doc": " Configure interface range no shutdown\n Args:\n device ('obj'): device to use\n start_interface('str'): Starting Interface\n end_interface('str'): Ending Interface number \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Configure interface range no shutdown\n Args:\n device ('obj'): device to use\n start_interface('str'): Starting Interface\n end_interface('str'): Ending Interface number\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.interface.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -10512,6 +10680,62 @@ } } }, + "configure_interface_rep_segment_edge_preferred": { + "folders": { + "iosxe": { + "doc": "Configure REP Segment Edge Preferred on the device\n Args:\n device ('obj'): Device object\n interface ('str'): Interface name\n segment ('str'): Segment value\n Returns:\n None\n Raises:\n SubCommandFailure: Failed configuring rep segment edge preferred\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_interface_rep_segment_edge_preferred", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10396" + } + } + }, + "configure_interface_rep_segment_edge_primary": { + "folders": { + "iosxe": { + "doc": "Configure REP Segment Edge Primary on the device\n Args:\n device ('obj'): Device object\n interface ('str'): Interface name\n segment ('str'): Segment value\n preferred ('bool', optional): Set to True for edge primary preferred (default: False)\n Returns:\n None\n Raises:\n SubCommandFailure: Failed configuring rep segment edge primary\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_interface_rep_segment_edge_primary", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10438" + } + } + }, + "configure_interface_rep_stcn_segment": { + "folders": { + "iosxe": { + "doc": "Configure interface rep stcn segment\n Args:\n device ('obj'): Device object\n interface ('str'): Interface to configure\n segment ('str'): Segment value\n Returns:\n None\n Raises:\n SubCommandFailure: Failed configuring interface rep stcn segment\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_interface_rep_stcn_segment", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10327" + } + } + }, + "configure_interface_rep_stcn_stp": { + "folders": { + "iosxe": { + "doc": "Configure interface rep stcn stp\n Args:\n device ('obj'): Device object\n interface ('str'): Interface to configure\n Returns:\n None\n Raises:\n SubCommandFailure: Failed configuring interface rep stcn stp\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_interface_rep_stcn_stp", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10362" + } + } + }, "configure_interface_service_policy": { "folders": { "iosxe": { @@ -11207,6 +11431,20 @@ } } }, + "configure_ip_access_list_with_dscp_on_device": { + "folders": { + "iosxe": { + "doc": " Configure ip access-list with source/destination host and dscp value\n Args:\n device ('obj'): device to use\n acc_list_number('int') : Extended IP access-list number\n sequence_num ('int') : Sequence Number\n action ('str'): Specify packets to forward or reject (eg. permit, deny)\n src_ip_add('str'): Sender Host IP address (eg. 10.1.1.1)\n dst_ip_add('str'): Receiver Host IP address (eg. 10.1.1.1)\n dscp_val('str'): Services codepoint value (eg. 0-7)\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.qos.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_ip_access_list_with_dscp_on_device", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/qos/configure.py#L384" + } + } + }, "configure_ip_acl": { "folders": { "iosxe": { @@ -11553,7 +11791,7 @@ "os": "iosxe" }, "uid": "configure_ip_domain_name", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2814" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2815" } } }, @@ -11567,7 +11805,7 @@ "os": "iosxe" }, "uid": "configure_ip_domain_name_vrf_mgmt_vrf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2832" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2833" } } }, @@ -11637,7 +11875,7 @@ "os": "iosxe" }, "uid": "configure_ip_http_client_secure_trustpoint", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5763" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5764" } } }, @@ -11651,7 +11889,7 @@ "os": "iosxe" }, "uid": "configure_ip_http_client_source_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2924" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2925" } } }, @@ -11665,7 +11903,7 @@ "os": "iosxe" }, "uid": "configure_ip_http_client_source_interface_vlan_domain_lookup", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2867" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2868" } } }, @@ -11679,7 +11917,7 @@ "os": "iosxe" }, "uid": "configure_ip_http_client_source_interface_vlan_domain_lookup_name_server_vrf_mgmt_vrf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2903" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2904" } } }, @@ -12127,7 +12365,7 @@ "os": "iosxe" }, "uid": "configure_ip_name_server_vrf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2850" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2851" } } }, @@ -12281,7 +12519,7 @@ "os": "iosxe" }, "uid": "configure_ip_ospf_mtu_ignore", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1474" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1525" } } }, @@ -12393,7 +12631,7 @@ "os": "iosxe" }, "uid": "configure_ip_prefix_list", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L891" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L942" } } }, @@ -12477,7 +12715,7 @@ "os": "iosxe" }, "uid": "configure_ip_scp_password", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4751" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4752" } } }, @@ -12491,7 +12729,7 @@ "os": "iosxe" }, "uid": "configure_ip_scp_server_enable", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5481" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5482" } } }, @@ -12505,7 +12743,7 @@ "os": "iosxe" }, "uid": "configure_ip_scp_username", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4719" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4720" } } }, @@ -12519,7 +12757,7 @@ "os": "iosxe" }, "uid": "configure_ip_sftp_password", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4783" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4784" } } }, @@ -12533,7 +12771,7 @@ "os": "iosxe" }, "uid": "configure_ip_sftp_username", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4686" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4687" } } }, @@ -12561,7 +12799,7 @@ "os": "iosxe" }, "uid": "configure_ip_source_binding", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4127" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4128" } } }, @@ -12673,7 +12911,7 @@ "os": "iosxe" }, "uid": "configure_ip_ssh_source_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5505" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5506" } } }, @@ -12715,7 +12953,7 @@ "os": "iosxe" }, "uid": "configure_ip_tftp_blocksize", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1477" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1478" } } }, @@ -13709,7 +13947,7 @@ "os": "iosxe" }, "uid": "configure_ipv6_ospf_bfd", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1263" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1314" } } }, @@ -13723,7 +13961,7 @@ "os": "iosxe" }, "uid": "configure_ipv6_ospf_mtu_ignore", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1321" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1372" } } }, @@ -13737,7 +13975,7 @@ "os": "iosxe" }, "uid": "configure_ipv6_ospf_router_id", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1991" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2042" } } }, @@ -13751,7 +13989,7 @@ "os": "iosxe" }, "uid": "configure_ipv6_ospf_routing_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1379" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1430" } } }, @@ -13905,7 +14143,7 @@ "os": "iosxe" }, "uid": "configure_ipxe_forever", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L407" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L408" } } }, @@ -13919,7 +14157,7 @@ "os": "iosxe" }, "uid": "configure_ipxe_timeout", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L389" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L390" } } }, @@ -14199,6 +14437,20 @@ } } }, + "configure_key_config_key_newpass_oldpass": { + "folders": { + "iosxe": { + "doc": " Changes the master key password\n Args:\n device (`obj`): Device object\n new_pass('str'): password, The new config-key\n Minimum 8 characters not beginning with\n IOS special character(! # ;)\n old_pass('str'): password, The old config-key\n Minimum 8 characters not beginning with\n IOS special character(! # ;)\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.platform.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_key_config_key_newpass_oldpass", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6250" + } + } + }, "configure_key_config_key_password_encrypt": { "folders": { "iosxe": { @@ -14209,7 +14461,7 @@ "os": "iosxe" }, "uid": "configure_key_config_key_password_encrypt", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3063" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3064" } } }, @@ -14251,7 +14503,7 @@ "os": "iosxe" }, "uid": "configure_l2vpn_evpn_advertise_sync", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1233" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1437" } } }, @@ -14279,14 +14531,14 @@ "os": "iosxe" }, "uid": "configure_l2vpn_evpn_flooding_suppression", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L727" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L754" } } }, "configure_l2vpn_evpn_router_id": { "folders": { "iosxe": { - "doc": " Config l2vpn evpn\n Args:\n device ('obj'): Device object\n interface ('str'): interface type \n loopback | physical\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Config l2vpn evpn\n Args:\n device ('obj'): Device object\n interface ('str'): interface type\n loopback | physical\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -14349,7 +14601,7 @@ "os": "iosxe" }, "uid": "configure_label_mode_all_explicit_null", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2177" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2256" } } }, @@ -14573,7 +14825,7 @@ "os": "iosxe" }, "uid": "configure_license_smart_transport_off", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2744" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2745" } } }, @@ -14657,7 +14909,7 @@ "os": "iosxe" }, "uid": "configure_line_vty", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3178" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3179" } } }, @@ -14939,7 +15191,7 @@ "os": "iosxe" }, "uid": "configure_logging_buffered_persistent_url", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4301" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4302" } } }, @@ -15058,7 +15310,7 @@ "configure_mab_eap_on_switchport_mode_access_interface": { "folders": { "iosxe": { - "doc": "api for configuring mab eap on switchport mode access interface\n\n Args:\n device ('obj') : Device object\n interface ('str') : switchport mode access interface name \n Return:\n None\n Raise:\n SubCommandFailure: failed to configure mab eap on switchport mode access interface\n ", + "doc": "api for configuring mab eap on switchport mode access interface\n\n Args:\n device ('obj') : Device object\n interface ('str') : switchport mode access interface name\n Return:\n None\n Raise:\n SubCommandFailure: failed to configure mab eap on switchport mode access interface\n ", "module_name": "iosxe.aaa.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -15266,7 +15518,7 @@ "os": "iosxe" }, "uid": "configure_macro_auto_global_processing", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3660" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3661" } } }, @@ -15280,7 +15532,7 @@ "os": "iosxe" }, "uid": "configure_macro_auto_global_processing_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3622" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3623" } } }, @@ -15294,7 +15546,7 @@ "os": "iosxe" }, "uid": "configure_macro_auto_processing_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3799" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3800" } } }, @@ -15308,7 +15560,7 @@ "os": "iosxe" }, "uid": "configure_macro_auto_sticky", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L773" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L774" } } }, @@ -15322,21 +15574,21 @@ "os": "iosxe" }, "uid": "configure_macro_global_apply", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1901" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1902" } } }, "configure_macro_name": { "folders": { "iosxe": { - "doc": " Configure macro name\n \n Args:\n device ('obj'): Device object\n macro_name ('str'): Macro namef\n macro_configs ('list'): Configuration lines for the macro\n timeout ('int', optional): Timeout for the CLI operation in seconds.\n Raises:\n SubCommandFailure\n Returns:\n None\n ", + "doc": " Configure macro name\n\n Args:\n device ('obj'): Device object\n macro_name ('str'): Macro namef\n macro_configs ('list'): Configuration lines for the macro\n timeout ('int', optional): Timeout for the CLI operation in seconds.\n Raises:\n SubCommandFailure\n Returns:\n None\n ", "module_name": "iosxe.platform.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_macro_name", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6214" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6215" } } }, @@ -15596,7 +15848,7 @@ "os": "iosxe" }, "uid": "configure_maximum_path_under_ospf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1182" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1233" } } }, @@ -15624,7 +15876,7 @@ "os": "iosxe" }, "uid": "configure_mdix_auto", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4200" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4201" } } }, @@ -16156,7 +16408,7 @@ "os": "iosxe" }, "uid": "configure_medium_p2p_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10264" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10287" } } }, @@ -16891,7 +17143,7 @@ "os": "iosxe" }, "uid": "configure_neighbor_under_ospf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1728" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1779" } } }, @@ -16961,7 +17213,7 @@ "os": "iosxe" }, "uid": "configure_no_bgp_default", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1087" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1160" } } }, @@ -16989,7 +17241,7 @@ "os": "iosxe" }, "uid": "configure_no_boot_system_switch_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L325" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L326" } } }, @@ -17045,7 +17297,7 @@ "os": "iosxe" }, "uid": "configure_no_shut_bgp_neighbors", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L789" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L858" } } }, @@ -17152,14 +17404,14 @@ "configure_nve_interface": { "folders": { "iosxe": { - "doc": " Configure nve interface\n\n Args:\n device (`obj`): Device object\n nve_num (`str`): nve interface number\n src_intf (`str`): source interface\n protocol (`str`): host-reachability protocol\n vni_id (`str`): vni id\n replication_type (`str`): replication type (static | ingress)\n mcast_group (`str`, optional): Multicast group address , default value is None\n l3vni (`str`, optional): l3vni enable/disable , default value is False\n vrf_name (`str`, optional): VRF Name , default value is None\n \n Returns:\n None\n\n Raises:\n SubCommandFailure\n\n ", + "doc": " Configure nve interface\n\n Args:\n device (`obj`): Device object\n nve_num (`str`): nve interface number\n src_intf (`str`): source interface\n protocol (`str`): host-reachability protocol\n vni_id (`str`): vni id\n replication_type (`str`): replication type (static | ingress)\n mcast_group (`str`, optional): Multicast group address , default value is None\n l3vni (`str`, optional): l3vni enable/disable , default value is False\n vrf_name (`str`, optional): VRF Name , default value is None\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_nve_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L499" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L526" } } }, @@ -17173,7 +17425,7 @@ "os": "iosxe" }, "uid": "configure_nve_interface_group_based_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L661" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L688" } } }, @@ -17215,7 +17467,7 @@ "os": "iosxe" }, "uid": "configure_ospf_area_type", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1550" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1601" } } }, @@ -17229,7 +17481,7 @@ "os": "iosxe" }, "uid": "configure_ospf_bfd", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1093" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1144" } } }, @@ -17257,7 +17509,7 @@ "os": "iosxe" }, "uid": "configure_ospf_include_connected_in_bgp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1254" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1327" } } }, @@ -17285,7 +17537,7 @@ "os": "iosxe" }, "uid": "configure_ospf_internal_external_routes_into_bgp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1218" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1291" } } }, @@ -17299,7 +17551,7 @@ "os": "iosxe" }, "uid": "configure_ospf_max_lsa_limit", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1919" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1970" } } }, @@ -17331,6 +17583,20 @@ } } }, + "configure_ospf_network_broadcast": { + "folders": { + "iosxe": { + "doc": "configure ospf broadcast network\n\n Args:\n device (`obj`): Device object\n interface (`str`): interface to configure\n ex.)\n interface = 'tenGigabitEthernet0/4/0'\n\n Return:\n None\n\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.ospf.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_ospf_network_broadcast", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L585" + } + } + }, "configure_ospf_network_non_broadcast": { "folders": { "iosxe": { @@ -17341,7 +17607,7 @@ "os": "iosxe" }, "uid": "configure_ospf_network_non_broadcast", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1670" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1721" } } }, @@ -17355,7 +17621,7 @@ "os": "iosxe" }, "uid": "configure_ospf_network_point", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1035" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1086" } } }, @@ -17383,7 +17649,7 @@ "os": "iosxe" }, "uid": "configure_ospf_nsf_ietf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1528" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1579" } } }, @@ -17411,6 +17677,20 @@ } } }, + "configure_ospf_priority": { + "folders": { + "iosxe": { + "doc": "configure ip ospf priority\n\n Args:\n device (`obj`): Device object\n interface (`str`): interface to configure\n ex.)\n interface = 'tenGigabitEthernet0/4/0'\n priority('int'): Priority value to configure for ospf\n\n Return:\n None\n\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.ospf.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_ospf_priority", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L641" + } + } + }, "configure_ospf_redistribute_in_bgp": { "folders": { "iosxe": { @@ -17421,7 +17701,7 @@ "os": "iosxe" }, "uid": "configure_ospf_redistribute_in_bgp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2505" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2584" } } }, @@ -17435,7 +17715,7 @@ "os": "iosxe" }, "uid": "configure_ospf_redistributed_connected", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1122" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1173" } } }, @@ -17449,7 +17729,7 @@ "os": "iosxe" }, "uid": "configure_ospf_redistributed_eigrp_metric", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2605" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2656" } } }, @@ -17463,7 +17743,7 @@ "os": "iosxe" }, "uid": "configure_ospf_redistributed_static", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1449" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1500" } } }, @@ -17477,7 +17757,7 @@ "os": "iosxe" }, "uid": "configure_ospf_routing", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L740" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L791" } } }, @@ -17491,7 +17771,7 @@ "os": "iosxe" }, "uid": "configure_ospf_routing_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L855" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L906" } } }, @@ -17519,7 +17799,7 @@ "os": "iosxe" }, "uid": "configure_ospf_vrf_lite", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2762" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2813" } } }, @@ -17533,7 +17813,7 @@ "os": "iosxe" }, "uid": "configure_ospfv3", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L639" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L690" } } }, @@ -17547,7 +17827,7 @@ "os": "iosxe" }, "uid": "configure_ospfv3_address_family", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L709" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L760" } } }, @@ -17561,7 +17841,7 @@ "os": "iosxe" }, "uid": "configure_ospfv3_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2741" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2792" } } }, @@ -17575,7 +17855,7 @@ "os": "iosxe" }, "uid": "configure_ospfv3_ipsec_ah", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2031" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2082" } } }, @@ -17589,7 +17869,7 @@ "os": "iosxe" }, "uid": "configure_ospfv3_ipsec_esp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2068" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2119" } } }, @@ -17603,7 +17883,7 @@ "os": "iosxe" }, "uid": "configure_ospfv3_max_lsa_limit", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1899" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1950" } } }, @@ -17617,7 +17897,7 @@ "os": "iosxe" }, "uid": "configure_ospfv3_network_point", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1205" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1256" } } }, @@ -17631,7 +17911,7 @@ "os": "iosxe" }, "uid": "configure_ospfv3_network_range", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2537" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2588" } } }, @@ -17645,7 +17925,7 @@ "os": "iosxe" }, "uid": "configure_ospfv3_network_type", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2717" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2768" } } }, @@ -17659,7 +17939,7 @@ "os": "iosxe" }, "uid": "configure_ospfv3_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2578" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2629" } } }, @@ -17673,7 +17953,7 @@ "os": "iosxe" }, "uid": "configure_ospfv3_redistributed_connected", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1790" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1841" } } }, @@ -17733,6 +18013,20 @@ } } }, + "configure_parser_view": { + "folders": { + "iosxe": { + "doc": "\" Configure Parser view\n\n Args:\n device ('obj'): Device object\n view_name ('str'): View name\n pwd ('str'): Password\n view_configs ('list'): Configuration execution to be included in the parser view\n Raises:\n SubCommandFailure\n Returns:\n None\n ", + "module_name": "iosxe.platform.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_parser_view", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6272" + } + } + }, "configure_pbr_route_map": { "folders": { "iosxe": { @@ -17757,7 +18051,7 @@ "os": "iosxe" }, "uid": "configure_periodic_time_range", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5028" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5029" } } }, @@ -17884,14 +18178,14 @@ "configure_pki_authenticate_certificate": { "folders": { "iosxe": { - "doc": " Pastes certificate on device\n Args:\n device (`obj`): Device object\n certificate ('str'): Certificate to be pasted\n label_name ('str'): Label name\n Returns:\n None\n Raise:\n SubCommandFailure: Failed to paste certificate on device\n ", - "module_name": "iosxe.pki.configure", + "doc": " Pastes certificate on device\n\n Args:\n device (`obj`): Device object\n certificate ('str'): Certificate to be pasted\n label_name ('str'): Label name\n\n Returns:\n None\n\n Raise:\n SubCommandFailure: Failed to paste certificate on device\n ", + "module_name": "iosxe.eaptls.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_pki_authenticate_certificate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L1019" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L38" } } }, @@ -18003,7 +18297,7 @@ "os": "iosxe" }, "uid": "configure_platform_acl_egress_dscp_enable", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5818" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5819" } } }, @@ -18017,7 +18311,7 @@ "os": "iosxe" }, "uid": "configure_platform_mgmt_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6141" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6142" } } }, @@ -18031,7 +18325,7 @@ "os": "iosxe" }, "uid": "configure_platform_qos_port_channel_aggregate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L177" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L178" } } }, @@ -18045,7 +18339,7 @@ "os": "iosxe" }, "uid": "configure_platform_shell", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2779" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2780" } } }, @@ -18162,7 +18456,7 @@ "os": "iosxe" }, "uid": "configure_policy_map_control", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2663" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2664" } } }, @@ -18176,7 +18470,7 @@ "os": "iosxe" }, "uid": "configure_policy_map_control_service_temp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5842" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5843" } } }, @@ -18330,7 +18624,7 @@ "os": "iosxe" }, "uid": "configure_port_channel_persistent", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2709" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2710" } } }, @@ -18414,7 +18708,21 @@ "os": "iosxe" }, "uid": "configure_power_inline_auto_max", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2977" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2978" + } + } + }, + "configure_ppp_multilink": { + "folders": { + "iosxe": { + "doc": " Configure ppp multilink on interface\n Args:\n device ('obj'): Device object\n interface ('str'): which interface to configure\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring ppp multilink on interface\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_ppp_multilink", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10479" } } }, @@ -18498,7 +18806,7 @@ "os": "iosxe" }, "uid": "configure_process_cpu_statistics_limit_entry_percentage_size", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3734" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3735" } } }, @@ -18512,7 +18820,7 @@ "os": "iosxe" }, "uid": "configure_process_cpu_threshold_type_rising_interval", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3694" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3695" } } }, @@ -18841,14 +19149,14 @@ "configure_pvlan_loadbalancing_ethernetsegment_l2vpn_evpn": { "folders": { "iosxe": { - "doc": " configure per vlan load balncing between PEs on ethernet segment \n Args:\n device ('obj'): Device object\n ethsegmentvalue ('str'): Ethernet segment local discriminator value\n identifier_type ('str', optional): Identifier type {type 0 or type 3, default is type 0}\n esivalue ('str', optional): 9-octet ESI value in hex {mandatory for type 0 identory type}\n system_mac ('str', optional): system mac address{mandatory for type 3 identory type}\n red_single_active ('str', optional): redundancy single active (yes or no, default value is \"yes\")\n \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " configure per vlan load balncing between PEs on ethernet segment\n Args:\n device ('obj'): Device object\n ethsegmentvalue ('str'): Ethernet segment local discriminator value\n identifier_type ('str', optional): Identifier type {type 0 or type 3, default is type 0}\n esivalue ('str', optional): 9-octet ESI value in hex {mandatory for type 0 identory type}\n system_mac ('str', optional): system mac address{mandatory for type 3 identory type}\n red_single_active ('str', optional): redundancy single active (yes or no, default value is \"yes\")\n\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_pvlan_loadbalancing_ethernetsegment_l2vpn_evpn", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1012" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1148" } } }, @@ -18904,7 +19212,7 @@ "os": "iosxe" }, "uid": "configure_qfp_drop_threshold", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5433" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5434" } } }, @@ -19177,7 +19485,7 @@ "configure_radius_server_source_ports_extended": { "folders": { "iosxe": { - "doc": " configure radius-server source-ports extended\n Args:\n device ('obj'): Device object \n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring radius-server source-ports extended\n ", + "doc": " configure radius-server source-ports extended\n Args:\n device ('obj'): Device object\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring radius-server source-ports extended\n ", "module_name": "iosxe.aaa.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -19226,7 +19534,7 @@ "os": "iosxe" }, "uid": "configure_redestribute_ospf_metric_in_bgp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2242" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2321" } } }, @@ -19240,7 +19548,7 @@ "os": "iosxe" }, "uid": "configure_redistribute_connected", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1015" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1084" } } }, @@ -19282,7 +19590,35 @@ "os": "iosxe" }, "uid": "configure_rep_admin_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4816" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4817" + } + } + }, + "configure_rep_segment": { + "folders": { + "iosxe": { + "doc": "Configures REP segment\n Args:\n device ('obj'): Switch object\n intfs ('list'): List of interfaces to configure\n segmentnum ('str'): Segment number to configure\n vlan ('str', 'optional'): Vlan to configure\n edge_port ('bool' 'optional'): Configure edge port\n no_neighbor ('bool' 'optional'): Configure no neighbor\n trunk('bool', 'optional'): Configure switchport trunk\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.rep.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_rep_segment", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rep/configure.py#L12" + } + } + }, + "configure_rep_ztp": { + "folders": { + "iosxe": { + "doc": " Configure REP ZTP on the device\n Args:\n device ('obj'): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.rep.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_rep_ztp", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rep/configure.py#L181" } } }, @@ -19310,7 +19646,7 @@ "os": "iosxe" }, "uid": "configure_replication_type_on_evi", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L630" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L657" } } }, @@ -19380,7 +19716,7 @@ "os": "iosxe" }, "uid": "configure_route_map", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L979" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1030" } } }, @@ -19394,14 +19730,14 @@ "os": "iosxe" }, "uid": "configure_route_map_match_length", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/route_map/configure.py#L202" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/route_map/configure.py#L205" } } }, "configure_route_map_permit": { "folders": { "iosxe": { - "doc": " Configures route-map on device\n Args:\n device('obj'): device to configure on\n route_map('list'): route-map\n seq ('int'): sequence number\n prefix_list ('str'): prefix-list value\n set_community ('int'): set community value\n match_community ('int'): match community value\n set_as_path ('int') : set as-path values\n set_metric ('int'): set metric value\n set_weight ('int'): set weight value\n set_as_path_prepend ('int'): set aspat prepend value\n local_preference ('int'): set local preference value\n match_as_path ('int'): set as path value\n continue_id ('int'): set continue id value\n Returns:\n None\n Raises:\n SubCommandFailure: Failed configuring route map\n ", + "doc": " Configures route-map on device\n Args:\n device('obj'): device to configure on\n route_map('list'): route-map\n seq ('int'): sequence number\n prefix_list ('str'): prefix-list value\n match_interface ('str'): Interface that needs to be matched\n set_community ('int'): set community value\n match_community ('int'): match community value\n set_as_path ('int') : set as-path values\n set_metric ('int'): set metric value\n set_weight ('int'): set weight value\n set_as_path_prepend ('int'): set aspat prepend value\n local_preference ('int'): set local preference value\n match_as_path ('int'): set as path value\n continue_id ('int'): set continue id value\n Returns:\n None\n Raises:\n SubCommandFailure: Failed configuring route map\n ", "module_name": "iosxe.route_map.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -19464,7 +19800,7 @@ "os": "iosxe" }, "uid": "configure_router_bgp_maximum_paths", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1935" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2014" } } }, @@ -19478,7 +19814,7 @@ "os": "iosxe" }, "uid": "configure_router_bgp_neighbor_ebgp_multihop", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2149" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2228" } } }, @@ -19492,7 +19828,7 @@ "os": "iosxe" }, "uid": "configure_router_bgp_neighbor_remote_as", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2095" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2174" } } }, @@ -19506,7 +19842,7 @@ "os": "iosxe" }, "uid": "configure_router_bgp_network_mask", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2122" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2201" } } }, @@ -19520,7 +19856,7 @@ "os": "iosxe" }, "uid": "configure_router_bgp_synchronization", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1985" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2064" } } }, @@ -19548,7 +19884,7 @@ "os": "iosxe" }, "uid": "configure_router_ospf_redistribute_internal_external", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1966" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2017" } } }, @@ -19926,7 +20262,7 @@ "os": "iosxe" }, "uid": "configure_service_compress_config", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4609" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4610" } } }, @@ -19996,7 +20332,7 @@ "os": "iosxe" }, "uid": "configure_service_performance", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3029" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3030" } } }, @@ -20014,6 +20350,20 @@ } } }, + "configure_service_policy_type_queueing_on_interface": { + "folders": { + "iosxe": { + "doc": " Configure service-policy type queueing on interface\n Args:\n device ('obj') : device to use\n interface ('str') : interface name on which we need to configure\n direction ('str') : Assign policy-map direction\n policy_map_name ('str') : Policy-map name\n Returns:\n None\n Raises:\n SubCommandFailure\n\t", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_service_policy_type_queueing_on_interface", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10264" + } + } + }, "configure_service_policy_with_queueing_name": { "folders": { "iosxe": { @@ -20031,14 +20381,14 @@ "configure_service_private_config_encryption": { "folders": { "iosxe": { - "doc": " service private-config-encryption\n Args:\n device (`obj`): Device object\n Returns:\n None\n Raises:\n SubCommandFailure : Failed configuring device\n ", - "module_name": "iosxe.sudi.configure", + "doc": " \n service private-config-encryption\n Args:\n device ('obj'): Device object\n Returns:\n None\n Raises:\n SubCommandFailure exception\n ", + "module_name": "iosxe.csdl.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_service_private_config_encryption", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sudi/configure.py#L42" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/csdl/configure.py#L33" } } }, @@ -20052,7 +20402,7 @@ "os": "iosxe" }, "uid": "configure_service_template", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2651" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2652" } } }, @@ -20220,7 +20570,7 @@ "os": "iosxe" }, "uid": "configure_service_timestamps", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L611" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L612" } } }, @@ -20234,7 +20584,7 @@ "os": "iosxe" }, "uid": "configure_set_clock_calendar", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1544" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1545" } } }, @@ -20262,7 +20612,7 @@ "os": "iosxe" }, "uid": "configure_shut_bgp_neighbors", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L633" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L702" } } }, @@ -20752,7 +21102,7 @@ "os": "iosxe" }, "uid": "configure_snmp_if_index_on_ospfv3_process_id", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2630" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2681" } } }, @@ -20766,7 +21116,7 @@ "os": "iosxe" }, "uid": "configure_snmp_mib_bulkstat", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L903" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L904" } } }, @@ -20780,7 +21130,7 @@ "os": "iosxe" }, "uid": "configure_snmp_mib_bulkstat_transfer", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4564" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4565" } } }, @@ -20794,7 +21144,7 @@ "os": "iosxe" }, "uid": "configure_snmp_server_contact", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1355" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1356" } } }, @@ -20826,6 +21176,20 @@ } } }, + "configure_snmp_server_host": { + "folders": { + "iosxe": { + "doc": " Configures the snmp-server host or informs on device\n Args:\n device ('obj'): device to use\n host_ip ('str'): WORD IP address of the SNMP notification host\n community_string ('str'): Community string\n version ('str', optional): SNMP version\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.snmp.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_snmp_server_host", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L729" + } + } + }, "configure_snmp_server_host_trap": { "folders": { "iosxe": { @@ -20850,21 +21214,21 @@ "os": "iosxe" }, "uid": "configure_snmp_server_location", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1394" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1395" } } }, "configure_snmp_server_manager": { "folders": { "iosxe": { - "doc": " Configures snmp-server manager\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.platform.configure", + "doc": "\n Configures the snmp-server manager\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.snmp.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_snmp_server_manager", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3014" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L508" } } }, @@ -20920,7 +21284,7 @@ "os": "iosxe" }, "uid": "configure_software_auto_upgrade", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2020" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2021" } } }, @@ -20934,7 +21298,7 @@ "os": "iosxe" }, "uid": "configure_source_template", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1700" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1701" } } }, @@ -21169,6 +21533,16 @@ "folders": { "cat9k": { "folders": { + "c9500": { + "doc": " Configures Spanning Tree Portfast\n Args:\n device ('obj') : device to use\n default ('boolean', optional) : Configure spanning-tree portfast default. Default is False\n bpdugaurd ('boolean', optional) : Configure spanning-tree portfast bpduguard. Default is False\n bpdufilter ('boolean', optional) : Configure spanning-tree bpdufilter default. Default is False\n mode ('str', optional) : Portfast mode. Default is edge\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.cat9k.c9500.spanning_tree.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "model": "c9500" + }, + "uid": "configure_spanning_tree_portfast", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9500/spanning_tree/configure.py#L14" + }, "c9610": { "doc": " Configures Spanning Tree Portfast\n Args:\n device ('obj') : device to use\n default ('boolean', optional) : Configure spanning-tree portfast default. Default is False\n bpdugaurd ('boolean', optional) : Configure spanning-tree portfast bpduguard. Default is False\n bpdufilter ('boolean', optional) : Configure spanning-tree bpdufilter default. Default is False\n mode ('str', optional) : Portfast mode. Default is edge\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.cat9k.c9610.spanning_tree.configure", @@ -21373,7 +21747,7 @@ "os": "iosxe" }, "uid": "configure_stack_power_auto_off", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5705" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5706" } } }, @@ -21387,7 +21761,7 @@ "os": "iosxe" }, "uid": "configure_stack_power_default_mode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1977" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1978" } } }, @@ -21401,7 +21775,7 @@ "os": "iosxe" }, "uid": "configure_stack_power_ecomode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5610" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5611" } } }, @@ -21415,7 +21789,7 @@ "os": "iosxe" }, "uid": "configure_stack_power_mode_power_shared", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3530" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3531" } } }, @@ -21429,7 +21803,7 @@ "os": "iosxe" }, "uid": "configure_stack_power_mode_redundant", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1929" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1930" } } }, @@ -21443,7 +21817,7 @@ "os": "iosxe" }, "uid": "configure_stack_power_switch", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2632" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2633" } } }, @@ -21457,7 +21831,7 @@ "os": "iosxe" }, "uid": "configure_stack_power_switch_no_standalone", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3507" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3508" } } }, @@ -21471,7 +21845,7 @@ "os": "iosxe" }, "uid": "configure_stack_power_switch_power_priority", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3340" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3341" } } }, @@ -21485,7 +21859,7 @@ "os": "iosxe" }, "uid": "configure_stack_power_switch_standalone", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3485" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3486" } } }, @@ -21499,7 +21873,7 @@ "os": "iosxe" }, "uid": "configure_stackpower_stack", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4430" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4431" } } }, @@ -21513,7 +21887,7 @@ "os": "iosxe" }, "uid": "configure_stackpower_stack_switch_standalone", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3431" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3432" } } }, @@ -21849,7 +22223,7 @@ "os": "iosxe" }, "uid": "configure_switch_provision_model", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2997" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2998" } } }, @@ -22185,7 +22559,7 @@ "os": "iosxe" }, "uid": "configure_system_disable_password_recovery_switch_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1296" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1297" } } }, @@ -22199,7 +22573,7 @@ "os": "iosxe" }, "uid": "configure_system_ignore_startupconfig_switch_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1187" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1188" } } }, @@ -22529,6 +22903,20 @@ } } }, + "configure_traffic_class_for_class_map": { + "folders": { + "iosxe": { + "doc": " Configure traffic-class for class-map on device\n Args:\n device ('obj'): device to use\n class_map_name ('str'): Class-map name\n matching_statement ('str') : matching statements under the classmap (match-any/match-all)\n traffic_class_value ('int'): Traffic Class value from 0 to 7\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.policy_class_map.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_traffic_class_for_class_map", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_class_map/configure.py#L115" + } + } + }, "configure_traffic_eng_passive_interface": { "folders": { "iosxe": { @@ -22693,7 +23081,7 @@ "os": "iosxe" }, "uid": "configure_udld_aggressive", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2480" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2481" } } }, @@ -22735,7 +23123,7 @@ "os": "iosxe" }, "uid": "configure_udld_message_time", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2497" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2498" } } }, @@ -22749,7 +23137,7 @@ "os": "iosxe" }, "uid": "configure_udld_port_aggressive", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2533" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2534" } } }, @@ -22868,14 +23256,14 @@ "configure_vfi_context_evpn": { "folders": { "iosxe": { - "doc": " Configure vfi context evpn\n Args:\n device ('obj'): Device object\n word('str'): Virtual Forwarding Instance (VFI) name\n id('int'): VPN id\n ethernet_segment('str'): Ethernet segment\n value('int'): <1-65535> Ethernet segment local discriminator value\n ip_address('int',optional): A.B.C.D IP address of the peer , default value is None\n vc_id('str',optional): <1-4294967295> Enter VC ID value , default value is None\n encapsulation('str',optional): Data encapsulation method , default value is None\n mpls('str',optional): Use MPLS encapsulation , default value is None\n temp('str',optional): Template to use for encapsulation and protocol configuration , default value is None\n temp_name('str',optional): WORD template name (Max size 32) , default value is None\n \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Configure vfi context evpn\n Args:\n device ('obj'): Device object\n word('str'): Virtual Forwarding Instance (VFI) name\n id('int'): VPN id\n ethernet_segment('str'): Ethernet segment\n value('int'): <1-65535> Ethernet segment local discriminator value\n ip_address('int',optional): A.B.C.D IP address of the peer , default value is None\n vc_id('str',optional): <1-4294967295> Enter VC ID value , default value is None\n encapsulation('str',optional): Data encapsulation method , default value is None\n mpls('str',optional): Use MPLS encapsulation , default value is None\n temp('str',optional): Template to use for encapsulation and protocol configuration , default value is None\n temp_name('str',optional): WORD template name (Max size 32) , default value is None\n\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_vfi_context_evpn", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1156" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1360" } } }, @@ -22889,7 +23277,7 @@ "os": "iosxe" }, "uid": "configure_virtual_service", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1591" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1592" } } }, @@ -22903,7 +23291,7 @@ "os": "iosxe" }, "uid": "configure_virtual_service_vnic_gateway_guest_ip_address", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L871" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L872" } } }, @@ -22977,6 +23365,20 @@ } } }, + "configure_vlan_service_instance_bd_association": { + "folders": { + "iosxe": { + "doc": "Configure configure VLAN Service Instance Association to EVPN instance\n Args:\n device ('obj'): Device object\n bd_id ('int'): bridge-domain id\n vlan_instance('str'): VLAN Instance\n service_instance('int'): Service Instance Id\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.evpn.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_vlan_service_instance_bd_association", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L986" + } + } + }, "configure_vlan_shutdown": { "folders": { "iosxe": { @@ -23461,7 +23863,7 @@ "os": "iosxe" }, "uid": "copy_file_with_scp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4940" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4941" } } }, @@ -23475,7 +23877,7 @@ "os": "iosxe" }, "uid": "copy_file_with_sftp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4852" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4853" } } }, @@ -23566,7 +23968,7 @@ "os": "iosxe" }, "uid": "copy_running_config_to_tftp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L737" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L738" } } }, @@ -23580,7 +23982,7 @@ "os": "iosxe" }, "uid": "copy_startup_config_from_flash", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3770" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3771" } } }, @@ -23594,7 +23996,7 @@ "os": "iosxe" }, "uid": "copy_startup_config_to_flash_memory", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L673" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L674" } } }, @@ -23608,7 +24010,7 @@ "os": "iosxe" }, "uid": "copy_startup_config_to_tftp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L702" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L703" } } }, @@ -25054,7 +25456,7 @@ "os": "iosxe" }, "uid": "enable_bgp_forwarding", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1439" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1512" } } }, @@ -25544,7 +25946,7 @@ "os": "iosxe" }, "uid": "enable_multicast_advertise_on_evi", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L602" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L629" } } }, @@ -26682,7 +27084,7 @@ "execute_event_manager_run_with_reload": { "folders": { "iosxe": { - "doc": " Execute event manager with Embedded Event Manager policy name \n Args:\n device ('obj'): device to use\n embedded_event_name ('str'): Embedded Event Manager policy name \n username ('str'): username \n password ('str'): password \n sleep_time : sleep time\n Returns:\n True if reload successful else False\n Raises:\n SubCommandFailure\n ", + "doc": " Execute event manager with Embedded Event Manager policy name\n Args:\n device ('obj'): device to use\n embedded_event_name ('str'): Embedded Event Manager policy name\n username ('str'): username\n password ('str'): password\n sleep_time : sleep time\n Returns:\n True if reload successful else False\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.platform.execute", "package": "genie.libs.sdk.apis", "tokens": { @@ -26997,7 +27399,7 @@ "os": "iosxe" }, "uid": "execute_issu_set_rollback_timer", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6177" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6178" } } }, @@ -27071,6 +27473,20 @@ } } }, + "execute_monitor_capture_access_list": { + "folders": { + "iosxe": { + "doc": "\n Execute monitor capture {capture_name} access-list {access_list_name}\n Example: monitor capture test access-list MYACLV6\n Args:\n device ('obj'): Device Object\n capture_name ('str'): Name of Capture\n access_list_name ('str'): Access list name\n ", + "module_name": "iosxe.flow.execute", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "execute_monitor_capture_access_list", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/execute.py#L141" + } + } + }, "execute_monitor_capture_class_map": { "folders": { "iosxe": { @@ -27113,6 +27529,20 @@ } } }, + "execute_monitor_capture_limit_duration": { + "folders": { + "iosxe": { + "doc": "\n Execute monitor capture {capture_name} limit duration {duration}\n Example: monitor capture test limit duration 40\n Args:\n device ('obj'): Device Object\n capture_name ('str'): Name of Capture\n duration ('int'): Duration in Seconds : Min 1 - Max 1000000\n ", + "module_name": "iosxe.flow.execute", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "execute_monitor_capture_limit_duration", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/execute.py#L125" + } + } + }, "execute_monitor_capture_start_capture_filter": { "folders": { "iosxe": { @@ -27127,6 +27557,20 @@ } } }, + "execute_monitor_capture_vlan_in_match_any": { + "folders": { + "iosxe": { + "doc": "\n Execute monitor capture {capture_name} vlan {vlan_id} in match any\n Example: monitor capture test vlan 33 in match any\n Args:\n device ('obj'): Device Object\n capture_name ('str'): Name of Capture\n vlan_id ('int'): Vlan ID\n ", + "module_name": "iosxe.flow.execute", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "execute_monitor_capture_vlan_in_match_any", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/execute.py#L157" + } + } + }, "execute_more_file": { "folders": { "iosxe": { @@ -27628,6 +28072,20 @@ } } }, + "execute_test_fru_fake_insert": { + "folders": { + "iosxe": { + "doc": " \n Args:\n device ('obj'): device to use \n mode ('str'): mode active/standby\n Returns:\n Return the test command execution output\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.interface.execute", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "execute_test_fru_fake_insert", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/execute.py#L132" + } + } + }, "execute_test_idprom_fake_insert": { "folders": { "iosxe": { @@ -31095,7 +31553,7 @@ "get_interface_media_types": { "folders": { "iosxe": { - "doc": " Get interface media types\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n\n Returns:\n None\n media types (`str`): Example: '10/100/1000BaseTX' , '100/1000/2.5GBaseTX' ,'100/1000/10GBaseTX - interface media \n type supporting copper connection.\n Example: '1000BaseSX', '1000BaseEX'- interface media type is supporting fiber connection.\n 'unknown' - interface type is unknown.\n Raises:\n None\n ", + "doc": " Get interface media types\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n\n Returns:\n None\n media types (`str`): Example: '10/100/1000BaseTX' , '100/1000/2.5GBaseTX' ,'100/1000/10GBaseTX - interface media\n type supporting copper connection.\n Example: '1000BaseSX', '1000BaseEX'- interface media type is supporting fiber connection.\n 'unknown' - interface type is unknown.\n Raises:\n None\n ", "module_name": "iosxe.interface.get", "package": "genie.libs.sdk.apis", "tokens": { @@ -31508,6 +31966,20 @@ } } }, + "get_interface_traffic_packet_counters": { + "folders": { + "iosxe": { + "doc": " Get interface traffic packet counters\n\n Args:\n api (`obj`): Device object\n interface (`str`): Interface name\n counter_fields (`list`): List of counter fields to get\n\n Returns:\n packet_counters (`dict`): Dictionary containing packet counters\n\n Raises:\n None\n ", + "module_name": "iosxe.interface.get", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "get_interface_traffic_packet_counters", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/get.py#L1572" + } + } + }, "get_interface_traffic_stats": { "folders": { "junos": { @@ -31645,7 +32117,7 @@ "get_interfaces_switchport_state": { "folders": { "iosxe": { - "doc": " Get interface switchport state of an interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n\n Returns:\n None\n switchport_enable state: (`bool`): if switchport is enabled return True\n switchport is disabled return False \n \n Raises:\n None\n ", + "doc": " Get interface switchport state of an interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n\n Returns:\n None\n switchport_enable state: (`bool`): if switchport is enabled return True\n switchport is disabled return False\n\n Raises:\n None\n ", "module_name": "iosxe.interface.get", "package": "genie.libs.sdk.apis", "tokens": { @@ -31673,7 +32145,7 @@ "get_interfaces_transceiver_supported_dom": { "folders": { "iosxe": { - "doc": "Get the corresponding DOM type for the list of transceivers \n\n Args:\n device (`obj`): Device object\n transceivers_list (`list`): List of transceivers to get the DOM type\n \n Returns:\n dom_value ('dict'): Digital Optical Monitoring value of the supported transceiver\n ", + "doc": "Get the corresponding DOM type for the list of transceivers\n\n Args:\n device (`obj`): Device object\n transceivers_list (`list`): List of transceivers to get the DOM type\n\n Returns:\n dom_value ('dict'): Digital Optical Monitoring value of the supported transceiver\n ", "module_name": "iosxe.interface.get", "package": "genie.libs.sdk.apis", "tokens": { @@ -37207,7 +37679,7 @@ "os": "iosxe" }, "uid": "hw_module_beacon_RP_active_standby", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4533" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4534" } } }, @@ -37221,7 +37693,7 @@ "os": "iosxe" }, "uid": "hw_module_beacon_rp_active_standby_status", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4548" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4549" } } }, @@ -37235,7 +37707,7 @@ "os": "iosxe" }, "uid": "hw_module_beacon_rp_status", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L469" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L470" } } }, @@ -37249,7 +37721,7 @@ "os": "iosxe" }, "uid": "hw_module_beacon_rp_toggle", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L454" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L455" } } }, @@ -37263,7 +37735,7 @@ "os": "iosxe" }, "uid": "hw_module_beacon_slot_on_off", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L424" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L425" } } }, @@ -37277,7 +37749,7 @@ "os": "iosxe" }, "uid": "hw_module_beacon_slot_status", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L439" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L440" } } }, @@ -38375,6 +38847,14 @@ "uid": "load_dict_from_json_file", "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2822" }, + "load_image": { + "doc": " Load image template\n Args:\n Renders the clean template and uses it to call clean. A clean template is JSON\n data which can have placeholders for data which the user needs to\n provide when calling this API. Similar to how Python functions\n can have keyword arguments with default values, default arguments\n may also be defined for a clean template. These are stored in\n a Python dictionary whose variable name should follow this\n convention: {template_name}_ARGS\n Shortened example:\n ```python\n from genie.conf.base.api import OPTIONAL, REQUIRED\n MY_TEMPLATE = {\n \"order\": [\n \"connect\",\n \"apply_configuration\",\n \"ping_server\",\n \"copy_to_device\",\n ],\n \"images\": r\"%CLEANARG{images}\",\n \"connect\": {},\n \"apply_configuration\": {\n \"configuration\": r\"%CLEANARG{config_str}\",\n },\n \"ping_server\": {\n \"server\": \"%CLEANARG{server}\",\n \"vrf\": \"%CLEANARG{vrf}\",\n },\n \"copy_to_device\": {\n \"overwrite\": r\"%CLEANARG{overwrite}\",\n \"origin\": {\n \"hostname\": \"%CLEANARG{server}\",\n },\n \"vrf\": \"%CLEANARG{vrf}\",\n },\n }\n\n MY_TEMPLATE_ARGS = {\n \"vrf\": \"management\", # argument with default which user can override\n \"server\": REQUIRED, # required argument which user must provide\n \"overwrite\": OPTIONAL, # optional argument\n \"config_str\": REQUIRED,\n \"images\": REQUIRED,\n }\n\n ```\n Arguments:\n 1. device: device object\n 2. template_name: which clean template to use, or None to not use any\n clean template\n 3. template_override: optionally override data in clean template. This\n is done with a recursive dictionary update.\n Example:\n ```python\n # template assumes config string is being provided. We want\n # to use a config file\n config_file_location = \"...\"\n override = {\"apply_configuration\": {\"file\": config_file_location}}\n dev.api.clean(template_name=\"MY_TEMPLATE\", template_override=config_file_location)\n ```\n 4. kwargs: arguments which are substituted into the template.\n Example:\n ```python\n dev.api.clean(\n template_name=\"MY_TEMPLATE\",\n vrf=\"Mgmt\",\n server=\"10.10.10.10\",\n images={\n \"server\": [...],\n \"kickstart\": [...],\n }\n ...\n )\n ```\n vrf, server and config_str are all kwargs, and will be substituted into\n the MY_TEMPLATE template to render the clean YAML that is used when\n invoking clean\n ", + "folders": {}, + "module_name": "utils", + "package": "genie.libs.sdk.apis", + "uid": "load_image", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4595" + }, "load_jinja": { "doc": "Use Jinja templates to build the device configuration\n\n Args:\n device (`obj`): Device object\n vrf_name (`str`): Vrf name to be used in configuration\n bandwidth (`int`): In bps, bandwidth for traffic flow\n packet_size (`int`): Config packet size\n ref_packet_size (`int`): Refrenced packet size\n time_interval (`float`): In seconds, used for calculating bc\n ipp4_bps (`int`): In bps, bandwidth for IPP4 traffic\n ipp2_bw_percent (`int`): In percents, bandwidth for IPP2 traffic\n ipp0_bw_percent (`int`): In percents, bandwidth for IPP0 traffic\n interface (`str`): Where to apply the configured policies\n\n Returns:\n out\n ", "folders": {}, @@ -38729,6 +39209,20 @@ } } }, + "platform_software_fed_switch_phy_options": { + "folders": { + "iosxe": { + "doc": "\n Execute 'test platform software fed switch' command with the specified parameters.\n\n Args:\n device (obj): Device object\n mode(str) : 'active'\n lpn (int): Local Port Number value (1-96)\n phy_info (int): Phy mode (0-1)\n read_mode (str): read,write,dump\n phy_mode(int) : <0-1> 0/1 - Mode - Mdio clause 22/45\n phy_side (int): Phy line/system side (0-1)\n phy_device_id (int): Phy device_id (0-255)\n phy_page_number (int): Phy page number (0-65535)\n phy_register_address (int): Phy register address (0-65535)\n\n Returns:\n str: Output of the command\n Raises:\n SubCommandFailure: Failed executing the command\n ", + "module_name": "iosxe.platform.execute", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "platform_software_fed_switch_phy_options", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1785" + } + } + }, "poe_enabled_p4": { "folders": { "iosxe": { @@ -38767,7 +39261,7 @@ "os": "iosxe" }, "uid": "power_supply_on_off", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2097" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2098" } } }, @@ -38863,7 +39357,7 @@ "os": "iosxe" }, "uid": "redistribute_bgp_metric_route_map_under_ospf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1873" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1924" } } }, @@ -38891,7 +39385,7 @@ "os": "iosxe" }, "uid": "redistribute_bgp_on_ospfv3", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2680" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2731" } } }, @@ -38919,7 +39413,7 @@ "os": "iosxe" }, "uid": "redistribute_eigrp_under_ospf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1595" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1646" } } }, @@ -38933,7 +39427,7 @@ "os": "iosxe" }, "uid": "redistribute_route_map_under_ospf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L819" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L870" } } }, @@ -38947,7 +39441,7 @@ "os": "iosxe" }, "uid": "redistribute_route_metric_vrf_green", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2652" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2703" } } }, @@ -39017,7 +39511,7 @@ "os": "iosxe" }, "uid": "remove_bgp_configuration", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L853" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L922" } } }, @@ -39761,7 +40255,7 @@ "os": "iosxe" }, "uid": "request_platform_software_package_clean", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1871" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1872" } } }, @@ -39903,7 +40397,7 @@ "os": "iosxe" }, "uid": "restore_running_config_file", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3592" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3593" } } }, @@ -40102,7 +40596,7 @@ "send_break_boot": { "folders": { "iosxe": { - "doc": " Connects to the device, waits for the (console or grub) activity pattern and\n sends break boot character to interrupt boot. Device is expected to reach rommon state.\n\n Args:\n device ('obj'): Device object\n console_activity_pattern (str): Pattern to send the break at. Default to match\n this boot statement: \"....\"\n console_breakboot_char (str): Character to send when console_activity_pattern is matched. Default to '\u0003'.\n console_breakboot_telnet_break (bool): Use telnet `send break` to interrupt device boot. \n grub_activity_pattern (str): Break pattern on the device for grub boot mode\n grub_breakboot_char (str): Character to send when grub_activity_pattern is matched\n break_count (int, optional): Number of break commands to send. Defaults to 2.\n timeout (int, optional): Break boot process timeout. Defaults to 60.\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Connects to the device, waits for the (console or grub) activity pattern and\n sends break boot character to interrupt boot. Device is expected to reach rommon state.\n\n Args:\n device ('obj'): Device object\n console_activity_pattern (str): Pattern to send the break at. Default to match\n this boot statement: \"....\"\n console_breakboot_char (str): Character to send when console_activity_pattern is matched. Default to '\u0003'.\n console_breakboot_telnet_break (bool): Use telnet `send break` to interrupt device boot.\n grub_activity_pattern (str): Break pattern on the device for grub boot mode\n grub_breakboot_char (str): Character to send when grub_activity_pattern is matched\n break_count (int, optional): Number of break commands to send. Defaults to 2.\n timeout (int, optional): Break boot process timeout. Defaults to 60.\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "folders": { "asr1k": { "doc": " Connects to the device, waits for the (console or grub) activity pattern and\n sends break boot character to interrupt boot. Device is expected to reach rommon state.\n Args:\n device ('obj'): Device object\n console_activity_pattern (str): Pattern to send the break at. Default to match\n this boot statement - Preparing to autoboot. [Press Ctrl-C to interrupt]\n console_breakboot_char (str): Character to send when console_activity_pattern is matched. Default to '\u0003'.\n console_breakboot_telnet_break (bool): Use telnet `send break` to interrupt device boot. \n grub_activity_pattern (str): Break pattern on the device for grub boot mode\n grub_breakboot_char (str): Character to send when grub_activity_pattern is matched\n break_count (int, optional): Number of break commands to send. Defaults to 2.\n timeout (int, optional): Break boot process timeout. Defaults to 60.\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -40131,7 +40625,7 @@ "os": "iosxe" }, "uid": "send_break_boot", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rommon/utils.py#L93" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rommon/utils.py#L108" } } }, @@ -40475,7 +40969,7 @@ "os": "iosxe" }, "uid": "stack_ports_enable_disable", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L486" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L487" } } }, @@ -40728,28 +41222,28 @@ "test_platform_software_fru_fake_insert_remove": { "folders": { "iosxe": { - "doc": "\n Execute 'test platform software fed switch {switch_num} fru {action}' command on the device.\n\n Args:\n device (obj): Device object\n switch_num (int): Slot or switch number\n action (str): Action to perform ('fake-insert' or 'fake-remove')\n \n Returns:\n str: Output of the command\n ", + "doc": "\n Execute 'test platform software fed switch {switch_num} fru {action}' command on the device.\n\n Args:\n device (obj): Device object\n switch_num (int): Slot or switch number\n action (str): Action to perform ('fake-insert' or 'fake-remove')\n\n Returns:\n str: Output of the command\n ", "module_name": "iosxe.platform.execute", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "test_platform_software_fru_fake_insert_remove", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1805" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1834" } } }, "test_platform_software_usb_fake_insert_remove": { "folders": { "iosxe": { - "doc": "\n Execute 'test platform software usb slot ' command on the device.\n\n Args:\n device (obj): Device object\n switch_num (int): Slot or switch number\n usbflash (str): USB flash identifier ('usbflash1' or 'usbflash2')\n action (str): Action to perform ('fake-insert' or 'fake-remove')\n \n Returns:\n str: Output of the command\n ", + "doc": "\n Execute 'test platform software usb slot ' command on the device.\n\n Args:\n device (obj): Device object\n switch_num (int): Slot or switch number\n usbflash (str): USB flash identifier ('usbflash1' or 'usbflash2')\n action (str): Action to perform ('fake-insert' or 'fake-remove')\n\n Returns:\n str: Output of the command\n ", "module_name": "iosxe.platform.execute", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "test_platform_software_usb_fake_insert_remove", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1785" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1814" } } }, @@ -41013,7 +41507,7 @@ "os": "iosxe" }, "uid": "unconfig_banner", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4281" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4282" } } }, @@ -41027,7 +41521,7 @@ "os": "iosxe" }, "uid": "unconfig_cns_agent_password", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4495" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4496" } } }, @@ -41734,7 +42228,7 @@ "unconfigure_aaa_accounting_identity_default_start_stop": { "folders": { "iosxe": { - "doc": "Unconfigure aaa accounting identity default start-stop\n Args:\n device (`obj`): Device object\n server_grp (`str`): Server-group (i.e group)\n server_grp_name ('str'): Server-group name\n Returns: \n None\n Raise:\n SubCommandFailure: Failed unconfiguring aaa accounting identity default start-stop\n ", + "doc": "Unconfigure aaa accounting identity default start-stop\n Args:\n device (`obj`): Device object\n server_grp (`str`): Server-group (i.e group)\n server_grp_name ('str'): Server-group name\n Returns:\n None\n Raise:\n SubCommandFailure: Failed unconfiguring aaa accounting identity default start-stop\n ", "module_name": "iosxe.aaa.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -41762,7 +42256,7 @@ "unconfigure_aaa_accounting_update": { "folders": { "iosxe": { - "doc": "Unconfigure aaa accounting update periodic\n Args:\n device (`obj`): Device object\n action_type('str'): newinfo Only send accounting update records when we have new acct info.\n periodic Send accounting update records at regular intervals.\n\t periodic_interval('str'): <1-71582> Periodic intervals to send accounting update records(in minutes)\n Returns: \n None\n Raise:\n SubCommandFailure: Failed unconfigure aaa accounting update periodic\n ", + "doc": "Unconfigure aaa accounting update periodic\n Args:\n device (`obj`): Device object\n action_type('str'): newinfo Only send accounting update records when we have new acct info.\n periodic Send accounting update records at regular intervals.\n\t periodic_interval('str'): <1-71582> Periodic intervals to send accounting update records(in minutes)\n Returns:\n None\n Raise:\n SubCommandFailure: Failed unconfigure aaa accounting update periodic\n ", "module_name": "iosxe.aaa.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -41937,7 +42431,7 @@ "os": "iosxe" }, "uid": "unconfigure_absolute_time_range", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5125" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5126" } } }, @@ -42175,7 +42669,7 @@ "os": "iosxe" }, "uid": "unconfigure_archive_logging", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L538" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L539" } } }, @@ -42189,7 +42683,7 @@ "os": "iosxe" }, "uid": "unconfigure_archive_maximum", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2230" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2231" } } }, @@ -42203,7 +42697,7 @@ "os": "iosxe" }, "uid": "unconfigure_archive_path", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2187" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2188" } } }, @@ -42217,7 +42711,7 @@ "os": "iosxe" }, "uid": "unconfigure_archive_rollback", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2276" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2277" } } }, @@ -42231,7 +42725,7 @@ "os": "iosxe" }, "uid": "unconfigure_archive_time_period", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2327" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2328" } } }, @@ -42245,7 +42739,7 @@ "os": "iosxe" }, "uid": "unconfigure_archive_write_memory", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2368" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2369" } } }, @@ -42511,7 +43005,7 @@ "os": "iosxe" }, "uid": "unconfigure_bba_group", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L154" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L155" } } }, @@ -42567,7 +43061,7 @@ "os": "iosxe" }, "uid": "unconfigure_bgp_auto_summary", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2073" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2152" } } }, @@ -42581,7 +43075,7 @@ "os": "iosxe" }, "uid": "unconfigure_bgp_log_neighbor_changes", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2029" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2108" } } }, @@ -42595,7 +43089,7 @@ "os": "iosxe" }, "uid": "unconfigure_bgp_neighbor_activate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1516" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1589" } } }, @@ -42609,7 +43103,7 @@ "os": "iosxe" }, "uid": "unconfigure_bgp_neighbor_remote_as", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1560" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1633" } } }, @@ -42623,7 +43117,7 @@ "os": "iosxe" }, "uid": "unconfigure_bgp_neighbor_send_community", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1462" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1535" } } }, @@ -42637,7 +43131,7 @@ "os": "iosxe" }, "uid": "unconfigure_bgp_redistribute_internal", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2222" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2301" } } }, @@ -42651,7 +43145,7 @@ "os": "iosxe" }, "uid": "unconfigure_bgp_redistribute_static", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2559" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2638" } } }, @@ -42665,7 +43159,7 @@ "os": "iosxe" }, "uid": "unconfigure_boot_manual_switch", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4183" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4184" } } }, @@ -42679,7 +43173,7 @@ "os": "iosxe" }, "uid": "unconfigure_boot_system", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1275" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1276" } } }, @@ -42693,7 +43187,7 @@ "os": "iosxe" }, "uid": "unconfigure_boot_system_switch_switchnumber", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3556" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3557" } } }, @@ -42728,7 +43222,7 @@ "os": "iosxe" }, "uid": "unconfigure_bridge_domain", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4665" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4666" } } }, @@ -42742,7 +43236,7 @@ "os": "iosxe" }, "uid": "unconfigure_broadband_aaa", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L300" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L301" } } }, @@ -42756,7 +43250,7 @@ "os": "iosxe" }, "uid": "unconfigure_bulkstat_profile", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L963" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L964" } } }, @@ -42770,21 +43264,21 @@ "os": "iosxe" }, "uid": "unconfigure_call_admission", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L248" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L249" } } }, "unconfigure_call_home": { "folders": { "iosxe": { - "doc": " Unconfigures call-home\n Example : no call-home\n\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises: \n SubCommandFailure\n ", - "module_name": "iosxe.platform_licensing.configure", + "doc": " Unconfigures call-home\n Example : no call-home\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises: \n SubCommandFailure\n ", + "module_name": "iosxe.call_home.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "unconfigure_call_home", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform_licensing/configure.py#L267" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/call_home/configure.py#L404" } } }, @@ -42926,7 +43420,7 @@ "os": "iosxe" }, "uid": "unconfigure_cdp_run", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5962" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5963" } } }, @@ -42996,7 +43490,7 @@ "os": "iosxe" }, "uid": "unconfigure_commands_from_template", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1816" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1817" } } }, @@ -43199,14 +43693,14 @@ "unconfigure_crypto_pki_server": { "folders": { "iosxe": { - "doc": "\n Configure crypto pki server\n Args:\n device ('obj'): Device object\n server_name ('str'): Name for the pki server\n ", - "module_name": "iosxe.pki.configure", + "doc": " Unconfigures crypto pki server on device\n\n Args:\n device (`obj`): Device object\n server_name ('str'): Name of the server\n\n Returns:\n None\n\n Raise:\n SubCommandFailure: Failed to unconfigure crypto pki server on device\n ", + "module_name": "iosxe.eaptls.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "unconfigure_crypto_pki_server", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L604" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L136" } } }, @@ -43435,7 +43929,7 @@ "os": "iosxe" }, "uid": "unconfigure_device_classifier", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L840" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L841" } } }, @@ -43449,7 +43943,7 @@ "os": "iosxe" }, "uid": "unconfigure_device_classifier_command", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3892" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3893" } } }, @@ -43463,7 +43957,7 @@ "os": "iosxe" }, "uid": "unconfigure_device_classifier_operator", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4098" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4099" } } }, @@ -43477,7 +43971,7 @@ "os": "iosxe" }, "uid": "unconfigure_device_classifier_profile", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4042" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4043" } } }, @@ -43491,7 +43985,7 @@ "os": "iosxe" }, "uid": "unconfigure_device_classifier_profile_command", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3935" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3936" } } }, @@ -43673,7 +44167,7 @@ "os": "iosxe" }, "uid": "unconfigure_diagnostic_monitor_interval_module", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6119" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6120" } } }, @@ -43687,7 +44181,7 @@ "os": "iosxe" }, "uid": "unconfigure_diagnostic_monitor_module", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6003" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6004" } } }, @@ -43701,7 +44195,7 @@ "os": "iosxe" }, "uid": "unconfigure_diagnostic_monitor_switch", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3246" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3247" } } }, @@ -43715,7 +44209,7 @@ "os": "iosxe" }, "uid": "unconfigure_diagnostic_monitor_syslog", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3874" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3875" } } }, @@ -43729,7 +44223,7 @@ "os": "iosxe" }, "uid": "unconfigure_diagnostic_schedule_module", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6062" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6063" } } }, @@ -43743,7 +44237,7 @@ "os": "iosxe" }, "uid": "unconfigure_diagnostic_schedule_switch", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3304" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3305" } } }, @@ -43757,7 +44251,7 @@ "os": "iosxe" }, "uid": "unconfigure_diagonistics_monitor_switch", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L366" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L367" } } }, @@ -43785,7 +44279,7 @@ "os": "iosxe" }, "uid": "unconfigure_distribute_prefix_list_under_ospf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1842" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1893" } } }, @@ -44191,7 +44685,7 @@ "os": "iosxe" }, "uid": "unconfigure_enable_secret_level", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4246" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4247" } } }, @@ -44205,7 +44699,7 @@ "os": "iosxe" }, "uid": "unconfigure_enable_secret_password", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3158" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3159" } } }, @@ -44261,7 +44755,7 @@ "os": "iosxe" }, "uid": "unconfigure_event_manager_applet", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2942" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2943" } } }, @@ -44282,7 +44776,7 @@ "unconfigure_evpn_evi_replication_type": { "folders": { "iosxe": { - "doc": " Config l2vpn evpn multicast advertise disable on evi\n Args:\n device (`obj`): Device object\n evi ('int'): evi id\n srvinst ('str'): service instance type\n vlan-based|vlan-bundle|vlan-aware\n rep_type ('str'): replication type \n static | ingress\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Config l2vpn evpn multicast advertise disable on evi\n Args:\n device (`obj`): Device object\n evi ('int'): evi id\n srvinst ('str'): service instance type\n vlan-based|vlan-bundle|vlan-aware\n rep_type ('str'): replication type\n static | ingress\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -44303,7 +44797,7 @@ "os": "iosxe" }, "uid": "unconfigure_evpn_floodsuppress_dhcprelay_disable_globally", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L933" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1069" } } }, @@ -44317,14 +44811,14 @@ "os": "iosxe" }, "uid": "unconfigure_evpn_instance", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L796" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L823" } } }, "unconfigure_evpn_instance_encapsulation_type": { "folders": { "iosxe": { - "doc": " Config l2vpn evpn replication type on evi\n Args:\n device (`obj`): Device object\n evi ('int'): evi id\n srvinst ('str'): service instance type\n vlan-based|vlan-bundle|vlan-aware\n encap_type ('str): encapsulation \n vxlan | mpls \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Config l2vpn evpn replication type on evi\n Args:\n device (`obj`): Device object\n evi ('int'): evi id\n srvinst ('str'): service instance type\n vlan-based|vlan-bundle|vlan-aware\n encap_type ('str): encapsulation\n vxlan | mpls\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -44338,14 +44832,14 @@ "unconfigure_evpn_instance_evi": { "folders": { "iosxe": { - "doc": " Unconfigure evpn instance evi\n Args:\n device ('obj'): Device object\n evi ('int'): evi id\n srv_inst ('str'): service instance type\n vlan-based|vlan-bundle|vlan-aware\n \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Unconfigure evpn instance evi\n Args:\n device ('obj'): Device object\n evi ('int'): evi id\n srv_inst ('str'): service instance type\n vlan-based|vlan-bundle|vlan-aware\n\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "unconfigure_evpn_instance_evi", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1126" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1262" } } }, @@ -44380,14 +44874,14 @@ "unconfigure_evpn_l2_instance_bd_association": { "folders": { "iosxe": { - "doc": " Configure configure VLAN association to EVPN instance\n Args:\n device ('obj'): Device object\n bd_id ('int'): bridge-domain id\n evpn_instance('int'): EVPN Instance id\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Unconfigure EVPN Instance association with bd\n Args:\n device ('obj'): Device object\n bd_id ('int'): bridge-domain id\n evpn_instance('int'): EVPN Instance id\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "unconfigure_evpn_l2_instance_bd_association", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L878" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L912" } } }, @@ -44405,6 +44899,20 @@ } } }, + "unconfigure_evpn_l2_profile_bd_association": { + "folders": { + "iosxe": { + "doc": " Unconfigure EVPN profile association with bd\n Args:\n device ('obj'): Device object\n bd_id ('int'): bridge-domain id\n evpn_name('str'): EVPN Instance Profile name\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.evpn.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_evpn_l2_profile_bd_association", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L962" + } + } + }, "unconfigure_evpn_l3_instance_vlan_association": { "folders": { "iosxe": { @@ -44419,10 +44927,24 @@ } } }, + "unconfigure_evpn_profile": { + "folders": { + "iosxe": { + "doc": " Unconfigure evpn profile\n Args:\n device ('obj'): Device object\n name ('str'): Name of the evpn profile\n srv_inst ('str'): service instance type\n vlan-bundle|vlan-aware\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.evpn.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_evpn_profile", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1332" + } + } + }, "unconfigure_evpn_replication_type": { "folders": { "iosxe": { - "doc": " Config l2vpn evpn instance\n Args:\n device (`obj`): Device object\n rep_type ('str'): replication type \n static | ingress\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Config l2vpn evpn instance\n Args:\n device (`obj`): Device object\n rep_type ('str'): replication type\n static | ingress\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -44447,6 +44969,20 @@ } } }, + "unconfigure_fast_rep_segment": { + "folders": { + "iosxe": { + "doc": "Unconfigures fastREP\n Args:\n device ('obj'): Switch object\n intfs ('list'): List of interfaces to unconfigure\n segmentnum ('int'): Segment number to unconfigure\n vlan ('str' 'optional'): Vlan to unconfigure\n edge_port ('bool' 'optional'): unconfigure edge port\n no_neighbor ('bool' 'optional'): unconfigure no neighbor\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.rep.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_fast_rep_segment", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rep/configure.py#L141" + } + } + }, "unconfigure_fec_on_interface": { "folders": { "iosxe": { @@ -44667,7 +45203,7 @@ "os": "iosxe" }, "uid": "unconfigure_global_source_template", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1743" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1744" } } }, @@ -44779,7 +45315,7 @@ "os": "iosxe" }, "uid": "unconfigure_hw_module_logging_onboard", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5178" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5179" } } }, @@ -44793,7 +45329,7 @@ "os": "iosxe" }, "uid": "unconfigure_hw_module_slot_breakout", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5799" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5800" } } }, @@ -44807,7 +45343,7 @@ "os": "iosxe" }, "uid": "unconfigure_hw_module_slot_logging_onboard_environment", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5265" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5266" } } }, @@ -44821,7 +45357,7 @@ "os": "iosxe" }, "uid": "unconfigure_hw_module_slot_logging_onboard_temperature", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5311" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5312" } } }, @@ -44835,7 +45371,7 @@ "os": "iosxe" }, "uid": "unconfigure_hw_module_slot_logging_onboard_voltage", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5219" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5220" } } }, @@ -44863,7 +45399,7 @@ "os": "iosxe" }, "uid": "unconfigure_hw_module_slot_upoe_plus", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5931" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5932" } } }, @@ -44877,7 +45413,7 @@ "os": "iosxe" }, "uid": "unconfigure_hw_module_switch_number_auto_off_led", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5687" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5688" } } }, @@ -44891,7 +45427,7 @@ "os": "iosxe" }, "uid": "unconfigure_hw_module_switch_number_ecomode_led", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5592" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5593" } } }, @@ -44919,7 +45455,7 @@ "os": "iosxe" }, "uid": "unconfigure_hw_switch_logging_onboard", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1456" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1457" } } }, @@ -44933,7 +45469,7 @@ "os": "iosxe" }, "uid": "unconfigure_hw_switch_switch_logging_onboard_environment", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1042" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1043" } } }, @@ -44947,7 +45483,7 @@ "os": "iosxe" }, "uid": "unconfigure_hw_switch_switch_logging_onboard_temperature", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1080" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1081" } } }, @@ -44961,7 +45497,7 @@ "os": "iosxe" }, "uid": "unconfigure_hw_switch_switch_logging_onboard_voltage", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1003" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1004" } } }, @@ -45169,7 +45705,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_VirtualPortGroup", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1679" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1680" } } }, @@ -45673,7 +46209,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_ospfv3_ipsec_ah", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2391" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2442" } } }, @@ -45687,7 +46223,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_ospfv3_ipsec_esp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2428" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2479" } } }, @@ -45803,6 +46339,62 @@ } } }, + "unconfigure_interface_rep_segment_edge_preferred": { + "folders": { + "iosxe": { + "doc": "Unconfigure REP Segment Edge Preferred on the device\n Args:\n device ('obj'): Device object\n interface ('str'): Interface name\n segment ('str'): Segment value\n Returns:\n None\n Raises:\n SubCommandFailure: Failed unconfiguring rep segment edge preferred\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_interface_rep_segment_edge_preferred", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10417" + } + } + }, + "unconfigure_interface_rep_segment_edge_primary": { + "folders": { + "iosxe": { + "doc": "Unconfigure REP Segment Edge Primary on the device\n Args:\n device ('obj'): Device object\n interface ('str'): Interface name\n segment ('str'): Segment value\n Returns:\n None\n Raises:\n SubCommandFailure: Failed unconfiguring rep segment edge primary\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_interface_rep_segment_edge_primary", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10461" + } + } + }, + "unconfigure_interface_rep_stcn_segment": { + "folders": { + "iosxe": { + "doc": "Unconfigure interface rep stcn segment\n Args:\n device ('obj'): Device object\n interface ('str'): Interface to configure\n Returns:\n None\n Raises:\n SubCommandFailure: Failed unconfiguring interface rep stcn segment\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_interface_rep_stcn_segment", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10345" + } + } + }, + "unconfigure_interface_rep_stcn_stp": { + "folders": { + "iosxe": { + "doc": "Unconfigure interface rep stcn stp\n Args:\n device ('obj'): Device object\n interface ('str'): Interface to configure\n Returns:\n None\n Raises:\n SubCommandFailure: Failed unconfiguring interface rep stcn stp\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_interface_rep_stcn_stp", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10379" + } + } + }, "unconfigure_interface_service_policy": { "folders": { "iosxe": { @@ -46121,7 +46713,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2515" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2516" } } }, @@ -47087,7 +47679,7 @@ "os": "iosxe" }, "uid": "unconfigure_ip_ospf_mtu_ignore", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1501" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1552" } } }, @@ -47185,7 +47777,7 @@ "os": "iosxe" }, "uid": "unconfigure_ip_prefix_list", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L948" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L999" } } }, @@ -47283,7 +47875,7 @@ "os": "iosxe" }, "uid": "unconfigure_ip_scp_password", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4768" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4769" } } }, @@ -47297,7 +47889,7 @@ "os": "iosxe" }, "uid": "unconfigure_ip_scp_server_enable", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5493" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5494" } } }, @@ -47311,7 +47903,7 @@ "os": "iosxe" }, "uid": "unconfigure_ip_scp_username", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4736" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4737" } } }, @@ -47325,7 +47917,7 @@ "os": "iosxe" }, "uid": "unconfigure_ip_sftp_password", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4800" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4801" } } }, @@ -47339,7 +47931,7 @@ "os": "iosxe" }, "uid": "unconfigure_ip_sftp_username", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4703" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4704" } } }, @@ -47367,7 +47959,7 @@ "os": "iosxe" }, "uid": "unconfigure_ip_source_binding", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4146" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4147" } } }, @@ -47381,7 +47973,7 @@ "os": "iosxe" }, "uid": "unconfigure_ip_ssh_source_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5518" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5519" } } }, @@ -47423,7 +48015,7 @@ "os": "iosxe" }, "uid": "unconfigure_ip_tftp_blocksize", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1498" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1499" } } }, @@ -48249,7 +48841,7 @@ "os": "iosxe" }, "uid": "unconfigure_ipv6_ospf_bfd", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1292" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1343" } } }, @@ -48263,7 +48855,7 @@ "os": "iosxe" }, "uid": "unconfigure_ipv6_ospf_mtu_ignore", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1350" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1401" } } }, @@ -48277,7 +48869,7 @@ "os": "iosxe" }, "uid": "unconfigure_ipv6_ospf_routing_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1414" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1465" } } }, @@ -48361,7 +48953,7 @@ "os": "iosxe" }, "uid": "unconfigure_ipv6_router_ospf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2701" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2752" } } }, @@ -48599,7 +49191,7 @@ "os": "iosxe" }, "uid": "unconfigure_issu_set_rollback_timer", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6195" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6196" } } }, @@ -48613,7 +49205,7 @@ "os": "iosxe" }, "uid": "unconfigure_key_config_key_password_encrypt", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3083" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3084" } } }, @@ -48634,7 +49226,7 @@ "unconfigure_l2vpn_evpn": { "folders": { "iosxe": { - "doc": " unconfig l2vpn evpn \n Args:\n device (`obj`): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " unconfig l2vpn evpn\n Args:\n device (`obj`): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -48655,14 +49247,14 @@ "os": "iosxe" }, "uid": "unconfigure_l2vpn_evpn_flooding_suppression", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L820" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L847" } } }, "unconfigure_l2vpn_evpn_router_id": { "folders": { "iosxe": { - "doc": " unconfig l2vpn evpn \n Args:\n device (`obj`): Device object\n interface ('str'): interface type \n loopback | physical\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " unconfig l2vpn evpn\n Args:\n device (`obj`): Device object\n interface ('str'): interface type\n loopback | physical\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -48795,7 +49387,7 @@ "os": "iosxe" }, "uid": "unconfigure_license_smart_reservation", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2727" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2728" } } }, @@ -48851,7 +49443,7 @@ "os": "iosxe" }, "uid": "unconfigure_line_vty", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3198" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3199" } } }, @@ -49154,7 +49746,7 @@ "unconfigure_mab_on_switchport_mode_access_interface": { "folders": { "iosxe": { - "doc": "api for configuring no mab on switchport mode access interface\n\n Args:\n device ('obj') : Device object\n interface ('str') : switchport mode access interface name \n Return:\n None\n Raise:\n SubCommandFailure: failed to configure no mab on switchport mode access interface\n ", + "doc": "api for configuring no mab on switchport mode access interface\n\n Args:\n device ('obj') : Device object\n interface ('str') : switchport mode access interface name\n Return:\n None\n Raise:\n SubCommandFailure: failed to configure no mab on switchport mode access interface\n ", "module_name": "iosxe.aaa.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -49362,7 +49954,7 @@ "os": "iosxe" }, "uid": "unconfigure_macro_auto_global_processing", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3677" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3678" } } }, @@ -49376,7 +49968,7 @@ "os": "iosxe" }, "uid": "unconfigure_macro_auto_global_processing_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3641" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3642" } } }, @@ -49390,7 +49982,7 @@ "os": "iosxe" }, "uid": "unconfigure_macro_auto_processing_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3818" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3819" } } }, @@ -49404,7 +49996,7 @@ "os": "iosxe" }, "uid": "unconfigure_macro_auto_sticky", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L791" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L792" } } }, @@ -49474,7 +50066,7 @@ "os": "iosxe" }, "uid": "unconfigure_mdix_auto", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4223" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4224" } } }, @@ -49747,14 +50339,14 @@ "unconfigure_mdt_config_on_vrf": { "folders": { "iosxe": { - "doc": " unconfigure mdt bgp autodiscovery or mdt default group or mdt overlay protocol on VRF\n Args:\n device ('obj'): Device object\n vrfname ('str'): VRF Name \n addressfamily ('str'): Address family ipv4 or ipv6\n mdtparam1 ('str'): \"auto-discovery\" for BGP auto-discovery for MVPN,\n \"default\" for the default group,\"overlay\" for MDT Overlay Protocol \n mdtparam2 ('str'): \"vxlan\" for BGP auto-discovery for MVPN and default group,\"use-bgp\" for MDT Overlay Protocol\n mdtparam3 ('str', optional): no values needed for BGP auto-discovery for MVPN, \n \"IP address\" for default group,\"spt-only\" for MDT Overlay Protocol\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " unconfigure mdt bgp autodiscovery or mdt default group or mdt overlay protocol on VRF\n Args:\n device ('obj'): Device object\n vrfname ('str'): VRF Name\n addressfamily ('str'): Address family ipv4 or ipv6\n mdtparam1 ('str'): \"auto-discovery\" for BGP auto-discovery for MVPN,\n \"default\" for the default group,\"overlay\" for MDT Overlay Protocol\n mdtparam2 ('str'): \"vxlan\" for BGP auto-discovery for MVPN and default group,\"use-bgp\" for MDT Overlay Protocol\n mdtparam3 ('str', optional): no values needed for BGP auto-discovery for MVPN,\n \"IP address\" for default group,\"spt-only\" for MDT Overlay Protocol\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "unconfigure_mdt_config_on_vrf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1045" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1181" } } }, @@ -49810,7 +50402,7 @@ "os": "iosxe" }, "uid": "unconfigure_medium_p2p_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10284" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10307" } } }, @@ -50300,7 +50892,7 @@ "os": "iosxe" }, "uid": "unconfigure_neighbor_under_ospf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1759" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1810" } } }, @@ -50412,7 +51004,7 @@ "os": "iosxe" }, "uid": "unconfigure_nve_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L551" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L578" } } }, @@ -50426,7 +51018,7 @@ "os": "iosxe" }, "uid": "unconfigure_nve_interface_group_based_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L684" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L711" } } }, @@ -50454,7 +51046,7 @@ "os": "iosxe" }, "uid": "unconfigure_ospf_area_type", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1621" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1672" } } }, @@ -50468,7 +51060,7 @@ "os": "iosxe" }, "uid": "unconfigure_ospf_cost", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1940" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1991" } } }, @@ -50482,7 +51074,7 @@ "os": "iosxe" }, "uid": "unconfigure_ospf_from_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2011" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2062" } } }, @@ -50496,7 +51088,7 @@ "os": "iosxe" }, "uid": "unconfigure_ospf_network_non_broadcast", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1699" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1750" } } }, @@ -50510,7 +51102,7 @@ "os": "iosxe" }, "uid": "unconfigure_ospf_on_device", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L921" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L972" } } }, @@ -50538,7 +51130,7 @@ "os": "iosxe" }, "uid": "unconfigure_ospf_vrf_on_device", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1153" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1204" } } }, @@ -50552,7 +51144,7 @@ "os": "iosxe" }, "uid": "unconfigure_ospfv3", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L616" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L667" } } }, @@ -50580,7 +51172,7 @@ "os": "iosxe" }, "uid": "unconfigure_ospfv3_ipsec_ah", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2272" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2323" } } }, @@ -50594,7 +51186,7 @@ "os": "iosxe" }, "uid": "unconfigure_ospfv3_ipsec_esp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2309" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2360" } } }, @@ -50608,7 +51200,7 @@ "os": "iosxe" }, "uid": "unconfigure_ospfv3_network", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1234" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1285" } } }, @@ -50654,6 +51246,20 @@ } } }, + "unconfigure_parser_view": { + "folders": { + "iosxe": { + "doc": "\" Unconfigure Parser view\n\n Args:\n device ('obj'): Device object\n view_name ('str'): View name\n Raises:\n SubCommandFailure\n Returns:\n None\n ", + "module_name": "iosxe.platform.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_parser_view", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6298" + } + } + }, "unconfigure_pbr_route_map": { "folders": { "iosxe": { @@ -50678,7 +51284,7 @@ "os": "iosxe" }, "uid": "unconfigure_periodic_time_range", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5059" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5060" } } }, @@ -50776,7 +51382,7 @@ "os": "iosxe" }, "uid": "unconfigure_platform_acl_egress_dscp_enable", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5830" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5831" } } }, @@ -50790,7 +51396,7 @@ "os": "iosxe" }, "uid": "unconfigure_platform_mgmt_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6159" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6160" } } }, @@ -50804,7 +51410,7 @@ "os": "iosxe" }, "uid": "unconfigure_platform_qos_port_channel_aggregate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L199" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L200" } } }, @@ -50888,7 +51494,7 @@ "os": "iosxe" }, "uid": "unconfigure_policy_map_control_service_temp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5899" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5900" } } }, @@ -50948,6 +51554,20 @@ } } }, + "unconfigure_port_channel": { + "folders": { + "iosxe": { + "doc": " Unconfigure port-channel ip address on port-channel interface\n Args:\n device ('obj'): Device object\n port_channel ('str'): Port-channel number for the Port-channel interface\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_port_channel", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10519" + } + } + }, "unconfigure_port_channel_ip": { "folders": { "iosxe": { @@ -51060,6 +51680,20 @@ } } }, + "unconfigure_ppp_multilink": { + "folders": { + "iosxe": { + "doc": " Configure no ppp multilink on interface\n Args:\n device ('obj'): Device object\n interface ('str'): which interface to configure\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring no ppp multilink on interface\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_ppp_multilink", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10499" + } + } + }, "unconfigure_pppoe_enable_interface": { "folders": { "iosxe": { @@ -51084,7 +51718,7 @@ "os": "iosxe" }, "uid": "unconfigure_process_cpu_statistics_limit_entry_percentage_size", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3752" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3753" } } }, @@ -51098,7 +51732,7 @@ "os": "iosxe" }, "uid": "unconfigure_process_cpu_threshold_type_rising_interval", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3714" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3715" } } }, @@ -51420,7 +52054,7 @@ "os": "iosxe" }, "uid": "unconfigure_qfp_drop_threshold", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5457" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5458" } } }, @@ -51616,7 +52250,7 @@ "os": "iosxe" }, "uid": "unconfigure_redestribute_ospf_metric_in_bgp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2266" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2345" } } }, @@ -51630,7 +52264,7 @@ "os": "iosxe" }, "uid": "unconfigure_redistribute_eigrp_under_ospf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1644" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1695" } } }, @@ -51658,7 +52292,35 @@ "os": "iosxe" }, "uid": "unconfigure_rep_admin_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4834" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4835" + } + } + }, + "unconfigure_rep_segment": { + "folders": { + "iosxe": { + "doc": "Unconfigures REP segment\n Args:\n device ('obj'): Switch object\n intfs ('list'): List of interfaces to unconfigure\n segmentnum ('int'): Segment number to unconfigure\n vlan ('str' 'optional'): Vlan to unconfigure\n edge_port ('bool' 'optional'): unconfigure edge port\n no_neighbor ('bool' 'optional'): unconfigure no neighbor\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.rep.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_rep_segment", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rep/configure.py#L101" + } + } + }, + "unconfigure_rep_ztp": { + "folders": { + "iosxe": { + "doc": " Unconfigure REP ZTP on the device\n Args:\n device ('obj'): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.rep.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_rep_ztp", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rep/configure.py#L197" } } }, @@ -51700,7 +52362,7 @@ "os": "iosxe" }, "uid": "unconfigure_route_map", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1067" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1118" } } }, @@ -51714,7 +52376,7 @@ "os": "iosxe" }, "uid": "unconfigure_route_map_permit", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/route_map/configure.py#L149" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/route_map/configure.py#L152" } } }, @@ -51756,7 +52418,7 @@ "os": "iosxe" }, "uid": "unconfigure_router_bgp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2388" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2389" } } }, @@ -51770,7 +52432,7 @@ "os": "iosxe" }, "uid": "unconfigure_router_bgp_maximum_paths", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1962" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2041" } } }, @@ -51784,7 +52446,7 @@ "os": "iosxe" }, "uid": "unconfigure_router_bgp_network_mask", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2402" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2481" } } }, @@ -51798,7 +52460,7 @@ "os": "iosxe" }, "uid": "unconfigure_router_bgp_synchronization", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2007" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L2086" } } }, @@ -51812,7 +52474,7 @@ "os": "iosxe" }, "uid": "unconfigure_router_ospf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2443" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2444" } } }, @@ -51938,7 +52600,7 @@ "os": "iosxe" }, "uid": "unconfigure_service_compress_config", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4626" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4627" } } }, @@ -51980,7 +52642,7 @@ "os": "iosxe" }, "uid": "unconfigure_service_internal", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2887" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2888" } } }, @@ -52008,7 +52670,7 @@ "os": "iosxe" }, "uid": "unconfigure_service_performance", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3046" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3047" } } }, @@ -52043,14 +52705,14 @@ "unconfigure_service_private_config_encryption": { "folders": { "iosxe": { - "doc": " no service private-config-encryption\n Args:\n device (`obj`): Device object\n Returns:\n None\n Raises:\n SubCommandFailure : Failed configuring device\n ", - "module_name": "iosxe.sudi.configure", + "doc": " \n no service private-config-encryption\n Args:\n device ('obj'): Device object\n Returns:\n None\n Raises:\n SubCommandFailure exception\n ", + "module_name": "iosxe.csdl.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "unconfigure_service_private_config_encryption", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sudi/configure.py#L60" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/csdl/configure.py#L14" } } }, @@ -52078,7 +52740,7 @@ "os": "iosxe" }, "uid": "unconfigure_service_timestamps", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L649" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L650" } } }, @@ -52330,7 +52992,7 @@ "os": "iosxe" }, "uid": "unconfigure_snmp_mib_bulkstat", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4401" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4402" } } }, @@ -52344,7 +53006,7 @@ "os": "iosxe" }, "uid": "unconfigure_snmp_server_contact", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1375" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1376" } } }, @@ -52390,6 +53052,20 @@ } } }, + "unconfigure_snmp_server_host": { + "folders": { + "iosxe": { + "doc": " Unconfigures the snmp-server host\n Args:\n device ('obj'): device to use\n host_ip ('str'): IP address of the SNMP notification host\n version ('str'): SNMP version\n community_string ('str'): Community string\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.snmp.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_snmp_server_host", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L748" + } + } + }, "unconfigure_snmp_server_location": { "folders": { "iosxe": { @@ -52400,7 +53076,7 @@ "os": "iosxe" }, "uid": "unconfigure_snmp_server_location", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1415" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1416" } } }, @@ -52470,7 +53146,7 @@ "os": "iosxe" }, "uid": "unconfigure_software_auto_upgrade", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2060" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2061" } } }, @@ -52498,7 +53174,7 @@ "os": "iosxe" }, "uid": "unconfigure_source_template_global", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1721" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1722" } } }, @@ -52646,6 +53322,35 @@ "folders": { "iosxe": { "doc": " Unconfigures Spanning Tree Portfast\n Args:\n device ('obj') : device to use\n default ('boolean', optional) : Options are True/False. Default is False\n bpdugaurd ('boolean',optional) : Options are True/Flase. Default is False\n bpdufilter ('boolean', optional) : Options are True/False. Default is False\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "folders": { + "cat9k": { + "folders": { + "c9500": { + "doc": " Unconfigures Spanning Tree Portfast\n Args:\n device ('obj') : device to use\n default ('boolean', optional) : Unconfigure spanning-tree portfast default. Default is False\n bpdugaurd ('boolean', optional) : Unconfigure spanning-tree portfast bpduguard. Default is False\n bpdufilter ('boolean', optional) : Unconfigure spanning-tree bpdufilter default. Default is False\n mode ('str', optional) : Portfast mode. Default is edge\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.cat9k.c9500.spanning_tree.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "model": "c9500" + }, + "uid": "unconfigure_spanning_tree_portfast", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9500/spanning_tree/configure.py#L43" + }, + "c9610": { + "doc": " Unconfigures Spanning Tree Portfast\n Args:\n device ('obj') : device to use\n default ('boolean', optional) : Unconfigure spanning-tree portfast default. Default is False\n bpdugaurd ('boolean', optional) : Unconfigure spanning-tree portfast bpduguard. Default is False\n bpdufilter ('boolean', optional) : Unconfigure spanning-tree bpdufilter default. Default is False\n mode ('str', optional) : Portfast mode. Default is edge\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.cat9k.c9610.spanning_tree.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "model": "c9610" + }, + "uid": "unconfigure_spanning_tree_portfast", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9610/spanning_tree/configure.py#L43" + } + }, + "tokens": { + "platform": "cat9k" + } + } + }, "module_name": "iosxe.spanning_tree.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -52820,7 +53525,7 @@ "os": "iosxe" }, "uid": "unconfigure_stack_power_auto_off", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5724" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5725" } } }, @@ -52834,7 +53539,7 @@ "os": "iosxe" }, "uid": "unconfigure_stack_power_ecomode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5629" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5630" } } }, @@ -52848,7 +53553,7 @@ "os": "iosxe" }, "uid": "unconfigure_stack_power_mode_redundant", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1953" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1954" } } }, @@ -52862,7 +53567,7 @@ "os": "iosxe" }, "uid": "unconfigure_stack_power_switch", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4262" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4263" } } }, @@ -52876,7 +53581,7 @@ "os": "iosxe" }, "uid": "unconfigure_stack_power_switch_power_priority", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3371" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3372" } } }, @@ -52890,7 +53595,7 @@ "os": "iosxe" }, "uid": "unconfigure_stackpower_stack", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4458" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4459" } } }, @@ -52904,7 +53609,7 @@ "os": "iosxe" }, "uid": "unconfigure_stackpower_stack_switch_standalone", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3457" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3458" } } }, @@ -53310,7 +54015,7 @@ "os": "iosxe" }, "uid": "unconfigure_system_disable_password_recovery_switch_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1326" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1327" } } }, @@ -53324,7 +54029,7 @@ "os": "iosxe" }, "uid": "unconfigure_system_ignore_startupconfig_switch_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1217" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1218" } } }, @@ -53464,7 +54169,7 @@ "os": "iosxe" }, "uid": "unconfigure_time_range", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5531" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5532" } } }, @@ -53576,7 +54281,7 @@ "os": "iosxe" }, "uid": "unconfigure_udld_aggressive", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2407" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2408" } } }, @@ -53604,7 +54309,7 @@ "os": "iosxe" }, "uid": "unconfigure_udld_message_time", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2425" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2426" } } }, @@ -53695,14 +54400,14 @@ "unconfigure_vfi_context_evpn": { "folders": { "iosxe": { - "doc": " Unconfigure vfi context evpn\n Args:\n device ('obj'): Device object\n word('str'): Virtual Forwarding Instance (VFI) name\n \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Unconfigure vfi context evpn\n Args:\n device ('obj'): Device object\n word('str'): Virtual Forwarding Instance (VFI) name\n\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.evpn.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "unconfigure_vfi_context_evpn", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1205" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1409" } } }, @@ -53716,7 +54421,7 @@ "os": "iosxe" }, "uid": "unconfigure_virtual_service", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1612" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1613" } } }, @@ -53730,7 +54435,7 @@ "os": "iosxe" }, "uid": "unconfigure_virtual_service_activate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1633" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1634" } } }, @@ -53804,6 +54509,20 @@ } } }, + "unconfigure_vlan_service_instance_bd_association": { + "folders": { + "iosxe": { + "doc": " Configure unconfigure VLAN Service Instance Association to EVPN instance\n Args:\n device ('obj'): Device object\n bd_id ('int'): bridge-domain id\n vlan_instance('str'): VLAN Instance\n service_instance('int'): Service Instance Id\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.evpn.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_vlan_service_instance_bd_association", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L1012" + } + } + }, "unconfigure_vlan_state_active": { "folders": { "iosxe": { @@ -55494,6 +56213,16 @@ }, "uid": "verify_boot_variable", "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/platform/verify.py#L6" + }, + "ie3k": { + "doc": " Verifies given boot_images are set to the next-reload BOOT vars\n Args:\n device ('obj'): Device object\n boot_images ('str'): System images\n ", + "module_name": "iosxe.ie3k.platform.verify", + "package": "genie.libs.sdk.apis", + "tokens": { + "platform": "ie3k" + }, + "uid": "verify_boot_variable", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/platform/verify.py#L13" } }, "module_name": "iosxe.platform.verify", diff --git a/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json b/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json index f642c290f..1bf5a3e62 100644 --- a/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json +++ b/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json @@ -3704,6 +3704,15 @@ }, "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxe/cat9k/c9300/show_platform.py" }, + "c9350": { + "doc": "\n Parser for :\n * show inventory\n ", + "groups": [], + "schema": "{'index': {Any (str) *: {'name': , 'descr': , Optional (str) pid: , Optional (str) vid: , Optional (str) sn: }}}", + "source": { + "class": "genie.harness.base.Template" + }, + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxe/cat9k/c9350/show_platform.py" + }, "c9500": { "doc": " Parser for:\n * 'show inventory'\n ", "groups": [], @@ -4532,7 +4541,7 @@ "ios": { "doc": "Parser for:\n show ip multicast\n show ip multicast vrf \n ", "groups": [], - "schema": "{'vrf': {Any (str) *: {'enable': , 'multipath': , 'route_limit': , 'fallback_group_mode': , 'multicast_bound_with_filter_autorp': , Optional (str) mo_frr: }}}", + "schema": "{'vrf': {Any (str) *: {'enable': , 'multipath': , 'route_limit': , 'fallback_group_mode': , 'multicast_bound_with_filter_autorp': , Optional (str) mo_frr: , Optional (str) algorithm: }}}", "source": { "class": "genie.harness.base.Template" }, @@ -4545,7 +4554,7 @@ "doc": "Parser for:\n show ip multicast\n show ip multicast vrf \n ", "exclude": [], "groups": [], - "schema": "{'vrf': {Any (str) *: {'enable': , 'multipath': , 'route_limit': , 'fallback_group_mode': , 'multicast_bound_with_filter_autorp': , Optional (str) mo_frr: }}}", + "schema": "{'vrf': {Any (str) *: {'enable': , 'multipath': , 'route_limit': , 'fallback_group_mode': , 'multicast_bound_with_filter_autorp': , Optional (str) mo_frr: , Optional (str) algorithm: }}}", "source": { "class": "genie.harness.base.Template" }, @@ -7171,7 +7180,7 @@ "instance_id": "*", "service": "ethernet" }, - "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) service_insertion_id: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': , Optional (str) affinity_id_x: , Optional (str) affinity_id_y: }}}}}}}}}}", + "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) dbmap_src: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) service_insertion_id: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) publish_mode: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': , Optional (str) affinity_id_x: , Optional (str) affinity_id_y: }}}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -7191,7 +7200,7 @@ "instance_id": "*", "service": "ipv4" }, - "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) service_insertion_id: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': , Optional (str) affinity_id_x: , Optional (str) affinity_id_y: }}}}}}}}}}", + "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) dbmap_src: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) service_insertion_id: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) publish_mode: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': , Optional (str) affinity_id_x: , Optional (str) affinity_id_y: }}}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -7211,7 +7220,7 @@ "instance_id": "*", "service": "ipv6" }, - "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) service_insertion_id: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': , Optional (str) affinity_id_x: , Optional (str) affinity_id_y: }}}}}}}}}}", + "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) dbmap_src: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) service_insertion_id: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) publish_mode: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': , Optional (str) affinity_id_x: , Optional (str) affinity_id_y: }}}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -10799,6 +10808,13 @@ "8", "c" ], + [ + "0", + "3", + "5", + "9", + "c" + ], [ "1", "a", @@ -10986,6 +11002,13 @@ "k", "t" ], + [ + "9", + "a", + "c", + "k", + "t" + ], [ "a", "a", @@ -12346,6 +12369,13 @@ "s", "x" ], + [ + "e", + "i", + "o", + "s", + "x" + ], [ "i", "o", diff --git a/pkgs/sdk-pkg/setup.py b/pkgs/sdk-pkg/setup.py index c610a9a10..6b433bb1a 100755 --- a/pkgs/sdk-pkg/setup.py +++ b/pkgs/sdk-pkg/setup.py @@ -52,11 +52,11 @@ def version_info(*paths): version, version_range = version_info('src', 'genie', 'libs', 'sdk', '__init__.py') install_requires = [ - 'ruamel.yaml', + 'ruamel.yaml', f'yang.connector{version_range}', f'rest.connector{version_range}', - 'pysnmp-lextudio==6.1.2', - 'pyasn1==0.4.8' + 'pysnmp>=6.1.4,<6.2', + 'pyasn1==0.4.8', ] # launch setup diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/__init__.py index 01eb03f3e..15d01783f 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/__init__.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/__init__.py @@ -7,7 +7,7 @@ ''' # metadata -__version__ = '24.9' +__version__ = '24.10' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2020, Cisco Systems Inc.' diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py index 096759027..560e5a452 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py @@ -678,7 +678,7 @@ def configure_radius_interface(device, interface, protocol='ipv4'): device.configure(["ip radius source-interface {interface}".format(interface=interface)]) else: device.configure(["ipv6 radius source-interface {interface}".format(interface=interface)]) - + except SubCommandFailure: raise SubCommandFailure( "Could not Configure Radius Interface" @@ -921,9 +921,9 @@ def configure_common_criteria_policy(device, if lifetime: for key in lifetime: configs.append("lifetime {attr} {val}".format(attr=key, val=lifetime[key])) - if int(lower_case) > 0: + if lower_case and int(lower_case) > 0: configs.append("lower-case {low}".format(low=lower_case)) - if int(upper_case) > 0: + if upper_case and int(upper_case) > 0: configs.append("upper-case {up}".format(up=upper_case)) if max_len: configs.append("max-length {maxl}".format(maxl=max_len)) @@ -938,7 +938,7 @@ def configure_common_criteria_policy(device, for key in no_value: configs.append("no {attr} {val}".format(attr=key, val=no_value[key])) - if int(num_count) > 0: + if num_count and int(num_count) > 0: configs.append("numeric-count {num}".format(num=num_count)) if special_case: configs.append("special-case {spcl}".format(spcl=special_case)) @@ -1464,8 +1464,8 @@ def configure_aaa_local_auth(device, method=None, credential_download=None): "aaa authentication dot1x default local", "aaa local authentication default authorization default", "aaa authorization network default local" - ] - + ] + try: device.configure(cmd) except SubCommandFailure as e: @@ -1867,7 +1867,7 @@ def configure_aaa_authentication_login(device,auth_list,auth_type, group_name='' logger.info(f"Configuring aaa authentication login") configs=f"aaa authentication login {auth_list} {auth_type}" - + if group_name: configs+=f' group {group_name}' try: @@ -2485,7 +2485,7 @@ def configure_disable_config_key_encryption(device): "Could not remove config-key password encryption on {device}.\nError: {e}".format( device=device.name, e=str(e)) ) - + def config_access_session_auth_attr_filter_spec_include_list(device, filter_list_name): """ access-session authentication attr filter-spec include list with @@ -2508,7 +2508,7 @@ def config_access_session_auth_attr_filter_spec_include_list(device, filter_list raise SubCommandFailure( 'Could not unconfigure Attribute list with type' ) - + def unconfig_access_session_auth_attr_filter_spec_include_list(device, filter_list_name): """ access-session authentication attr filter-spec include list with @@ -2536,13 +2536,13 @@ def unconfig_access_session_auth_attr_filter_spec_include_list(device, filter_li def configure_radius_server_source_ports_extended(device): """ configure radius-server source-ports extended Args: - device ('obj'): Device object + device ('obj'): Device object Return: None Raise: SubCommandFailure: Failed configuring radius-server source-ports extended - """ - configs=['radius-server source-ports extended'] + """ + configs=['radius-server source-ports extended'] try: device.configure(configs) except SubCommandFailure as e: @@ -2589,7 +2589,7 @@ def unconfig_access_session_accnt_attr_filter_spec_include_list(device, filter_l ) -def configure_access_session_attr_filter_list(device, filter_list_name, vlan_id=None, cdp=None, +def configure_access_session_attr_filter_list(device, filter_list_name, vlan_id=None, cdp=None, dhcp=None, lldp=None, dhcpv6=None, http=None): """ Configure access-session filter list Args: @@ -2620,10 +2620,10 @@ def configure_access_session_attr_filter_list(device, filter_list_name, vlan_id= cmd.append(f'{http}') try: device.configure(cmd) - + except SubCommandFailure as e: raise SubCommandFailure(f"Failed to configure device sensor filter list. Error:\n{e}") - + def unconfigure_access_session_attr_filter_list(device, filter_list_name): """ Unconfigure access-session filter list Args: @@ -2639,11 +2639,11 @@ def unconfigure_access_session_attr_filter_list(device, filter_list_name): try: device.configure(cmd) - + except SubCommandFailure as e: raise SubCommandFailure(f"Failed to configure device sensor filter list. Error:\n{e}") -def unconfigure_access_session_attr_filter_list_protocol(device, filter_list_name, vlan_id=None, cdp=None, +def unconfigure_access_session_attr_filter_list_protocol(device, filter_list_name, vlan_id=None, cdp=None, dhcp=None, lldp=None, dhcpv6=None, http=None): """ Configure access-session filter list Args: @@ -2674,7 +2674,7 @@ def unconfigure_access_session_attr_filter_list_protocol(device, filter_list_nam cmd.append(f'no {http}') try: device.configure(cmd) - + except SubCommandFailure as e: raise SubCommandFailure(f"Failed to configure device sensor filter list. Error:\n{e}") @@ -2685,7 +2685,7 @@ def configure_aaa_accounting_update(device, action_type, periodic_interval): action_type('str'): newinfo Only send accounting update records when we have new acct info. periodic Send accounting update records at regular intervals. periodic_interval('str'): <1-71582> Periodic intervals to send accounting update records(in minutes) - Returns: + Returns: None Raise: SubCommandFailure: Failed configure aaa accounting update periodic @@ -2703,7 +2703,7 @@ def unconfigure_aaa_accounting_update(device, action_type, periodic_interval): action_type('str'): newinfo Only send accounting update records when we have new acct info. periodic Send accounting update records at regular intervals. periodic_interval('str'): <1-71582> Periodic intervals to send accounting update records(in minutes) - Returns: + Returns: None Raise: SubCommandFailure: Failed unconfigure aaa accounting update periodic @@ -2720,11 +2720,11 @@ def unconfigure_aaa_accounting_identity_default_start_stop(device,server_grp,ser device (`obj`): Device object server_grp (`str`): Server-group (i.e group) server_grp_name ('str'): Server-group name - Returns: + Returns: None Raise: SubCommandFailure: Failed unconfiguring aaa accounting identity default start-stop - """ + """ config = f"no aaa accounting identity default start-stop {server_grp} {server_grp_name}" try: device.configure(config) @@ -2783,7 +2783,7 @@ def configure_aaa_accounting_network_default_start_stop_group(device , server_gr device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f"failed to configure aaa accounting network default start-stop group {server_group_name}") - + def unconfigure_aaa_accounting_network_default_start_stop_group(device , server_group_name): '''api for no aaa accounting network default start-stop group @@ -2801,7 +2801,7 @@ def unconfigure_aaa_accounting_network_default_start_stop_group(device , server_ device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f"failed to unconfigure aaa accounting network default start-stop group {server_group_name}") - + def configure_aaa_accounting_identity_default_start_stop_group(device , server_group_name): '''api for aaa accounting identity default start-stop group @@ -2818,14 +2818,14 @@ def configure_aaa_accounting_identity_default_start_stop_group(device , server_g device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f"failed to configure aaa accounting identity default start-stop group {server_group_name}") - + def unconfigure_mab_on_switchport_mode_access_interface(device , interface): '''api for configuring no mab on switchport mode access interface Args: device ('obj') : Device object - interface ('str') : switchport mode access interface name + interface ('str') : switchport mode access interface name Return: None Raise: @@ -2838,13 +2838,13 @@ def unconfigure_mab_on_switchport_mode_access_interface(device , interface): device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f"failed to unconfigure mab on switchport mode access {interface}") - + def configure_mab_eap_on_switchport_mode_access_interface(device , interface): '''api for configuring mab eap on switchport mode access interface Args: device ('obj') : Device object - interface ('str') : switchport mode access interface name + interface ('str') : switchport mode access interface name Return: None Raise: @@ -2855,14 +2855,14 @@ def configure_mab_eap_on_switchport_mode_access_interface(device , interface): try: device.configure(cmd) except SubCommandFailure as e: - raise SubCommandFailure(f"failed to configure mab eap on switchport mode access interface {interface}") + raise SubCommandFailure(f"failed to configure mab eap on switchport mode access interface {interface}") def configure_aaa_authentication_login_default_group_local(device, group_name): '''api for configuring aaa authentication login default group local Args: device ('obj') : Device object - group_name ('str') : Group name required to configure + group_name ('str') : Group name required to configure Return: None Raise: @@ -2874,13 +2874,13 @@ def configure_aaa_authentication_login_default_group_local(device, group_name): device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f"failed to configure aaa authentication login default group {group_name} local") - + def configure_aaa_authentication_enable_default_group_enable(device, group_name): '''api for configuring aaa authentication enable default group enable Args: device ('obj') : Device object - group_name ('str') : Group name required to configure + group_name ('str') : Group name required to configure Return: None Raise: @@ -2892,13 +2892,13 @@ def configure_aaa_authentication_enable_default_group_enable(device, group_name) device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f"failed to configure aaa authentication enable default group {group_name} enable") - + def configure_aaa_authorization_exec_default_group_if_authenticated(device, group_name): '''api for configuring aaa authorization exec default group if-authenticated Args: device ('obj') : Device object - group_name ('str') : Group name required to configure + group_name ('str') : Group name required to configure Return: None Raise: @@ -2916,7 +2916,7 @@ def configure_aaa_authorization_network_default_group(device, group_name): Args: device ('obj') : Device object - group_name ('str') : Group name required to configure + group_name ('str') : Group name required to configure Return: None Raise: @@ -2948,7 +2948,7 @@ def configure_radius_attribute_policy_name_globally(device, word, request): device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f'Failed configuring radius attribute attribute policy-name globally {word}. Error:\n{e}') - + def unconfigure_radius_attribute_policy_name_globally(device, word, request): """unconfigure radius attribute policy-name globally {word, request} @@ -2969,7 +2969,7 @@ def unconfigure_radius_attribute_policy_name_globally(device, word, request): device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f'Failed unconfiguring radius attribute attribute policy-name globally {word}. Error:\n{e}') - + def configure_radius_attribute_policy_name_under_server(device, server_name, word, request): """configure radius attribute policy-name under radius server {server_name, word, request} @@ -2995,7 +2995,7 @@ def configure_radius_attribute_policy_name_under_server(device, server_name, wor device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f'Failed configuring radius attribute policy-name under radius server {word}. Error:\n{e}') - + def unconfigure_radius_attribute_policy_name_under_server(device, server_name, word, request): """unconfigure radius attribute policy-name under radius server {server_name, word, request} example: @@ -3015,13 +3015,13 @@ def unconfigure_radius_attribute_policy_name_under_server(device, server_name, w Raise: SubCommandFailure: Failed unconfiguring radius attribute policy-name under radius server """ - + cmd = [f'radius server {server_name}', f'no attribute policy-name {word} include-in-{request}-req'] try: device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f'Failed unconfiguring radius attribute policy-name under radius server {word}. Error:\n{e}') - + def configure_radius_attribute_policy_name_under_servergroup(device, server_group, word, request): """configure radius attribute policy-name under radius server group {server_group, word, request} example: @@ -3069,7 +3069,7 @@ def unconfigure_radius_attribute_policy_name_under_servergroup(device, server_gr device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f'Failed unconfiguring radius attribute policy-name under radius server group {word}. Error:\n{e}') - + def unconfigure_aaa_accounting_dot1x_default_start_stop_group(device , server_group_name): '''api for no aaa accounting dot1x default start-stop group @@ -3086,4 +3086,54 @@ def unconfigure_aaa_accounting_dot1x_default_start_stop_group(device , server_gr try: device.configure(cmd) except SubCommandFailure as e: - raise SubCommandFailure(f"failed to unconfigure aaa accounting dot1x default start-stop group {server_group_name}") \ No newline at end of file + raise SubCommandFailure(f"failed to unconfigure aaa accounting dot1x default start-stop group {server_group_name}") + +def configure_aaa_authorization_config_commands(device): + """ + configure aaa authorization config-commands + Args: + device ('obj'): Device object + Return: + None + Raise: + SubCommandFailure: Failed to configure aaa authorization config-commands + """ + cmd = 'aaa authorization config-commands' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f'Failed to configure aaa authorization config-commands. Error: \n{e}') + +def configure_aaa_accounting_connection_default_start_stop_group_tacacs_group(device, server_group_name): + """ + Configure aaa accounting connection default start-stop group tacacs+ group + Args: + device ('obj'): Device object + server_group_name ('str'): Name of server group + Return: + None + Raise: + SubCommandFailure: Failed to configure aaa accounting connection default start-stop group tacacs+ group + """ + cmd = f'aaa accounting connection default start-stop group tacacs+ group {server_group_name}' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f'Failed to configure aaa accounting connection default start-stop group tacacs+ group {server_group_name}. Error:\n{e}') + +def configure_aaa_accounting_system_default_start_stop_group_tacacs_group(device, server_group_name): + """ + Configure aaa accounting system default start-stop group tacacs+ group + Args: + device ('obj'): Device object + server_group_name ('str'): Name of server group + Return: + None + Raise: + SubCommandFailure: Failed to configure aaa accounting system default start-stop group tacacs+ group + """ + cmd = f'aaa accounting system default start-stop group tacacs+ group {server_group_name}' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f'Failed to configure aaa accounting system default start-stop group tacacs+ group {server_group_name}. Error:\n{e}') diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py index 6db79cc3f..16f1f9b11 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py @@ -630,6 +630,75 @@ def configure_bgp_l2vpn_neighbor_activate( "router {bgp_as}. Error:{e}".format(bgp_as=bgp_as, e=e) ) +def configure_bgp_l2vpn_route_map( + device, address_family, bgp_as, neighbor_address,route_map,direction, + address_family_modifier="" + ): + """ Activate bgp neighbor on bgp router + + Args: + device ('obj') : Device to be configured + address_family ('str') : Address family to be configured + bgp_as ('str') : Bgp Id to be added to configuration + neighbor_address ('str') : Address of neighbor to be added to configuration + route_map ('str') : Name of the route map + direction ('str') : Direction in which route map has to be applied + address_family_modifier ('str') : the endpoint provisioning information to be distributed + to BGP peers. + Returns: + N/A + Raises: + SubCommandFailure: Failed executing configure commands + + """ + log.info("configure router_map on l2vpn vpls address-family on router bgp {bgp_as}" + .format(bgp_as=bgp_as)) + configs=[ + f"router bgp {bgp_as}", + f"address-family {address_family} {address_family_modifier}", + f"neighbor {neighbor_address} route-map {route_map} {direction}" + ] + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not configure route_map on l2vpn bgp neighbor on bgp " + "router {bgp_as}. Error:{e}".format(bgp_as=bgp_as, e=e) + ) + +def configure_bgp_l2vpn_route_reflector_client( + device, address_family, bgp_as, neighbor_address, + address_family_modifier="" + ): + """ Activate bgp neighbor on bgp router + + Args: + device ('obj') : Device to be configured + address_family ('str') : Address family to be configured + bgp_as ('str') : Bgp Id to be added to configuration + neighbor_address ('str') : Address of neighbor to be added to configuration + address_family_modifier ('str') : the endpoint provisioning information to be distributed + to BGP peers. + Returns: + N/A + Raises: + SubCommandFailure: Failed executing configure commands + + """ + log.info("configure route-reflector-client on l2vpn vpls address-family on router bgp {bgp_as}" + .format(bgp_as=bgp_as)) + configs = [ + f"router bgp {bgp_as}", + f"address-family {address_family} {address_family_modifier}", + f"neighbor {neighbor_address} route-reflector-client" + ] + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not configure route-reflector-client on l2vpn bgp neighbor on bgp " + "router {bgp_as}. Error:{e}".format(bgp_as=bgp_as, e=e) + ) def configure_shut_bgp_neighbors( device, bgp_as, neighbors=None, address_family=None, vrf=None, noshut=False): @@ -1012,7 +1081,7 @@ def configure_bgp_address_advertisement( "router bgp {bgp_as}".format(bgp_as) ) -def configure_redistribute_connected(device, bgp_as, address_family, vrf=None): +def configure_redistribute_connected(device, bgp_as, address_family, vrf=None,route_map=None): """ configure redistribute connected in bgp Args: @@ -1036,7 +1105,11 @@ def configure_redistribute_connected(device, bgp_as, address_family, vrf=None): else: confg.append("address-family {address_family}".format( address_family=address_family)) - confg.append("redistribute connected") + if route_map: + confg.append("redistribute connected route-map {route_map}".format( + route_map=route_map)) + else: + confg.append("redistribute connected") try: device.configure(confg) except SubCommandFailure: @@ -1630,7 +1703,8 @@ def configure_bgp_update_delay(device, bgp_as, delay): "BGP router {bgp_as}".format(delay=delay, bgp_as=bgp_as) ) -def configure_bgp_router_id_peergroup_neighbor(device, bgp_as, neighborname, as_id): +def configure_bgp_router_id_peergroup_neighbor(device, bgp_as, neighborname, as_id,listen_range=None, + peer_group=None): """ Configures router-id on BGP router Args: @@ -1638,6 +1712,8 @@ def configure_bgp_router_id_peergroup_neighbor(device, bgp_as, neighborname, as_ bgp_as('str'): bgp id (autonomous system number) to configure neighborname('str'): neighbor peer-group-name to configure as_id('str'): ASN of the peer group to configure + listen_range('str'): Range of IP's that BGP listen + peer_group('str'): peer_group_name Return: None Raises: @@ -1658,6 +1734,9 @@ def configure_bgp_router_id_peergroup_neighbor(device, bgp_as, neighborname, as_ 'neighbor {neighborname} peer-group'.format(neighborname=neighborname), 'neighbor {neighborname} remote-as {as_id}'.format(neighborname=neighborname, as_id=as_id) ] + if listen_range and peer_group: + config.append('bgp listen range {listen_range} peer-group {peer_group}'.format( + listen_range=listen_range, peer_group=peer_group)) try: device.configure(config) except SubCommandFailure as e: diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9500/spanning_tree/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9500/spanning_tree/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9500/spanning_tree/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9500/spanning_tree/configure.py new file mode 100755 index 000000000..5ce5eef7e --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9500/spanning_tree/configure.py @@ -0,0 +1,69 @@ +''' Common Config functions for IOXE / Spanning-tree ''' + +import logging +import time + +log = logging.getLogger(__name__) + +# Unicon +from unicon.core.errors import SubCommandFailure + +# Genie +from genie.utils.timeout import Timeout + +def configure_spanning_tree_portfast(device, default=False, bpduguard=False, bpdufilter=False, mode='edge'): + """ Configures Spanning Tree Portfast + Args: + device ('obj') : device to use + default ('boolean', optional) : Configure spanning-tree portfast default. Default is False + bpdugaurd ('boolean', optional) : Configure spanning-tree portfast bpduguard. Default is False + bpdufilter ('boolean', optional) : Configure spanning-tree bpdufilter default. Default is False + mode ('str', optional) : Portfast mode. Default is edge + Returns: + None + Raises: + SubCommandFailure + """ + config = f"spanning-tree portfast {mode} " + if bpduguard: + config += "bpduguard default" if default else "bpduguard" + elif bpdufilter: + config += "bpdufilter default" + elif default: + config += "default" + + try: + device.configure(config) + except SubCommandFailure as error: + raise SubCommandFailure( + f'Could not configure spanning-tree portfast - Error:\n{error}' + ) + + +def unconfigure_spanning_tree_portfast(device, default=False, bpduguard=False, bpdufilter=False, mode='edge'): + """ Unconfigures Spanning Tree Portfast + Args: + device ('obj') : device to use + default ('boolean', optional) : Unconfigure spanning-tree portfast default. Default is False + bpdugaurd ('boolean', optional) : Unconfigure spanning-tree portfast bpduguard. Default is False + bpdufilter ('boolean', optional) : Unconfigure spanning-tree bpdufilter default. Default is False + mode ('str', optional) : Portfast mode. Default is edge + Returns: + None + Raises: + SubCommandFailure + """ + config = f"no spanning-tree portfast {mode} " + if bpduguard: + config += "bpduguard default" if default else "bpduguard" + elif bpdufilter: + config += "bpdufilter default" + elif default: + config += "default" + + try: + device.configure(config) + except SubCommandFailure as error: + raise SubCommandFailure( + f'Could not unconfigure spanning-tree portfast - Error:\n{error}' + ) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9610/spanning_tree/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9610/spanning_tree/configure.py index e321e8876..5ce5eef7e 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9610/spanning_tree/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9610/spanning_tree/configure.py @@ -38,3 +38,32 @@ def configure_spanning_tree_portfast(device, default=False, bpduguard=False, bpd raise SubCommandFailure( f'Could not configure spanning-tree portfast - Error:\n{error}' ) + + +def unconfigure_spanning_tree_portfast(device, default=False, bpduguard=False, bpdufilter=False, mode='edge'): + """ Unconfigures Spanning Tree Portfast + Args: + device ('obj') : device to use + default ('boolean', optional) : Unconfigure spanning-tree portfast default. Default is False + bpdugaurd ('boolean', optional) : Unconfigure spanning-tree portfast bpduguard. Default is False + bpdufilter ('boolean', optional) : Unconfigure spanning-tree bpdufilter default. Default is False + mode ('str', optional) : Portfast mode. Default is edge + Returns: + None + Raises: + SubCommandFailure + """ + config = f"no spanning-tree portfast {mode} " + if bpduguard: + config += "bpduguard default" if default else "bpduguard" + elif bpdufilter: + config += "bpdufilter default" + elif default: + config += "default" + + try: + device.configure(config) + except SubCommandFailure as error: + raise SubCommandFailure( + f'Could not unconfigure spanning-tree portfast - Error:\n{error}' + ) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/execute.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/execute.py index 6b17ee73f..529943701 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/execute.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/execute.py @@ -76,3 +76,20 @@ def clear_ip_dhcp_snooping_statistics(device): raise SubCommandFailure( f'Failed to clear dhcp snooping statistics\n{e}' ) + +def clear_ip_dhcp_snooping_track_server(device): + """execute 'clear ip dhcp snooping binding *' on device + Args: + device('obj'): device object + Returns: + None + Raises: + SubCommandFailure + """ + log.info("Executing clear_ip_dhcp_snooping_track_server API") + try: + device.execute("clear ip dhcp snooping track server all") + except SubCommandFailure as e: + raise SubCommandFailure( + f'Failed to clear dhcp snooping track server\n{e}' + ) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py index 262d17d4d..83c10c7da 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py @@ -68,7 +68,7 @@ def configure_l2vpn_evpn(device): log.info( "Configuring 'l2vpn evpn' globally" ) - + configs = [] configs.append("l2vpn evpn") @@ -81,7 +81,7 @@ def configure_l2vpn_evpn(device): ) def unconfigure_l2vpn_evpn(device): - """ unconfig l2vpn evpn + """ unconfig l2vpn evpn Args: device (`obj`): Device object Returns: @@ -92,7 +92,7 @@ def unconfigure_l2vpn_evpn(device): log.info( "Unconfiguring 'l2vpn evpn' globally" ) - + configs = [] configs.append("no l2vpn evpn") @@ -108,17 +108,17 @@ def configure_l2vpn_evpn_router_id(device,interface): """ Config l2vpn evpn Args: device ('obj'): Device object - interface ('str'): interface type + interface ('str'): interface type loopback | physical Returns: None Raises: SubCommandFailure """ - + '''Configuring 'l2vpn evpn router_id ' globally''' - - + + configs = [] configs.append("l2vpn evpn") configs.append("router-id {interface}".format(interface=interface)) @@ -132,10 +132,10 @@ def configure_l2vpn_evpn_router_id(device,interface): ) def unconfigure_l2vpn_evpn_router_id(device,interface): - """ unconfig l2vpn evpn + """ unconfig l2vpn evpn Args: device (`obj`): Device object - interface ('str'): interface type + interface ('str'): interface type loopback | physical Returns: None @@ -145,7 +145,7 @@ def unconfigure_l2vpn_evpn_router_id(device,interface): log.info( "Unconfiguring 'l2vpn evpn router_id' globally" ) - + configs = [] configs.append("l2vpn evpn") configs.append("no router-id {interface}".format(interface=interface)) @@ -162,7 +162,7 @@ def configure_evpn_replication_type(device,rep_type): """ Config l2vpn evpn instance Args: device (`obj`): Device object - rep_type ('str'): replication type + rep_type ('str'): replication type static | ingress Returns: None @@ -172,7 +172,7 @@ def configure_evpn_replication_type(device,rep_type): log.info( "Configuring 'l2vpn evpn multicast replication type' {rep_type} globally ".format(rep_type=rep_type) ) - + configs = [] configs.append("l2vpn evpn") configs.append("replication-type {rep_type}".format(rep_type=rep_type)) @@ -189,7 +189,7 @@ def unconfigure_evpn_replication_type(device, rep_type ): """ Config l2vpn evpn instance Args: device (`obj`): Device object - rep_type ('str'): replication type + rep_type ('str'): replication type static | ingress Returns: None @@ -219,15 +219,15 @@ def configure_evpn_instance_encapsulation_type(device, evi, srvinst , encap_type evi ('int'): evi id srvinst ('str'): service instance type vlan-based|vlan-bundle|vlan-aware - encap_type ('str): encapsulation - vxlan | mpls + encap_type ('str): encapsulation + vxlan | mpls Returns: None Raises: SubCommandFailure """ log.info( - "Configuring 'l2vpn evpn evi instance - encapsulation type' on evi {evi}".format(evi=evi) + "Configuring 'l2vpn evpn evi instance - encapsulation type' on evi {evi}".format(evi=evi) ) configs = [] @@ -240,7 +240,7 @@ def configure_evpn_instance_encapsulation_type(device, evi, srvinst , encap_type except SubCommandFailure as e: raise SubCommandFailure( "Failed to configure 'l2vpn evpn multicast replication type " - 'Error:{e}'.format(e=e) + 'Error:{e}'.format(e=e) ) def unconfigure_evpn_instance_encapsulation_type(device, evi, srvinst , encap_type): @@ -250,15 +250,15 @@ def unconfigure_evpn_instance_encapsulation_type(device, evi, srvinst , encap_ty evi ('int'): evi id srvinst ('str'): service instance type vlan-based|vlan-bundle|vlan-aware - encap_type ('str): encapsulation - vxlan | mpls + encap_type ('str): encapsulation + vxlan | mpls Returns: None Raises: SubCommandFailure """ log.info( - "unconfiguring 'l2vpn evpn evi instance - encapsulation type' on evi {evi}".format(evi=evi) + "unconfiguring 'l2vpn evpn evi instance - encapsulation type' on evi {evi}".format(evi=evi) ) configs = [] @@ -271,8 +271,8 @@ def unconfigure_evpn_instance_encapsulation_type(device, evi, srvinst , encap_ty except SubCommandFailure: raise SubCommandFailure( "Failed to configure 'l2vpn evpn multicast replication type ' " - "on evi {evi}".format(evi=evi, srvinst=srvinst, encap_type=encap_type) - + "on evi {evi}".format(evi=evi, srvinst=srvinst, encap_type=encap_type) + ) def configure_evpn_evi_replication_type(device, evi, srvinst , rep_type): @@ -282,7 +282,7 @@ def configure_evpn_evi_replication_type(device, evi, srvinst , rep_type): evi ('int'): evi id srvinst ('str'): service instance type vlan-based|vlan-bundle|vlan-aware - rep_type ('str'): replication type + rep_type ('str'): replication type static | ingress Returns: None @@ -290,7 +290,7 @@ def configure_evpn_evi_replication_type(device, evi, srvinst , rep_type): SubCommandFailure """ log.info( - "Configuring 'l2vpn evpn evi - multicast replication type' on evi {evi}".format(evi=evi) + "Configuring 'l2vpn evpn evi - multicast replication type' on evi {evi}".format(evi=evi) ) configs = [] @@ -312,7 +312,7 @@ def unconfigure_evpn_evi_replication_type(device, evi, srvinst, rep_type): evi ('int'): evi id srvinst ('str'): service instance type vlan-based|vlan-bundle|vlan-aware - rep_type ('str'): replication type + rep_type ('str'): replication type static | ingress Returns: None @@ -383,7 +383,7 @@ def unconfigure_evpn_default_gateway_advertise_global(device): "Failed to unconfigure default-gateway advertise on globally " 'Error:{e}'.format(e=e) ) - + def configure_evpn_l2_instance_vlan_association(device,vlan_id,evpn_instance,vni_id,protected=False): """ Configure configure VLAN association to EVPN instance Args: @@ -391,7 +391,7 @@ def configure_evpn_l2_instance_vlan_association(device,vlan_id,evpn_instance,vni vlan_id (`int`): Vlan id evpn_instance('int'): EVPN Instance id vni_id('int'): VNI id - protected('bool'): protected knob True or False + protected('bool'): protected knob True or False Returns: None @@ -403,7 +403,7 @@ def configure_evpn_l2_instance_vlan_association(device,vlan_id,evpn_instance,vni if protected is True: configs.append("member evpn-instance {evpn_instance} vni {vni_id} protected".format(evpn_instance=evpn_instance,vni_id = vni_id)) else: - configs.append("member evpn-instance {evpn_instance} vni {vni_id}".format(evpn_instance=evpn_instance,vni_id = vni_id)) + configs.append("member evpn-instance {evpn_instance} vni {vni_id}".format(evpn_instance=evpn_instance,vni_id = vni_id)) try: device.configure(configs) @@ -496,6 +496,33 @@ def unconfigure_evpn_l3_instance_vlan_association(device,vlan_id,vni_id): 'Error:{e}'.format(e=e) ) +def configure_evpn_l3_instance_bd_association(device, bd_id, vni_id): + """ configure BD association to EVPN l3 vni instance + + Args: + device (`obj`): Device object + bd_id (`int`): Bridge Domain id + vni_id('int'): VNI id + Returns: + None + + Raises: + SubCommandFailure + + """ + + configs = [ + f"bridge-domain {bd_id}", + f"member vni {vni_id}" + ] + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + "Failed to configure BD association to EVPN L3 instance on device " + 'Error:{e}'.format(e=e) + ) + def configure_nve_interface(device,nve_num,src_intf,protocol,vni_id,replication_type,mcast_group=None, l3vni=False,vrf_name=None): """ Configure nve interface @@ -509,7 +536,7 @@ def configure_nve_interface(device,nve_num,src_intf,protocol,vni_id,replication_ mcast_group (`str`, optional): Multicast group address , default value is None l3vni (`str`, optional): l3vni enable/disable , default value is False vrf_name (`str`, optional): VRF Name , default value is None - + Returns: None @@ -521,15 +548,15 @@ def configure_nve_interface(device,nve_num,src_intf,protocol,vni_id,replication_ configs.append("interface nve {nve_num}".format(nve_num=nve_num)) configs.append("source-interface {intf}".format(intf=src_intf)) configs.append("host-reachability protocol {protocol}".format(protocol=protocol)) - + if l3vni is True: if vrf_name is None : raise Exception("missing required argument: 'vrf_name'") else: configs.append("member vni {vni_id} vrf {vrf_name}".format(vni_id=vni_id, vrf_name=vrf_name)) - + else: - if replication_type.lower() == 'static': + if replication_type.lower() == 'static': if mcast_group is None: raise Exception("missing required argument: 'mcast_group'") else: @@ -598,7 +625,7 @@ def change_nve_source_interface(device, nve_num, source_interface): except SubCommandFailure as e: raise SubCommandFailure( f"Failed to change source-interface for NVE. Error:\n{e}") - + def enable_multicast_advertise_on_evi(device, evi, srvinst): """ Enable multicast advertise on evi Args: @@ -624,9 +651,9 @@ def enable_multicast_advertise_on_evi(device, evi, srvinst): except SubCommandFailure as e: raise SubCommandFailure( - f"enable multicast advertise on evi {evi}. Error:\n{e}" + f"enable multicast advertise on evi {evi}. Error:\n{e}" ) - + def configure_replication_type_on_evi(device, evi, srvinst, replication_type): """ Configure replication-type on evi Args: @@ -648,13 +675,13 @@ def configure_replication_type_on_evi(device, evi, srvinst, replication_type): f"l2vpn evpn instance {evi} {srvinst}", f"replication-type {replication_type}" ] - + try: device.configure(configs) except SubCommandFailure as e: raise SubCommandFailure( - f"configure replication-type {replication_type} on evi {evi}. Error:\n{e}" + f"configure replication-type {replication_type} on evi {evi}. Error:\n{e}" ) @@ -672,7 +699,7 @@ def configure_nve_interface_group_based_policy(device, nve_num): configs = [] configs.append("interface nve {nve_num}".format(nve_num=nve_num)) configs.append("group-based-policy") - + try: device.configure(configs) except SubCommandFailure as e: @@ -680,7 +707,7 @@ def configure_nve_interface_group_based_policy(device, nve_num): "Failed to configure nve interface on device {dev}. Error:\n{error}".format( dev=device.name, error=e,)) - + def unconfigure_nve_interface_group_based_policy(device, nve_num): """ Un-configure group-based-policy for nve interface Args: @@ -735,8 +762,8 @@ def configure_l2vpn_evpn_flooding_suppression(device): """ cmd = [ f"l2vpn evpn", - f"flooding-suppression address-resolution disable" - ] + f"flooding-suppression address-resolution disable" + ] try: device.configure(cmd) @@ -828,8 +855,8 @@ def unconfigure_l2vpn_evpn_flooding_suppression(device): """ cmd = [ f"l2vpn evpn", - f"no flooding-suppression address-resolution disable" - ] + f"no flooding-suppression address-resolution disable" + ] try: device.configure(cmd) @@ -840,13 +867,14 @@ def unconfigure_l2vpn_evpn_flooding_suppression(device): def configure_evpn_l2_instance_bd_association(device, bd_id, - evpn_instance, vni_id=None): - """ Configure configure VLAN association to EVPN instance + evpn_instance, vni_id=None, eth_tag=None): + """ Configure evpn instance association with bd Args: device ('obj'): Device object bd_id ('int'): bridge-domain id evpn_instance('int'): EVPN Instance id vni_id('int'): VNI id, default is None + eth_tag('int'): Ethernet tag, default is None Returns: None Raises: @@ -854,7 +882,13 @@ def configure_evpn_l2_instance_bd_association(device, bd_id, """ configs = ["bridge-domain {bd_id}".format(bd_id=bd_id)] - if vni_id: + if eth_tag: + configs.append( + "member evpn-instance {evpn_instance} vni {vni_id} ethernet-tag {eth_tag}".format( + evpn_instance=evpn_instance, vni_id=vni_id, eth_tag=eth_tag + ) + ) + elif vni_id: configs.append( "member evpn-instance {evpn_instance} vni {vni_id}".format( evpn_instance=evpn_instance, vni_id=vni_id @@ -871,12 +905,12 @@ def configure_evpn_l2_instance_bd_association(device, bd_id, device.configure(configs) except SubCommandFailure as e: raise SubCommandFailure( - "Failed to configure VLAN association to EVPN L2 instance on device " + "Failed to configure EVPN Instance association with bd on device " 'Error:\n{e}'.format(e=e) ) def unconfigure_evpn_l2_instance_bd_association(device, bd_id, evpn_instance): - """ Configure configure VLAN association to EVPN instance + """ Unconfigure EVPN Instance association with bd Args: device ('obj'): Device object bd_id ('int'): bridge-domain id @@ -897,10 +931,112 @@ def unconfigure_evpn_l2_instance_bd_association(device, bd_id, evpn_instance): device.configure(configs) except SubCommandFailure as e: raise SubCommandFailure( - "Failed to configure VLAN association to EVPN L2 instance on device " + "Failed to unconfigure EVPN Instance association with bd" + 'Error:\n{e}'.format(e=e) + ) + +def configure_evpn_l2_profile_bd_association(device, bd_id, + evpn_name): + """ Configure EVPN profile association with bd + Args: + device ('obj'): Device object + bd_id ('int'): bridge-domain id + evpn_name('str'): EVPN Instance Profile name + Returns: + None + Raises: + SubCommandFailure + """ + configs = [ + f"bridge-domain {bd_id}", + f"member evpn-instance profile {evpn_name}" + ] + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + "Failed to configure EVPN Profile assosication with bd on device" + 'Error:\n{e}'.format(e=e) + ) + +def unconfigure_evpn_l2_profile_bd_association(device, bd_id, + evpn_name): + """ Unconfigure EVPN profile association with bd + Args: + device ('obj'): Device object + bd_id ('int'): bridge-domain id + evpn_name('str'): EVPN Instance Profile name + Returns: + None + Raises: + SubCommandFailure + """ + + configs = [ + f"bridge-domain {bd_id}", + f"no member evpn-instance profile {evpn_name}" + ] + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + "Failed to unconfigure EVPN Profile assosication with bd on device" + 'Error:\n{e}'.format(e=e) + ) +def configure_vlan_service_instance_bd_association(device, bd_id, + vlan_instance, service_instance): + """Configure configure VLAN Service Instance Association to EVPN instance + Args: + device ('obj'): Device object + bd_id ('int'): bridge-domain id + vlan_instance('str'): VLAN Instance + service_instance('int'): Service Instance Id + Returns: + None + Raises: + SubCommandFailure + """ + + configs = [ + f"bridge-domain {bd_id}", + f"member {vlan_instance} service-instance {service_instance}" + ] + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + "Failed to configure VLAN Service Instance association to EVPN L2 instance on device " 'Error:\n{e}'.format(e=e) ) +def unconfigure_vlan_service_instance_bd_association(device, bd_id, + vlan_instance, service_instance): + """ Configure unconfigure VLAN Service Instance Association to EVPN instance + Args: + device ('obj'): Device object + bd_id ('int'): bridge-domain id + vlan_instance('str'): VLAN Instance + service_instance('int'): Service Instance Id + Returns: + None + Raises: + SubCommandFailure + """ + + configs = [ + "bridge-domain {bd_id}".format(bd_id=bd_id), + "no member {vlan_instance} service-instance {service_instance}".format( + vlan_instance=vlan_instance, service_instance=service_instance + ) + ] + + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + "Failed to unconfigure VLAN Service Instance association to EVPN L2 instance on device " + 'Error:\n{e}'.format(e=e) + ) def configure_evpn_floodsuppress_dhcprelay_disable_globally(device): """ Configure l2vpn evpn flooding suppression dhcp-relay disable globally Args: @@ -1009,9 +1145,9 @@ def configure_interface_evpn_ethernet_segment(device, interface, segment_value): raise SubCommandFailure(f'Could not configure interface evpn ethernet-segment. Error: {e}') -def configure_pvlan_loadbalancing_ethernetsegment_l2vpn_evpn(device, ethsegmentvalue, +def configure_pvlan_loadbalancing_ethernetsegment_l2vpn_evpn(device, ethsegmentvalue, esivalue='', identifier_type='0', system_mac='', red_single_active='yes'): - """ configure per vlan load balncing between PEs on ethernet segment + """ configure per vlan load balncing between PEs on ethernet segment Args: device ('obj'): Device object ethsegmentvalue ('str'): Ethernet segment local discriminator value @@ -1019,7 +1155,7 @@ def configure_pvlan_loadbalancing_ethernetsegment_l2vpn_evpn(device, ethsegmentv esivalue ('str', optional): 9-octet ESI value in hex {mandatory for type 0 identory type} system_mac ('str', optional): system mac address{mandatory for type 3 identory type} red_single_active ('str', optional): redundancy single active (yes or no, default value is "yes") - + Returns: None Raises: @@ -1046,12 +1182,12 @@ def unconfigure_mdt_config_on_vrf(device, vrfname, addressfamily, mdtparam1, mdt """ unconfigure mdt bgp autodiscovery or mdt default group or mdt overlay protocol on VRF Args: device ('obj'): Device object - vrfname ('str'): VRF Name + vrfname ('str'): VRF Name addressfamily ('str'): Address family ipv4 or ipv6 mdtparam1 ('str'): "auto-discovery" for BGP auto-discovery for MVPN, - "default" for the default group,"overlay" for MDT Overlay Protocol + "default" for the default group,"overlay" for MDT Overlay Protocol mdtparam2 ('str'): "vxlan" for BGP auto-discovery for MVPN and default group,"use-bgp" for MDT Overlay Protocol - mdtparam3 ('str', optional): no values needed for BGP auto-discovery for MVPN, + mdtparam3 ('str', optional): no values needed for BGP auto-discovery for MVPN, "IP address" for default group,"spt-only" for MDT Overlay Protocol Returns: None @@ -1078,20 +1214,20 @@ def configure_evpn_instance_evi(device, evi, srv_inst, conf_command_list=None, e vlan-based|vlan-bundle|vlan-aware conf_command_list('list',optional): L2VPN EVPN instance configuration commands, default value is None encap_type ('str',optional): encapsulation, default value is None - vxlan | mpls + vxlan | mpls mode_type ('str',optional): ip local-learning, default value is None - disable | enable + disable | enable Returns: None Raises: SubCommandFailure """ log.info( - "Configuring 'evpn instance' on evi {evi}".format(evi=evi) + "Configuring 'evpn instance' on evi {evi}".format(evi=evi) ) configs = [f'l2vpn evpn instance {evi} {srv_inst}'.format(evi=evi,srv_inst=srv_inst)] - + for conf_command in conf_command_list: if srv_inst == "vlan-based": if conf_command == "encapsulation": @@ -1103,7 +1239,7 @@ def configure_evpn_instance_evi(device, evi, srv_inst, conf_command_list=None, e elif conf_command == "default": configs.append(f"{conf_command}") elif conf_command == "default-gateway": - configs.append(f"{conf_command} advertise") + configs.append(f"{conf_command} advertise enable") elif conf_command == "exit": configs.append(f"{conf_command}") elif conf_command == "no": @@ -1130,14 +1266,14 @@ def unconfigure_evpn_instance_evi(device, evi, srv_inst): evi ('int'): evi id srv_inst ('str'): service instance type vlan-based|vlan-bundle|vlan-aware - + Returns: None Raises: SubCommandFailure """ log.info( - "Unconfiguring ' evpn instance ' on evi {evi}".format(evi=evi) + "Unconfiguring ' evpn instance ' on evi {evi}".format(evi=evi) ) configs = [ @@ -1149,10 +1285,78 @@ def unconfigure_evpn_instance_evi(device, evi, srv_inst): except SubCommandFailure as e: raise SubCommandFailure( - f"Failed to unconfigure evpn instance evi .Error:\n{e}" + f"Failed to unconfigure evpn instance evi .Error:\n{e}" ) +def configure_evpn_profile(device, name, srv_inst, evi_id=None, l2vni=None, ethernet_tag=None, encap=None): + """ Configure evpn profile + Args: + device ('obj'): Device object + name ('str'): Name of the evpn profile + srv_inst ('str'): service instance type + vlan-bundle|vlan-aware + evi_id('int',optional): <1-65535> EVPN evi id, default value is None + l2vni ('int',optional): <4096-16777215> VxLAN L2VNI base, default value is None + etherent_tag ('str',optional): EVPN Ethernet Tag, default value is None + auto-vlan | auto-vni + encap('str',optional): Encapsulation type + vxlan | mpls + Returns: + None + Raises: + SubCommandFailure + """ + log.info( + "Configuring evpn profile" + ) + + configs = [f'l2vpn evpn profile {name} {srv_inst}'.format(name=name,srv_inst=srv_inst)] + + if evi_id: + configs.append(f"evi-id {evi_id}") + if l2vni: + configs.append(f"l2vni-base {l2vni}") + if ethernet_tag: + configs.append(f"ethernet-tag {ethernet_tag}") + if encap: + configs.append(f"encapsulation {encap}") + try: + device.configure(configs) + + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to configure evpn profile. Error:\n{e}" + ) + +def unconfigure_evpn_profile(device, name, srv_inst): + """ Unconfigure evpn profile + Args: + device ('obj'): Device object + name ('str'): Name of the evpn profile + srv_inst ('str'): service instance type + vlan-bundle|vlan-aware + Returns: + None + Raises: + SubCommandFailure + """ + log.info( + "Unconfiguring evpn profile" + ) + + configs = [f"l2vpn evpn profile {name} {srv_inst}", + f"no evi-id", + f"exit", + f"no l2vpn evpn profile {name} {srv_inst}" + ] + try: + device.configure(configs) + + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to unconfigure evpn profile. Error:\n{e}" + ) def configure_vfi_context_evpn(device, word, id, ethernet_segment=None, value=None, ip_address=None, vc_id=None, encapsulation=None, mpls=None, temp=None, temp_name=None): """ Configure vfi context evpn Args: @@ -1167,7 +1371,7 @@ def configure_vfi_context_evpn(device, word, id, ethernet_segment=None, value=No mpls('str',optional): Use MPLS encapsulation , default value is None temp('str',optional): Template to use for encapsulation and protocol configuration , default value is None temp_name('str',optional): WORD template name (Max size 32) , default value is None - + Returns: None Raises: @@ -1180,7 +1384,7 @@ def configure_vfi_context_evpn(device, word, id, ethernet_segment=None, value=No configs = [ f'l2vpn vfi context {word}', f'vpn id {id}'] - + if ethernet_segment: configs.append(f'evpn {ethernet_segment} {value}') if vc_id: @@ -1192,7 +1396,7 @@ def configure_vfi_context_evpn(device, word, id, ethernet_segment=None, value=No configs.append(f'member {ip_address} {encapsulation} mpls') elif temp: configs.append(f'member {ip_address} {temp} {temp_name}') - + try: device.configure(configs) @@ -1203,12 +1407,12 @@ def configure_vfi_context_evpn(device, word, id, ethernet_segment=None, value=No def unconfigure_vfi_context_evpn(device, word): - + """ Unconfigure vfi context evpn Args: device ('obj'): Device object word('str'): Virtual Forwarding Instance (VFI) name - + Returns: None Raises: @@ -1217,7 +1421,7 @@ def unconfigure_vfi_context_evpn(device, word): log.info( "Unconfiguring 'l2vpn vfi context evpn' on vfi {word}".format(word=word) ) - + configs = [ f'no l2vpn vfi context {word}' ] @@ -1231,7 +1435,7 @@ def unconfigure_vfi_context_evpn(device, word): ) def configure_l2vpn_evpn_advertise_sync(device, instance=None): - + """ Config multicast advertise sync-only Args: device ('obj'): Device object @@ -1241,20 +1445,20 @@ def configure_l2vpn_evpn_advertise_sync(device, instance=None): Raises: SubCommandFailure """ - + '''Configuring 'multicast advertise sync-only' on l2vpn evpn''' - + configs = ["l2vpn evpn", "multicast advertise sync-only"] - + if instance is not None: configs.extend([f"l2vpn evpn instance {instance} vlan-based", "multicast advertise sync-only"]) - + try: device.configure(configs) except SubCommandFailure as e: raise SubCommandFailure( f"Failed to configure 'multicast advertise sync-only' on l2vpn evpn. " f"Error: {e}" - ) \ No newline at end of file + ) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/configure.py index b68a5faa5..d1ea7b384 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/configure.py @@ -1163,7 +1163,7 @@ def configure_flow_record_match_datalink(device, record_name, field_type, mac_ty elif direction is None and mac_type is None: config.append(f'match datalink {field_type}') elif direction is not None and mac_type is None: - config.append(f'match datalink {field_type} {direction}') + config.append(f'match datalink {field_type} {direction}') elif direction: config.append(f'match datalink {field_type} {mac_type} {direction}') @@ -1299,7 +1299,7 @@ def configure_flow_exporter(device, exporter_name, dest_ip=None, udp_port=None, config.append(f'source {source_int}') if export_proto: config.append(f'export-protocol {export_proto}') - + try: device.configure(config) @@ -1445,11 +1445,11 @@ def configure_fnf_flow_record( if collect_type_mask: configs.extend([f'collect ipv4 {collect_type_mask} mask']) if collect_length: - configs.extend([f'collect ipv4 length {collect_length}']) + configs.extend([f'collect ipv4 length {collect_length}']) if collect_ipv4_ttl: configs.extend([f'collect ipv4 ttl {collect_ipv4_ttl}']) if collect_udp_ports: - configs.extend([f'collect transport udp {collect_udp_ports}']) + configs.extend([f'collect transport udp {collect_udp_ports}']) try: device.configure(configs) @@ -1458,12 +1458,12 @@ def configure_fnf_flow_record( f'Could not configure flow record. Error:\n{e}') def unconfigure_record_configs_from_flow_monitor( - device, - monitor_name, + device, + monitor_name, record_name=None, - active_timeout=None, - inactive_timeout=None, - cache_entries=None, + active_timeout=None, + inactive_timeout=None, + cache_entries=None, exporter_name=None ): """ Unconfig Flow Monitor with cache entry on Device @@ -1482,7 +1482,7 @@ def unconfigure_record_configs_from_flow_monitor( """ cmd = ["flow monitor {monitor_name}".format(monitor_name=monitor_name)] if active_timeout: - cmd.append("no cache timeout active {active_timeout}".format(active_timeout=active_timeout)) + cmd.append("no cache timeout active {active_timeout}".format(active_timeout=active_timeout)) if inactive_timeout: cmd.append("no cache timeout inactive {inactive_timeout}".format(inactive_timeout=inactive_timeout)) if record_name: @@ -1533,7 +1533,7 @@ def unconfigure_flow_exporter(device, exporter_name, dest_ip=None, udp_port=None config.append('no source {source_int}'.format(source_int=source_int)) if export_proto: config.append('no export-protocol {export_proto}'.format(export_proto=export_proto)) - + try: device.configure(config) except SubCommandFailure as e: @@ -1549,14 +1549,14 @@ def configure_flow_monitor(device, monitor_name, exporter_name, record_name, exporter_name (`str`): Flow exporter name record_name (`str`): Flow record name timeout ('int'): Timeout - + Return: None Raise: SubCommandFailure: Failed configuring flow monitor """ - + try: device.configure([ f"flow monitor {monitor_name}", @@ -1589,7 +1589,7 @@ def configure_datalink_flow_monitor(device, interface, flow_name, direction): """ config = [f'interface {interface}', f'datalink flow monitor {flow_name} {direction}'] - + try: device.configure(config) except SubCommandFailure as e: @@ -1623,7 +1623,7 @@ def unconfigure_datalink_flow_monitor(device, interface, flow_name, direction): def configure_fnf_flow_record_match_flow(device, record_name, flow_name, cts_type=None): - + """ Configure Flow Record match flow on Device Args: device ('obj'): Device object @@ -1633,11 +1633,11 @@ def configure_fnf_flow_record_match_flow(device, record_name, flow_name, cts_typ Return: None - + Raise: SubCommandFailure: Failed configuring Flow Record on Device """ - + config = [f'flow record {record_name}'] if flow_name == 'observation': config.append(f'match flow observation point') @@ -1647,3 +1647,17 @@ def configure_fnf_flow_record_match_flow(device, record_name, flow_name, cts_typ device.configure(config) except SubCommandFailure: raise SubCommandFailure(f'Could not configure flow record {record_name}') + +def clear_monitor_capture(device, capture_name): + """ + Execute monitor capture clear + Example: monitor capture test clear + Args: + device ('obj'): Device Object + capture_name ('str'): Name of Capture + """ + cmd = f"monitor capture {capture_name} clear" + try: + device.execute(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Could not execute monitor capture {capture_name} clear. \nError: {e}") diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/execute.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/execute.py index b7546b6d3..42c34a1ee 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/execute.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/execute.py @@ -19,11 +19,11 @@ def execute_set_fnf_debug(device): cmd = f"set platform software trace fed switch active fnf debug" try: device.execute(cmd) - + except SubCommandFailure as e: raise SubCommandFailure( f'Could not set platform software trace fed switch active fnf debug on device. Error:\n{e}') - + def execute_set_fnf_verbose(device): """ set platform software trace fed switch active fnf verbose Args: @@ -36,7 +36,7 @@ def execute_set_fnf_verbose(device): cmd = f"set platform software trace fed switch active fnf verbose" try: device.execute(cmd) - + except SubCommandFailure as e: raise SubCommandFailure( f'Could not set platform software trace fed switch active fnf verbose on device. Error:\n{e}') @@ -55,7 +55,7 @@ def execute_monitor_capture_start_capture_filter(device, capture_name, capture_f device.execute(cmd) except SubCommandFailure as e: raise SubCommandFailure(f"Could not execute monitor capture {capture_name} start capture_filter {capture_filter}. \nError: {e}") - + def execute_monitor_capture_file_location_flash(device, capture_name, file_name, number_of_file = '', size_of_file = ''): """ Execute: @@ -76,8 +76,8 @@ def execute_monitor_capture_file_location_flash(device, capture_name, file_name, f'monitor capture {capture_name} file location flash:{file_name} size {size_of_file}', f'monitor capture {capture_name} file location flash:{file_name} ring {number_of_file}', f'monitor capture {capture_name} file location flash:{file_name} ring {number_of_file} size {size_of_file}', - ] - + ] + command = '' if number_of_file: if size_of_file: @@ -92,7 +92,7 @@ def execute_monitor_capture_file_location_flash(device, capture_name, file_name, device.execute(command) except SubCommandFailure as e: raise SubCommandFailure(f'Could not perform {command}. \nError: {e}') - + def execute_monitor_capture_class_map(device, capture_name, class_name): """ Execute monitor capture class-map @@ -107,7 +107,7 @@ def execute_monitor_capture_class_map(device, capture_name, class_name): device.execute(cmd) except SubCommandFailure as e: raise SubCommandFailure(f"Could not execute monitor capture {capture_name} class-map {class_name}. \nError: {e}") - + def execute_monitor_capture_clear(device, capture_name): """ Execute monitor capture clear @@ -120,4 +120,52 @@ def execute_monitor_capture_clear(device, capture_name): try: device.execute(cmd) except SubCommandFailure as e: - raise SubCommandFailure(f"Could not execute monitor capture {capture_name} clear. \nError: {e}") \ No newline at end of file + raise SubCommandFailure(f"Could not execute monitor capture {capture_name} clear. \nError: {e}") + +def execute_monitor_capture_limit_duration(device, capture_name, duration): + """ + Execute monitor capture {capture_name} limit duration {duration} + Example: monitor capture test limit duration 40 + Args: + device ('obj'): Device Object + capture_name ('str'): Name of Capture + duration ('int'): Duration in Seconds : Min 1 - Max 1000000 + """ + cmd = f"monitor capture {capture_name} limit duration {duration}" + + try: + device.execute(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Could not execute monitor capture {capture_name} limit duration {duration}. \nError: {e}") + +def execute_monitor_capture_access_list(device, capture_name, access_list_name): + """ + Execute monitor capture {capture_name} access-list {access_list_name} + Example: monitor capture test access-list MYACLV6 + Args: + device ('obj'): Device Object + capture_name ('str'): Name of Capture + access_list_name ('str'): Access list name + """ + cmd = f"monitor capture {capture_name} access-list {access_list_name}" + + try: + device.execute(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Could not execute monitor capture {capture_name} access-list {access_list_name}. \nError: {e}") + +def execute_monitor_capture_vlan_in_match_any(device, capture_name, vlan_id): + """ + Execute monitor capture {capture_name} vlan {vlan_id} in match any + Example: monitor capture test vlan 33 in match any + Args: + device ('obj'): Device Object + capture_name ('str'): Name of Capture + vlan_id ('int'): Vlan ID + """ + cmd = f"monitor capture {capture_name} vlan {vlan_id} in match any" + + try: + device.execute(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Could not execute monitor capture {capture_name} vlan {vlan_id} in match any. \nError: {e}") diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/platform/verify.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/platform/verify.py new file mode 100644 index 000000000..c6d95679b --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/platform/verify.py @@ -0,0 +1,26 @@ +"""Common verify functions for platform""" + +# Python +import re +import logging + +# Genie +from genie.metaparser.util.exceptions import SchemaEmptyParserError +from genie.utils.timeout import Timeout + +log = logging.getLogger(__name__) + +def verify_boot_variable(device, boot_images, output=None): + ''' Verifies given boot_images are set to the next-reload BOOT vars + Args: + device ('obj'): Device object + boot_images ('str'): System images + ''' + + if boot_images == device.api.get_boot_variables(boot_var='next', output=output): + log.info(f"Given boot images '{boot_images}' are set to 'BOOT' variable") + return True + else: + log.info(f"Given boot images '{boot_images}' are not set to 'BOOT' variable") + return False + \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py old mode 100644 new mode 100755 index 46c54d1a0..2c2a1bb37 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py @@ -7178,7 +7178,7 @@ def configure_interface_dot1q_ethertype(device, interface, ethervalue): .format(interface=interface, ethervalue=ethervalue ) ) - + config_list=["interface {interface}".format(interface=interface),\ "dot1q tunneling ethertype {ethervalue}".format(ethervalue=ethervalue)] @@ -7190,7 +7190,7 @@ def configure_interface_dot1q_ethertype(device, interface, ethervalue): .format(error=e ) ) - + def configure_hsrp_version_on_interface(device, interface, version): """ Configure hsrp version on interface Args: @@ -9700,7 +9700,7 @@ def unconfigure_interface_speed(device, interface): config = [ f'interface {interface}', 'no speed' - ] + ] try: device.configure(config) except SubCommandFailure as e: @@ -9875,17 +9875,17 @@ def configure_dual_port_interface_media_type(device, interface, media_type): """ log.debug( f"Configuring media_type {media_type} on interface {interface}") - + cmd = [f"interface {interface}", f"media-type {media_type}"] - + try: device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure( f"Could not configure media_type on {interface}. Error:\n{e}" ) - + def configure_interface_range_shutdown(device, start_interface, end_interface): """ Configure interface range shutdown @@ -9914,7 +9914,7 @@ def configure_interface_range_no_shutdown(device, start_interface, end_interface Args: device ('obj'): device to use start_interface('str'): Starting Interface - end_interface('str'): Ending Interface number + end_interface('str'): Ending Interface number Returns: None Raises: @@ -9942,7 +9942,7 @@ def configure_system_debounce_link_up_timer(device, link_up): Raise: SubCommandFailure: Failed configuring system debounce timer """ - + log.debug("Configure system debounce link-up timer") cmd = f"system debounce link-up {link_up}" try: @@ -9962,7 +9962,7 @@ def configure_system_debounce_link_down_timer(device, link_down): Raise: SubCommandFailure: Failed configuring system debounce timer """ - + log.debug("Configure system debounce link-down timer") cmd = f"system debounce link-down {link_down}" try: @@ -10001,7 +10001,7 @@ def unconfigure_system_debounce_link_down_timer(device, link_down): Raise: SubCommandFailure: Failed unconfiguring system debounce timer """ - + log.debug("Unconfigure system debounce link-down timer") cmd = f"no system debounce link-down {link_down}" try: @@ -10021,7 +10021,7 @@ def configure_phymode_ignore_linkup_fault(device, interface): Raise: SubCommandFailure: Failed configuring phymode ignore linkup fault """ - + log.debug("Configure phymode ignore linkup fault") cmd =[f"interface {interface}", "phymode ignore-linkup-fault"] try: @@ -10041,7 +10041,7 @@ def unconfigure_phymode_ignore_linkup_fault(device, interface): Raise: SubCommandFailure: Failed configuring phymode ignore linkup fault """ - + log.debug("Unconfigure phymode ignore linkup fault") cmd =[f"interface {interface}", "no phymode"] try: @@ -10241,8 +10241,8 @@ def configure_switchport_trunk_native_vlan_tag(device, interface): device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure( - f'Could not configure switchport trunk native vlan tag on {device}.Error:\n{e}') - + f'Could not configure switchport trunk native vlan tag on {device}.Error:\n{e}') + def unconfigure_switchport_trunk_native_vlan_tag(device, interface): """ unconfigure switchport trunk native vlan tag Args: @@ -10261,6 +10261,29 @@ def unconfigure_switchport_trunk_native_vlan_tag(device, interface): raise SubCommandFailure( f'Could not unconfigure switchport trunk native vlan tag on {device}.Error:\n{e}') +def configure_service_policy_type_queueing_on_interface(device, interface, direction, policy_map_name): + """ Configure service-policy type queueing on interface + Args: + device ('obj') : device to use + interface ('str') : interface name on which we need to configure + direction ('str') : Assign policy-map direction + policy_map_name ('str') : Policy-map name + Returns: + None + Raises: + SubCommandFailure + """ + log.debug("Configuring service-policy type queueing on interface") + + configs = [f'interface {interface}', + f'service-policy type queueing {direction} {policy_map_name}'] + try: + device.configure(configs) + + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure service-policy type queueing on interface {interface}. Error:\n{e}") + def configure_medium_p2p_interface(device, interface): """ Configure medium p2p on interface Args: @@ -10271,7 +10294,7 @@ def configure_medium_p2p_interface(device, interface): Raise: SubCommandFailure: Failed configuring medium p2p on interface """ - + log.debug("Configure medium p2p on interface") cmd =[f"interface {interface}", "medium p2p"] try: @@ -10279,8 +10302,8 @@ def configure_medium_p2p_interface(device, interface): except SubCommandFailure as e: raise SubCommandFailure( f"Failed to configure medium p2p on interface, Error:\n{e}" - ) - + ) + def unconfigure_medium_p2p_interface(device, interface): """ Unconfigure medium p2p on interface Args: @@ -10291,7 +10314,7 @@ def unconfigure_medium_p2p_interface(device, interface): Raise: SubCommandFailure: Failed unconfiguring medium p2p on interface """ - + log.debug("Unconfigure medium p2p on interface") cmd =[f"interface {interface}", "no medium p2p"] try: @@ -10299,4 +10322,217 @@ def unconfigure_medium_p2p_interface(device, interface): except SubCommandFailure as e: raise SubCommandFailure( f"Failed to unconfigure medium p2p on interface, Error:\n{e}" - ) \ No newline at end of file + ) + +def configure_interface_rep_stcn_segment(device, interface, segment): + """Configure interface rep stcn segment + Args: + device ('obj'): Device object + interface ('str'): Interface to configure + segment ('str'): Segment value + Returns: + None + Raises: + SubCommandFailure: Failed configuring interface rep stcn segment + """ + log.debug("Configure interface rep stcn segment") + cmd = [f"interface {interface}", f"rep stcn segment {segment}"] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed configuring interface rep stcn segment: {e}") + +def unconfigure_interface_rep_stcn_segment(device, interface): + """Unconfigure interface rep stcn segment + Args: + device ('obj'): Device object + interface ('str'): Interface to configure + Returns: + None + Raises: + SubCommandFailure: Failed unconfiguring interface rep stcn segment + """ + log.debug("Unconfigure interface rep stcn segment") + cmd = [f"interface {interface}", "no rep stcn segment"] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed unconfiguring interface rep stcn segment on {interface}") from e + +def configure_interface_rep_stcn_stp(device, interface): + """Configure interface rep stcn stp + Args: + device ('obj'): Device object + interface ('str'): Interface to configure + Returns: + None + Raises: + SubCommandFailure: Failed configuring interface rep stcn stp + """ + log.debug("Configure interface rep stcn stp") + cmd = [f"interface {interface}", "rep stcn stp"] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed configuring interface rep stcn stp on {interface}: {e}") + +def unconfigure_interface_rep_stcn_stp(device, interface): + """Unconfigure interface rep stcn stp + Args: + device ('obj'): Device object + interface ('str'): Interface to configure + Returns: + None + Raises: + SubCommandFailure: Failed unconfiguring interface rep stcn stp + """ + log.debug("Unconfigure interface rep stcn stp") + cmd = [f"interface {interface}", "no rep stcn stp"] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed unconfiguring interface rep stcn stp on {interface}: {e}") + +def configure_interface_rep_segment_edge_preferred(device, interface, segment): + """Configure REP Segment Edge Preferred on the device + Args: + device ('obj'): Device object + interface ('str'): Interface name + segment ('str'): Segment value + Returns: + None + Raises: + SubCommandFailure: Failed configuring rep segment edge preferred + """ + + cmd = [f"interface {interface}", "switchport", "switchport mode trunk", f"rep segment {segment} edge preferred"] + + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure REP Segment Edge Preferred on device {device.name}. Error: {e}" + ) + +def unconfigure_interface_rep_segment_edge_preferred(device, interface, segment): + """Unconfigure REP Segment Edge Preferred on the device + Args: + device ('obj'): Device object + interface ('str'): Interface name + segment ('str'): Segment value + Returns: + None + Raises: + SubCommandFailure: Failed unconfiguring rep segment edge preferred + """ + + cmd = [f"interface {interface}", f"no rep segment {segment} edge preferred"] + + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not unconfigure REP Segment Edge Preferred on device {device.name}. Error: {e}" + ) + +def configure_interface_rep_segment_edge_primary(device, interface, segment, preferred=False): + """Configure REP Segment Edge Primary on the device + Args: + device ('obj'): Device object + interface ('str'): Interface name + segment ('str'): Segment value + preferred ('bool', optional): Set to True for edge primary preferred (default: False) + Returns: + None + Raises: + SubCommandFailure: Failed configuring rep segment edge primary + """ + log.debug("Configure REP Segment Edge Primary") + cmd = [f"interface {interface}", "switchport", "switchport mode trunk"] + if preferred: + cmd.append(f"rep segment {segment} edge primary preferred") + else: + cmd.append(f"rep segment {segment} edge primary") + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to configure REP Segment Edge Primary on {interface}: {e}") + +def unconfigure_interface_rep_segment_edge_primary(device, interface, segment): + """Unconfigure REP Segment Edge Primary on the device + Args: + device ('obj'): Device object + interface ('str'): Interface name + segment ('str'): Segment value + Returns: + None + Raises: + SubCommandFailure: Failed unconfiguring rep segment edge primary + """ + + cmd = [f"interface {interface}", f"no rep segment {segment} edge primary"] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to unconfigure REP Segment Edge Primary on interface {interface}: {e}") + +def configure_ppp_multilink(device, interface): + """ Configure ppp multilink on interface + Args: + device ('obj'): Device object + interface ('str'): which interface to configure + Return: + None + Raise: + SubCommandFailure: Failed configuring ppp multilink on interface + """ + + log.debug(f"Configure ppp multilink on interface {interface}") + cmd =[f"interface {interface}", "ppp multilink"] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to configure ppp multilink on interface, Error:\n{e}" + ) + +def unconfigure_ppp_multilink(device, interface): + """ Configure no ppp multilink on interface + Args: + device ('obj'): Device object + interface ('str'): which interface to configure + Return: + None + Raise: + SubCommandFailure: Failed configuring no ppp multilink on interface + """ + + log.debug(f"Configure no ppp multilink on interface {interface}") + cmd =[f"interface {interface}", "no ppp multilink"] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to unconfigure ppp multilink on interface, Error:\n{e}" + ) + +def unconfigure_port_channel(device, port_channel): + """ Unconfigure port-channel ip address on port-channel interface + Args: + device ('obj'): Device object + port_channel ('str'): Port-channel number for the Port-channel interface + Returns: + None + Raises: + SubCommandFailure + """ + + log.debug(f"Unconfigure interface port-channel {port_channel}") + config = [f"no interface Port-channel {port_channel}"] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to unconfigure interface Port-channel {port_channel}. Error: {e}") + + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/execute.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/execute.py index 7360eea19..604baa667 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/execute.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/execute.py @@ -127,4 +127,21 @@ def execute_test_cable_diagnostics_tdr_interface(device, interface): output = device.execute(cmd) except Exception as err: log.error(f"Error while executing {cmd}. Error:\n{err}") - return output \ No newline at end of file + return output + +def execute_test_fru_fake_insert(device, mode): + """ + Args: + device ('obj'): device to use + mode ('str'): mode active/standby + Returns: + Return the test command execution output + Raises: + SubCommandFailure + """ + cmd = f"test platform software fed switch {mode} fru fake-insert" + try: + out = device.execute(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f'Failed to perform FRU Fake-insert. Error:\n{e}') + return out \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/get.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/get.py index 503279d73..6e98c7b5c 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/get.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/get.py @@ -1484,7 +1484,7 @@ def get_interface_media_types(device, interface): Returns: None - media types (`str`): Example: '10/100/1000BaseTX' , '100/1000/2.5GBaseTX' ,'100/1000/10GBaseTX - interface media + media types (`str`): Example: '10/100/1000BaseTX' , '100/1000/2.5GBaseTX' ,'100/1000/10GBaseTX - interface media type supporting copper connection. Example: '1000BaseSX', '1000BaseEX'- interface media type is supporting fiber connection. 'unknown' - interface type is unknown. @@ -1526,12 +1526,12 @@ def get_interface_capabilities_multiple_media_types(device, interface): def get_interfaces_transceiver_supported_dom(device, transceivers_list): - """Get the corresponding DOM type for the list of transceivers + """Get the corresponding DOM type for the list of transceivers Args: device (`obj`): Device object transceivers_list (`list`): List of transceivers to get the DOM type - + Returns: dom_value ('dict'): Digital Optical Monitoring value of the supported transceiver """ @@ -1541,7 +1541,7 @@ def get_interfaces_transceiver_supported_dom(device, transceivers_list): except Exception as e: log.error(f"Not able to get output for show interfaces transceiver supported-list. Error:\n{e}") return False - + return dom_value @@ -1555,8 +1555,8 @@ def get_interfaces_switchport_state(device, interface): Returns: None switchport_enable state: (`bool`): if switchport is enabled return True - switchport is disabled return False - + switchport is disabled return False + Raises: None """ @@ -1567,3 +1567,23 @@ def get_interfaces_switchport_state(device, interface): return return out[interface].get('switchport_enable') + + +def get_interface_traffic_packet_counters(device, interface, counter_fields): + """ Get interface traffic packet counters + + Args: + api (`obj`): Device object + interface (`str`): Interface name + counter_fields (`list`): List of counter fields to get + + Returns: + packet_counters (`dict`): Dictionary containing packet counters + + Raises: + None + """ + packet_counters = {} + for counter_field in counter_fields: + packet_counters[counter_field] = device.api.get_interface_packet_counter(interface=interface, counter_field=counter_field, output=None) + return packet_counters diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py index aa99d7514..3e6e5db82 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py @@ -582,6 +582,31 @@ def configure_ospf_network_point(device, interface): ) +def configure_ospf_network_broadcast(device, interface): + """configure ospf broadcast network + + Args: + device (`obj`): Device object + interface (`str`): interface to configure + ex.) + interface = 'tenGigabitEthernet0/4/0' + + Return: + None + + Raises: + SubCommandFailure + """ + configs = [ + f"interface {interface}", + f"ip ospf network broadcast" + ] + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Ospf network broadcast is not configured on device {device} for interface {interface}. Error:\n{e}" + ) def configure_ospf_bfd(device, interface): """configure ospf ip bfd @@ -613,6 +638,32 @@ def configure_ospf_bfd(device, interface): ) ) +def configure_ospf_priority(device, interface,priority): + """configure ip ospf priority + + Args: + device (`obj`): Device object + interface (`str`): interface to configure + ex.) + interface = 'tenGigabitEthernet0/4/0' + priority('int'): Priority value to configure for ospf + + Return: + None + + Raises: + SubCommandFailure + """ + cmd = [ + f"interface {interface}", + f"ip ospf priority {priority}" + ] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Ospf priority is not configured on device {device} for interface {interface}.Error:\n{e}" + ) def unconfigure_ospfv3(device, pid): """unconfigure ospfv3 @@ -2778,4 +2829,4 @@ def configure_ospf_vrf_lite(device, ospf_process_id, vrf_name): except SubCommandFailure as e: raise SubCommandFailure( f"Failed to configure vrf-lite capability for OSPF process {ospf_process_id}. Error:\n{e}" - ) \ No newline at end of file + ) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py index faffab57b..b941ce2fa 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py @@ -151,6 +151,7 @@ def configure_bba_group(device,name,vt_number, service_profile_name=None, .format(device=device, error=e) ) + def unconfigure_bba_group(device,name,vt_number): """ bba-group Args: @@ -1918,7 +1919,7 @@ def configure_macro_global_apply(device, macro_name, variables=None, values=None cmd = f"macro global apply {macro_name}" if variables and values: cmd += f" {variables} {values}" - + try: device.configure(cmd, timeout=timeout) except SubCommandFailure as e: @@ -6137,7 +6138,7 @@ def unconfigure_diagnostic_monitor_interval_module(device, mod_num, test_name, t raise SubCommandFailure( f"could not Unconfigure diagnostic monitor interval module {device}. Error:\n{e}" ) - + def configure_platform_mgmt_interface(device, interface_name): """ Configure platform management interface Args: @@ -6173,7 +6174,7 @@ def unconfigure_platform_mgmt_interface(device, interface_name): device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f"Failed to unconfigure platform management interface. Error:\n{e}") - + def execute_issu_set_rollback_timer(device, timer=0): """ Performs issu set rollback-timer on device @@ -6185,13 +6186,13 @@ def execute_issu_set_rollback_timer(device, timer=0): Raises: SubCommandFailure """ - + cmd = f"issu set rollback-timer {timer}" try: output = device.configure(cmd) except SubCommandFailure: raise SubCommandFailure("Rollback timer should be in format (0-7200) or hh:mm:ss format") - + def unconfigure_issu_set_rollback_timer(device, timer=0): """ Unconfigures issu set rollback-timer on device @@ -6213,7 +6214,7 @@ def unconfigure_issu_set_rollback_timer(device, timer=0): def configure_macro_name(device, macro_name, macro_configs, timeout=60): """ Configure macro name - + Args: device ('obj'): Device object macro_name ('str'): Macro namef @@ -6227,7 +6228,7 @@ def configure_macro_name(device, macro_name, macro_configs, timeout=60): def send_configs(device, macro_configs): for config in macro_configs: device.sendline(config) - + dialog = Dialog([ Statement( pattern=r"Enter macro commands one per line. End with the character.*", @@ -6246,3 +6247,70 @@ def send_configs(device, macro_configs): f"Failed to configure macro name {macro_name} on device {device.hostname}. Error:\n{e}" ) +def configure_key_config_key_newpass_oldpass(device, new_pass, old_pass): + """ Changes the master key password + Args: + device (`obj`): Device object + new_pass('str'): password, The new config-key + Minimum 8 characters not beginning with + IOS special character(! # ;) + old_pass('str'): password, The old config-key + Minimum 8 characters not beginning with + IOS special character(! # ;) + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f'key config-key newpass {new_pass} oldpass {old_pass}' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure configure key config key newpass oldpass on {device}. Error:\n{e}") + +def configure_parser_view(device, view_name, pwd, view_configs): + """" Configure Parser view + + Args: + device ('obj'): Device object + view_name ('str'): View name + pwd ('str'): Password + view_configs ('list'): Configuration execution to be included in the parser view + Raises: + SubCommandFailure + Returns: + None + """ + view_configs = [str(cmd) for cmd in view_configs] + base_config = [ + f'parser view {view_name}', + f'secret 0 {pwd}' + ] + view_configs = [f'command exec include {cmd}' for cmd in view_configs] + commands = base_config + view_configs + ['end'] + try: + device.configure(commands) + except SubCommandFailure as e: + raise SubCommandFailure(f"Parser view creation failed. Error:\n{e}") + + +def unconfigure_parser_view(device, view_name): + """" Unconfigure Parser view + + Args: + device ('obj'): Device object + view_name ('str'): View name + Raises: + SubCommandFailure + Returns: + None + """ + + cmd = f"no parser view {view_name}" + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Parser view deletion failed {view_name}. Error:\n{e}") + + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py index 1b4cb3799..74e6afb7d 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py @@ -1723,12 +1723,12 @@ def clear_ip_pim_rp_mapping(device): def execute_event_manager_run_with_reload(device,username,password, embedded_event_name="RELOAD",sleep_time=10): - """ Execute event manager with Embedded Event Manager policy name + """ Execute event manager with Embedded Event Manager policy name Args: device ('obj'): device to use - embedded_event_name ('str'): Embedded Event Manager policy name - username ('str'): username - password ('str'): password + embedded_event_name ('str'): Embedded Event Manager policy name + username ('str'): username + password ('str'): password sleep_time : sleep time Returns: True if reload successful else False @@ -1781,7 +1781,36 @@ def send_username(spawn): return False log.debug(f"Reload is successful on {device.name}") return True - + +def platform_software_fed_switch_phy_options(device, mode, lpn, phy_info, read_mode, phy_mode, phy_side, phy_device_id, phy_page_number, phy_register_address): + """ + Execute 'test platform software fed switch' command with the specified parameters. + + Args: + device (obj): Device object + mode(str) : 'active' + lpn (int): Local Port Number value (1-96) + phy_info (int): Phy mode (0-1) + read_mode (str): read,write,dump + phy_mode(int) : <0-1> 0/1 - Mode - Mdio clause 22/45 + phy_side (int): Phy line/system side (0-1) + phy_device_id (int): Phy device_id (0-255) + phy_page_number (int): Phy page number (0-65535) + phy_register_address (int): Phy register address (0-65535) + + Returns: + str: Output of the command + Raises: + SubCommandFailure: Failed executing the command + """ + + cmd = f"test platform software fed switch {mode} xcvr lpn {lpn} {phy_info} {read_mode} {phy_mode} {phy_side} {phy_device_id} {phy_page_number} {phy_register_address}" + + try: + return device.execute(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to execute command. Error:\n{e}") + def test_platform_software_usb_fake_insert_remove(device, switch_num, usbflash, action): """ Execute 'test platform software usb slot ' command on the device. @@ -1791,12 +1820,12 @@ def test_platform_software_usb_fake_insert_remove(device, switch_num, usbflash, switch_num (int): Slot or switch number usbflash (str): USB flash identifier ('usbflash1' or 'usbflash2') action (str): Action to perform ('fake-insert' or 'fake-remove') - + Returns: str: Output of the command """ command = f"test platform software usb slot {switch_num} {usbflash} {action}" - + try: device.execute(command) except SubCommandFailure as e: @@ -1810,15 +1839,16 @@ def test_platform_software_fru_fake_insert_remove(device, switch_num, action): device (obj): Device object switch_num (int): Slot or switch number action (str): Action to perform ('fake-insert' or 'fake-remove') - + Returns: str: Output of the command """ log.debug(f"Perform fake insert/remove for fru on {device}") - + command = f"test platform software fed switch {switch_num} fru {action}" - + try: device.execute(command) except SubCommandFailure as e: raise SubCommandFailure(f"Failed to perform fake insert/remove for fru. Error:\n{e}") + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_class_map/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_class_map/configure.py index cf0865f1b..92950d99e 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_class_map/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_class_map/configure.py @@ -91,4 +91,45 @@ def unconfigure_class_map(device, class_name, class_match_type='match-all'): error=e ) ) - + +def configure_class_map_access_group_on_device(device, class_map_name, acc_list_number): + """ Configure class-map access-group on device + Args: + device ('obj'): device to use + class_map_name ('str'): class-map name on which we need to configure + acc_list_number ('str') : access-list number/name + Returns: + None + Raises: + SubCommandFailure + """ + log.debug("Configuring class-map access-group on device") + configs = [f'class-map match-all {class_map_name}', + f'match access-group {acc_list_number}'] + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure class-map access-group on device {device}. Error:\n{e}") + +def configure_traffic_class_for_class_map(device, class_map_name, matching_statement, traffic_class_value): + """ Configure traffic-class for class-map on device + Args: + device ('obj'): device to use + class_map_name ('str'): Class-map name + matching_statement ('str') : matching statements under the classmap (match-any/match-all) + traffic_class_value ('int'): Traffic Class value from 0 to 7 + Returns: + None + Raises: + SubCommandFailure + """ + log.debug("Configuring traffic-class for class-map on device") + cmd = [f'class-map {matching_statement} {class_map_name}', + f'match traffic-class {traffic_class_value}'] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure traffic-class for class-map on device {device}. Error:\n{e}") + \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/qos/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/qos/configure.py index 1518e234b..23eb1ce19 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/qos/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/qos/configure.py @@ -379,4 +379,31 @@ def config_replace_to_flash_memory_force(device,flash='flash', timeout=60): try: device.execute(f"configure replace {flash}:backup_config force",timeout=timeout) except SubCommandFailure as e: - raise SubCommandFailure(f"Failed to execute configure replace flash memory force. Error:\n{e}") \ No newline at end of file + raise SubCommandFailure(f"Failed to execute configure replace flash memory force. Error:\n{e}") + +def configure_ip_access_list_with_dscp_on_device(device, acc_list_number, sequence_num, action, src_ip_add, dst_ip_add, dscp_val): + """ Configure ip access-list with source/destination host and dscp value + Args: + device ('obj'): device to use + acc_list_number('int') : Extended IP access-list number + sequence_num ('int') : Sequence Number + action ('str'): Specify packets to forward or reject (eg. permit, deny) + src_ip_add('str'): Sender Host IP address (eg. 10.1.1.1) + dst_ip_add('str'): Receiver Host IP address (eg. 10.1.1.1) + dscp_val('str'): Services codepoint value (eg. 0-7) + Returns: + None + Raises: + SubCommandFailure + """ + log.debug("Configuring ip access-list with source/destination host and dscp value on device") + + configs = [f'ip access-list extended {acc_list_number}', + f'{sequence_num} {action} ip host {src_ip_add} host {dst_ip_add} dscp {dscp_val}'] + try: + device.configure(configs) + + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure ip access-list with source/destination host and dscp value on device {device}. Error:\n{e}") + \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rep/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rep/__init__.py new file mode 100755 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rep/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rep/configure.py new file mode 100755 index 000000000..527ed09c8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rep/configure.py @@ -0,0 +1,211 @@ +'''IOSXE configure functions for iiot rep feature''' + +# Python +import logging + +# Unicon +from unicon.core.errors import SubCommandFailure + +# Logger +log = logging.getLogger(__name__) + +def configure_rep_segment(device, intfs, segmentnum, vlan=None, edge_port=False, no_neighbor=False, trunk=True): + """Configures REP segment + Args: + device ('obj'): Switch object + intfs ('list'): List of interfaces to configure + segmentnum ('str'): Segment number to configure + vlan ('str', 'optional'): Vlan to configure + edge_port ('bool' 'optional'): Configure edge port + no_neighbor ('bool' 'optional'): Configure no neighbor + trunk('bool', 'optional'): Configure switchport trunk + Returns: + None + Raises: + SubCommandFailure + """ + log.info("Configuring REP segment {} on interfaces {}".format(segmentnum, intfs)) + + if no_neighbor: + rep_command = "rep segment {} edge no-neighbor".format(segmentnum) + elif edge_port: + rep_command = "rep segment {} edge".format(segmentnum) + else: + rep_command = "rep segment {}".format(segmentnum) + + for intf in intfs: + if trunk: + config_list = [ + "interface {}".format(intf), + "switchport mode trunk", + rep_command, + "shut", + "no shut" + ] + else: + config_list = [ + "interface {}".format(intf), + rep_command, + "shut", + "no shut" + ] + if vlan: + config_list.append("switchport trunk allowed vlan {}".format(vlan)) + config_list.append("vlan {}".format(vlan)) + try: + device.configure(config_list) + except SubCommandFailure as e: + raise SubCommandFailure("Error configuring interface {}: {}".format(intf, e)) + +def configure_fast_rep_segment(device, intfs, segmentnum, vlan=None, edge_port=False, no_neighbor=False): + """Configures fastREP + Args: + device ('obj'): Switch object + intfs ('list'): List of interfaces to configure + segmentnum ('str'): Segment number to configure + vlan ('str', 'optional'): Vlan to configure + edge_port ('bool' 'optional'): Configure edge port + no_neighbor ('bool' 'optional'): Configure no neighbor + Returns: + None + Raises: + SubCommandFailure + """ + + log.info("Configuring fastREP segment {} on interfaces {}".format(segmentnum, intfs)) + + if no_neighbor: + rep_command = "rep segment {} edge no-neighbor".format(segmentnum) + elif edge_port: + rep_command = "rep segment {} edge".format(segmentnum) + else: + rep_command = "rep segment {}".format(segmentnum) + + for intf in intfs: + config_list = [ + "interface {}".format(intf), + "switchport mode trunk", + rep_command, + "rep fastmode", + "shut", + "no shut" + ] + if vlan: + config_list.append("switchport trunk allowed vlan {}".format(vlan)) + config_list.append("vlan {}".format(vlan)) + try: + device.configure(config_list) + except SubCommandFailure as e: + raise SubCommandFailure("Error configuring interface {}: {}".format(intf, e)) + +def unconfigure_rep_segment(device, intfs, segmentnum, vlan=None, edge_port=False, no_neighbor=False): + """Unconfigures REP segment + Args: + device ('obj'): Switch object + intfs ('list'): List of interfaces to unconfigure + segmentnum ('int'): Segment number to unconfigure + vlan ('str' 'optional'): Vlan to unconfigure + edge_port ('bool' 'optional'): unconfigure edge port + no_neighbor ('bool' 'optional'): unconfigure no neighbor + Returns: + None + Raises: + SubCommandFailure + """ + log.info("Unconfiguring REP segment {} on interfaces {}".format(segmentnum, intfs)) + + if no_neighbor: + rep_command = "no rep segment {} edge no-neighbor".format(segmentnum) + elif edge_port: + rep_command = "no rep segment {} edge".format(segmentnum) + else: + rep_command = "no rep segment {}".format(segmentnum) + + for intf in intfs: + config_list = [ + "interface {}".format(intf), + rep_command, + "no rep fastmode", + "no switchport mode trunk", + "no shut", + "shut" + ] + if vlan: + config_list.append("no switchport trunk allowed vlan {}".format(vlan)) + config_list.append("no vlan {}".format(vlan)) + try: + device.configure(config_list) + except SubCommandFailure as e: + raise SubCommandFailure("Error unconfiguring interface {}: {}".format(intf, e)) + +def unconfigure_fast_rep_segment(device, intfs, segmentnum, vlan=None, edge_port=False, no_neighbor=False): + """Unconfigures fastREP + Args: + device ('obj'): Switch object + intfs ('list'): List of interfaces to unconfigure + segmentnum ('int'): Segment number to unconfigure + vlan ('str' 'optional'): Vlan to unconfigure + edge_port ('bool' 'optional'): unconfigure edge port + no_neighbor ('bool' 'optional'): unconfigure no neighbor + Returns: + None + Raises: + SubCommandFailure + """ + log.info("Unconfiguring fastREP segment {} on interfaces {}".format(segmentnum, intfs)) + + if no_neighbor: + rep_command = "no rep segment {} edge no-neighbor".format(segmentnum) + elif edge_port: + rep_command = "no rep segment {} edge".format(segmentnum) + else: + rep_command = "no rep segment {}".format(segmentnum) + + for intf in intfs: + config_list = [ + "interface {}".format(intf), + rep_command, + "no rep fastmode", + "no switchport mode trunk", + "no shut", + "shut" + ] + if vlan: + config_list.append("no switchport trunk allowed vlan {}".format(vlan)) + config_list.append("no vlan {}".format(vlan)) + try: + device.configure(config_list) + except SubCommandFailure as e: + raise SubCommandFailure("Error unconfiguring interface {}: {}".format(intf, e)) + +def configure_rep_ztp(device): + """ Configure REP ZTP on the device + Args: + device ('obj'): Device object + Returns: + None + Raises: + SubCommandFailure + """ + try: + device.configure("rep ztp") + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not configure REP ZTP on device {device.name}. Error: {e}" + ) + +def unconfigure_rep_ztp(device): + """ Unconfigure REP ZTP on the device + Args: + device ('obj'): Device object + Returns: + None + Raises: + SubCommandFailure + """ + try: + device.configure("no rep ztp") + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not unconfigure REP ZTP on device {device.name}. Error: {e}" + ) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rommon/utils.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rommon/utils.py index be6497507..f70c3db71 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rommon/utils.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/rommon/utils.py @@ -43,8 +43,7 @@ def device_rommon_boot(device, golden_image=None, tftp_boot=None, error_pattern= image = tftp_boot.get('image', []) tftp_server = tftp_boot.get('tftp_server', "") - - # To boot using golden image + # To boot using golden image if golden_image: log.info(banner("Booting device '{}' with the Golden images".\ format(device.name))) @@ -66,6 +65,22 @@ def device_rommon_boot(device, golden_image=None, tftp_boot=None, error_pattern= cmd_info = ("tftp://", tftp_server, image[0]) cmd = ''.join(cmd_info) + # If the length of the TFTP path is greater than the + # imposed limit on IOSXE, boot from TFTP_FILE instead + if len(cmd) > 199: + log.info(f"TFTP path `{cmd}` is too long, will boot from TFTP_FILE instead") + cmd = "tftp:" + + # Set ROMMON variables + log.info('Setting the rommon variables for TFTP boot (device_rommon_boot)') + try: + if device.is_ha and hasattr(device, 'subconnections'): + device.api.configure_rommon_tftp_ha() + else: + device.api.configure_rommon_tftp() + except Exception as e: + log.warning(f'Failed to set the rommon variables for device {device.name}') + # To boot using tftp rommon variable # In this case, we assume the rommon variable TFTP_FILE is set already # and booting it using the "boot tftp:" command @@ -85,7 +100,7 @@ def device_rommon_boot(device, golden_image=None, tftp_boot=None, error_pattern= device.reload(image_to_boot=cmd, error_pattern=error_pattern, timeout=timeout) except Exception as e: log.error(str(e)) - raise Exception(f"Failed to boot the device {device.name}", from_exception=e) + raise Exception(f"Failed to boot the device {device.name}") else: log.info(f"Successfully boot the device {device.name}") @@ -102,7 +117,7 @@ def send_break_boot(device, console_activity_pattern= None, console_activity_pattern (str): Pattern to send the break at. Default to match this boot statement: "...." console_breakboot_char (str): Character to send when console_activity_pattern is matched. Default to '\x03'. - console_breakboot_telnet_break (bool): Use telnet `send break` to interrupt device boot. + console_breakboot_telnet_break (bool): Use telnet `send break` to interrupt device boot. grub_activity_pattern (str): Break pattern on the device for grub boot mode grub_breakboot_char (str): Character to send when grub_activity_pattern is matched break_count (int, optional): Number of break commands to send. Defaults to 2. @@ -115,7 +130,6 @@ def send_break_boot(device, console_activity_pattern= None, console_activity_pattern = console_activity_pattern or '\.\.\.\.' console_breakboot_char = console_breakboot_char or '\x03' - def telnet_breakboot(spawn, break_count): """ Breaks the booting process on a device using telnet `send break` @@ -142,7 +156,7 @@ def console_breakboot(spawn, break_count, break_char): Args: spawn (obj): Spawn connection object - break_count (int): Number of break commands to send + break_count (int): Number of break commands to send break_char (str): Char to send Returns: diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/route_map/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/route_map/configure.py index 31c2ca119..e765f0373 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/route_map/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/route_map/configure.py @@ -97,13 +97,14 @@ def configure_route_map_permit( device, route_map, seq, prefix_list=None, set_community=None, match_community=None, set_metric=None, set_weight=None, set_as_path_prepend=None, local_preference=None, - match_as_path=None, continue_id=None): + match_as_path=None, continue_id=None, match_interface=None): """ Configures route-map on device Args: device('obj'): device to configure on route_map('list'): route-map seq ('int'): sequence number prefix_list ('str'): prefix-list value + match_interface ('str'): Interface that needs to be matched set_community ('int'): set community value match_community ('int'): match community value set_as_path ('int') : set as-path values @@ -121,6 +122,8 @@ def configure_route_map_permit( cmd = [f"route-map {route_map} permit {seq}"] if prefix_list: cmd.append(f"match ip address prefix-list {prefix_list}") + if match_interface: + cmd.append(f"match interface {match_interface}") if match_community: cmd.append(f"match community {match_community}") if set_community: diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py index 4decf96e3..f91b3a968 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py @@ -724,3 +724,42 @@ def configure_object_list_schema_transfer_for_bulkstat(device, type_, object_nam raise SubCommandFailure( f"Could not configure Object list Schema Transfer for Bulkstat. Error:\n{error}" ) + + +def configure_snmp_server_host(device, host_ip, version, community_string): + """ Configures the snmp-server host or informs on device + Args: + device ('obj'): device to use + host_ip ('str'): WORD IP address of the SNMP notification host + community_string ('str'): Community string + version ('str', optional): SNMP version + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f"snmp-server host {host_ip} {version} {community_string}" + try: + device.configure(cmd) + except SubCommandFailure as error: + raise SubCommandFailure(f"Could not configure host on snmp-server. Error:\n{str(error)}") + + +def unconfigure_snmp_server_host(device, host_ip, version, community_string): + """ Unconfigures the snmp-server host + Args: + device ('obj'): device to use + host_ip ('str'): IP address of the SNMP notification host + version ('str'): SNMP version + community_string ('str'): Community string + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f"no snmp-server host {host_ip} {version} {community_string}" + try: + device.configure(cmd) + except SubCommandFailure as error: + raise SubCommandFailure(f"Could not unconfigure SNMP server host. Error:\n{str(error)}") + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_connection_default_start_stop_group_tacacs_group/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_connection_default_start_stop_group_tacacs_group/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_connection_default_start_stop_group_tacacs_group/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_connection_default_start_stop_group_tacacs_group/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..9f5883048 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_connection_default_start_stop_group_tacacs_group/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + aaa accounting connection default start-stop group tacacs+ group TACACS-group: "" + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: PREG_IFD_CFD_TB2_9500_SA(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: PREG_IFD_CFD_TB2_9500_SA(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: PREG_IFD_CFD_TB2_9500_SA# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_connection_default_start_stop_group_tacacs_group/test_api_configure_aaa_accounting_connection_default_start_stop_group_tacacs_group.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_connection_default_start_stop_group_tacacs_group/test_api_configure_aaa_accounting_connection_default_start_stop_group_tacacs_group.py new file mode 100644 index 000000000..e13e70f20 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_connection_default_start_stop_group_tacacs_group/test_api_configure_aaa_accounting_connection_default_start_stop_group_tacacs_group.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.aaa.configure import configure_aaa_accounting_connection_default_start_stop_group_tacacs_group + + +class TestConfigureAaaAccountingConnectionDefaultStartStopGroupTacacsGroup(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + PREG_IFD_CFD_TB2_9500_SA: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: C9500-24Q + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['PREG_IFD_CFD_TB2_9500_SA'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_aaa_accounting_connection_default_start_stop_group_tacacs_group(self): + result = configure_aaa_accounting_connection_default_start_stop_group_tacacs_group(self.device, 'TACACS-group') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_system_default_start_stop_group_tacacs_group/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_system_default_start_stop_group_tacacs_group/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_system_default_start_stop_group_tacacs_group/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_system_default_start_stop_group_tacacs_group/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..7f8bf3b9a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_system_default_start_stop_group_tacacs_group/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + aaa accounting system default start-stop group tacacs+ group TACACS-group: "" + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: PREG_IFD_CFD_TB2_9500_SA(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: PREG_IFD_CFD_TB2_9500_SA(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: PREG_IFD_CFD_TB2_9500_SA# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_system_default_start_stop_group_tacacs_group/test_api_configure_aaa_accounting_system_default_start_stop_group_tacacs_group.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_system_default_start_stop_group_tacacs_group/test_api_configure_aaa_accounting_system_default_start_stop_group_tacacs_group.py new file mode 100644 index 000000000..9c2e87ff6 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_accounting_system_default_start_stop_group_tacacs_group/test_api_configure_aaa_accounting_system_default_start_stop_group_tacacs_group.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.aaa.configure import configure_aaa_accounting_system_default_start_stop_group_tacacs_group + + +class TestConfigureAaaAccountingSystemDefaultStartStopGroupTacacsGroup(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + PREG_IFD_CFD_TB2_9500_SA: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: C9500-24Q + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['PREG_IFD_CFD_TB2_9500_SA'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_aaa_accounting_system_default_start_stop_group_tacacs_group(self): + result = configure_aaa_accounting_system_default_start_stop_group_tacacs_group(self.device, 'TACACS-group') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_authorization_config_commands/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_authorization_config_commands/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_authorization_config_commands/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_authorization_config_commands/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..799606b84 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_authorization_config_commands/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + aaa authorization config-commands: "" + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: PREG_IFD_CFD_TB1_GRYPHON_SA(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: PREG_IFD_CFD_TB1_GRYPHON_SA(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: PREG_IFD_CFD_TB1_GRYPHON_SA# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_authorization_config_commands/test_api_configure_aaa_authorization_config_commands.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_authorization_config_commands/test_api_configure_aaa_authorization_config_commands.py new file mode 100644 index 000000000..2faada266 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_aaa_authorization_config_commands/test_api_configure_aaa_authorization_config_commands.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.aaa.configure import configure_aaa_authorization_config_commands + + +class TestConfigureAaaAuthorizationConfigCommands(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + PREG_IFD_CFD_TB1_GRYPHON_SA: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: C9500-24Y4C + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['PREG_IFD_CFD_TB1_GRYPHON_SA'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_aaa_authorization_config_commands(self): + result = configure_aaa_authorization_config_commands(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_common_criteria_policy/test_api_configure_common_criteria_policy.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_common_criteria_policy/test_api_configure_common_criteria_policy.py index 698032a50..433ff65be 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_common_criteria_policy/test_api_configure_common_criteria_policy.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/configure_common_criteria_policy/test_api_configure_common_criteria_policy.py @@ -32,3 +32,33 @@ def test_configure_common_criteria_policy(self): result = configure_common_criteria_policy(self.device, 'ABCD', 5, 0, 0, 1, 1, 20, 8, 0, 1, 5, True, 1) expected_output = None self.assertEqual(result, expected_output) + +class TestConfigureCommonCriteriaPolicyBase(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Router: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir mock_data --state connect + protocol: unknown + os: iosxe + platform: vwlc + type: wlc + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Router'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_common_criteria_policy(self): + result = configure_common_criteria_policy(self.device, 'ABCD', None, None, None, None, None, None, 1, None, None, None, False, None) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_map/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_map/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_map/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_map/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..772e23e86 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_map/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,39 @@ +configure: + commands: + address-family l2vpn evpn: "address-family l2vpn evpn\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + neighbor pg-ibgp-rc route-map rm-bgp-no-export in: "neighbor pg-ibgp-rc route-map\ + \ rm-bgp-no-export in\r\n" + no logging console: '' + router bgp 1: "router bgp 1\r\n" + prompt: IR1101(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR1101(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_map/test_api_configure_bgp_l2vpn_route_map.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_map/test_api_configure_bgp_l2vpn_route_map.py new file mode 100644 index 000000000..6f8dd329a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_map/test_api_configure_bgp_l2vpn_route_map.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.bgp.configure import configure_bgp_l2vpn_route_map + + +class TestConfigureBgpL2vpnRouteMap(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR1101: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR1101'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_bgp_l2vpn_route_map(self): + result = configure_bgp_l2vpn_route_map(self.device, 'l2vpn', 1, 'pg-ibgp-rc', 'rm-bgp-no-export', 'in', 'evpn') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_reflector_client/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_reflector_client/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_reflector_client/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_reflector_client/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..74cd22f27 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_reflector_client/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,39 @@ +configure: + commands: + address-family l2vpn evpn: "address-family l2vpn evpn\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + neighbor pg-ibgp-rc route-reflector-client: "neighbor pg-ibgp-rc route-reflector-client\r\ + \n" + no logging console: '' + router bgp 1: "router bgp 1\r\n" + prompt: IR1101(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR1101(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_reflector_client/test_api_configure_bgp_l2vpn_route_reflector_client.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_reflector_client/test_api_configure_bgp_l2vpn_route_reflector_client.py new file mode 100644 index 000000000..a0b6cde07 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_l2vpn_route_reflector_client/test_api_configure_bgp_l2vpn_route_reflector_client.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.bgp.configure import configure_bgp_l2vpn_route_reflector_client + + +class TestConfigureBgpL2vpnRouteReflectorClient(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR1101: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR1101'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_bgp_l2vpn_route_reflector_client(self): + result = configure_bgp_l2vpn_route_reflector_client(self.device, 'l2vpn', 1, 'pg-ibgp-rc', 'evpn') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_router_id_peergroup_neighbor/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_router_id_peergroup_neighbor/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_router_id_peergroup_neighbor/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_router_id_peergroup_neighbor/mock_data/iosxe/mock_data.yaml index 915abb475..14cef6e2e 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_router_id_peergroup_neighbor/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_router_id_peergroup_neighbor/mock_data/iosxe/mock_data.yaml @@ -1,29 +1,32 @@ configure: commands: + bgp listen range 102.102.102.0/24 peer-group pg-ibgp-rc: "bgp listen range 102.102.102.0/24\ + \ peer-group pg-ibgp-rc\r\n" bgp log-neighbor-changes: "bgp log-neighbor-changes\r\n" end: new_state: execute line console 0: new_state: configure_line - neighbor neigh-gig1 peer-group: "neighbor neigh-gig1 peer-group\r\n" - neighbor neigh-gig1 remote-as 1: "neighbor neigh-gig1 remote-as 1\r\n" + neighbor pg-ibgp-rc peer-group: "neighbor pg-ibgp-rc peer-group\r\n" + neighbor pg-ibgp-rc remote-as 1: "neighbor pg-ibgp-rc remote-as 1\r\n" no logging console: '' router bgp 1: "router bgp 1\r\n" - prompt: mac-gen2(config)# + prompt: IR1101(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: mac-gen2(config-line)# + prompt: IR1101(config-line)# connect: commands: - '': - new_state: execute - preface: |- - Trying mock_device ... + ? '' + : new_state: execute + preface: 'Trying mock_device ... + Connected to mock_device. - Escape character is '^]'. + + Escape character is ''^]''.' prompt: '' execute: commands: @@ -32,7 +35,7 @@ execute: config-transaction: new_state: configure show version: '' + show version | include operating mode: '' term length 0: '' term width 0: '' - show version | include operating mode: '' - prompt: mac-gen2# + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_router_id_peergroup_neighbor/test_api_configure_bgp_router_id_peergroup_neighbor.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_router_id_peergroup_neighbor/test_api_configure_bgp_router_id_peergroup_neighbor.py index 3e8d4b574..ee13d2ea6 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_router_id_peergroup_neighbor/test_api_configure_bgp_router_id_peergroup_neighbor.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_bgp_router_id_peergroup_neighbor/test_api_configure_bgp_router_id_peergroup_neighbor.py @@ -1,3 +1,4 @@ +import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.bgp.configure import configure_bgp_router_id_peergroup_neighbor @@ -7,21 +8,21 @@ class TestConfigureBgpRouterIdPeergroupNeighbor(unittest.TestCase): @classmethod def setUpClass(self): - testbed = """ + testbed = f""" devices: - mac-gen2: + IR1101: connections: defaults: class: unicon.Unicon a: - command: mock_device_cli --os iosxe --mock_data_dir mock_data --state connect + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: cat9k - type: C9400 + platform: router + type: router """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['mac-gen2'] + self.device = self.testbed.devices['IR1101'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -29,6 +30,6 @@ def setUpClass(self): ) def test_configure_bgp_router_id_peergroup_neighbor(self): - result = configure_bgp_router_id_peergroup_neighbor(self.device, '1', 'neigh-gig1', '1') + result = configure_bgp_router_id_peergroup_neighbor(self.device, 1, 'pg-ibgp-rc', 1, '102.102.102.0/24', 'pg-ibgp-rc') expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_redistribute_connected/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_redistribute_connected/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_redistribute_connected/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_redistribute_connected/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..eabca9106 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_redistribute_connected/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,39 @@ +configure: + commands: + address-family ipv4: "address-family ipv4\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + redistribute connected route-map rm-adv-loopback: "redistribute connected route-map\ + \ rm-adv-loopback\r\n" + router bgp 1: "router bgp 1\r\n" + prompt: IR1101(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR1101(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_redistribute_connected/test_api_configure_redistribute_connected.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_redistribute_connected/test_api_configure_redistribute_connected.py new file mode 100644 index 000000000..a7336e921 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/configure_redistribute_connected/test_api_configure_redistribute_connected.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.bgp.configure import configure_redistribute_connected + + +class TestConfigureRedistributeConnected(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR1101: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR1101'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_redistribute_connected(self): + result = configure_redistribute_connected(self.device, 1, 'ipv4', None, 'rm-adv-loopback') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/get_running_config_section_dict/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/get_running_config_section_dict/mock_data/iosxe/mock_data.yaml index 482672a8d..ea15fb759 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/get_running_config_section_dict/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/get_running_config_section_dict/mock_data/iosxe/mock_data.yaml @@ -1,25 +1,30 @@ configure: commands: + address-family l2vpn: '% Invalid command at ''^'' marker.' end: new_state: execute line console 0: new_state: configure_line + neighbor evpn route-reflector-client: '% Invalid command at ''^'' marker.' + neighbor rm-bgp-no-export route-map in` evpn: '% Invalid command at ''^'' marker.' no logging console: '' - prompt: iolpe2(config)# + router bgp 1: '% Invalid command at ''^'' marker.' + prompt: IR1101(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: iolpe2(config-line)# + prompt: IR1101(config-line)# connect: commands: - '': - new_state: execute - preface: |- - Trying mock_device ... + ? '' + : new_state: execute + preface: 'Trying mock_device ... + Connected to mock_device. - Escape character is '^]'. + + Escape character is ''^]''.' prompt: '' execute: commands: @@ -29,482 +34,139 @@ execute: new_state: configure show run: response: - - |- - Building configuration... - - Current configuration : 8337 bytes - ! - ! Last configuration change at 15:10:04 PST Mon Jul 10 2023 - ! - version 17.13 - service tcp-keepalives-in - service tcp-keepalives-out - service timestamps debug datetime msec - service timestamps log datetime msec - service internal - service compress-config - ! - hostname iolpe2 - ! - boot-start-marker - boot-end-marker - ! - ! - vrf definition ce1 - rd 3:3 - ! - address-family ipv4 - route-target export 1:1 - route-target import 1:1 - exit-address-family - ! - address-family ipv6 - route-target export 1:1 - route-target import 1:1 - exit-address-family - ! - logging buffered 4000000 - no logging console - no aaa new-model - ! - ! - ! - clock timezone PST -8 0 - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - no ip domain lookup - ip cef - login on-success log - ipv6 unicast-routing - ipv6 cef - ! - ! - ! - ! - ! - ! - ! - ! - mpls traffic-eng tunnels - ! - ! - ! - ! - ! - memory free low-watermark processor 54960 - ! - ! - spanning-tree mode rapid-pvst - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - interface Loopback1 - ip address 1.1.1.3 255.255.255.255 - ip router isis sr - ipv6 address 2001::1:1:1:3/128 - ipv6 router isis sr - ! - interface Ethernet0/0 - no ip address - shutdown - ! - interface Ethernet0/1 - no ip address - shutdown - ! - interface Ethernet0/2 - no ip address - shutdown - ! - interface Ethernet0/3 - no ip address - shutdown - ! - interface Ethernet1/0 - description to iolce1 Ethernet2/0 - vrf forwarding ce1 - ip address 99.1.3.3 255.255.255.0 - ipv6 address 2001::99:1:3:3/112 - ! - interface Ethernet1/1 - description to iolce1 Ethernet2/1 - vrf forwarding ce1 - ip address 100.1.3.3 255.255.255.0 - ipv6 address 2001::100:1:3:3/112 - ! - interface Ethernet1/2 - no ip address - shutdown - ! - interface Ethernet1/3 - no ip address - shutdown - ! - interface Ethernet2/0 - description to iolpe1 Ethernet2/0 - ip address 99.2.3.3 255.255.255.0 - ip router isis sr - ipv6 address 2001::99:2:3:3/112 - ipv6 router isis sr - mpls ip - mpls traffic-eng tunnels - isis network point-to-point - ip rsvp bandwidth - ! - interface Ethernet2/1 - description to iolpe1 Ethernet2/1 - ip address 100.2.3.3 255.255.255.0 - ip router isis sr - ipv6 address 2001::100:2:3:3/112 - ipv6 router isis sr - mpls ip - mpls traffic-eng tunnels - isis network point-to-point - ip rsvp bandwidth - ! - interface Ethernet2/2 - no ip address - shutdown - ! - interface Ethernet2/3 - no ip address - shutdown - ! - interface Ethernet3/0 - description to iolp2 Ethernet1/0 - ip address 99.3.5.3 255.255.255.0 - ip router isis sr - ipv6 address 2001::99:3:5:3/112 - ipv6 router isis sr - mpls ip - mpls traffic-eng tunnels - isis network point-to-point - ip rsvp bandwidth - ! - interface Ethernet3/1 - description to iolp2 Ethernet1/1 - ip address 100.3.5.3 255.255.255.0 - ip router isis sr - ipv6 address 2001::100:3:5:3/112 - ipv6 router isis sr - mpls ip - mpls traffic-eng tunnels - isis network point-to-point - ip rsvp bandwidth - ! - interface Ethernet3/2 - no ip address - shutdown - ! - interface Ethernet3/3 - no ip address - shutdown - ! - interface Ethernet4/0 - no ip address - shutdown - ! - interface Ethernet4/1 - no ip address - shutdown - ! - interface Ethernet4/2 - no ip address - shutdown - ! - interface Ethernet4/3 - no ip address - shutdown - ! - interface Ethernet5/0 - description to iolp1 Ethernet5/0 - ip address 99.3.4.3 255.255.255.0 - ip router isis sr - ipv6 address 2001::99:3:4:3/112 - ipv6 router isis sr - mpls ip - mpls traffic-eng tunnels - isis network point-to-point - ip rsvp bandwidth - ! - interface Ethernet5/1 - description to iolp1 Ethernet5/1 - ip address 100.3.4.3 255.255.255.0 - ip router isis sr - ipv6 address 2001::100:3:4:3/112 - ipv6 router isis sr - mpls ip - mpls traffic-eng tunnels - isis network point-to-point - ip rsvp bandwidth - ! - interface Ethernet5/2 - no ip address - shutdown - ! - interface Ethernet5/3 - no ip address - shutdown - ! - ! - segment-routing mpls - ! - set-attributes - address-family ipv4 - sr-label-preferred - exit-address-family - ! - global-block 16000 23999 - local-block 30000 39999 - ! - connected-prefix-sid-map - address-family ipv4 - 1.1.1.3/32 index 3 range 1 - exit-address-family - ! - ! - segment-routing traffic-eng - ! - on-demand color 10 - authorize - candidate-paths - preference 1 - constraints - segments - dataplane srv6 - ! - ! - dynamic - ! - ! - ! - ! - ! - segment-routing srv6 - locators - locator loc1 - prefix FC01:101:3::/48 - format usid-f3216 - ! - router isis sr - net 49.0000.0000.0003.00 - is-type level-2-only - metric-style wide - distribute link-state - segment-routing mpls - ! - address-family ipv6 - multi-topology - router-id Loopback1 - segment-routing srv6 - locator loc1 - level-2 - exit-address-family - mpls traffic-eng router-id Loopback1 - mpls traffic-eng level-2 - ! - router bgp 65000 - ! - segment-routing srv6 - locator loc1 - exit-srv6 - ! - bgp router-id interface Loopback1 - bgp log-neighbor-changes - bgp graceful-restart all - no bgp default ipv4-unicast - neighbor 1.1.1.4 remote-as 65000 - neighbor 1.1.1.4 update-source Loopback1 - neighbor 1.1.1.6 remote-as 65000 - neighbor 1.1.1.6 update-source Loopback1 - neighbor 2001::1:1:1:4 remote-as 65000 - neighbor 2001::1:1:1:4 update-source Loopback1 - neighbor 2001::1:1:1:6 remote-as 65000 - neighbor 2001::1:1:1:6 update-source Loopback1 - ! - address-family ipv4 - redistribute static route-map test - exit-address-family - ! - address-family vpnv4 - ! - segment-routing srv6 - locator loc1 - alloc-mode per-vrf - exit-srv6 - ! - neighbor 1.1.1.4 activate - neighbor 1.1.1.4 send-community extended - neighbor 1.1.1.4 next-hop-self - neighbor 1.1.1.4 route-map test in - neighbor 1.1.1.4 route-map pe2 out - neighbor 1.1.1.6 activate - neighbor 1.1.1.6 send-community extended - neighbor 1.1.1.6 next-hop-self - neighbor 1.1.1.6 route-map odn in - neighbor 1.1.1.6 route-map pe2 out - neighbor 2001::1:1:1:4 activate - neighbor 2001::1:1:1:4 send-community both - neighbor 2001::1:1:1:4 next-hop-self - neighbor 2001::1:1:1:4 route-map odn in - neighbor 2001::1:1:1:4 route-map pe2 out - neighbor 2001::1:1:1:6 activate - neighbor 2001::1:1:1:6 send-community both - neighbor 2001::1:1:1:6 next-hop-self - neighbor 2001::1:1:1:6 route-map odn in - neighbor 2001::1:1:1:6 route-map pe2 out - exit-address-family - ! - address-family ipv6 - exit-address-family - ! - address-family vpnv6 - ! - segment-routing srv6 - locator loc1 - alloc-mode per-vrf - exit-srv6 - ! - neighbor 1.1.1.4 activate - neighbor 1.1.1.4 send-community extended - neighbor 1.1.1.4 next-hop-self - neighbor 1.1.1.4 route-map odn in - neighbor 1.1.1.4 route-map pe2 out - neighbor 1.1.1.6 activate - neighbor 1.1.1.6 send-community extended - neighbor 1.1.1.6 next-hop-self - neighbor 1.1.1.6 route-map odn in - neighbor 1.1.1.6 route-map pe2 out - neighbor 2001::1:1:1:4 activate - neighbor 2001::1:1:1:4 send-community both - neighbor 2001::1:1:1:4 next-hop-self - neighbor 2001::1:1:1:4 route-map odn in - neighbor 2001::1:1:1:4 route-map pe2 out - neighbor 2001::1:1:1:6 activate - neighbor 2001::1:1:1:6 send-community both - neighbor 2001::1:1:1:6 next-hop-self - neighbor 2001::1:1:1:6 route-map odn in - neighbor 2001::1:1:1:6 route-map pe2 out - exit-address-family - ! - address-family ipv4 vrf ce1 - neighbor 99.1.3.1 remote-as 65001 - neighbor 99.1.3.1 activate - neighbor 99.1.3.1 send-community extended - neighbor 100.1.3.1 remote-as 65001 - neighbor 100.1.3.1 activate - neighbor 100.1.3.1 send-community extended - exit-address-family - ! - address-family ipv6 vrf ce1 - neighbor 2001::99:1:3:1 remote-as 65001 - neighbor 2001::99:1:3:1 activate - neighbor 2001::99:1:3:1 send-community extended - neighbor 2001::100:1:3:1 remote-as 65001 - neighbor 2001::100:1:3:1 activate - neighbor 2001::100:1:3:1 send-community extended - exit-address-family - ! - ip forward-protocol nd - ! - ! - ip http server - ip http secure-server - ip ssh bulk-mode 131072 - ! - no logging btrace - ! - route-map odn permit 10 - set extcommunity color 10 - ! - route-map pe2 permit 10 - set local-preference 30 - ! - ! - ! - performance-measurement - interface Ethernet2/0 - delay-measurement - advertise-delay 10 - ! - ! - interface Ethernet2/1 - delay-measurement - advertise-delay 10 - ! - ! - interface Ethernet3/0 - delay-measurement - advertise-delay 10 - ! - ! - interface Ethernet3/1 - delay-measurement - advertise-delay 10 - ! - ! - interface Ethernet5/0 - delay-measurement - advertise-delay 10 - ! - ! - interface Ethernet5/1 - delay-measurement - advertise-delay 10 - ! - ! - ! - ! - control-plane - ! - ! - ! - line con 0 - exec-timeout 0 0 - logging synchronous - line aux 0 - line vty 0 4 - exec-timeout 0 0 - login - transport input ssh - ! - ! - ! - ! - end + - "Building configuration...\r\n\r\nCurrent configuration : 8848 bytes\r\n!\r\ + \n! Last configuration change at 06:08:57 UTC Fri Aug 23 2024\r\n!\r\nversion\ + \ 17.16\r\nservice timestamps debug datetime msec\r\nservice timestamps log\ + \ datetime msec\r\nplatform qfp utilization monitor load 80\r\nplatform hardware\ + \ throughput level 250M\r\nplatform hardware msata-led\r\n!\r\nhostname IR1101\r\ + \n!\r\nboot-start-marker\r\nboot system bootflash:ir1101-universalk9.2024-08-19_16.16_flian.SSA.bin\r\ + \nboot-end-marker\r\n!\r\n!\r\nno logging console\r\naaa new-model\r\n!\r\n\ + !\r\naaa authentication login CON local\r\naaa authentication login VTY local\r\ + \naaa authentication dot1x default group radius\r\naaa authorization network\ + \ default group radius \r\naaa authorization auth-proxy default group radius\ + \ \r\naaa accounting auth-proxy default start-stop group radius\r\naaa accounting\ + \ dot1x default start-stop group radius\r\n!\r\n!\r\naaa session-id common\r\ + \n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\nlogin block-for 60 attempts\ + \ 3 within 30\r\nlogin delay 3\r\nlogin on-success log\r\n!\r\n!\r\n!\r\n\ + !\r\n!\r\n!\r\n!\r\nsubscriber templating\r\n!\r\n! \r\n! \r\n! \r\n! \r\n\ + !\r\n!\r\n!\r\nl2vpn evpn\r\n replication-type ingress\r\n!\r\nl2vpn evpn\ + \ profile evpn_va vlan-aware\r\n evi-id 3\r\n l2vni-base 50000\r\n ethernet-tag\ + \ auto-vni\r\n!\r\nl2vpn evpn ethernet-segment 1\r\n identifier type 0 0A.0A.0A.0A.0A.0A.0A.0A.0A\r\ + \n redundancy all-active\r\n!\r\nl2vpn evpn ethernet-segment 2\r\n identifier\ + \ type 3 system-mac 0020.bbbb.bbbb\r\n redundancy all-active\r\n!\r\nl2vpn\ + \ evpn instance 1 vlan-aware\r\n encapsulation vxlan\r\n replication-type\ + \ ingress\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\ncrypto pki trustpoint\ + \ TP-self-signed-79755127\r\n enrollment selfsigned\r\n subject-name cn=IOS-Self-Signed-Certificate-79755127\r\ + \n revocation-check none\r\n rsakeypair TP-self-signed-79755127\r\n hash sha256\r\ + \n!\r\ncrypto pki trustpoint SLA-TrustPoint\r\n enrollment pkcs12\r\n revocation-check\ + \ crl\r\n hash sha512\r\n!\r\n!\r\ncrypto pki certificate chain TP-self-signed-79755127\r\ + \n certificate self-signed 01\r\n 3082032C 30820214 A0030201 02020101 300D0609\ + \ 2A864886 F70D0101 0D050030 \r\n 2F312D30 2B060355 04030C24 494F532D 53656C66\ + \ 2D536967 6E65642D 43657274 \r\n 69666963 6174652D 37393735 35313237 301E170D\ + \ 32343038 31313034 30343238 \r\n 5A170D33 34303831 31303430 3432385A 302F312D\ + \ 302B0603 5504030C 24494F53 \r\n 2D53656C 662D5369 676E6564 2D436572 74696669\ + \ 63617465 2D373937 35353132 \r\n 37308201 22300D06 092A8648 86F70D01 01010500\ + \ 0382010F 00308201 0A028201 \r\n 010096BD FA5EC31E E1CA26D1 D1A94236 53C2676C\ + \ CBA0B127 950659A7 4E30333A \r\n 0E2F09E5 0003CF83 24D0F290 71633F0E 3FCA406A\ + \ 6E973955 D62A886D 38D3E72B \r\n ADC0EEF7 E110E2B3 90CFD773 FD172613 CFDB5BFA\ + \ 986129C4 BF27264D 63B30B5C \r\n 7FF00828 1D1B290A 552A7D90 F7F6BFDF DBE9146E\ + \ 7A0A7261 A48BF507 C724D80C \r\n 57E40B34 5D13765B CB30AB97 322896F2 D58C6FC7\ + \ 97881B0F 02494695 28067056 \r\n 5ED1F03D 5D862072 0FC2BE97 E02C149C 5A6953E7\ + \ 54F80ED6 A367C749 5202FC26 \r\n 040FEB98 AACD013C 0219E81C A17B3165 BC6E293F\ + \ 8C99A03E 19B1B20B F819DBD3 \r\n 3BAB97FE 6C52EFBB 1BCBC620 ED88716D 62C32FB9\ + \ D7CB201C 44383EEB ADF9EC7E \r\n 56710203 010001A3 53305130 1D060355 1D0E0416\ + \ 0414CDFE 54823321 E5288730 \r\n ECB57C9D AC16E8F7 8C4B301F 0603551D 23041830\ + \ 168014CD FE548233 21E52887 \r\n 30ECB57C 9DAC16E8 F78C4B30 0F060355 1D130101\ + \ FF040530 030101FF 300D0609 \r\n 2A864886 F70D0101 0D050003 82010100 38DACAB7\ + \ 4A785C4C 31DCB300 1A2059B1 \r\n D494F855 8AEE9D74 2211CE08 BBB475A9 E6C19D2F\ + \ 18F3028E D05D766D 0914DC02 \r\n DE77BF86 623303CF 419A6423 D8DE02AF 51C0525A\ + \ F5C7A823 78475D78 EFBB5A0F \r\n 06D462F5 7FF006E8 61B060DB 4F5C448A 7F665ED3\ + \ 36E4F72A D3C211B2 6D02D27E \r\n F470DCB4 DAC377C5 38AAF646 32A72DE3 111FCA7E\ + \ 5B72A3F8 56A1186B A410D8E2 \r\n 8BC33D8A EC579C44 75DD9462 3AC80735 D548CFD1\ + \ 72E59516 2DC268F5 5F578897 \r\n 0F3A9E56 43799614 71ADA617 A965FA8F 34CB72C6\ + \ C08B7317 A2F14949 5EF4B26B \r\n 9EC0EBB3 00905472 28782737 324C6084 3B442E60\ + \ CDE7733A 9CE57C53 494B9353 \r\n 7F7CDDC6 D40F7CB5 6743D168 31625D2B\r\n\ + \ \tquit\r\ncrypto pki certificate chain SLA-TrustPoint\r\n certificate ca\ + \ 01\r\n 3082031B 30820203 A0030201 02020101 300D0609 2A864886 F70D0101 0B050030\ + \ \r\n 2F310E30 0C060355 040A1305 43697363 6F311D30 1B060355 04031314 4C696365\ + \ \r\n 6E73696E 6720526F 6F74202D 20444556 301E170D 31333034 32343231 35353433\ + \ \r\n 5A170D33 33303432 34323135 3534335A 302F310E 300C0603 55040A13 05436973\ + \ \r\n 636F311D 301B0603 55040313 144C6963 656E7369 6E672052 6F6F7420 2D204445\ + \ \r\n 56308201 22300D06 092A8648 86F70D01 01010500 0382010F 00308201 0A028201\ + \ \r\n 01009C56 7101D61E DF2EBCC3 BA7AE0DB B241B3B4 328A9B00 EB8A80D0 2AA86F5E\ + \ \r\n F1AEBFDE B67BD6AD 7DAD7B43 F582753B FFCC1CA5 A7841A07 6934D3AF 99078EF6\ + \ \r\n 179196FA 4FB3F2ED 3942C756 BF1CA0A9 CC98A7A7 F9E43724 D9E61D47 89E9E792\ + \ \r\n DD9F27B4 517C2BDE D0EB5B9A 787BA085 D9BBF003 F0563BE0 A4450C8F 127B5583\ + \ \r\n 3EBC1385 2D9BAD98 68D3AE07 5C27987C 6B814B99 0686B14A 5F61753C 813089E6\ + \ \r\n AEC48C68 F6D45267 0E365F44 B4456E11 96DCB950 233C8ADB 9FEEBAF1 2B5F3BB6\ + \ \r\n 7CE521B5 F277EBF6 03B7B0A4 958C9C7D 5460C20B CF9CCFC7 14B80F58 B5268947\ + \ \r\n 6D081172 26916B41 FB07DF42 EB9B9408 EC346138 23FBD8C4 19909697 A30845F3\ + \ \r\n 01C50203 010001A3 42304030 0E060355 1D0F0101 FF040403 02010630 0F060355\ + \ \r\n 1D130101 FF040530 030101FF 301D0603 551D0E04 16041443 214521B5 FB217A1A\ + \ \r\n 4D1BB702 36E664CB EC8B6530 0D06092A 864886F7 0D01010B 05000382 01010085\ + \ \r\n F1B1F2AE AE7D2F9C AB0351C3 29E3F1AE 982DF11F 5E3C90F6 00B3CDED 5A1491FB\ + \ \r\n DF07E06C AA0F4325 9FB4C4AE 2080F675 8C3B7AC5 4EAAA03E C5B50A2F 670AFF87\ + \ \r\n EDA6462F CFC43967 C024AB32 EE3CCDCF A04B9DAE 1BBABBDA C8DF5587 CF51CB1C\ + \ \r\n 005A282F 8B518A5A 8C6F9B3C AABA3446 32EF3A75 C2F45450 7A9BCFD3 0C8BE54A\ + \ \r\n 11872DE0 CF1200D0 D1018FD9 AC685968 167E421C 9BC394ED 9BC85463 83B28146\ + \ \r\n 07B2BDED DFC1605B 4D16007B 68723E25 55908512 4EEB0A70 B2A74C2A CB1EC882\ + \ \r\n C3215B87 6FC74304 241E59D7 C7C02C6D BD3042F5 196E8133 7A4446A4 81216E70\ + \ \r\n CF52CF22 50A7D23E FA9F6B07 FB0F6386 9DCC3BBC 65250693 38CF6BA6 CB8EFD\r\ + \n \tquit\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\ndiagnostic bootup\ + \ level minimal\r\n!\r\nno license feature hseck9\r\nlicense udi pid IR1101-K9\ + \ sn FCW2804Y6L5\r\nmemory free low-watermark processor 43390\r\n!\r\nspanning-tree\ + \ extend system-id\r\n!\r\n!\r\n!\r\n!\r\nredundancy\r\nbridge-domain 12 \r\ + \n member Vlan12 service-instance 12\r\n member evpn-instance profile evpn_va\r\ + \n!\r\nbridge-domain 20 \r\n member Vlan20 service-instance 20\r\n member\ + \ evpn-instance\r\n!\r\nbridge-domain 21 \r\n member Vlan21 service-instance\ + \ 21\r\n member evpn-instance\r\n!\r\nbridge-domain 22 \r\n member Vlan22\ + \ service-instance 22\r\n member evpn-instance profile evpn_va\r\n!\r\n!\r\ + \n!\r\n!\r\n!\r\n!\r\n!\r\ncontroller Cellular 0/1/0\r\n!\r\ncontroller Cellular\ + \ 0/4/0\r\n!\r\n!\r\nvlan internal allocation policy ascending\r\n!\r\n!\r\ + \n! \r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n\ + ! \r\n! \r\n!\r\n!\r\ninterface Loopback0\r\n ip address 100.100.100.1 255.255.255.255\r\ + \n!\r\ninterface GigabitEthernet0/0/0\r\n ip address 10.10.10.2 255.255.255.0\r\ + \n!\r\ninterface FastEthernet0/0/1\r\n switchport access vlan 20\r\n switchport\ + \ trunk allowed vlan 20,21,30\r\n switchport mode trunk\r\n switchport voice\ + \ vlan 117\r\n authentication open\r\n authentication order mab\r\n authentication\ + \ port-control auto\r\n mab\r\n dot1x pae authenticator\r\n evpn ethernet-segment\ + \ 1\r\n spanning-tree portfast\r\n!\r\ninterface FastEthernet0/0/2\r\n switchport\ + \ access vlan 11\r\n switchport mode access\r\n!\r\ninterface FastEthernet0/0/3\r\ + \n switchport access vlan 10\r\n switchport voice vlan 117\r\n spanning-tree\ + \ portfast\r\n!\r\ninterface FastEthernet0/0/4\r\n!\r\ninterface Cellular0/1/0\r\ + \n ip address negotiated\r\n ipv6 enable\r\n!\r\ninterface Cellular0/1/1\r\ + \n no ip address\r\n shutdown\r\n!\r\ninterface Cellular0/4/0\r\n no ip address\r\ + \n shutdown\r\n!\r\ninterface Cellular0/4/1\r\n no ip address\r\n shutdown\r\ + \n!\r\ninterface Vlan1\r\n no ip address\r\n!\r\ninterface Vlan11\r\n ip address\ + \ 11.1.6.78 255.255.255.0\r\n!\r\ninterface Vlan12\r\n no ip address\r\n service\ + \ instance 12 ethernet\r\n encapsulation dot1q 12\r\n !\r\n!\r\ninterface\ + \ Vlan20\r\n no ip address\r\n service instance 20 ethernet\r\n encapsulation\ + \ dot1q 20\r\n !\r\n!\r\ninterface Vlan21\r\n no ip address\r\n service instance\ + \ 21 ethernet\r\n encapsulation dot1q 21\r\n !\r\n!\r\ninterface Vlan22\r\ + \n no ip address\r\n service instance 22 ethernet\r\n encapsulation dot1q\ + \ 22\r\n !\r\n!\r\ninterface Async0/2/0\r\n no ip address\r\n encapsulation\ + \ scada\r\n!\r\ninterface nve1\r\n no ip address\r\n source-interface Loopback0\r\ + \n host-reachability protocol bgp\r\n member vni 30000 ingress-replication\r\ + \n!\r\nrouter ospf 1\r\n router-id 100.100.100.1\r\n network 10.10.10.0 0.0.0.255\ + \ area 0\r\n network 100.100.100.1 0.0.0.0 area 0\r\n!\r\nrouter bgp 1\r\n\ + \ bgp router-id 100.100.100.1\r\n bgp log-neighbor-changes\r\n neighbor 100.100.100.4\ + \ remote-as 1\r\n neighbor 100.100.100.4 update-source Loopback0\r\n !\r\n\ + \ address-family ipv4\r\n neighbor 100.100.100.4 activate\r\n neighbor 100.100.100.4\ + \ send-community both\r\n exit-address-family\r\n !\r\n address-family l2vpn\ + \ vpls\r\n exit-address-family\r\n !\r\n address-family l2vpn evpn\r\n neighbor\ + \ 100.100.100.4 activate\r\n neighbor 100.100.100.4 send-community both\r\ + \n exit-address-family\r\n!\r\nip forward-protocol nd\r\nno ip forward-protocol\ + \ udp\r\nno ip http server\r\nip http auth-retry 3 time-window 1\r\nip http\ + \ authentication local\r\nip http secure-server\r\n!\r\nip ssh bulk-mode 131072\r\ + \n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\ncontrol-plane\r\n!\r\n!\r\n!\r\n!\r\n!\r\n\ + !\r\n!\r\n!\r\nline con 0\r\n exec-timeout 0 0\r\n stopbits 1\r\nline 0/0/0\r\ + \nline 0/2/0\r\nline vty 0 4\r\n exec-timeout 0 0\r\n transport input ssh\r\ + \nline vty 5 14\r\n transport input ssh\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n\ + !\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\n!\r\nyang-interfaces feature deprecated\ + \ disable\r\nend" response_type: circular show version: '' + show version | include operating mode: '' term length 0: '' term width 0: '' - show version | include operating mode: '' - prompt: iolpe2# + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/get_running_config_section_dict/test_api_get_running_config_section_dict.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/get_running_config_section_dict/test_api_get_running_config_section_dict.py index b3e4efa25..b3a926e54 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/get_running_config_section_dict/test_api_get_running_config_section_dict.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/bgp/configure/get_running_config_section_dict/test_api_get_running_config_section_dict.py @@ -10,7 +10,7 @@ class TestGetRunningConfigSectionDict(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - iolpe2: + IR1101: connections: defaults: class: unicon.Unicon @@ -18,11 +18,11 @@ def setUpClass(self): command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: iol - type: iol + platform: router + type: router """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['iolpe2'] + self.device = self.testbed.devices['IR1101'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -32,232 +32,181 @@ def setUpClass(self): def test_get_running_config_section_dict(self): result = get_running_config_section_dict(self.device) expected_output = {'Building configuration...': {}, - 'Current configuration : 8337 bytes': {}, + 'Current configuration : 8848 bytes': {}, + 'aaa accounting auth-proxy default start-stop group radius': {}, + 'aaa accounting dot1x default start-stop group radius': {}, + 'aaa authentication dot1x default group radius': {}, + 'aaa authentication login CON local': {}, + 'aaa authentication login VTY local': {}, + 'aaa authorization auth-proxy default group radius': {}, + 'aaa authorization network default group radius': {}, + 'aaa new-model': {}, + 'aaa session-id common': {}, + 'boot system bootflash:ir1101-universalk9.2024-08-19_16.16_flian.SSA.bin': {}, 'boot-end-marker': {}, 'boot-start-marker': {}, - 'clock timezone PST -8 0': {}, + 'bridge-domain 12': {'member Vlan12 service-instance 12': {}, + 'member evpn-instance profile evpn_va': {}}, + 'bridge-domain 20': {'member Vlan20 service-instance 20': {}, + 'member evpn-instance': {}}, + 'bridge-domain 21': {'member Vlan21 service-instance 21': {}, + 'member evpn-instance': {}}, + 'bridge-domain 22': {'member Vlan22 service-instance 22': {}, + 'member evpn-instance profile evpn_va': {}}, 'control-plane': {}, + 'controller Cellular 0/1/0': {}, + 'controller Cellular 0/4/0': {}, + 'crypto pki certificate chain SLA-TrustPoint': {'certificate ca 01': {'005A282F 8B518A5A 8C6F9B3C AABA3446 32EF3A75 C2F45450 7A9BCFD3 0C8BE54A': {}, + '01009C56 7101D61E DF2EBCC3 BA7AE0DB B241B3B4 328A9B00 EB8A80D0 2AA86F5E': {}, + '01C50203 010001A3 42304030 0E060355 1D0F0101 FF040403 02010630 0F060355': {}, + '07B2BDED DFC1605B 4D16007B 68723E25 55908512 4EEB0A70 B2A74C2A CB1EC882': {}, + '11872DE0 CF1200D0 D1018FD9 AC685968 167E421C 9BC394ED 9BC85463 83B28146': {}, + '179196FA 4FB3F2ED 3942C756 BF1CA0A9 CC98A7A7 F9E43724 D9E61D47 89E9E792': {}, + '1D130101 FF040530 030101FF 301D0603 551D0E04 16041443 214521B5 FB217A1A': {}, + '2F310E30 0C060355 040A1305 43697363 6F311D30 1B060355 04031314 4C696365': {}, + '3082031B 30820203 A0030201 02020101 300D0609 2A864886 F70D0101 0B050030': {}, + '3EBC1385 2D9BAD98 68D3AE07 5C27987C 6B814B99 0686B14A 5F61753C 813089E6': {}, + '4D1BB702 36E664CB EC8B6530 0D06092A 864886F7 0D01010B 05000382 01010085': {}, + '56308201 22300D06 092A8648 86F70D01 01010500 0382010F 00308201 0A028201': {}, + '5A170D33 33303432 34323135 3534335A 302F310E 300C0603 55040A13 05436973': {}, + '636F311D 301B0603 55040313 144C6963 656E7369 6E672052 6F6F7420 2D204445': {}, + '6D081172 26916B41 FB07DF42 EB9B9408 EC346138 23FBD8C4 19909697 A30845F3': {}, + '6E73696E 6720526F 6F74202D 20444556 301E170D 31333034 32343231 35353433': {}, + '7CE521B5 F277EBF6 03B7B0A4 958C9C7D 5460C20B CF9CCFC7 14B80F58 B5268947': {}, + 'AEC48C68 F6D45267 0E365F44 B4456E11 96DCB950 233C8ADB 9FEEBAF1 2B5F3BB6': {}, + 'C3215B87 6FC74304 241E59D7 C7C02C6D BD3042F5 196E8133 7A4446A4 81216E70': {}, + 'CF52CF22 50A7D23E FA9F6B07 FB0F6386 9DCC3BBC 65250693 38CF6BA6 CB8EFD': {'quit': {}}, + 'DD9F27B4 517C2BDE D0EB5B9A 787BA085 D9BBF003 F0563BE0 A4450C8F 127B5583': {}, + 'DF07E06C AA0F4325 9FB4C4AE 2080F675 8C3B7AC5 4EAAA03E C5B50A2F 670AFF87': {}, + 'EDA6462F CFC43967 C024AB32 EE3CCDCF A04B9DAE 1BBABBDA C8DF5587 CF51CB1C': {}, + 'F1AEBFDE B67BD6AD 7DAD7B43 F582753B FFCC1CA5 A7841A07 6934D3AF 99078EF6': {}, + 'F1B1F2AE AE7D2F9C AB0351C3 29E3F1AE 982DF11F 5E3C90F6 00B3CDED 5A1491FB': {}}}, + 'crypto pki certificate chain TP-self-signed-79755127': {'certificate self-signed 01': {'010096BD FA5EC31E E1CA26D1 D1A94236 53C2676C CBA0B127 950659A7 4E30333A': {}, + '040FEB98 AACD013C 0219E81C A17B3165 BC6E293F 8C99A03E 19B1B20B F819DBD3': {}, + '06D462F5 7FF006E8 61B060DB 4F5C448A 7F665ED3 36E4F72A D3C211B2 6D02D27E': {}, + '0E2F09E5 0003CF83 24D0F290 71633F0E 3FCA406A 6E973955 D62A886D 38D3E72B': {}, + '0F3A9E56 43799614 71ADA617 A965FA8F 34CB72C6 C08B7317 A2F14949 5EF4B26B': {}, + '2A864886 F70D0101 0D050003 82010100 38DACAB7 4A785C4C 31DCB300 1A2059B1': {}, + '2D53656C 662D5369 676E6564 2D436572 74696669 63617465 2D373937 35353132': {}, + '2F312D30 2B060355 04030C24 494F532D 53656C66 2D536967 6E65642D 43657274': {}, + '3082032C 30820214 A0030201 02020101 300D0609 2A864886 F70D0101 0D050030': {}, + '30ECB57C 9DAC16E8 F78C4B30 0F060355 1D130101 FF040530 030101FF 300D0609': {}, + '37308201 22300D06 092A8648 86F70D01 01010500 0382010F 00308201 0A028201': {}, + '3BAB97FE 6C52EFBB 1BCBC620 ED88716D 62C32FB9 D7CB201C 44383EEB ADF9EC7E': {}, + '56710203 010001A3 53305130 1D060355 1D0E0416 0414CDFE 54823321 E5288730': {}, + '57E40B34 5D13765B CB30AB97 322896F2 D58C6FC7 97881B0F 02494695 28067056': {}, + '5A170D33 34303831 31303430 3432385A 302F312D 302B0603 5504030C 24494F53': {}, + '5ED1F03D 5D862072 0FC2BE97 E02C149C 5A6953E7 54F80ED6 A367C749 5202FC26': {}, + '69666963 6174652D 37393735 35313237 301E170D 32343038 31313034 30343238': {}, + '7F7CDDC6 D40F7CB5 6743D168 31625D2B': {'quit': {}}, + '7FF00828 1D1B290A 552A7D90 F7F6BFDF DBE9146E 7A0A7261 A48BF507 C724D80C': {}, + '8BC33D8A EC579C44 75DD9462 3AC80735 D548CFD1 72E59516 2DC268F5 5F578897': {}, + '9EC0EBB3 00905472 28782737 324C6084 3B442E60 CDE7733A 9CE57C53 494B9353': {}, + 'ADC0EEF7 E110E2B3 90CFD773 FD172613 CFDB5BFA 986129C4 BF27264D 63B30B5C': {}, + 'D494F855 8AEE9D74 2211CE08 BBB475A9 E6C19D2F 18F3028E D05D766D 0914DC02': {}, + 'DE77BF86 623303CF 419A6423 D8DE02AF 51C0525A F5C7A823 78475D78 EFBB5A0F': {}, + 'ECB57C9D AC16E8F7 8C4B301F 0603551D 23041830 168014CD FE548233 21E52887': {}, + 'F470DCB4 DAC377C5 38AAF646 32A72DE3 111FCA7E 5B72A3F8 56A1186B A410D8E2': {}}}, + 'crypto pki trustpoint SLA-TrustPoint': {'enrollment pkcs12': {}, + 'hash sha512': {}, + 'revocation-check crl': {}}, + 'crypto pki trustpoint TP-self-signed-79755127': {'enrollment selfsigned': {}, + 'hash sha256': {}, + 'revocation-check none': {}, + 'rsakeypair TP-self-signed-79755127': {}, + 'subject-name cn=IOS-Self-Signed-Certificate-79755127': {}}, + 'diagnostic bootup level minimal': {}, 'end': {}, - 'hostname iolpe2': {}, - 'interface Ethernet0/0': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet0/1': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet0/2': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet0/3': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet1/0': {'description to iolce1 Ethernet2/0': {}, - 'ip address 99.1.3.3 255.255.255.0': {}, - 'ipv6 address 2001::99:1:3:3/112': {}, - 'vrf forwarding ce1': {}}, - 'interface Ethernet1/1': {'description to iolce1 Ethernet2/1': {}, - 'ip address 100.1.3.3 255.255.255.0': {}, - 'ipv6 address 2001::100:1:3:3/112': {}, - 'vrf forwarding ce1': {}}, - 'interface Ethernet1/2': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet1/3': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet2/0': {'description to iolpe1 Ethernet2/0': {}, - 'ip address 99.2.3.3 255.255.255.0': {}, - 'ip router isis sr': {}, - 'ip rsvp bandwidth': {}, - 'ipv6 address 2001::99:2:3:3/112': {}, - 'ipv6 router isis sr': {}, - 'isis network point-to-point': {}, - 'mpls ip': {}, - 'mpls traffic-eng tunnels': {}}, - 'interface Ethernet2/1': {'description to iolpe1 Ethernet2/1': {}, - 'ip address 100.2.3.3 255.255.255.0': {}, - 'ip router isis sr': {}, - 'ip rsvp bandwidth': {}, - 'ipv6 address 2001::100:2:3:3/112': {}, - 'ipv6 router isis sr': {}, - 'isis network point-to-point': {}, - 'mpls ip': {}, - 'mpls traffic-eng tunnels': {}}, - 'interface Ethernet2/2': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet2/3': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet3/0': {'description to iolp2 Ethernet1/0': {}, - 'ip address 99.3.5.3 255.255.255.0': {}, - 'ip router isis sr': {}, - 'ip rsvp bandwidth': {}, - 'ipv6 address 2001::99:3:5:3/112': {}, - 'ipv6 router isis sr': {}, - 'isis network point-to-point': {}, - 'mpls ip': {}, - 'mpls traffic-eng tunnels': {}}, - 'interface Ethernet3/1': {'description to iolp2 Ethernet1/1': {}, - 'ip address 100.3.5.3 255.255.255.0': {}, - 'ip router isis sr': {}, - 'ip rsvp bandwidth': {}, - 'ipv6 address 2001::100:3:5:3/112': {}, - 'ipv6 router isis sr': {}, - 'isis network point-to-point': {}, - 'mpls ip': {}, - 'mpls traffic-eng tunnels': {}}, - 'interface Ethernet3/2': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet3/3': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet4/0': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet4/1': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet4/2': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet4/3': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet5/0': {'description to iolp1 Ethernet5/0': {}, - 'ip address 99.3.4.3 255.255.255.0': {}, - 'ip router isis sr': {}, - 'ip rsvp bandwidth': {}, - 'ipv6 address 2001::99:3:4:3/112': {}, - 'ipv6 router isis sr': {}, - 'isis network point-to-point': {}, - 'mpls ip': {}, - 'mpls traffic-eng tunnels': {}}, - 'interface Ethernet5/1': {'description to iolp1 Ethernet5/1': {}, - 'ip address 100.3.4.3 255.255.255.0': {}, - 'ip router isis sr': {}, - 'ip rsvp bandwidth': {}, - 'ipv6 address 2001::100:3:4:3/112': {}, - 'ipv6 router isis sr': {}, - 'isis network point-to-point': {}, - 'mpls ip': {}, - 'mpls traffic-eng tunnels': {}}, - 'interface Ethernet5/2': {'no ip address': {}, 'shutdown': {}}, - 'interface Ethernet5/3': {'no ip address': {}, 'shutdown': {}}, - 'interface Loopback1': {'ip address 1.1.1.3 255.255.255.255': {}, - 'ip router isis sr': {}, - 'ipv6 address 2001::1:1:1:3/128': {}, - 'ipv6 router isis sr': {}}, - 'ip cef': {}, + 'hostname IR1101': {}, + 'interface Async0/2/0': {'encapsulation scada': {}, 'no ip address': {}}, + 'interface Cellular0/1/0': {'ip address negotiated': {}, 'ipv6 enable': {}}, + 'interface Cellular0/1/1': {'no ip address': {}, 'shutdown': {}}, + 'interface Cellular0/4/0': {'no ip address': {}, 'shutdown': {}}, + 'interface Cellular0/4/1': {'no ip address': {}, 'shutdown': {}}, + 'interface FastEthernet0/0/1': {'authentication open': {}, + 'authentication order mab': {}, + 'authentication port-control auto': {}, + 'dot1x pae authenticator': {}, + 'evpn ethernet-segment 1': {}, + 'mab': {}, + 'spanning-tree portfast': {}, + 'switchport access vlan 20': {}, + 'switchport mode trunk': {}, + 'switchport trunk allowed vlan 20,21,30': {}, + 'switchport voice vlan 117': {}}, + 'interface FastEthernet0/0/2': {'switchport access vlan 11': {}, + 'switchport mode access': {}}, + 'interface FastEthernet0/0/3': {'spanning-tree portfast': {}, + 'switchport access vlan 10': {}, + 'switchport voice vlan 117': {}}, + 'interface FastEthernet0/0/4': {}, + 'interface GigabitEthernet0/0/0': {'ip address 10.10.10.2 255.255.255.0': {}}, + 'interface Loopback0': {'ip address 100.100.100.1 255.255.255.255': {}}, + 'interface Vlan1': {'no ip address': {}}, + 'interface Vlan11': {'ip address 11.1.6.78 255.255.255.0': {}}, + 'interface Vlan12': {'no ip address': {}, + 'service instance 12 ethernet': {'encapsulation dot1q 12': {}}}, + 'interface Vlan20': {'no ip address': {}, + 'service instance 20 ethernet': {'encapsulation dot1q 20': {}}}, + 'interface Vlan21': {'no ip address': {}, + 'service instance 21 ethernet': {'encapsulation dot1q 21': {}}}, + 'interface Vlan22': {'no ip address': {}, + 'service instance 22 ethernet': {'encapsulation dot1q 22': {}}}, + 'interface nve1': {'host-reachability protocol bgp': {}, + 'member vni 30000 ingress-replication': {}, + 'no ip address': {}, + 'source-interface Loopback0': {}}, 'ip forward-protocol nd': {}, + 'ip http auth-retry 3 time-window 1': {}, + 'ip http authentication local': {}, 'ip http secure-server': {}, - 'ip http server': {}, 'ip ssh bulk-mode 131072': {}, - 'ipv6 cef': {}, - 'ipv6 unicast-routing': {}, - 'line aux 0': {}, - 'line con 0': {'exec-timeout 0 0': {}, 'logging synchronous': {}}, - 'line vty 0 4': {'exec-timeout 0 0': {}, - 'login': {}, - 'transport input ssh': {}}, - 'logging buffered 4000000': {}, + 'l2vpn evpn': {'replication-type ingress': {}}, + 'l2vpn evpn ethernet-segment 1': {'identifier type 0 0A.0A.0A.0A.0A.0A.0A.0A.0A': {}, + 'redundancy all-active': {}}, + 'l2vpn evpn ethernet-segment 2': {'identifier type 3 system-mac 0020.bbbb.bbbb': {}, + 'redundancy all-active': {}}, + 'l2vpn evpn instance 1 vlan-aware': {'encapsulation vxlan': {}, + 'replication-type ingress': {}}, + 'l2vpn evpn profile evpn_va vlan-aware': {'ethernet-tag auto-vni': {}, + 'evi-id 3': {}, + 'l2vni-base 50000': {}}, + 'license udi pid IR1101-K9 sn FCW2804Y6L5': {}, + 'line 0/0/0': {}, + 'line 0/2/0': {}, + 'line con 0': {'exec-timeout 0 0': {}, 'stopbits 1': {}}, + 'line vty 0 4': {'exec-timeout 0 0': {}, 'transport input ssh': {}}, + 'line vty 5 14': {'transport input ssh': {}}, + 'login block-for 60 attempts 3 within 30': {}, + 'login delay 3': {}, 'login on-success log': {}, - 'memory free low-watermark processor 54960': {}, - 'mpls traffic-eng tunnels': {}, - 'no aaa new-model': {}, - 'no ip domain lookup': {}, - 'no logging btrace': {}, + 'memory free low-watermark processor 43390': {}, + 'no ip forward-protocol udp': {}, + 'no ip http server': {}, + 'no license feature hseck9': {}, 'no logging console': {}, - 'performance-measurement': {'interface Ethernet2/0': {'delay-measurement': {'advertise-delay 10': {}}}, - 'interface Ethernet2/1': {'delay-measurement': {'advertise-delay 10': {}}}, - 'interface Ethernet3/0': {'delay-measurement': {'advertise-delay 10': {}}}, - 'interface Ethernet3/1': {'delay-measurement': {'advertise-delay 10': {}}}, - 'interface Ethernet5/0': {'delay-measurement': {'advertise-delay 10': {}}}, - 'interface Ethernet5/1': {'delay-measurement': {'advertise-delay 10': {}}}}, - 'route-map odn permit 10': {'set extcommunity color 10': {}}, - 'route-map pe2 permit 10': {'set local-preference 30': {}}, - 'router bgp 65000': {'address-family ipv4': {'redistribute static route-map test': {}}, - 'address-family ipv4 vrf ce1': {'neighbor 100.1.3.1 activate': {}, - 'neighbor 100.1.3.1 remote-as 65001': {}, - 'neighbor 100.1.3.1 send-community extended': {}, - 'neighbor 99.1.3.1 activate': {}, - 'neighbor 99.1.3.1 remote-as 65001': {}, - 'neighbor 99.1.3.1 send-community extended': {}}, - 'address-family ipv6': {}, - 'address-family ipv6 vrf ce1': {'neighbor 2001::100:1:3:1 activate': {}, - 'neighbor 2001::100:1:3:1 remote-as 65001': {}, - 'neighbor 2001::100:1:3:1 send-community extended': {}, - 'neighbor 2001::99:1:3:1 activate': {}, - 'neighbor 2001::99:1:3:1 remote-as 65001': {}, - 'neighbor 2001::99:1:3:1 send-community extended': {}}, - 'address-family vpnv4': {'exit-srv6': {}, - 'neighbor 1.1.1.4 activate': {}, - 'neighbor 1.1.1.4 next-hop-self': {}, - 'neighbor 1.1.1.4 route-map pe2 out': {}, - 'neighbor 1.1.1.4 route-map test in': {}, - 'neighbor 1.1.1.4 send-community extended': {}, - 'neighbor 1.1.1.6 activate': {}, - 'neighbor 1.1.1.6 next-hop-self': {}, - 'neighbor 1.1.1.6 route-map odn in': {}, - 'neighbor 1.1.1.6 route-map pe2 out': {}, - 'neighbor 1.1.1.6 send-community extended': {}, - 'neighbor 2001::1:1:1:4 activate': {}, - 'neighbor 2001::1:1:1:4 next-hop-self': {}, - 'neighbor 2001::1:1:1:4 route-map odn in': {}, - 'neighbor 2001::1:1:1:4 route-map pe2 out': {}, - 'neighbor 2001::1:1:1:4 send-community both': {}, - 'neighbor 2001::1:1:1:6 activate': {}, - 'neighbor 2001::1:1:1:6 next-hop-self': {}, - 'neighbor 2001::1:1:1:6 route-map odn in': {}, - 'neighbor 2001::1:1:1:6 route-map pe2 out': {}, - 'neighbor 2001::1:1:1:6 send-community both': {}, - 'segment-routing srv6': {'alloc-mode per-vrf': {}, - 'locator loc1': {}}}, - 'address-family vpnv6': {'exit-srv6': {}, - 'neighbor 1.1.1.4 activate': {}, - 'neighbor 1.1.1.4 next-hop-self': {}, - 'neighbor 1.1.1.4 route-map odn in': {}, - 'neighbor 1.1.1.4 route-map pe2 out': {}, - 'neighbor 1.1.1.4 send-community extended': {}, - 'neighbor 1.1.1.6 activate': {}, - 'neighbor 1.1.1.6 next-hop-self': {}, - 'neighbor 1.1.1.6 route-map odn in': {}, - 'neighbor 1.1.1.6 route-map pe2 out': {}, - 'neighbor 1.1.1.6 send-community extended': {}, - 'neighbor 2001::1:1:1:4 activate': {}, - 'neighbor 2001::1:1:1:4 next-hop-self': {}, - 'neighbor 2001::1:1:1:4 route-map odn in': {}, - 'neighbor 2001::1:1:1:4 route-map pe2 out': {}, - 'neighbor 2001::1:1:1:4 send-community both': {}, - 'neighbor 2001::1:1:1:6 activate': {}, - 'neighbor 2001::1:1:1:6 next-hop-self': {}, - 'neighbor 2001::1:1:1:6 route-map odn in': {}, - 'neighbor 2001::1:1:1:6 route-map pe2 out': {}, - 'neighbor 2001::1:1:1:6 send-community both': {}, - 'segment-routing srv6': {'alloc-mode per-vrf': {}, - 'locator loc1': {}}}, - 'bgp graceful-restart all': {}, - 'bgp log-neighbor-changes': {}, - 'bgp router-id interface Loopback1': {}, - 'exit-address-family': {}, - 'exit-srv6': {}, - 'neighbor 1.1.1.4 remote-as 65000': {}, - 'neighbor 1.1.1.4 update-source Loopback1': {}, - 'neighbor 1.1.1.6 remote-as 65000': {}, - 'neighbor 1.1.1.6 update-source Loopback1': {}, - 'neighbor 2001::1:1:1:4 remote-as 65000': {}, - 'neighbor 2001::1:1:1:4 update-source Loopback1': {}, - 'neighbor 2001::1:1:1:6 remote-as 65000': {}, - 'neighbor 2001::1:1:1:6 update-source Loopback1': {}, - 'no bgp default ipv4-unicast': {}, - 'segment-routing srv6': {'locator loc1': {}}}, - 'router isis sr': {'address-family ipv6': {'multi-topology': {}, - 'router-id Loopback1': {}, - 'segment-routing srv6': {'locator loc1': {'level-2': {}}}}, - 'distribute link-state': {}, - 'exit-address-family': {}, - 'is-type level-2-only': {}, - 'metric-style wide': {}, - 'mpls traffic-eng level-2': {}, - 'mpls traffic-eng router-id Loopback1': {}, - 'net 49.0000.0000.0003.00': {}, - 'segment-routing mpls': {}}, - 'segment-routing mpls': {'connected-prefix-sid-map': {'address-family ipv4': {'1.1.1.3/32 index 3 range 1': {}}, - 'exit-address-family': {}}, - 'global-block 16000 23999': {}, - 'local-block 30000 39999': {}, - 'set-attributes': {'address-family ipv4': {'sr-label-preferred': {}}, - 'exit-address-family': {}}}, - 'segment-routing srv6': {'locators': {'locator loc1': {'format usid-f3216': {}, - 'prefix FC01:101:3::/48': {}}}}, - 'segment-routing traffic-eng': {'on-demand color 10': {'authorize': {}, - 'candidate-paths': {'preference 1': {'constraints': {'segments': {'dataplane srv6': {}}}, - 'dynamic': {}}}}}, - 'service compress-config': {}, - 'service internal': {}, - 'service tcp-keepalives-in': {}, - 'service tcp-keepalives-out': {}, + 'platform hardware msata-led': {}, + 'platform hardware throughput level 250M': {}, + 'platform qfp utilization monitor load 80': {}, + 'redundancy': {}, + 'router bgp 1': {'address-family ipv4': {'neighbor 100.100.100.4 activate': {}, + 'neighbor 100.100.100.4 send-community both': {}}, + 'address-family l2vpn evpn': {'neighbor 100.100.100.4 activate': {}, + 'neighbor 100.100.100.4 send-community both': {}}, + 'address-family l2vpn vpls': {}, + 'bgp log-neighbor-changes': {}, + 'bgp router-id 100.100.100.1': {}, + 'exit-address-family': {}, + 'neighbor 100.100.100.4 remote-as 1': {}, + 'neighbor 100.100.100.4 update-source Loopback0': {}}, + 'router ospf 1': {'network 10.10.10.0 0.0.0.255 area 0': {}, + 'network 100.100.100.1 0.0.0.0 area 0': {}, + 'router-id 100.100.100.1': {}}, 'service timestamps debug datetime msec': {}, 'service timestamps log datetime msec': {}, - 'spanning-tree mode rapid-pvst': {}, - 'version 17.13': {}, - 'vrf definition ce1': {'address-family ipv4': {'route-target export 1:1': {}, - 'route-target import 1:1': {}}, - 'address-family ipv6': {'route-target export 1:1': {}, - 'route-target import 1:1': {}}, - 'exit-address-family': {}, - 'rd 3:3': {}}} + 'spanning-tree extend system-id': {}, + 'subscriber templating': {}, + 'version 17.16': {}, + 'vlan internal allocation policy ascending': {}, + 'yang-interfaces feature deprecated disable': {}} self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/configure_spanning_tree_portfast/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/configure_spanning_tree_portfast/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/configure_spanning_tree_portfast/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/configure_spanning_tree_portfast/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..3b54a8112 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/configure_spanning_tree_portfast/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,39 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + spanning-tree portfast edge bpdufilter default: "spanning-tree portfast edge bpdufilter + default\r\n" + spanning-tree portfast edge bpduguard: "spanning-tree portfast edge bpduguard\r\n" + spanning-tree portfast edge bpduguard default: "spanning-tree portfast edge bpduguard default\r\ + \n" + prompt: stack3-nyquist-1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: stack3-nyquist-1(config-line)# +connect: + commands: + '': + new_state: execute + preface: |- + Trying mock_device ... + Connected to mock_device. + Escape character is '^]'. + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + show version | include operating mode: '' + prompt: stack3-nyquist-1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/configure_spanning_tree_portfast/test_api_configure_spanning_tree_portfast.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/configure_spanning_tree_portfast/test_api_configure_spanning_tree_portfast.py new file mode 100644 index 000000000..605d36b3a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/configure_spanning_tree_portfast/test_api_configure_spanning_tree_portfast.py @@ -0,0 +1,45 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.cat9k.c9500.spanning_tree.configure import configure_spanning_tree_portfast + + +class TestConfigureSpanningTreePortfast(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + stack3-nyquist-1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: None + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['stack3-nyquist-1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_spanning_tree_portfast(self): + result = configure_spanning_tree_portfast(self.device, True, True, False, 'edge') + expected_output = None + self.assertEqual(result, expected_output) + + def test_configure_spanning_tree_portfast_1(self): + result = configure_spanning_tree_portfast(self.device, False, True, False, 'edge') + expected_output = None + self.assertEqual(result, expected_output) + + def test_configure_spanning_tree_portfast_2(self): + result = configure_spanning_tree_portfast(self.device, True, False, True, 'edge') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/unconfigure_spanning_tree_portfast/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/unconfigure_spanning_tree_portfast/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/unconfigure_spanning_tree_portfast/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/unconfigure_spanning_tree_portfast/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ef61c3bd9 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/unconfigure_spanning_tree_portfast/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,39 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + no spanning-tree portfast edge bpdufilter default: "no spanning-tree portfast edge bpdufilter + default\r\n" + no spanning-tree portfast edge bpduguard: "no spanning-tree portfast edge bpduguard\r\n" + no spanning-tree portfast edge bpduguard default: "no spanning-tree portfast edge bpduguard + default\r\n" + prompt: stack3-nyquist-1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: stack3-nyquist-1(config-line)# +connect: + commands: + '': + new_state: execute + preface: |- + Trying mock_device ... + Connected to mock_device. + Escape character is '^]'. + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + show version | include operating mode: '' + prompt: stack3-nyquist-1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/unconfigure_spanning_tree_portfast/test_api_unconfigure_spanning_tree_portfast.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/unconfigure_spanning_tree_portfast/test_api_unconfigure_spanning_tree_portfast.py new file mode 100644 index 000000000..14227a87b --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9500/spanning_tree/configure/unconfigure_spanning_tree_portfast/test_api_unconfigure_spanning_tree_portfast.py @@ -0,0 +1,45 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.cat9k.c9500.spanning_tree.configure import unconfigure_spanning_tree_portfast + + +class TestUnconfigureSpanningTreePortfast(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + stack3-nyquist-1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: None + type: c9500 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['stack3-nyquist-1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_spanning_tree_portfast(self): + result = unconfigure_spanning_tree_portfast(self.device, True, True, False) + expected_output = None + self.assertEqual(result, expected_output) + + def test_unconfigure_spanning_tree_portfast_1(self): + result = unconfigure_spanning_tree_portfast(self.device, False, True, False) + expected_output = None + self.assertEqual(result, expected_output) + + def test_unconfigure_spanning_tree_portfast_2(self): + result = unconfigure_spanning_tree_portfast(self.device, True, False, True) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9610/spanning_tree/configure/unconfigure_spanning_tree_portfast/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9610/spanning_tree/configure/unconfigure_spanning_tree_portfast/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9610/spanning_tree/configure/unconfigure_spanning_tree_portfast/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9610/spanning_tree/configure/unconfigure_spanning_tree_portfast/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ef61c3bd9 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9610/spanning_tree/configure/unconfigure_spanning_tree_portfast/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,39 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + no spanning-tree portfast edge bpdufilter default: "no spanning-tree portfast edge bpdufilter + default\r\n" + no spanning-tree portfast edge bpduguard: "no spanning-tree portfast edge bpduguard\r\n" + no spanning-tree portfast edge bpduguard default: "no spanning-tree portfast edge bpduguard + default\r\n" + prompt: stack3-nyquist-1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: stack3-nyquist-1(config-line)# +connect: + commands: + '': + new_state: execute + preface: |- + Trying mock_device ... + Connected to mock_device. + Escape character is '^]'. + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + show version | include operating mode: '' + prompt: stack3-nyquist-1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9610/spanning_tree/configure/unconfigure_spanning_tree_portfast/test_api_unconfigure_spanning_tree_portfast.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9610/spanning_tree/configure/unconfigure_spanning_tree_portfast/test_api_unconfigure_spanning_tree_portfast.py new file mode 100644 index 000000000..65e5c23cf --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9610/spanning_tree/configure/unconfigure_spanning_tree_portfast/test_api_unconfigure_spanning_tree_portfast.py @@ -0,0 +1,45 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.cat9k.c9610.spanning_tree.configure import unconfigure_spanning_tree_portfast + + +class TestUnconfigureSpanningTreePortfast(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + stack3-nyquist-1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: None + type: c9610 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['stack3-nyquist-1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_spanning_tree_portfast(self): + result = unconfigure_spanning_tree_portfast(self.device, True, True, False) + expected_output = None + self.assertEqual(result, expected_output) + + def test_unconfigure_spanning_tree_portfast_1(self): + result = unconfigure_spanning_tree_portfast(self.device, False, True, False) + expected_output = None + self.assertEqual(result, expected_output) + + def test_unconfigure_spanning_tree_portfast_2(self): + result = unconfigure_spanning_tree_portfast(self.device, True, False, True) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/execute/clear_ip_dhcp_snooping_track_server/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/execute/clear_ip_dhcp_snooping_track_server/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/execute/clear_ip_dhcp_snooping_track_server/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/execute/clear_ip_dhcp_snooping_track_server/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..84268da20 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/execute/clear_ip_dhcp_snooping_track_server/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,39 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: peer1-ott-topo2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: peer1-ott-topo2(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + clear ip dhcp snooping track server all: + response: + - '' + response_type: circular + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: peer1-ott-topo2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/execute/clear_ip_dhcp_snooping_track_server/test_api_clear_ip_dhcp_snooping_track_server.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/execute/clear_ip_dhcp_snooping_track_server/test_api_clear_ip_dhcp_snooping_track_server.py new file mode 100644 index 000000000..479365e12 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/execute/clear_ip_dhcp_snooping_track_server/test_api_clear_ip_dhcp_snooping_track_server.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.dhcp.execute import clear_ip_dhcp_snooping_track_server + + +class TestClearIpDhcpSnoopingTrackServer(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + peer1-ott-topo2: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['peer1-ott-topo2'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_clear_ip_dhcp_snooping_track_server(self): + result = clear_ip_dhcp_snooping_track_server(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/clear_bgp_l2vpn_evpn/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/clear_bgp_l2vpn_evpn/mock_data/iosxe/mock_data.yaml index 67e063db8..02ce40212 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/clear_bgp_l2vpn_evpn/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/clear_bgp_l2vpn_evpn/mock_data/iosxe/mock_data.yaml @@ -5,34 +5,35 @@ configure: line console 0: new_state: configure_line no logging console: '' - prompt: Leaf-01(config)# + prompt: IR1101(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: Leaf-01(config-line)# + prompt: IR1101(config-line)# connect: commands: - '': - new_state: execute - preface: |- - Trying mock_device ... + ? '' + : new_state: execute + preface: 'Trying mock_device ... + Connected to mock_device. - Escape character is '^]'. + + Escape character is ''^]''.' prompt: '' execute: commands: clear bgp l2vpn evpn *: response: - - '' + - '' response_type: circular config term: new_state: configure config-transaction: new_state: configure show version: '' + show version | include operating mode: '' term length 0: '' term width 0: '' - show version | include operating mode: '' - prompt: Leaf-01# + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/clear_bgp_l2vpn_evpn/test_api_clear_bgp_l2vpn_evpn.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/clear_bgp_l2vpn_evpn/test_api_clear_bgp_l2vpn_evpn.py index d000b47d9..c09aa7661 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/clear_bgp_l2vpn_evpn/test_api_clear_bgp_l2vpn_evpn.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/clear_bgp_l2vpn_evpn/test_api_clear_bgp_l2vpn_evpn.py @@ -10,7 +10,7 @@ class TestClearBgpL2vpnEvpn(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - Leaf-01: + IR1101: connections: defaults: class: unicon.Unicon @@ -18,11 +18,11 @@ def setUpClass(self): command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: cat9k - type: c9300 + platform: router + type: router """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['Leaf-01'] + self.device = self.testbed.devices['IR1101'] self.device.connect( learn_hostname=True, init_config_commands=[], diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_default_gateway_advertise_global/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_default_gateway_advertise_global/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_default_gateway_advertise_global/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_default_gateway_advertise_global/mock_data/iosxe/mock_data.yaml index 5b21455c6..4f00e2544 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_default_gateway_advertise_global/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_default_gateway_advertise_global/mock_data/iosxe/mock_data.yaml @@ -4,28 +4,25 @@ configure: end: new_state: execute l2vpn evpn: "l2vpn evpn\r\n" - line console: - new_state: configure_line line console 0: new_state: configure_line no logging console: '' - prompt: NyqC(config)# + prompt: IR1101(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - line vty: '' - terminal width 511: '' - prompt: NyqC(config-line)# + prompt: IR1101(config-line)# connect: commands: - '': - new_state: execute - preface: |- - Trying mock_device ... + ? '' + : new_state: execute + preface: 'Trying mock_device ... + Connected to mock_device. - Escape character is '^]'. + + Escape character is ''^]''.' prompt: '' execute: commands: @@ -34,9 +31,7 @@ execute: config-transaction: new_state: configure show version: '' + show version | include operating mode: '' term length 0: '' term width 0: '' - term width 511: '' - terminal session-timeout 0: '' - show version | include operating mode: '' - prompt: NyqC# + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_default_gateway_advertise_global/test_api_configure_evpn_default_gateway_advertise_global.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_default_gateway_advertise_global/test_api_configure_evpn_default_gateway_advertise_global.py index 14c92b2f6..0e4c083f6 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_default_gateway_advertise_global/test_api_configure_evpn_default_gateway_advertise_global.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_default_gateway_advertise_global/test_api_configure_evpn_default_gateway_advertise_global.py @@ -1,3 +1,4 @@ +import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.evpn.configure import configure_evpn_default_gateway_advertise_global @@ -7,21 +8,21 @@ class TestConfigureEvpnDefaultGatewayAdvertiseGlobal(unittest.TestCase): @classmethod def setUpClass(self): - testbed = """ + testbed = f""" devices: - NyqC: + IR1101: connections: defaults: class: unicon.Unicon a: - command: mock_device_cli --os iosxe --mock_data_dir mock_data --state connect + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: cat9k - type: c9300 + platform: router + type: router """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['NyqC'] + self.device = self.testbed.devices['IR1101'] self.device.connect( learn_hostname=True, init_config_commands=[], diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_instance_evi/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_instance_evi/mock_data/iosxe/mock_data.yaml index 972e8f110..c8e70a584 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_instance_evi/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_instance_evi/mock_data/iosxe/mock_data.yaml @@ -1,28 +1,28 @@ configure: commands: - encapsulation vxlan: "encapsulation vxlan\r\n" + default-gateway advertise enable: "default-gateway advertise enable\r\n" end: new_state: execute - ip local-learning disable: "ip local-learning disable\r\n" - l2vpn evpn instance 201 vlan-based: "l2vpn evpn instance 201 vlan-based\r\n" + l2vpn evpn instance 12 vlan-based: "l2vpn evpn instance 12 vlan-based\r\n" line console 0: new_state: configure_line no logging console: '' - prompt: T3-9500-S2(config)# + prompt: IR1101(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: T3-9500-S2(config-line)# + prompt: IR1101(config-line)# connect: commands: - '': - new_state: execute - preface: |- - Trying mock_device ... + ? '' + : new_state: execute + preface: 'Trying mock_device ... + Connected to mock_device. - Escape character is '^]'. + + Escape character is ''^]''.' prompt: '' execute: commands: @@ -31,7 +31,7 @@ execute: config-transaction: new_state: configure show version: '' + show version | include operating mode: '' term length 0: '' term width 0: '' - show version | include operating mode: '' - prompt: T3-9500-S2# + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_instance_evi/test_api_configure_evpn_instance_evi.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_instance_evi/test_api_configure_evpn_instance_evi.py index f74d5a6cd..b7c2e1419 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_instance_evi/test_api_configure_evpn_instance_evi.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_instance_evi/test_api_configure_evpn_instance_evi.py @@ -10,7 +10,7 @@ class TestConfigureEvpnInstanceEvi(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - T3-9500-S2: + IR1101: connections: defaults: class: unicon.Unicon @@ -18,11 +18,11 @@ def setUpClass(self): command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: c9300 - type: c9500 + platform: router + type: router """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['T3-9500-S2'] + self.device = self.testbed.devices['IR1101'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -30,6 +30,6 @@ def setUpClass(self): ) def test_configure_evpn_instance_evi(self): - result = configure_evpn_instance_evi(self.device, 201, 'vlan-based', ['encapsulation', 'ip'], 'vxlan', 'disable') + result = configure_evpn_instance_evi(self.device, 12, 'vlan-based', ['default-gateway'], 'vxlan', 'disable') expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_instance_bd_association/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_instance_bd_association/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_instance_bd_association/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_instance_bd_association/mock_data/iosxe/mock_data.yaml index ddcb4ca5b..708181f63 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_instance_bd_association/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_instance_bd_association/mock_data/iosxe/mock_data.yaml @@ -1,28 +1,29 @@ configure: commands: + bridge-domain 40: "bridge-domain 40\r\n" end: new_state: execute line console 0: new_state: configure_line - member evpn-instance 10 vni 100: | - member evpn-instance 10 vni 100 + member evpn-instance 9 vni 30012 ethernet-tag 20012: "member evpn-instance 9 vni\ + \ 30012 ethernet-tag 20012\r\n" no logging console: '' - bridge-domain 1: "bridge-domain 1" - prompt: VTEP1(config)# + prompt: IR1101(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: VTEP1(config-line)# + prompt: IR1101(config-line)# connect: commands: - '': - new_state: execute - preface: |- - Trying mock_device ... + ? '' + : new_state: execute + preface: 'Trying mock_device ... + Connected to mock_device. - Escape character is '^]'. + + Escape character is ''^]''.' prompt: '' execute: commands: @@ -31,7 +32,7 @@ execute: config-transaction: new_state: configure show version: '' + show version | include operating mode: '' term length 0: '' term width 0: '' - 'show version | include operating mode': '' - prompt: VTEP1# \ No newline at end of file + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_instance_bd_association/test_api_configure_evpn_l2_instance_bd_association.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_instance_bd_association/test_api_configure_evpn_l2_instance_bd_association.py index 6a970c919..eecd51fea 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_instance_bd_association/test_api_configure_evpn_l2_instance_bd_association.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_instance_bd_association/test_api_configure_evpn_l2_instance_bd_association.py @@ -1,3 +1,4 @@ +import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.evpn.configure import configure_evpn_l2_instance_bd_association @@ -7,21 +8,21 @@ class TestConfigureEvpnL2InstanceBdAssociation(unittest.TestCase): @classmethod def setUpClass(self): - testbed = """ + testbed = f""" devices: - VTEP1: + IR1101: connections: defaults: class: unicon.Unicon a: - command: mock_device_cli --os iosxe --mock_data_dir mock_data --state connect + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: cat9k - type: c9300 + platform: router + type: router """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['VTEP1'] + self.device = self.testbed.devices['IR1101'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -29,6 +30,6 @@ def setUpClass(self): ) def test_configure_evpn_l2_instance_bd_association(self): - result = configure_evpn_l2_instance_bd_association(self.device, 1, 10, 100) + result = configure_evpn_l2_instance_bd_association(self.device, 40, 9, 30012, 20012) expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_profile_bd_association/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_profile_bd_association/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_profile_bd_association/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_profile_bd_association/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ad00adfa5 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_profile_bd_association/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + bridge-domain 10: "bridge-domain 10\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + member evpn-instance profile evpn_va1: "member evpn-instance profile evpn_va1\r\ + \n" + no logging console: '' + prompt: IR1101(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR1101(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_profile_bd_association/test_api_configure_evpn_l2_profile_bd_association.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_profile_bd_association/test_api_configure_evpn_l2_profile_bd_association.py new file mode 100644 index 000000000..6b5da9bf1 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l2_profile_bd_association/test_api_configure_evpn_l2_profile_bd_association.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.evpn.configure import configure_evpn_l2_profile_bd_association + + +class TestConfigureEvpnL2ProfileBdAssociation(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR1101: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR1101'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_evpn_l2_profile_bd_association(self): + result = configure_evpn_l2_profile_bd_association(self.device, 10, 'evpn_va1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l3_instance_bd_association/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l3_instance_bd_association/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l3_instance_bd_association/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l3_instance_bd_association/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..6931b723a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l3_instance_bd_association/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + bridge-domain 30: "bridge-domain 30\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + member vni 30000: "member vni 30000\r\n" + no logging console: '' + prompt: IR1101(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR1101(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l3_instance_bd_association/test_api_configure_evpn_l3_instance_bd_association.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l3_instance_bd_association/test_api_configure_evpn_l3_instance_bd_association.py new file mode 100644 index 000000000..8e82401f8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_l3_instance_bd_association/test_api_configure_evpn_l3_instance_bd_association.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.evpn.configure import configure_evpn_l3_instance_bd_association + + +class TestConfigureEvpnL3InstanceBdAssociation(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR1101: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR1101'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_evpn_l3_instance_bd_association(self): + result = configure_evpn_l3_instance_bd_association(self.device, 30, 30000) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_profile/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_profile/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_profile/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_profile/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ad755c7ec --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_profile/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,41 @@ +configure: + commands: + encapsulation vxlan: "encapsulation vxlan\r\n" + end: + new_state: execute + ethernet-tag auto-vni: "ethernet-tag auto-vni\r\n" + evi-id 1: "evi-id 1\r\n" + l2vni-base 50000: "l2vni-base 50000\r\n" + l2vpn evpn profile evpn_va1 vlan-aware: "l2vpn evpn profile evpn_va1 vlan-aware\r\ + \n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: IR1101(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR1101(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_profile/test_api_configure_evpn_profile.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_profile/test_api_configure_evpn_profile.py new file mode 100644 index 000000000..2e932a105 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_evpn_profile/test_api_configure_evpn_profile.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.evpn.configure import configure_evpn_profile + + +class TestConfigureEvpnProfile(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR1101: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR1101'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_evpn_profile(self): + result = configure_evpn_profile(self.device, 'evpn_va1', 'vlan-aware', 1, 50000, 'auto-vni', 'vxlan') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn/mock_data/iosxe/mock_data.yaml index dfb311ff5..8741d4c93 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn/mock_data/iosxe/mock_data.yaml @@ -3,28 +3,25 @@ configure: end: new_state: execute l2vpn evpn: "l2vpn evpn\r\n" - line console: - new_state: configure_line line console 0: new_state: configure_line no logging console: '' - prompt: NyqC(config)# + prompt: IR1101(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - line vty: '' - terminal width 511: '' - prompt: NyqC(config-line)# + prompt: IR1101(config-line)# connect: commands: - '': - new_state: execute - preface: |- - Trying mock_device ... + ? '' + : new_state: execute + preface: 'Trying mock_device ... + Connected to mock_device. - Escape character is '^]'. + + Escape character is ''^]''.' prompt: '' execute: commands: @@ -33,9 +30,7 @@ execute: config-transaction: new_state: configure show version: '' + show version | include operating mode: '' term length 0: '' term width 0: '' - term width 511: '' - terminal session-timeout 0: '' - show version | include operating mode: '' - prompt: NyqC# + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn/test_api_configure_l2vpn_evpn.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn/test_api_configure_l2vpn_evpn.py index 692994cc2..6c6e46bc8 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn/test_api_configure_l2vpn_evpn.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn/test_api_configure_l2vpn_evpn.py @@ -1,3 +1,4 @@ +import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.evpn.configure import configure_l2vpn_evpn @@ -7,21 +8,21 @@ class TestConfigureL2vpnEvpn(unittest.TestCase): @classmethod def setUpClass(self): - testbed = """ + testbed = f""" devices: - NyqC: + IR1101: connections: defaults: class: unicon.Unicon a: - command: mock_device_cli --os iosxe --mock_data_dir mock_data --state connect + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: cat9k - type: c9300 + platform: router + type: router """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['NyqC'] + self.device = self.testbed.devices['IR1101'] self.device.connect( learn_hostname=True, init_config_commands=[], diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn_flooding_suppression/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn_flooding_suppression/mock_data/iosxe/mock_data.yaml index 75093645f..9a44d1f6e 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn_flooding_suppression/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn_flooding_suppression/mock_data/iosxe/mock_data.yaml @@ -2,27 +2,28 @@ configure: commands: end: new_state: execute - flooding-suppression address-resolution disable: "flooding-suppression address-resolution - disable\r\n" + flooding-suppression address-resolution disable: "flooding-suppression address-resolution\ + \ disable\r\n" l2vpn evpn: "l2vpn evpn\r\n" line console 0: new_state: configure_line no logging console: '' - prompt: Leaf-01(config)# + prompt: IR1101(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: Leaf-01(config-line)# + prompt: IR1101(config-line)# connect: commands: - '': - new_state: execute - preface: |- - Trying mock_device ... + ? '' + : new_state: execute + preface: 'Trying mock_device ... + Connected to mock_device. - Escape character is '^]'. + + Escape character is ''^]''.' prompt: '' execute: commands: @@ -31,7 +32,7 @@ execute: config-transaction: new_state: configure show version: '' + show version | include operating mode: '' term length 0: '' term width 0: '' - show version | include operating mode: '' - prompt: Leaf-01# + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn_flooding_suppression/test_api_configure_l2vpn_evpn_flooding_suppression.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn_flooding_suppression/test_api_configure_l2vpn_evpn_flooding_suppression.py index 21ab3fb18..6cdca1533 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn_flooding_suppression/test_api_configure_l2vpn_evpn_flooding_suppression.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_l2vpn_evpn_flooding_suppression/test_api_configure_l2vpn_evpn_flooding_suppression.py @@ -10,7 +10,7 @@ class TestConfigureL2vpnEvpnFloodingSuppression(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - Leaf-01: + IR1101: connections: defaults: class: unicon.Unicon @@ -18,11 +18,11 @@ def setUpClass(self): command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: cat9k - type: c9300 + platform: router + type: router """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['Leaf-01'] + self.device = self.testbed.devices['IR1101'] self.device.connect( learn_hostname=True, init_config_commands=[], diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_vlan_service_instance_bd_association/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_vlan_service_instance_bd_association/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_vlan_service_instance_bd_association/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_vlan_service_instance_bd_association/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..2ce761e9a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_vlan_service_instance_bd_association/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + bridge-domain 10: "bridge-domain 10\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + member Vlan12 service-instance 12: "member Vlan12 service-instance 12\r\n" + no logging console: '' + prompt: IR1101(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR1101(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_vlan_service_instance_bd_association/test_api_configure_vlan_service_instance_bd_association.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_vlan_service_instance_bd_association/test_api_configure_vlan_service_instance_bd_association.py new file mode 100644 index 000000000..9230223a2 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/configure_vlan_service_instance_bd_association/test_api_configure_vlan_service_instance_bd_association.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.evpn.configure import configure_vlan_service_instance_bd_association + + +class TestConfigureVlanServiceInstanceBdAssociation(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR1101: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR1101'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_vlan_service_instance_bd_association(self): + result = configure_vlan_service_instance_bd_association(self.device, 10, 'Vlan12', 12) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_l2_profile_bd_association/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_l2_profile_bd_association/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_l2_profile_bd_association/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_l2_profile_bd_association/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ab299804b --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_l2_profile_bd_association/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + bridge-domain 10: "bridge-domain 10\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + no member evpn-instance profile evpn_va1: "no member evpn-instance profile evpn_va1\r\ + \n" + prompt: IR1101(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR1101(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_l2_profile_bd_association/test_api_unconfigure_evpn_l2_profile_bd_association.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_l2_profile_bd_association/test_api_unconfigure_evpn_l2_profile_bd_association.py new file mode 100644 index 000000000..77a3d68f8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_l2_profile_bd_association/test_api_unconfigure_evpn_l2_profile_bd_association.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.evpn.configure import unconfigure_evpn_l2_profile_bd_association + + +class TestUnconfigureEvpnL2ProfileBdAssociation(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR1101: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR1101'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_evpn_l2_profile_bd_association(self): + result = unconfigure_evpn_l2_profile_bd_association(self.device, 10, 'evpn_va1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_profile/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_profile/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_profile/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_profile/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..382bd27fb --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_profile/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,41 @@ +configure: + commands: + end: + new_state: execute + exit: "exit\r\n" + l2vpn evpn profile evpn_va1 vlan-aware: "l2vpn evpn profile evpn_va1 vlan-aware\r\ + \n" + line console 0: + new_state: configure_line + no evi-id: "no evi-id\r\n" + no l2vpn evpn profile evpn_va1 vlan-aware: "no l2vpn evpn profile evpn_va1 vlan-aware\r\ + \n" + no logging console: '' + prompt: IR1101(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR1101(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_profile/test_api_unconfigure_evpn_profile.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_profile/test_api_unconfigure_evpn_profile.py new file mode 100644 index 000000000..20521285f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_evpn_profile/test_api_unconfigure_evpn_profile.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.evpn.configure import unconfigure_evpn_profile + + +class TestUnconfigureEvpnProfile(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR1101: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR1101'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_evpn_profile(self): + result = unconfigure_evpn_profile(self.device, 'evpn_va1', 'vlan-aware') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_vlan_service_instance_bd_association/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_vlan_service_instance_bd_association/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_vlan_service_instance_bd_association/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_vlan_service_instance_bd_association/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..da72bbd4e --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_vlan_service_instance_bd_association/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + bridge-domain 10: "bridge-domain 10\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + no member Vlan12 service-instance 12: "no member Vlan12 service-instance 12\r\n" + prompt: IR1101(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR1101(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_vlan_service_instance_bd_association/test_api_unconfigure_vlan_service_instance_bd_association.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_vlan_service_instance_bd_association/test_api_unconfigure_vlan_service_instance_bd_association.py new file mode 100644 index 000000000..3d95445bf --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/evpn/configure/unconfigure_vlan_service_instance_bd_association/test_api_unconfigure_vlan_service_instance_bd_association.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.evpn.configure import unconfigure_vlan_service_instance_bd_association + + +class TestUnconfigureVlanServiceInstanceBdAssociation(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR1101: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR1101'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_vlan_service_instance_bd_association(self): + result = unconfigure_vlan_service_instance_bd_association(self.device, 10, 'Vlan12', 12) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/clear_monitor_capture/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/clear_monitor_capture/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/clear_monitor_capture/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/clear_monitor_capture/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..a3e1449ba --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/clear_monitor_capture/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,39 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: Gryphon(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Gryphon(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + monitor capture capture1 clear: + response: + - 'Capture point does not exist : capture1' + response_type: circular + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: Gryphon# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/clear_monitor_capture/test_api_clear_monitor_capture.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/clear_monitor_capture/test_api_clear_monitor_capture.py new file mode 100644 index 000000000..1ecd117a9 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/clear_monitor_capture/test_api_clear_monitor_capture.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.flow.configure import clear_monitor_capture + + +class TestClearMonitorCapture(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Gryphon: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9500 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Gryphon'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_clear_monitor_capture(self): + result = clear_monitor_capture(self.device, 'capture1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_access_list/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_access_list/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_access_list/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_access_list/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..5ff07edb3 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_access_list/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,39 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: PREG_IFD_CFD_TB3_9500_SA(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: PREG_IFD_CFD_TB3_9500_SA(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + monitor capture test access-list MYACLV6: + response: + - "Non-existent access-list specified\r\n\r\nFailed to attach existing ACL" + response_type: circular + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: PREG_IFD_CFD_TB3_9500_SA# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_access_list/test_api_execute_monitor_capture_access_list.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_access_list/test_api_execute_monitor_capture_access_list.py new file mode 100644 index 000000000..02ba86403 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_access_list/test_api_execute_monitor_capture_access_list.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.flow.execute import execute_monitor_capture_access_list + + +class TestExecuteMonitorCaptureAccessList(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + PREG_IFD_CFD_TB3_9500_SA: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: C9500-32QC + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['PREG_IFD_CFD_TB3_9500_SA'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_execute_monitor_capture_access_list(self): + result = execute_monitor_capture_access_list(self.device, 'test', 'MYACLV6') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_limit_duration/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_limit_duration/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_limit_duration/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_limit_duration/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..e9754ddf1 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_limit_duration/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,39 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: PREG_IFD_CFD_TB3_9500_SA(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: PREG_IFD_CFD_TB3_9500_SA(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + monitor capture test limit duration 40: + response: + - '' + response_type: circular + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: PREG_IFD_CFD_TB3_9500_SA# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_limit_duration/test_api_execute_monitor_capture_limit_duration.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_limit_duration/test_api_execute_monitor_capture_limit_duration.py new file mode 100644 index 000000000..b9dbd324c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_limit_duration/test_api_execute_monitor_capture_limit_duration.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.flow.execute import execute_monitor_capture_limit_duration + + +class TestExecuteMonitorCaptureLimitDuration(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + PREG_IFD_CFD_TB3_9500_SA: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: C9500-32QC + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['PREG_IFD_CFD_TB3_9500_SA'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_execute_monitor_capture_limit_duration(self): + result = execute_monitor_capture_limit_duration(self.device, 'test', 40) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_vlan_in_match_any/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_vlan_in_match_any/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_vlan_in_match_any/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_vlan_in_match_any/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..142ff7e44 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_vlan_in_match_any/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,39 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: PREG_IFD_CFD_TB3_9500_SA(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: PREG_IFD_CFD_TB3_9500_SA(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + monitor capture test vlan 33 in match any: + response: + - '' + response_type: circular + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: PREG_IFD_CFD_TB3_9500_SA# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_vlan_in_match_any/test_api_execute_monitor_capture_vlan_in_match_any.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_vlan_in_match_any/test_api_execute_monitor_capture_vlan_in_match_any.py new file mode 100644 index 000000000..eace88969 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_vlan_in_match_any/test_api_execute_monitor_capture_vlan_in_match_any.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.flow.execute import execute_monitor_capture_vlan_in_match_any + + +class TestExecuteMonitorCaptureVlanInMatchAny(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + PREG_IFD_CFD_TB3_9500_SA: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: C9500-32QC + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['PREG_IFD_CFD_TB3_9500_SA'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_execute_monitor_capture_vlan_in_match_any(self): + result = execute_monitor_capture_vlan_in_match_any(self.device, 'test', 33) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ie3k/platform/verify/verify_boot_variable/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ie3k/platform/verify/verify_boot_variable/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ie3k/platform/verify/verify_boot_variable/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ie3k/platform/verify/verify_boot_variable/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ebf41098c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ie3k/platform/verify/verify_boot_variable/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,41 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: IE-3300-8U2X-tgen1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IE-3300-8U2X-tgen1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show boot: + response: + - "Current Boot Variables:\r\nBOOT variable = flash:ie3x00-universalk9.BLD_POLARIS_DEV_LATEST_20240328_003412.SSA.bin;\r\ + \n\r\nBoot Variables on next reload:\r\nBOOT variable = flash:ie3x00-universalk9.BLD_POLARIS_DEV_LATEST_20240328_003412.SSA.bin;\r\ + \nMANUAL_BOOT variable = no\r\nENABLE_BREAK variable = yes" + response_type: circular + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IE-3300-8U2X-tgen1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ie3k/platform/verify/verify_boot_variable/test_api_verify_boot_variable.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ie3k/platform/verify/verify_boot_variable/test_api_verify_boot_variable.py new file mode 100644 index 000000000..d469d42c4 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ie3k/platform/verify/verify_boot_variable/test_api_verify_boot_variable.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.ie3k.platform.verify import verify_boot_variable + + +class TestVerifyBootVariable(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IE-3300-8U2X-tgen1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: ie3k + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IE-3300-8U2X-tgen1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_verify_boot_variable(self): + result = verify_boot_variable(self.device, 'sdflash:/ie31xx-universalk9.BLD_POLARIS_DEV_LATEST_20240301_003017.SSA.bin', None) + expected_output = False + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_preferred/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_preferred/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_preferred/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_preferred/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..f77b9ac80 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_preferred/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,39 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/1: "interface GigabitEthernet1/1\r\n" + line console 0: + new_state: configure_line + no logging console: '' + rep segment 1 edge preferred: "rep segment 1 edge preferred\r\n" + switchport: "switchport\r\n" + switchport mode trunk: "switchport mode trunk\r\n" + prompt: IR_DBS_IE3400_1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR_DBS_IE3400_1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR_DBS_IE3400_1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_preferred/test_api_configure_interface_rep_segment_edge_preferred.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_preferred/test_api_configure_interface_rep_segment_edge_preferred.py new file mode 100644 index 000000000..21685a648 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_preferred/test_api_configure_interface_rep_segment_edge_preferred.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import configure_interface_rep_segment_edge_preferred + + +class TestConfigureInterfaceRepSegmentEdgePreferred(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR_DBS_IE3400_1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR_DBS_IE3400_1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_interface_rep_segment_edge_preferred(self): + result = configure_interface_rep_segment_edge_preferred(self.device, 'GigabitEthernet1/1', '1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_primary/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_primary/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_primary/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_primary/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..513137022 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_primary/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,39 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/1: "interface GigabitEthernet1/1\r\n" + line console 0: + new_state: configure_line + no logging console: '' + rep segment 1 edge primary: "rep segment 1 edge primary\r\n" + switchport: "switchport\r\n" + switchport mode trunk: "switchport mode trunk\r\n" + prompt: IR_DBS_IE3400_1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR_DBS_IE3400_1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR_DBS_IE3400_1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_primary/test_api_configure_interface_rep_segment_edge_primary.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_primary/test_api_configure_interface_rep_segment_edge_primary.py new file mode 100644 index 000000000..278547e10 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_segment_edge_primary/test_api_configure_interface_rep_segment_edge_primary.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import configure_interface_rep_segment_edge_primary + + +class TestConfigureInterfaceRepSegmentEdgePrimary(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR_DBS_IE3400_1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR_DBS_IE3400_1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_interface_rep_segment_edge_primary(self): + result = configure_interface_rep_segment_edge_primary(self.device, 'GigabitEthernet1/1', '1', False) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_segment/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_segment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_segment/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_segment/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..f483a4323 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_segment/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/1: "interface GigabitEthernet1/1\r\n" + line console 0: + new_state: configure_line + no logging console: '' + rep stcn segment 1: "rep stcn segment 1\r\n" + prompt: IR_DBS_IE3400_1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR_DBS_IE3400_1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR_DBS_IE3400_1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_segment/test_api_configure_interface_rep_stcn_segment.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_segment/test_api_configure_interface_rep_stcn_segment.py new file mode 100644 index 000000000..4bbbfdd51 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_segment/test_api_configure_interface_rep_stcn_segment.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import configure_interface_rep_stcn_segment + + +class TestConfigureInterfaceRepStcnSegment(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR_DBS_IE3400_1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR_DBS_IE3400_1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_interface_rep_stcn_segment(self): + result = configure_interface_rep_stcn_segment(self.device, 'GigabitEthernet1/1', '1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_stp/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_stp/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_stp/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_stp/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..169a7ccf7 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_stp/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/1: "interface GigabitEthernet1/1\r\n" + line console 0: + new_state: configure_line + no logging console: '' + rep stcn stp: "rep stcn stp\r\n" + prompt: IR_DBS_IE3400_1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR_DBS_IE3400_1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR_DBS_IE3400_1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_stp/test_api_configure_interface_rep_stcn_stp.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_stp/test_api_configure_interface_rep_stcn_stp.py new file mode 100644 index 000000000..a37d07256 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_interface_rep_stcn_stp/test_api_configure_interface_rep_stcn_stp.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import configure_interface_rep_stcn_stp + + +class TestConfigureInterfaceRepStcnStp(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR_DBS_IE3400_1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR_DBS_IE3400_1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_interface_rep_stcn_stp(self): + result = configure_interface_rep_stcn_stp(self.device, 'GigabitEthernet1/1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ppp_multilink/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ppp_multilink/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ppp_multilink/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ppp_multilink/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..b2656f9f8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ppp_multilink/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface Dialer10: "interface Dialer10\r\n" + line console 0: + new_state: configure_line + no logging console: '' + ppp multilink: "ppp multilink\r\n" + prompt: nanook_pkumarmu_rr(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: nanook_pkumarmu_rr(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: nanook_pkumarmu_rr# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ppp_multilink/test_api_configure_ppp_multilink.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ppp_multilink/test_api_configure_ppp_multilink.py new file mode 100644 index 000000000..1354f2584 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ppp_multilink/test_api_configure_ppp_multilink.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import configure_ppp_multilink + + +class TestConfigurePppMultilink(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + nanook_pkumarmu_rr: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['nanook_pkumarmu_rr'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ppp_multilink(self): + result = configure_ppp_multilink(self.device, 'Dialer10') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_service_policy_type_queueing_on_interface/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_service_policy_type_queueing_on_interface/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_service_policy_type_queueing_on_interface/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_service_policy_type_queueing_on_interface/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..db3a82800 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_service_policy_type_queueing_on_interface/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/0/10: "interface GigabitEthernet1/0/10\r\n" + line console 0: + new_state: configure_line + no logging console: '' + service-policy type queueing output 3p1q: "service-policy type queueing output\ + \ 3p1q\r\n" + prompt: Raitt(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Raitt(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: Raitt# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_service_policy_type_queueing_on_interface/test_api_configure_service_policy_type_queueing_on_interface.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_service_policy_type_queueing_on_interface/test_api_configure_service_policy_type_queueing_on_interface.py new file mode 100644 index 000000000..314a61356 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_service_policy_type_queueing_on_interface/test_api_configure_service_policy_type_queueing_on_interface.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import configure_service_policy_type_queueing_on_interface + + +class TestConfigureServicePolicyTypeQueueingOnInterface(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Raitt: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Raitt'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_service_policy_type_queueing_on_interface(self): + result = configure_service_policy_type_queueing_on_interface(self.device, 'GigabitEthernet1/0/10', 'output', '3p1q') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_preferred/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_preferred/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_preferred/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_preferred/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..769ca620f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_preferred/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/1: "interface GigabitEthernet1/1\r\n" + line console 0: + new_state: configure_line + no logging console: '' + no rep segment 1 edge preferred: "no rep segment 1 edge preferred\r\n" + prompt: IR_DBS_IE3400_1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR_DBS_IE3400_1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR_DBS_IE3400_1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_preferred/test_api_unconfigure_interface_rep_segment_edge_preferred.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_preferred/test_api_unconfigure_interface_rep_segment_edge_preferred.py new file mode 100644 index 000000000..d9ec7e23d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_preferred/test_api_unconfigure_interface_rep_segment_edge_preferred.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import unconfigure_interface_rep_segment_edge_preferred + + +class TestUnconfigureInterfaceRepSegmentEdgePreferred(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR_DBS_IE3400_1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR_DBS_IE3400_1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_interface_rep_segment_edge_preferred(self): + result = unconfigure_interface_rep_segment_edge_preferred(self.device, 'GigabitEthernet1/1', '1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_primary/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_primary/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_primary/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_primary/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..f20165a01 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_primary/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/1: "interface GigabitEthernet1/1\r\n" + line console 0: + new_state: configure_line + no logging console: '' + no rep segment 1 edge primary: "no rep segment 1 edge primary\r\n" + prompt: IR_DBS_IE3400_1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR_DBS_IE3400_1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR_DBS_IE3400_1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_primary/test_api_unconfigure_interface_rep_segment_edge_primary.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_primary/test_api_unconfigure_interface_rep_segment_edge_primary.py new file mode 100644 index 000000000..645c5dfc8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_segment_edge_primary/test_api_unconfigure_interface_rep_segment_edge_primary.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import unconfigure_interface_rep_segment_edge_primary + + +class TestUnconfigureInterfaceRepSegmentEdgePrimary(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR_DBS_IE3400_1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR_DBS_IE3400_1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_interface_rep_segment_edge_primary(self): + result = unconfigure_interface_rep_segment_edge_primary(self.device, 'GigabitEthernet1/1', '1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_segment/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_segment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_segment/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_segment/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..f96fad6f0 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_segment/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/1: "interface GigabitEthernet1/1\r\n" + line console 0: + new_state: configure_line + no logging console: '' + no rep stcn segment: "no rep stcn segment\r\n" + prompt: IR_DBS_IE3400_1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR_DBS_IE3400_1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR_DBS_IE3400_1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_segment/test_api_unconfigure_interface_rep_stcn_segment.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_segment/test_api_unconfigure_interface_rep_stcn_segment.py new file mode 100644 index 000000000..47a4ce2bd --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_segment/test_api_unconfigure_interface_rep_stcn_segment.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import unconfigure_interface_rep_stcn_segment + + +class TestUnconfigureInterfaceRepStcnSegment(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR_DBS_IE3400_1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR_DBS_IE3400_1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_interface_rep_stcn_segment(self): + result = unconfigure_interface_rep_stcn_segment(self.device, 'GigabitEthernet1/1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_stp/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_stp/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_stp/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_stp/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..c7414802f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_stp/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/1: "interface GigabitEthernet1/1\r\n" + line console 0: + new_state: configure_line + no logging console: '' + no rep stcn stp: "no rep stcn stp\r\n" + prompt: IR_DBS_IE3400_1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR_DBS_IE3400_1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR_DBS_IE3400_1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_stp/test_api_unconfigure_interface_rep_stcn_stp.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_stp/test_api_unconfigure_interface_rep_stcn_stp.py new file mode 100644 index 000000000..14c5352c2 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_rep_stcn_stp/test_api_unconfigure_interface_rep_stcn_stp.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import unconfigure_interface_rep_stcn_stp + + +class TestUnconfigureInterfaceRepStcnStp(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR_DBS_IE3400_1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR_DBS_IE3400_1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_interface_rep_stcn_stp(self): + result = unconfigure_interface_rep_stcn_stp(self.device, 'GigabitEthernet1/1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_port_channel/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_port_channel/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_port_channel/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_port_channel/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..f93c7848e --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_port_channel/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no interface Port-channel 126: "" + no logging console: '' + prompt: PE-A(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: PE-A(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: PE-A# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_port_channel/test_api_unconfigure_port_channel.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_port_channel/test_api_unconfigure_port_channel.py new file mode 100644 index 000000000..c8333f7c0 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_port_channel/test_api_unconfigure_port_channel.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import unconfigure_port_channel + + +class TestUnconfigurePortChannel(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + PE-A: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['PE-A'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_port_channel(self): + result = unconfigure_port_channel(self.device, '126') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_ppp_multilink/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_ppp_multilink/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_ppp_multilink/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_ppp_multilink/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..44169f6fa --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_ppp_multilink/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface Dialer10: "interface Dialer10\r\n" + line console 0: + new_state: configure_line + no logging console: '' + no ppp multilink: "no ppp multilink\r\n" + prompt: nanook_pkumarmu_rr(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: nanook_pkumarmu_rr(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: nanook_pkumarmu_rr# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_ppp_multilink/test_api_unconfigure_ppp_multilink.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_ppp_multilink/test_api_unconfigure_ppp_multilink.py new file mode 100644 index 000000000..410ed3fcd --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_ppp_multilink/test_api_unconfigure_ppp_multilink.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import unconfigure_ppp_multilink + + +class TestUnconfigurePppMultilink(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + nanook_pkumarmu_rr: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['nanook_pkumarmu_rr'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_ppp_multilink(self): + result = unconfigure_ppp_multilink(self.device, 'Dialer10') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/execute/execute_test_fru_fake_insert/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/execute/execute_test_fru_fake_insert/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/execute/execute_test_fru_fake_insert/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/execute/execute_test_fru_fake_insert/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..10464a360 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/execute/execute_test_fru_fake_insert/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: stack-9350(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: stack-9350(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version | include operating mode: '' + term length 0: '' + term width 0: '' + test platform software fed switch active fru fake-insert: + response: + - '' + response_type: circular + prompt: stack-9350# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/execute/execute_test_fru_fake_insert/test_api_execute_test_fru_fake_insert.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/execute/execute_test_fru_fake_insert/test_api_execute_test_fru_fake_insert.py new file mode 100644 index 000000000..eaf8f0196 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/execute/execute_test_fru_fake_insert/test_api_execute_test_fru_fake_insert.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.execute import execute_test_fru_fake_insert + + +class TestExecuteTestFruFakeInsert(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + stack-9350: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: C9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['stack-9350'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_execute_test_fru_fake_insert(self): + result = execute_test_fru_fake_insert(self.device, 'active') + expected_output = '' + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/get/get_interface_traffic_packet_counters/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/get/get_interface_traffic_packet_counters/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/get/get_interface_traffic_packet_counters/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/get/get_interface_traffic_packet_counters/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..3cd1ff11e --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/get/get_interface_traffic_packet_counters/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,238 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: IE-3300-8U2X-tgen1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IE-3300-8U2X-tgen1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show interfaces GigabitEthernet1/6: + response: + - "GigabitEthernet1/6 is down, line protocol is down (notconnect) \r\n Hardware\ + \ is Gigabit Ethernet, address is b0c5.3c99.0726 (bia b0c5.3c99.0726)\r\n\ + \ MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, \r\n reliability\ + \ 255/255, txload 1/255, rxload 1/255\r\n Encapsulation ARPA, loopback not\ + \ set\r\n Keepalive set (10 sec)\r\n Auto-duplex, Auto-speed, media type\ + \ is 10/100/1000BaseTX\r\n input flow-control is off, output flow-control\ + \ is unsupported \r\n ARP type: ARPA, ARP Timeout 04:00:00\r\n Last input\ + \ never, output never, output hang never\r\n Last clearing of \"show interface\"\ + \ counters never\r\n Input queue: 0/375/0/0 (size/max/drops/flushes); Total\ + \ output drops: 0\r\n Queueing strategy: fifo\r\n Output queue: 0/40 (size/max)\r\ + \n 5 minute input rate 0 bits/sec, 0 packets/sec\r\n 5 minute output rate\ + \ 0 bits/sec, 0 packets/sec\r\n 0 packets input, 0 bytes, 0 no buffer\r\ + \n Received 0 broadcasts (0 multicasts)\r\n 0 runts, 0 giants, 0 throttles\ + \ \r\n 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored\r\n 0\ + \ watchdog, 0 multicast, 0 pause input\r\n 0 input packets with dribble\ + \ condition detected\r\n 0 packets output, 0 bytes, 0 underruns\r\n \ + \ Output 0 broadcasts (0 multicasts)\r\n 0 output errors, 0 collisions,\ + \ 1 interface resets\r\n 0 unknown protocol drops\r\n 0 babbles, 0\ + \ late collision, 0 deferred\r\n 0 lost carrier, 0 no carrier, 0 pause\ + \ output\r\n 0 output buffer failures, 0 output buffers swapped out" + - "GigabitEthernet1/6 is down, line protocol is down (notconnect) \r\n Hardware\ + \ is Gigabit Ethernet, address is b0c5.3c99.0726 (bia b0c5.3c99.0726)\r\n\ + \ MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, \r\n reliability\ + \ 255/255, txload 1/255, rxload 1/255\r\n Encapsulation ARPA, loopback not\ + \ set\r\n Keepalive set (10 sec)\r\n Auto-duplex, Auto-speed, media type\ + \ is 10/100/1000BaseTX\r\n input flow-control is off, output flow-control\ + \ is unsupported \r\n ARP type: ARPA, ARP Timeout 04:00:00\r\n Last input\ + \ never, output never, output hang never\r\n Last clearing of \"show interface\"\ + \ counters never\r\n Input queue: 0/375/0/0 (size/max/drops/flushes); Total\ + \ output drops: 0\r\n Queueing strategy: fifo\r\n Output queue: 0/40 (size/max)\r\ + \n 5 minute input rate 0 bits/sec, 0 packets/sec\r\n 5 minute output rate\ + \ 0 bits/sec, 0 packets/sec\r\n 0 packets input, 0 bytes, 0 no buffer\r\ + \n Received 0 broadcasts (0 multicasts)\r\n 0 runts, 0 giants, 0 throttles\ + \ \r\n 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored\r\n 0\ + \ watchdog, 0 multicast, 0 pause input\r\n 0 input packets with dribble\ + \ condition detected\r\n 0 packets output, 0 bytes, 0 underruns\r\n \ + \ Output 0 broadcasts (0 multicasts)\r\n 0 output errors, 0 collisions,\ + \ 1 interface resets\r\n 0 unknown protocol drops\r\n 0 babbles, 0\ + \ late collision, 0 deferred\r\n 0 lost carrier, 0 no carrier, 0 pause\ + \ output\r\n 0 output buffer failures, 0 output buffers swapped out" + - "GigabitEthernet1/6 is down, line protocol is down (notconnect) \r\n Hardware\ + \ is Gigabit Ethernet, address is b0c5.3c99.0726 (bia b0c5.3c99.0726)\r\n\ + \ MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, \r\n reliability\ + \ 255/255, txload 1/255, rxload 1/255\r\n Encapsulation ARPA, loopback not\ + \ set\r\n Keepalive set (10 sec)\r\n Auto-duplex, Auto-speed, media type\ + \ is 10/100/1000BaseTX\r\n input flow-control is off, output flow-control\ + \ is unsupported \r\n ARP type: ARPA, ARP Timeout 04:00:00\r\n Last input\ + \ never, output never, output hang never\r\n Last clearing of \"show interface\"\ + \ counters never\r\n Input queue: 0/375/0/0 (size/max/drops/flushes); Total\ + \ output drops: 0\r\n Queueing strategy: fifo\r\n Output queue: 0/40 (size/max)\r\ + \n 5 minute input rate 0 bits/sec, 0 packets/sec\r\n 5 minute output rate\ + \ 0 bits/sec, 0 packets/sec\r\n 0 packets input, 0 bytes, 0 no buffer\r\ + \n Received 0 broadcasts (0 multicasts)\r\n 0 runts, 0 giants, 0 throttles\ + \ \r\n 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored\r\n 0\ + \ watchdog, 0 multicast, 0 pause input\r\n 0 input packets with dribble\ + \ condition detected\r\n 0 packets output, 0 bytes, 0 underruns\r\n \ + \ Output 0 broadcasts (0 multicasts)\r\n 0 output errors, 0 collisions,\ + \ 1 interface resets\r\n 0 unknown protocol drops\r\n 0 babbles, 0\ + \ late collision, 0 deferred\r\n 0 lost carrier, 0 no carrier, 0 pause\ + \ output\r\n 0 output buffer failures, 0 output buffers swapped out" + - "GigabitEthernet1/6 is down, line protocol is down (notconnect) \r\n Hardware\ + \ is Gigabit Ethernet, address is b0c5.3c99.0726 (bia b0c5.3c99.0726)\r\n\ + \ MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, \r\n reliability\ + \ 255/255, txload 1/255, rxload 1/255\r\n Encapsulation ARPA, loopback not\ + \ set\r\n Keepalive set (10 sec)\r\n Auto-duplex, Auto-speed, media type\ + \ is 10/100/1000BaseTX\r\n input flow-control is off, output flow-control\ + \ is unsupported \r\n ARP type: ARPA, ARP Timeout 04:00:00\r\n Last input\ + \ never, output never, output hang never\r\n Last clearing of \"show interface\"\ + \ counters never\r\n Input queue: 0/375/0/0 (size/max/drops/flushes); Total\ + \ output drops: 0\r\n Queueing strategy: fifo\r\n Output queue: 0/40 (size/max)\r\ + \n 5 minute input rate 0 bits/sec, 0 packets/sec\r\n 5 minute output rate\ + \ 0 bits/sec, 0 packets/sec\r\n 0 packets input, 0 bytes, 0 no buffer\r\ + \n Received 0 broadcasts (0 multicasts)\r\n 0 runts, 0 giants, 0 throttles\ + \ \r\n 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored\r\n 0\ + \ watchdog, 0 multicast, 0 pause input\r\n 0 input packets with dribble\ + \ condition detected\r\n 0 packets output, 0 bytes, 0 underruns\r\n \ + \ Output 0 broadcasts (0 multicasts)\r\n 0 output errors, 0 collisions,\ + \ 1 interface resets\r\n 0 unknown protocol drops\r\n 0 babbles, 0\ + \ late collision, 0 deferred\r\n 0 lost carrier, 0 no carrier, 0 pause\ + \ output\r\n 0 output buffer failures, 0 output buffers swapped out" + - "GigabitEthernet1/6 is down, line protocol is down (notconnect) \r\n Hardware\ + \ is Gigabit Ethernet, address is b0c5.3c99.0726 (bia b0c5.3c99.0726)\r\n\ + \ MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, \r\n reliability\ + \ 255/255, txload 1/255, rxload 1/255\r\n Encapsulation ARPA, loopback not\ + \ set\r\n Keepalive set (10 sec)\r\n Auto-duplex, Auto-speed, media type\ + \ is 10/100/1000BaseTX\r\n input flow-control is off, output flow-control\ + \ is unsupported \r\n ARP type: ARPA, ARP Timeout 04:00:00\r\n Last input\ + \ never, output never, output hang never\r\n Last clearing of \"show interface\"\ + \ counters never\r\n Input queue: 0/375/0/0 (size/max/drops/flushes); Total\ + \ output drops: 0\r\n Queueing strategy: fifo\r\n Output queue: 0/40 (size/max)\r\ + \n 5 minute input rate 0 bits/sec, 0 packets/sec\r\n 5 minute output rate\ + \ 0 bits/sec, 0 packets/sec\r\n 0 packets input, 0 bytes, 0 no buffer\r\ + \n Received 0 broadcasts (0 multicasts)\r\n 0 runts, 0 giants, 0 throttles\ + \ \r\n 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored\r\n 0\ + \ watchdog, 0 multicast, 0 pause input\r\n 0 input packets with dribble\ + \ condition detected\r\n 0 packets output, 0 bytes, 0 underruns\r\n \ + \ Output 0 broadcasts (0 multicasts)\r\n 0 output errors, 0 collisions,\ + \ 1 interface resets\r\n 0 unknown protocol drops\r\n 0 babbles, 0\ + \ late collision, 0 deferred\r\n 0 lost carrier, 0 no carrier, 0 pause\ + \ output\r\n 0 output buffer failures, 0 output buffers swapped out" + - "GigabitEthernet1/6 is down, line protocol is down (notconnect) \r\n Hardware\ + \ is Gigabit Ethernet, address is b0c5.3c99.0726 (bia b0c5.3c99.0726)\r\n\ + \ MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, \r\n reliability\ + \ 255/255, txload 1/255, rxload 1/255\r\n Encapsulation ARPA, loopback not\ + \ set\r\n Keepalive set (10 sec)\r\n Auto-duplex, Auto-speed, media type\ + \ is 10/100/1000BaseTX\r\n input flow-control is off, output flow-control\ + \ is unsupported \r\n ARP type: ARPA, ARP Timeout 04:00:00\r\n Last input\ + \ never, output never, output hang never\r\n Last clearing of \"show interface\"\ + \ counters never\r\n Input queue: 0/375/0/0 (size/max/drops/flushes); Total\ + \ output drops: 0\r\n Queueing strategy: fifo\r\n Output queue: 0/40 (size/max)\r\ + \n 5 minute input rate 0 bits/sec, 0 packets/sec\r\n 5 minute output rate\ + \ 0 bits/sec, 0 packets/sec\r\n 0 packets input, 0 bytes, 0 no buffer\r\ + \n Received 0 broadcasts (0 multicasts)\r\n 0 runts, 0 giants, 0 throttles\ + \ \r\n 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored\r\n 0\ + \ watchdog, 0 multicast, 0 pause input\r\n 0 input packets with dribble\ + \ condition detected\r\n 0 packets output, 0 bytes, 0 underruns\r\n \ + \ Output 0 broadcasts (0 multicasts)\r\n 0 output errors, 0 collisions,\ + \ 1 interface resets\r\n 0 unknown protocol drops\r\n 0 babbles, 0\ + \ late collision, 0 deferred\r\n 0 lost carrier, 0 no carrier, 0 pause\ + \ output\r\n 0 output buffer failures, 0 output buffers swapped out" + - "GigabitEthernet1/6 is down, line protocol is down (notconnect) \r\n Hardware\ + \ is Gigabit Ethernet, address is b0c5.3c99.0726 (bia b0c5.3c99.0726)\r\n\ + \ MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, \r\n reliability\ + \ 255/255, txload 1/255, rxload 1/255\r\n Encapsulation ARPA, loopback not\ + \ set\r\n Keepalive set (10 sec)\r\n Auto-duplex, Auto-speed, media type\ + \ is 10/100/1000BaseTX\r\n input flow-control is off, output flow-control\ + \ is unsupported \r\n ARP type: ARPA, ARP Timeout 04:00:00\r\n Last input\ + \ never, output never, output hang never\r\n Last clearing of \"show interface\"\ + \ counters never\r\n Input queue: 0/375/0/0 (size/max/drops/flushes); Total\ + \ output drops: 0\r\n Queueing strategy: fifo\r\n Output queue: 0/40 (size/max)\r\ + \n 5 minute input rate 0 bits/sec, 0 packets/sec\r\n 5 minute output rate\ + \ 0 bits/sec, 0 packets/sec\r\n 0 packets input, 0 bytes, 0 no buffer\r\ + \n Received 0 broadcasts (0 multicasts)\r\n 0 runts, 0 giants, 0 throttles\ + \ \r\n 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored\r\n 0\ + \ watchdog, 0 multicast, 0 pause input\r\n 0 input packets with dribble\ + \ condition detected\r\n 0 packets output, 0 bytes, 0 underruns\r\n \ + \ Output 0 broadcasts (0 multicasts)\r\n 0 output errors, 0 collisions,\ + \ 1 interface resets\r\n 0 unknown protocol drops\r\n 0 babbles, 0\ + \ late collision, 0 deferred\r\n 0 lost carrier, 0 no carrier, 0 pause\ + \ output\r\n 0 output buffer failures, 0 output buffers swapped out" + - "GigabitEthernet1/6 is down, line protocol is down (notconnect) \r\n Hardware\ + \ is Gigabit Ethernet, address is b0c5.3c99.0726 (bia b0c5.3c99.0726)\r\n\ + \ MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, \r\n reliability\ + \ 255/255, txload 1/255, rxload 1/255\r\n Encapsulation ARPA, loopback not\ + \ set\r\n Keepalive set (10 sec)\r\n Auto-duplex, Auto-speed, media type\ + \ is 10/100/1000BaseTX\r\n input flow-control is off, output flow-control\ + \ is unsupported \r\n ARP type: ARPA, ARP Timeout 04:00:00\r\n Last input\ + \ never, output never, output hang never\r\n Last clearing of \"show interface\"\ + \ counters never\r\n Input queue: 0/375/0/0 (size/max/drops/flushes); Total\ + \ output drops: 0\r\n Queueing strategy: fifo\r\n Output queue: 0/40 (size/max)\r\ + \n 5 minute input rate 0 bits/sec, 0 packets/sec\r\n 5 minute output rate\ + \ 0 bits/sec, 0 packets/sec\r\n 0 packets input, 0 bytes, 0 no buffer\r\ + \n Received 0 broadcasts (0 multicasts)\r\n 0 runts, 0 giants, 0 throttles\ + \ \r\n 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored\r\n 0\ + \ watchdog, 0 multicast, 0 pause input\r\n 0 input packets with dribble\ + \ condition detected\r\n 0 packets output, 0 bytes, 0 underruns\r\n \ + \ Output 0 broadcasts (0 multicasts)\r\n 0 output errors, 0 collisions,\ + \ 1 interface resets\r\n 0 unknown protocol drops\r\n 0 babbles, 0\ + \ late collision, 0 deferred\r\n 0 lost carrier, 0 no carrier, 0 pause\ + \ output\r\n 0 output buffer failures, 0 output buffers swapped out" + - "GigabitEthernet1/6 is down, line protocol is down (notconnect) \r\n Hardware\ + \ is Gigabit Ethernet, address is b0c5.3c99.0726 (bia b0c5.3c99.0726)\r\n\ + \ MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, \r\n reliability\ + \ 255/255, txload 1/255, rxload 1/255\r\n Encapsulation ARPA, loopback not\ + \ set\r\n Keepalive set (10 sec)\r\n Auto-duplex, Auto-speed, media type\ + \ is 10/100/1000BaseTX\r\n input flow-control is off, output flow-control\ + \ is unsupported \r\n ARP type: ARPA, ARP Timeout 04:00:00\r\n Last input\ + \ never, output never, output hang never\r\n Last clearing of \"show interface\"\ + \ counters never\r\n Input queue: 0/375/0/0 (size/max/drops/flushes); Total\ + \ output drops: 0\r\n Queueing strategy: fifo\r\n Output queue: 0/40 (size/max)\r\ + \n 5 minute input rate 0 bits/sec, 0 packets/sec\r\n 5 minute output rate\ + \ 0 bits/sec, 0 packets/sec\r\n 0 packets input, 0 bytes, 0 no buffer\r\ + \n Received 0 broadcasts (0 multicasts)\r\n 0 runts, 0 giants, 0 throttles\ + \ \r\n 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored\r\n 0\ + \ watchdog, 0 multicast, 0 pause input\r\n 0 input packets with dribble\ + \ condition detected\r\n 0 packets output, 0 bytes, 0 underruns\r\n \ + \ Output 0 broadcasts (0 multicasts)\r\n 0 output errors, 0 collisions,\ + \ 1 interface resets\r\n 0 unknown protocol drops\r\n 0 babbles, 0\ + \ late collision, 0 deferred\r\n 0 lost carrier, 0 no carrier, 0 pause\ + \ output\r\n 0 output buffer failures, 0 output buffers swapped out" + - "GigabitEthernet1/6 is down, line protocol is down (notconnect) \r\n Hardware\ + \ is Gigabit Ethernet, address is b0c5.3c99.0726 (bia b0c5.3c99.0726)\r\n\ + \ MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, \r\n reliability\ + \ 255/255, txload 1/255, rxload 1/255\r\n Encapsulation ARPA, loopback not\ + \ set\r\n Keepalive set (10 sec)\r\n Auto-duplex, Auto-speed, media type\ + \ is 10/100/1000BaseTX\r\n input flow-control is off, output flow-control\ + \ is unsupported \r\n ARP type: ARPA, ARP Timeout 04:00:00\r\n Last input\ + \ never, output never, output hang never\r\n Last clearing of \"show interface\"\ + \ counters never\r\n Input queue: 0/375/0/0 (size/max/drops/flushes); Total\ + \ output drops: 0\r\n Queueing strategy: fifo\r\n Output queue: 0/40 (size/max)\r\ + \n 5 minute input rate 0 bits/sec, 0 packets/sec\r\n 5 minute output rate\ + \ 0 bits/sec, 0 packets/sec\r\n 0 packets input, 0 bytes, 0 no buffer\r\ + \n Received 0 broadcasts (0 multicasts)\r\n 0 runts, 0 giants, 0 throttles\ + \ \r\n 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored\r\n 0\ + \ watchdog, 0 multicast, 0 pause input\r\n 0 input packets with dribble\ + \ condition detected\r\n 0 packets output, 0 bytes, 0 underruns\r\n \ + \ Output 0 broadcasts (0 multicasts)\r\n 0 output errors, 0 collisions,\ + \ 1 interface resets\r\n 0 unknown protocol drops\r\n 0 babbles, 0\ + \ late collision, 0 deferred\r\n 0 lost carrier, 0 no carrier, 0 pause\ + \ output\r\n 0 output buffer failures, 0 output buffers swapped out" + response_type: circular + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IE-3300-8U2X-tgen1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/get/get_interface_traffic_packet_counters/test_api_get_interface_traffic_packet_counters.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/get/get_interface_traffic_packet_counters/test_api_get_interface_traffic_packet_counters.py new file mode 100644 index 000000000..434326c4a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/get/get_interface_traffic_packet_counters/test_api_get_interface_traffic_packet_counters.py @@ -0,0 +1,53 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.get import get_interface_traffic_packet_counters + + +class TestGetInterfaceTrafficPacketCounters(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IE-3300-8U2X-tgen1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: ie3k + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IE-3300-8U2X-tgen1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_get_interface_traffic_packet_counters(self): + result = get_interface_traffic_packet_counters(self.device, 'GigabitEthernet1/6', ['in_pkts', + 'out_pkts', + 'out_errors', + 'out_collision', + 'out_interface_resets', + 'out_babble', + 'out_late_collision', + 'out_deferred', + 'in_errors', + 'in_crc_errors']) + expected_output = {'in_crc_errors': 0, + 'in_errors': 0, + 'in_pkts': 0, + 'out_babble': 0, + 'out_collision': 0, + 'out_deferred': 0, + 'out_errors': 0, + 'out_interface_resets': 1, + 'out_late_collision': 0, + 'out_pkts': 0} + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_network_broadcast/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_network_broadcast/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_network_broadcast/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_network_broadcast/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..f040c1522 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_network_broadcast/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet0/0/0: "interface GigabitEthernet0/0/0\r\n" + ip ospf network broadcast: "ip ospf network broadcast\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: IR1101(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR1101(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_network_broadcast/test_api_configure_ospf_network_broadcast.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_network_broadcast/test_api_configure_ospf_network_broadcast.py new file mode 100644 index 000000000..f984e601f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_network_broadcast/test_api_configure_ospf_network_broadcast.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.ospf.configure import configure_ospf_network_broadcast + + +class TestConfigureOspfNetworkBroadcast(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR1101: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR1101'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ospf_network_broadcast(self): + result = configure_ospf_network_broadcast(self.device, 'GigabitEthernet0/0/0') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_priority/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_priority/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_priority/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_priority/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..32da979c0 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_priority/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet0/0/0: "interface GigabitEthernet0/0/0\r\n" + ip ospf priority 0: "ip ospf priority 0\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: IR1101(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR1101(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_priority/test_api_configure_ospf_priority.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_priority/test_api_configure_ospf_priority.py new file mode 100644 index 000000000..e18113d7a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_priority/test_api_configure_ospf_priority.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.ospf.configure import configure_ospf_priority + + +class TestConfigureOspfPriority(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR1101: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR1101'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ospf_priority(self): + result = configure_ospf_priority(self.device, 'GigabitEthernet0/0/0', 0) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_key_config_key_newpass_oldpass/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_key_config_key_newpass_oldpass/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_key_config_key_newpass_oldpass/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_key_config_key_newpass_oldpass/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..1f2175d4a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_key_config_key_newpass_oldpass/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + key config-key newpass test4567 oldpass cisco123: "key config-key newpass test4567\ + \ oldpass cisco123\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: pki-reg2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: pki-reg2(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: pki-reg2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_key_config_key_newpass_oldpass/test_api_configure_key_config_key_newpass_oldpass.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_key_config_key_newpass_oldpass/test_api_configure_key_config_key_newpass_oldpass.py new file mode 100644 index 000000000..846dc0fd0 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_key_config_key_newpass_oldpass/test_api_configure_key_config_key_newpass_oldpass.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_key_config_key_newpass_oldpass + + +class TestConfigureKeyConfigKeyNewpassOldpass(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + pki-reg2: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: c8000v + type: c8000v + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['pki-reg2'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_key_config_key_newpass_oldpass(self): + result = configure_key_config_key_newpass_oldpass(self.device, 'test4567', 'cisco123') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_parser_view/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_parser_view/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_parser_view/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_parser_view/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..765ced652 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_parser_view/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,46 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + parser view pv1: + new_state: configure_view + prompt: c8kv-dev-11(config)# + +configure_view: + prompt: c8kv-dev-11(config-view)# + commands: + secret 0 pass: | + WARNING: CLI-VIEW secret command has been added to the configuration using a type 0 secret. However, type 0 secret will soon be deprecated. Migrate to either, type 8 or type 9 secret + command exec include show vrrp: "command exec include show vrrp\r\n" + end: + new_state: execute +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: c8kv-dev-11(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: c8kv-dev-11# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_parser_view/test_api_configure_parser_view.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_parser_view/test_api_configure_parser_view.py new file mode 100644 index 000000000..82f45fc51 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_parser_view/test_api_configure_parser_view.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_parser_view + + +class TestConfigureParserView(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + c8kv-dev-7: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: C8000v + type: C8000v + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['c8kv-dev-7'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_parser_view(self): + result = configure_parser_view(self.device, 'pv1', 'pass', ['show vrrp']) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_parser_view/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_parser_view/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_parser_view/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_parser_view/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..00b4ce9c4 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_parser_view/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + no parser view pv1: "no parser view pv1\r\n" + prompt: Router(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Router(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: Router# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_parser_view/test_api_unconfigure_parser_view.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_parser_view/test_api_unconfigure_parser_view.py new file mode 100644 index 000000000..0bc8ebbfc --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_parser_view/test_api_unconfigure_parser_view.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_parser_view + + +class TestUnconfigureParserView(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + c8kv-dev-7: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: C8000v + type: C8000v + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['c8kv-dev-7'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_parser_view(self): + result = unconfigure_parser_view(self.device, 'pv1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/platform_software_fed_switch_phy_options/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/platform_software_fed_switch_phy_options/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/platform_software_fed_switch_phy_options/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/platform_software_fed_switch_phy_options/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..05ca316bc --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/platform_software_fed_switch_phy_options/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,40 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: hendrix(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: hendrix(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + test platform software fed switch active xcvr lpn 1 1 read 0 0 0 0 0: + response: + - ' XcvrPhyRead Lpn:01,Page:00,DevID:00,Clause:00,Reg:0x0000,Val:0x0000(00):0000 + 0000 0000 0000' + response_type: circular + prompt: hendrix# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/platform_software_fed_switch_phy_options/test_api_platform_software_fed_switch_phy_options.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/platform_software_fed_switch_phy_options/test_api_platform_software_fed_switch_phy_options.py new file mode 100644 index 000000000..764e17428 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/platform_software_fed_switch_phy_options/test_api_platform_software_fed_switch_phy_options.py @@ -0,0 +1,37 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.execute import platform_software_fed_switch_phy_options + + +class TestPlatformSoftwareFedSwitchPhyOptions(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + hendrix: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: None + type: None + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['hendrix'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_platform_software_fed_switch_phy_options(self): + result = platform_software_fed_switch_phy_options(self.device, 'active', 1, 1, 'read', 0, 0, 0, 0, 0) + expected_output = (' XcvrPhyRead ' + 'Lpn:01,Page:00,DevID:00,Clause:00,Reg:0x0000,Val:0x0000(00):0000 0000 0000 ' + '0000') + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_class_map_access_group_on_device/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_class_map_access_group_on_device/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_class_map_access_group_on_device/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_class_map_access_group_on_device/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..cfcfaccd4 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_class_map_access_group_on_device/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + class-map match-all cm-acl100: "class-map match-all cm-acl100\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + match access-group 100: "match access-group 100\r\n" + no logging console: '' + prompt: Raitt(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Raitt(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: Raitt# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_class_map_access_group_on_device/test_api_configure_class_map_access_group_on_device.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_class_map_access_group_on_device/test_api_configure_class_map_access_group_on_device.py new file mode 100644 index 000000000..08f0dd95e --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_class_map_access_group_on_device/test_api_configure_class_map_access_group_on_device.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.policy_class_map.configure import configure_class_map_access_group_on_device + + +class TestConfigureClassMapAccessGroupOnDevice(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Raitt: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Raitt'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_class_map_access_group_on_device(self): + result = configure_class_map_access_group_on_device(self.device, 'cm-acl100', '100') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_traffic_class_for_class_map/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_traffic_class_for_class_map/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_traffic_class_for_class_map/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_traffic_class_for_class_map/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..b5a920101 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_traffic_class_for_class_map/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + class-map match-any tc7: "class-map match-any tc7\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + match traffic-class 7: "match traffic-class 7\r\n" + no logging console: '' + prompt: Raitt(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Raitt(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: Raitt# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_traffic_class_for_class_map/test_api_configure_traffic_class_for_class_map.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_traffic_class_for_class_map/test_api_configure_traffic_class_for_class_map.py new file mode 100644 index 000000000..e8c7050d6 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_class_map/configure/configure_traffic_class_for_class_map/test_api_configure_traffic_class_for_class_map.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.policy_class_map.configure import configure_traffic_class_for_class_map + + +class TestConfigureTrafficClassForClassMap(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Raitt: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Raitt'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_traffic_class_for_class_map(self): + result = configure_traffic_class_for_class_map(self.device, 'tc7', 'match-any', 7) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/qos/configure/configure_ip_access_list_with_dscp_on_device/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/qos/configure/configure_ip_access_list_with_dscp_on_device/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/qos/configure/configure_ip_access_list_with_dscp_on_device/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/qos/configure/configure_ip_access_list_with_dscp_on_device/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..7d1eda84d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/qos/configure/configure_ip_access_list_with_dscp_on_device/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + 10 permit ip host 131.1.1.2 host 162.1.1.2 dscp 7: "10 permit ip host 131.1.1.2\ + \ host 162.1.1.2 dscp 7\r\n" + end: + new_state: execute + ip access-list extended 100: "ip access-list extended 100\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: Raitt(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Raitt(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: Raitt# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/qos/configure/configure_ip_access_list_with_dscp_on_device/test_api_configure_ip_access_list_with_dscp_on_device.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/qos/configure/configure_ip_access_list_with_dscp_on_device/test_api_configure_ip_access_list_with_dscp_on_device.py new file mode 100644 index 000000000..35f8cc4c1 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/qos/configure/configure_ip_access_list_with_dscp_on_device/test_api_configure_ip_access_list_with_dscp_on_device.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.qos.configure import configure_ip_access_list_with_dscp_on_device + + +class TestConfigureIpAccessListWithDscpOnDevice(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Raitt: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Raitt'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ip_access_list_with_dscp_on_device(self): + result = configure_ip_access_list_with_dscp_on_device(self.device, 100, 10, 'permit', '131.1.1.2', '162.1.1.2', '7') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_fast_rep_segment/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_fast_rep_segment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_fast_rep_segment/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_fast_rep_segment/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..f72f0eb3c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_fast_rep_segment/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,53 @@ +configure: + commands: + end: + new_state: execute + interface Gi1/0/10: + new_state: interface + interface Gi1/0/11: + new_state: interface + line console 0: + new_state: configure_line + no logging console: '' + prompt: IE-II-03-AgN1_2008_PB(config)# + +interface: + prompt: IE-II-03-AgN1_2008_P(config-if)# + commands: + rep fastmode: "" + rep segment 1 edge: "" + shut: "" + no shut: "" + switchport mode trunk: "" + switchport trunk allowed vlan 25: "" + vlan 25: "" + end: + new_state: execute + +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IE-II-03-AgN1_2008_PB(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IE-II-03-AgN1_2008_PB# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_fast_rep_segment/test_api_configure_fast_rep_segment.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_fast_rep_segment/test_api_configure_fast_rep_segment.py new file mode 100644 index 000000000..64c2f1031 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_fast_rep_segment/test_api_configure_fast_rep_segment.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.rep.configure import configure_fast_rep_segment + + +class TestConfigureFastRepSegment(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IE-II-03-AgN1_2008_PB: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IE-II-03-AgN1_2008_PB'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_fast_rep_segment(self): + result = configure_fast_rep_segment(self.device, ['Gi1/0/10', 'Gi1/0/11'], '1', '25', True, False) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_segment/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_segment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_segment/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_segment/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..4e4b7892f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_segment/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,39 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet0/0/8: "interface GigabitEthernet0/0/8\r\n" + line console 0: + new_state: configure_line + no logging console: '' + no shut: "no shut\r\n" + rep segment 1 edge: "rep segment 1 edge\r\n" + shut: "shut\r\n" + prompt: PE1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: PE1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: PE1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_segment/test_api_configure_rep_segment.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_segment/test_api_configure_rep_segment.py new file mode 100644 index 000000000..f0189b4df --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_segment/test_api_configure_rep_segment.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.rep.configure import configure_rep_segment + + +class TestConfigureRepSegment(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + PE1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['PE1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_rep_segment(self): + result = configure_rep_segment(self.device, ['GigabitEthernet0/0/8'], 1, None, True, False, False) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_ztp/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_ztp/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_ztp/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_ztp/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..2fc14935c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_ztp/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + rep ztp: "rep ztp\r\n" + prompt: IR_DBS_IE3400_1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR_DBS_IE3400_1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR_DBS_IE3400_1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_ztp/test_api_configure_rep_ztp.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_ztp/test_api_configure_rep_ztp.py new file mode 100644 index 000000000..a7d2ea0b5 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/configure_rep_ztp/test_api_configure_rep_ztp.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.rep.configure import configure_rep_ztp + + +class TestConfigureRepZtp(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR_DBS_IE3400_1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR_DBS_IE3400_1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_rep_ztp(self): + result = configure_rep_ztp(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_fast_rep_segment/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_fast_rep_segment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_fast_rep_segment/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_fast_rep_segment/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..e10598463 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_fast_rep_segment/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,53 @@ +configure: + commands: + end: + new_state: execute + interface Gi1/0/10: + new_state: interface + interface Gi1/0/11: + new_state: interface + line console 0: + new_state: configure_line + no logging console: '' + prompt: IE-II-03-AgN1_2008_PB(config)# + +interface: + prompt: IE-II-03-AgN1_2008_P(config-if)# + commands: + no rep fastmode: "" + no rep segment 1 edge: "" + no shut: "" + no switchport mode trunk: "" + no switchport trunk allowed vlan 25: "" + no vlan 25: "" + shut: "" + end: + new_state: execute + +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IE-II-03-AgN1_2008_PB(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IE-II-03-AgN1_2008_PB# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_fast_rep_segment/test_api_unconfigure_fast_rep_segment.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_fast_rep_segment/test_api_unconfigure_fast_rep_segment.py new file mode 100644 index 000000000..06837e093 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_fast_rep_segment/test_api_unconfigure_fast_rep_segment.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.rep.configure import unconfigure_fast_rep_segment + + +class TestUnconfigureFastRepSegment(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IE-II-03-AgN1_2008_PB: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IE-II-03-AgN1_2008_PB'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_fast_rep_segment(self): + result = unconfigure_fast_rep_segment(self.device, ['Gi1/0/10', 'Gi1/0/11'], '1', '25', True, False) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_segment/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_segment/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_segment/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_segment/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..928be4d81 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_segment/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,61 @@ +configure: + commands: + end: + new_state: execute + interface Gi1/0/10: "interface Gi1/0/10\r\n" + interface Gi1/0/11: "interface Gi1/0/11\r\n" + line console 0: + new_state: configure_line + no logging console: '' + no rep fastmode: "IE-II-03-AgN1_2008_P(config-if)#no rep fastmode\r\n" + no rep segment 1 edge: "IE-II-03-AgN1_2008_P(config-if)#no rep segment 1 edge\r\ + \n" + no shut: "IE-II-03-AgN1_2008_P(config-if)#no shut\r\n" + no switchport mode trunk: "IE-II-03-AgN1_2008_P(config-if)#no switchport mode\ + \ trunk\r\n" + no switchport trunk allowed vlan 25: "IE-II-03-AgN1_2008_P(config-if)#no switchport\ + \ trunk allowed vlan 25\r\n" + no vlan 25: "no vlan 25\r\nIE-II-03-AgN1_2008_P(config)#" + shut: "IE-II-03-AgN1_2008_P(config-if)#shut\r\n" + prompt: IE-II-03-AgN1_2008_PB(config)# + +interface: + prompt: IE-II-03-AgN1_2008_P(config-if)# + commands: + no rep fastmode: "" + no rep segment 1 edge: "" + no shut: "" + no switchport mode trunk: "" + no switchport trunk allowed vlan 25: "" + no vlan 25: "" + shut: "" + end: + new_state: execute + +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IE-II-03-AgN1_2008_PB(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IE-II-03-AgN1_2008_PB# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_segment/test_api_unconfigure_rep_segment.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_segment/test_api_unconfigure_rep_segment.py new file mode 100644 index 000000000..1f060a8fd --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_segment/test_api_unconfigure_rep_segment.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.rep.configure import unconfigure_rep_segment + + +class TestUnconfigureRepSegment(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IE-II-03-AgN1_2008_PB: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IE-II-03-AgN1_2008_PB'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_rep_segment(self): + result = unconfigure_rep_segment(self.device, ['Gi1/0/10', 'Gi1/0/11'], '1', '25', True, False) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_ztp/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_ztp/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_ztp/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_ztp/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..64a656f3c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_ztp/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + no rep ztp: "no rep ztp\r\n" + prompt: IR_DBS_IE3400_1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: IR_DBS_IE3400_1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: IR_DBS_IE3400_1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_ztp/test_api_unconfigure_rep_ztp.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_ztp/test_api_unconfigure_rep_ztp.py new file mode 100644 index 000000000..4dd177cd4 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/rep/configure/unconfigure_rep_ztp/test_api_unconfigure_rep_ztp.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.rep.configure import unconfigure_rep_ztp + + +class TestUnconfigureRepZtp(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + IR_DBS_IE3400_1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['IR_DBS_IE3400_1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_rep_ztp(self): + result = unconfigure_rep_ztp(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/route_map/configure/configure_route_map_permit/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/route_map/configure/configure_route_map_permit/mock_data/iosxe/mock_data.yaml index fc0794514..279dbc9f5 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/route_map/configure/configure_route_map_permit/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/route_map/configure/configure_route_map_permit/mock_data/iosxe/mock_data.yaml @@ -1,32 +1,29 @@ configure: commands: - continue 20: "continue 20\r\n" end: new_state: execute line console 0: new_state: configure_line - match as-path 12: "match as-path 12\r\n" + match community 20: "match community 20\r\n" + match interface Loopback0: "match interface Loopback0\r\n" no logging console: '' - route-map internal permit 10: "route-map internal permit 10\r\n" - set as-path prepend 45000: "set as-path prepend 45000\r\n" - set local-preference 500: "set local-preference 500\r\n" - set metric 30: "set metric 30\r\n" - set weight 100: "set weight 100\r\n" - prompt: stack3-nyquist-1(config)# + route-map rm-adv-loopback permit 10: "route-map rm-adv-loopback permit 10\r\n" + prompt: IR1101(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: stack3-nyquist-1(config-line)# + prompt: IR1101(config-line)# connect: commands: - '': - new_state: execute - preface: |- - Trying mock_device ... + ? '' + : new_state: execute + preface: 'Trying mock_device ... + Connected to mock_device. - Escape character is '^]'. + + Escape character is ''^]''.' prompt: '' execute: commands: @@ -35,7 +32,7 @@ execute: config-transaction: new_state: configure show version: '' + show version | include operating mode: '' term length 0: '' term width 0: '' - show version | include operating mode: '' - prompt: stack3-nyquist-1# + prompt: IR1101# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/route_map/configure/configure_route_map_permit/test_api_configure_route_map_permit.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/route_map/configure/configure_route_map_permit/test_api_configure_route_map_permit.py index 993ffd709..b31d82acf 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/route_map/configure/configure_route_map_permit/test_api_configure_route_map_permit.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/route_map/configure/configure_route_map_permit/test_api_configure_route_map_permit.py @@ -10,7 +10,7 @@ class TestConfigureRouteMapPermit(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - Switch: + IR1101: connections: defaults: class: unicon.Unicon @@ -18,11 +18,11 @@ def setUpClass(self): command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: cat9k + platform: router type: router """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['Switch'] + self.device = self.testbed.devices['IR1101'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -30,6 +30,6 @@ def setUpClass(self): ) def test_configure_route_map_permit(self): - result = configure_route_map_permit(self.device, 'internal', 10, None, None, None, 30, 100, 45000, 500, 12, 20) + result = configure_route_map_permit(self.device, 'rm-adv-loopback', 10, None, None, 20, None, None, None, None, None, None, 'Loopback0') expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_host/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_host/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_host/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_host/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..e38f2b866 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_host/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + snmp-server host 5.5.5.5 6 [QggBEaZ^MSMV`ATHVFB]Pcd^Z`O`\: "snmp-server host 5.5.5.5\ + \ 6 [QggBEaZ^MSMV`ATHVFB]Pcd^Z`O`\\\r\n" + prompt: Router(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Router(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: Router# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_host/test_api_configure_snmp_server_host.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_host/test_api_configure_snmp_server_host.py new file mode 100644 index 000000000..1398619cc --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_host/test_api_configure_snmp_server_host.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.snmp.configure import configure_snmp_server_host + + +class TestConfigureSnmpServerHost(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Router: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat8k + type: cat8k + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Router'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_snmp_server_host(self): + result = configure_snmp_server_host(self.device, '5.5.5.5', 6, '[QggBEaZ^MSMV`ATHVFB]Pcd^Z`O`\\') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/unconfigure_snmp_server_host/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/unconfigure_snmp_server_host/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/unconfigure_snmp_server_host/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/unconfigure_snmp_server_host/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..4bd0e2b8f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/unconfigure_snmp_server_host/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + no snmp-server host 5.5.5.5 6 [QggBEaZ^MSMV`ATHVFB]Pcd^Z`O`\: "no snmp-server\ + \ host 5.5.5.5 6 [QggBEaZ^MSMV`ATHVFB]Pcd^Z`O`\\\r\n" + prompt: Router(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Router(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + show version | include operating mode: '' + term length 0: '' + term width 0: '' + prompt: Router# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/unconfigure_snmp_server_host/test_api_unconfigure_snmp_server_host.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/unconfigure_snmp_server_host/test_api_unconfigure_snmp_server_host.py new file mode 100644 index 000000000..c03a074c0 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/unconfigure_snmp_server_host/test_api_unconfigure_snmp_server_host.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.snmp.configure import unconfigure_snmp_server_host + + +class TestUnconfigureSnmpServerHost(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Router: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat8k + type: cat8k + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Router'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_snmp_server_host(self): + result = unconfigure_snmp_server_host(self.device, '5.5.5.5', 6, '[QggBEaZ^MSMV`ATHVFB]Pcd^Z`O`\\') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/test_utils.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/test_utils.py index df2295f9c..a43d04445 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/test_utils.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/test_utils.py @@ -4,6 +4,7 @@ from unittest.mock import MagicMock, Mock, call, patch from ats.topology import Device +from unittest import mock from genie.libs.clean.stages.tests.utils import create_test_device from genie.libs.sdk.apis.utils import ( diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py index f7a22eede..08435e9b3 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py @@ -4592,3 +4592,90 @@ def configure_peripheral_terminal_server(device): log.error(f'Device {device} has no peripherals or terminal_server!') +def load_image(device, template_name="LOAD_IMAGE", template_override={}, template=None, **kwargs): + ''' Load image template + Args: + Renders the clean template and uses it to call clean. A clean template is JSON + data which can have placeholders for data which the user needs to + provide when calling this API. Similar to how Python functions + can have keyword arguments with default values, default arguments + may also be defined for a clean template. These are stored in + a Python dictionary whose variable name should follow this + convention: {template_name}_ARGS + Shortened example: + ```python + from genie.conf.base.api import OPTIONAL, REQUIRED + MY_TEMPLATE = { + "order": [ + "connect", + "apply_configuration", + "ping_server", + "copy_to_device", + ], + "images": r"%CLEANARG{images}", + "connect": {}, + "apply_configuration": { + "configuration": r"%CLEANARG{config_str}", + }, + "ping_server": { + "server": "%CLEANARG{server}", + "vrf": "%CLEANARG{vrf}", + }, + "copy_to_device": { + "overwrite": r"%CLEANARG{overwrite}", + "origin": { + "hostname": "%CLEANARG{server}", + }, + "vrf": "%CLEANARG{vrf}", + }, + } + + MY_TEMPLATE_ARGS = { + "vrf": "management", # argument with default which user can override + "server": REQUIRED, # required argument which user must provide + "overwrite": OPTIONAL, # optional argument + "config_str": REQUIRED, + "images": REQUIRED, + } + + ``` + Arguments: + 1. device: device object + 2. template_name: which clean template to use, or None to not use any + clean template + 3. template_override: optionally override data in clean template. This + is done with a recursive dictionary update. + Example: + ```python + # template assumes config string is being provided. We want + # to use a config file + config_file_location = "..." + override = {"apply_configuration": {"file": config_file_location}} + dev.api.clean(template_name="MY_TEMPLATE", template_override=config_file_location) + ``` + 4. kwargs: arguments which are substituted into the template. + Example: + ```python + dev.api.clean( + template_name="MY_TEMPLATE", + vrf="Mgmt", + server="10.10.10.10", + images={ + "server": [...], + "kickstart": [...], + } + ... + ) + ``` + vrf, server and config_str are all kwargs, and will be substituted into + the MY_TEMPLATE template to render the clean YAML that is used when + invoking clean + ''' + try: + device.api.clean(template_name=template_name, + template_override=template_override, + template=template, + **kwargs) + except Exception as e: + raise Exception(f'Failed to load the image template from clean. Error: {e}') + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxe/processors.py b/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxe/processors.py index fdab4d3a8..8d0052a0e 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxe/processors.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxe/processors.py @@ -185,7 +185,7 @@ def learn_routing(device, setdefault(ip, {}).update({device.name: keys}) -def check_memory_leaks(section, devices, keywords, timeout=60): +def check_memory_leaks(section, processor, devices, keywords, timeout=60): '''Check memory leaks by show memory debug leaks command Args: @@ -229,8 +229,83 @@ def _check_memory_leaks(device, keywords): ikwargs=ikwargs) if pcall_return and all(pcall_return): - log.info(f"No memory leaks found with keywords {keywords}") - section.result += Passed + processor.passed(f"No memory leaks found with keywords {keywords}") else: - log.error(f"Found memory leaks with keywords {keywords}") - section.result += Failed + processor.failed(f"Found memory leaks with keywords {keywords}") + +def execute_reload(section, + processor, + devices, + prompt_recovery=True, + reload_creds='default', + sleep_after_reload=120, + timeout=800, + reload_command='reload', + error_pattern=None, + exclude_devices=None, + save_config=True): + '''Execute reload on devices + + Args: + devices (`list`): List of device name + prompt_recovery (`bool`): Prompt recovery. default: True + reload_creds (`str`): Reload credentials. default: 'default' + sleep_after_reload (`int`): Sleep after reload. default: 120 + timeout (`int`): Timeout value. default: 800 + reload_command (`str`): Reload command. default: 'reload' + error_pattern (`str`): Error pattern. default: None + exclude_devices (`list`): List of devices to exclude. default: None + save_config (`bool`): Save config. default: True + + Returns: + None + + Raises: + None + ''' + + def execute_reload_worker(device, prompt_recovery, reload_creds, sleep_after_reload, + timeout, reload_command, error_pattern, exclude_devices, save_config): + + if save_config: + device.api.save_running_config() + + try: + device.api.execute_reload(prompt_recovery=prompt_recovery, + reload_creds=reload_creds, + sleep_after_reload=sleep_after_reload, + timeout=timeout, + reload_command=reload_command, + error_pattern=error_pattern, + exclude_devices=exclude_devices) + except Exception as e: + log.exception(e) + return False + + return True + + if section and getattr(section, 'parameters', {}): + testbed = section.parameters.get('testbed', {}) + ckwargs = { + 'prompt_recovery': prompt_recovery, + 'reload_creds': reload_creds, + 'sleep_after_reload': sleep_after_reload, + 'timeout': timeout, + 'reload_command': reload_command, + 'error_pattern': error_pattern, + 'exclude_devices': exclude_devices, + 'save_config': save_config + } + ikwargs = [] + for device in devices: + if device in testbed.devices: + ikwargs.append({'device': testbed.devices[device]}) + + pcall_return = pcall(execute_reload_worker, + ckwargs=ckwargs, + ikwargs=ikwargs) + + if pcall_return and all(pcall_return): + processor.passed(f"Reloaded devices {devices}") + else: + processor.failed(f"Failed to reload devices {devices}") diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxe/restore.py b/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxe/restore.py index e9d94a2f5..9fc615eda 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxe/restore.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxe/restore.py @@ -175,6 +175,7 @@ def restore_configuration( for i in range(1, iteration): # configure replace location: + device.execute(f'show archive config incremental-diffs {self.to_url}') out = device.execute( 'configure replace {}'. format( self.to_url), diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/processors.py b/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/processors.py index 69a4fff81..7ad72cb21 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/processors.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/processors.py @@ -1301,23 +1301,19 @@ def pre_execute_command(section, save_to_file='', zipped_folder=''): ''' - Execute commands as processors. This can be run only with specified condition and the log can be archived with text file or zip file. - - Can be controlled via sections parameters which is provided by the datafile + Execute commands as processors in parallel. + This can be run only with specified condition and the log can be archived with text file or zip file. Args: - section (`obj`) : Aetest Subsection object. - device (`obj`) : Device object. - sleep_time (`int`) : sleep after all commands (unit: seconds) - max_retry (`int`) : Retry issuing command in case any error (max_retry 1 by default) - save_to_file (`str`) : Set either one of below modes when show output needs to be saved as file. folder for the processor is generated and store files in the folder. (Disabled by default) - per_device : file generated per device - per_command : file generated per command - zipped_folder (`bool`) : Set if archive folder needs to be zipped. - If True, zip file generated and removed the folder with files. + section (`obj`): Aetest Subsection object. + devices (`dict`): Device dictionary with command lists. + sleep_time (`int`): Sleep after all commands (unit: seconds). + max_retry (`int`): Retry issuing command in case any error (max_retry 1 by default). + save_to_file (`str`): Mode for saving output files (per_device or per_command). + zipped_folder (`bool`): Archive folder into a zip file. Returns: - AETEST results + AETEST results. Raises: None @@ -1325,7 +1321,7 @@ def pre_execute_command(section, # Init log.info(banner("processor: 'execute_command'")) - # sanitize arguments + # Sanitize arguments if save_to_file and save_to_file not in ['per_device', 'per_command']: section.errored( "`save_to_file` in datafile must be `per_device` or `per_command`") @@ -1336,167 +1332,119 @@ def pre_execute_command(section, elif save_to_file and not isinstance(zipped_folder, bool): section.errored("`zipped_folder` must be True or False in datafile") - # prepare save location + # Prepare save location + folder_name = None if save_to_file: - file_list = {} + # Setup folder for saving outputs now = datetime.datetime.now() timestamp_format = '%Y%m%d_%H%M%S' folder_log = '_'.join( [section.parent.uid, section.uid, 'pre_execute_command', now.strftime(timestamp_format)]) folder_name = runtime.directory + '/' + folder_log + try: os.mkdir(folder_name) - log.info( - "Folder `{folder}` is created for `save_to_file` with mode {mode}" - .format(folder=folder_name, mode=save_to_file)) + log.info(f"Folder `{folder_name}` created for `save_to_file` with mode {save_to_file}") except Exception: - section.errored( - "Failed to create folder `{folder_name}` for `save_to_file`". - format(folder_name=folder_name)) + section.errored(f"Failed to create folder `{folder_name}` for `save_to_file`") + if zipped_folder: try: - zip = zipfile.ZipFile(folder_name + '.zip', 'w', - zipfile.ZIP_DEFLATED) + zip = zipfile.ZipFile(folder_name + '.zip', 'w', zipfile.ZIP_DEFLATED) except Exception: - section.errored( - "Failed to create zip file: {file} for `save_to_file`". - format(file=folder_name + '.zip')) + section.errored(f"Failed to create zip file: {folder_name + '.zip'} for `save_to_file`") + + def _pre_execute_command(dev, cmd, device, save_to_file, folder_name): + # Command execution logic, now isolated for parallel processing + for _ in range(max_retry + 1): + try: + exec_cmd = cmd.get('cmd', '') + pattern = cmd.get('pattern', '') + answer = cmd.get('answer', '') + cmd_timeout = cmd.get('timeout', 60) + + # If pattern is provided, set up dialog + if pattern: + if isinstance(pattern, str): + pattern = [pattern] + statement_list = [ + Statement( + pattern=p, + action='sendline({})'.format(answer), + loop_continue=True, + continue_timer=False + ) for p in pattern + ] + dialog = Dialog(statement_list) + output = device.execute(exec_cmd, reply=dialog, timeout=cmd_timeout) + else: + output = device.execute(exec_cmd, timeout=cmd_timeout) + + # Handle save to file logic here based on mode + file_name = None + if save_to_file == 'per_device': + file_name = os.path.join(folder_name, f"{dev}.txt") + elif save_to_file == 'per_command': + file_name = os.path.join(folder_name, f"{dev}_{device.api.slugify(exec_cmd)}.txt") + + if file_name: + with open(file_name, 'a') as f: + f.write(output) + log.info(f"File {file_name} saved to folder {folder_name}") + + # Successful command execution + log.info(f"Successfully executed command '{exec_cmd}' on device {device.name}") + return True + + except SubCommandFailure as e: + log.error(f'Failed to execute "{exec_cmd}" on device {device.name}: {e}') + device.api.reconnect_device() + else: + section.failed(f'Reached max number of {max_retry} retries, command execution has failed') + return False + + ikwargs = [] + result_list = [] - sleep_if_cmd_executed = False for dev in devices: if dev == 'uut': device = section.parameters['uut'] else: - if dev in section.parameters[ - 'testbed'].devices.names or dev in section.parameters[ - 'testbed'].devices.aliases: + if dev in section.parameters['testbed'].devices.names or dev in section.parameters['testbed'].devices.aliases: device = section.parameters['testbed'].devices[dev] else: - section.errored( - "Failed to find a device {device} in testbed yaml".format( - device=dev)) - # if device not in TB or not connected, then skip + section.errored(f"Failed to find a device {dev} in testbed yaml") + + # Skip if not connected if not device or not device.is_connected(): continue - # execute list of commands given in yaml + for cmd in devices[dev].get('cmds', []): - if not cmd.get('condition') or section.result in list( - map(TestResult.from_str, cmd['condition'])): - exec_cmd = cmd.get('cmd', '') - pattern = cmd.get('pattern', '') - answer = cmd.get('answer', '') - cmd_sleep = cmd.get('sleep', 0) - cmd_timeout = cmd.get('timeout', 60) + if not cmd.get('condition') or section.result in list(map(TestResult.from_str, cmd['condition'])): + ikwargs.append({'dev': dev, 'cmd': cmd, 'device': device, 'save_to_file': save_to_file, 'folder_name': folder_name}) - for _ in range(max_retry + 1): - try: - # handle prompt if pattern and answer is in the - # datafile - if pattern: - if isinstance(pattern, str): - pattern = [pattern] - statement_list = [] - for p in pattern: - statement_list.append( - Statement( - pattern=p, - action='sendline({})'.format(answer), - loop_continue=True, - continue_timer=False)) - dialog = Dialog(statement_list) - output = device.execute(exec_cmd, - reply=dialog, - timeout=cmd_timeout) - else: - output = device.execute(exec_cmd, - timeout=cmd_timeout) - # save output to file as per device or command - if save_to_file == 'per_device': - file_name = folder_name + '/' + dev - save_file_name = file_name.split('/')[-1] + '.txt' - with open(file_name + '.txt', 'a') as f: - output = '+' * 10 + ' ' + datetime.datetime.now( - ).strftime( - '%Y-%m-%d %H:%M:%S.%f' - ) + ': ' + dev + ': executing command \'' + exec_cmd + '\' ' + '+' * 10 + '\n' + output + '\n' - f.write(output) - log.info( - "File {file} saved to folder {folder}". - format(file=save_file_name, - folder=folder_name)) - if zipped_folder: - file_list.update({file_name+'.txt': save_file_name}) - elif save_to_file == 'per_command': - file_name = folder_name + '/' + dev - file_name = file_name + '_' + device.api.slugify( - exec_cmd) - save_file_name = file_name.split('/')[-1] + '.txt' - with open(file_name + '.txt', 'w') as f: - output = '+' * 10 + ' ' + datetime.datetime.now( - ).strftime( - '%Y-%m-%d %H:%M:%S.%f' - ) + ': ' + dev + ': executing command \'' + exec_cmd + '\' ' + '+' * 10 + '\n' + output + '\n' - f.write(output) - log.info( - "File {file} saved to folder {folder}". - format(file=save_file_name, - folder=folder_name)) - if zipped_folder: - file_list.update({file_name+'.txt': save_file_name}) - except SubCommandFailure as e: - log.error( - 'Failed to execute "{cmd}" on device {d}: {e}'. - format(cmd=exec_cmd, d=device.name, e=str(e))) - device.destroy() - log.info('Trying to recover after execution failure') - connect_device(device) - else: - log.info( - "Successfully executed command '{cmd}' device {d}". - format(cmd=exec_cmd, d=device.name)) - # sleep if any command is successfully executed - sleep_if_cmd_executed = True - break - # didn't break loop, which means command execution is failed - else: - section.failed('Reached max number of {} retries, command ' - 'execution have failed'.format(max_retry)) - # if sleep is under the command, sleep after execution - if cmd_sleep: - log.info("Sleeping for {sleep_time} seconds".format( - sleep_time=cmd_sleep)) - time.sleep(cmd_sleep) + pcall_return = pcall(_pre_execute_command, ikwargs=ikwargs) + result_list.extend(pcall_return) + + if zipped_folder and result_list: + for fname in os.listdir(folder_name): + zip.write(os.path.join(folder_name, fname), fname) - if zipped_folder: - for fname, sname in file_list.items(): - try: - zip.write(fname ,sname) - except Exception: - section.errored( - "Failed to add file `{file}` to zip file {zip}" - .format(file=sname + '.txt', - zip=folder_name + '.zip')) try: zip.close() - log.info("Zip file `{zip}` was created with mode {mode}".format( - zip=folder_name + '.zip', mode=save_to_file)) + log.info(f"Zip file `{folder_name}.zip` was created with mode {save_to_file}") except Exception: - section.errored("Failed to close zip file: {zip}".format( - file=folder_name + '.zip')) + section.errored(f"Failed to close zip file: {folder_name}.zip") + try: shutil.rmtree(folder_name) - log.info( - "Folder `{folder}` was deleted because the folder was zipped". - format(folder=folder_name)) + log.info(f"Folder `{folder_name}` was deleted because the folder was zipped.") except Exception: - section.errored( - "Failed to delete folder which was zipped. Folder: {folder}". - format(folder=folder_name)) + section.errored(f"Failed to delete folder which was zipped. Folder: {folder_name}") - if sleep_time and sleep_if_cmd_executed: - log.info( - "Sleeping for {sleep_time} seconds".format(sleep_time=sleep_time)) + if sleep_time and any(result_list): + log.info(f"Sleeeping for {sleep_time} seconds") time.sleep(sleep_time) @@ -1508,7 +1456,6 @@ def post_execute_command(section, valid_section_results=None, devices=None, server_to_store=None): - ''' Execute commands or APIs as processors. The CLI command output can be stored in text files per device or per command and optionally archived in a zip file. @@ -1536,24 +1483,6 @@ def post_execute_command(section, The server should be specified in testbed> protocol: remote_path: } - Example: - - processors: - post: - post_execute: - method: genie.libs.sdk.libs.abstracted_libs.processors.post_execute_command - parameters: - valid_section_results: - - 'failed' - devices: - uut: - cmds: - - cmd: show version - apis: - - api: get_show_tech - arguments: - remote_server: sftp-1 - remote_path: /tmp/archive Returns: AETEST results @@ -1571,18 +1500,14 @@ def post_execute_command(section, return # Init - log.info(banner("processor: 'execute_command'")) + log.info(banner("processor: 'post_execute_command'")) - # Execute APIs against devices in in parallel - # - # Note: section.result is not passed down correctly to pcall - # (no result support for multiprocessing at this time) - # A failed status here is not reflected in _post_execute_api_device + # Execute APIs against devices in parallel pcall(_post_execute_device_api, cargs=(section,), iargs=[(dev, devices[dev]) for dev in devices]) - # sanitize arguments + # Sanitize arguments if save_to_file and save_to_file not in ['per_device', 'per_command']: section.errored( "`save_to_file` in datafile must be `per_device` or `per_command`") @@ -1593,7 +1518,7 @@ def post_execute_command(section, elif save_to_file and not isinstance(zipped_folder, bool): section.errored("`zipped_folder` must be True or False in datafile") - # prepare save location + # Prepare save location if save_to_file: file_list = {} now = datetime.datetime.now() @@ -1605,12 +1530,10 @@ def post_execute_command(section, try: os.mkdir(folder_name) log.info( - "Folder `{folder}` is created for `save_to_file` with mode {mode}" - .format(folder=folder_name, mode=save_to_file)) + "Folder `{folder}` is created for `save_to_file` with mode {mode}".format(folder=folder_name, mode=save_to_file)) except Exception: section.errored( - "Failed to create folder `{folder_name}` for `save_to_file`". - format(folder_name=folder_name)) + "Failed to create folder `{folder_name}` for `save_to_file`".format(folder_name=folder_name)) if zipped_folder: try: zip = zipfile.ZipFile(folder_name + '.zip', 'w', @@ -1621,45 +1544,29 @@ def post_execute_command(section, format(file=folder_name + '.zip')) sleep_if_cmd_executed = False - for dev in devices: - if dev == 'uut': - device = section.parameters['uut'] - else: - if dev in section.parameters[ - 'testbed'].devices.names or dev in section.parameters[ - 'testbed'].devices.aliases: - device = section.parameters['testbed'].devices[dev] - else: - section.errored( - "Failed to find a device {device} in testbed yaml".format( - device=dev)) - # if device not in TB or not connected, then skip - if not device or not device.is_connected(): - continue - # execute list of commands given in yaml + + def _post_execute_command(dev, device): + # Execute list of commands given in yaml for cmd in devices[dev].get('cmds', []): if not cmd.get('condition') or section.result in list( map(TestResult.from_str, cmd['condition'])): + exec_cmd = cmd.get('cmd', '') pattern = cmd.get('pattern', '') answer = cmd.get('answer', '') cmd_sleep = cmd.get('sleep', 0) cmd_timeout = cmd.get('timeout', 60) + for _ in range(max_retry + 1): try: - # handle prompt if pattern and answer is in the - # datafile + # Handle prompt if pattern and answer is in the datafile if pattern: if isinstance(pattern, str): pattern = [pattern] - statement_list = [] - for p in pattern: - statement_list.append( - Statement( - pattern=p, - action='sendline({})'.format(answer), - loop_continue=True, - continue_timer=False)) + statement_list = [Statement(pattern=p, + action='sendline({})'.format(answer), + loop_continue=True, + continue_timer=False) for p in pattern] dialog = Dialog(statement_list) output = device.execute(exec_cmd, reply=dialog, @@ -1668,98 +1575,92 @@ def post_execute_command(section, output = device.execute(exec_cmd, timeout=cmd_timeout) - # save output to file as per device or command + # Save output to file as per device or command if save_to_file == 'per_device': - file_name = folder_name + '/' + dev - save_file_name = file_name.split('/')[-1] + '.txt' - with open(file_name + '.txt', 'a') as f: + file_name = os.path.join(folder_name, f"{dev}.txt") + with open(file_name, 'a') as f: output = '+' * 10 + ' ' + datetime.datetime.now( ).strftime( '%Y-%m-%d %H:%M:%S.%f' ) + ': ' + dev + ': executing command \'' + exec_cmd + '\' ' + '+' * 10 + '\n' + output + '\n' f.write(output) log.info( - "File {file} saved to folder {folder}". - format(file=save_file_name, - folder=folder_name)) + "File {file} saved to folder {folder}".format(file=file_name, folder=folder_name)) if zipped_folder: - file_list.update({file_name+'.txt': save_file_name}) + file_list.update({file_name: dev}) elif save_to_file == 'per_command': - file_name = folder_name + '/' + dev - file_name = file_name + '_' + device.api.slugify( - exec_cmd) - save_file_name = file_name.split('/')[-1] + '.txt' - with open(file_name + '.txt', 'w') as f: + file_name = os.path.join(folder_name, f"{dev}_{device.api.slugify(exec_cmd)}.txt") + with open(file_name, 'w') as f: output = '+' * 10 + ' ' + datetime.datetime.now( ).strftime( '%Y-%m-%d %H:%M:%S.%f' ) + ': ' + dev + ': executing command \'' + exec_cmd + '\' ' + '+' * 10 + '\n' + output + '\n' f.write(output) log.info( - "File {file} saved to folder {folder}". - format(file=save_file_name, - folder=folder_name)) + "File {file} saved to folder {folder}".format(file=file_name, folder=folder_name)) if zipped_folder or server_to_store: - file_list.update({file_name+'.txt': save_file_name}) + file_list.update({file_name: dev}) except SubCommandFailure as e: log.error( - 'Failed to execute "{cmd}" on device {d}: {e}'. - format(cmd=exec_cmd, d=device.name, e=str(e))) - + 'Failed to execute "{cmd}" on device {d}: {e}'.format(cmd=exec_cmd, d=device.name, e=str(e))) device.destroy() log.info('Trying to recover after execution failure') connect_device(device) else: log.info( - "Successfully executed command '{cmd}' device {d}". - format(cmd=exec_cmd, d=device.name)) - # sleep if any command is successfully executed + "Successfully executed command '{cmd}' on device {d}".format(cmd=exec_cmd, d=device.name)) + # Sleep if any command is successfully executed sleep_if_cmd_executed = True break - # didn't break loop, which means command execution is failed else: section.failed('Reached max number of {} retries, command ' - 'execution have failed'.format(max_retry)) - # if sleep is under the command, sleep after execution + 'execution has failed'.format(max_retry)) + if cmd_sleep: - log.info("Sleeping for {sleep_time} seconds".format( - sleep_time=cmd_sleep)) + log.info("Sleeping for {sleep_time} seconds".format(sleep_time=cmd_sleep)) time.sleep(cmd_sleep) + ikwargs = [] + for dev in devices: + if dev == 'uut': + device = section.parameters['uut'] + else: + if dev in section.parameters['testbed'].devices.names or dev in section.parameters['testbed'].devices.aliases: + device = section.parameters['testbed'].devices[dev] + else: + section.errored("Failed to find a device {device} in testbed yaml".format(device=dev)) + + # Skip if device is not connected + if not device or not device.is_connected(): + continue + + ikwargs.append({'dev': dev, 'device': device}) + + pcall(_post_execute_command, ikwargs=ikwargs) + if server_to_store: - _store_in_server_func(section, server_to_store, - file_list, list(devices.keys())) + _store_in_server_func(section, server_to_store, file_list, list(devices.keys())) if zipped_folder: for fname, sname in file_list.items(): try: zip.write(fname, sname) except Exception: - section.errored( - "Failed to add file `{file}` to zip file {zip}" - .format(file=sname + '.txt', - zip=folder_name + '.zip')) + section.errored("Failed to add file `{file}` to zip file {zip}".format(file=sname + '.txt', zip=folder_name + '.zip')) try: zip.close() - log.info("Zip file `{zip}` was created with mode {mode}".format( - zip=folder_name + '.zip', mode=save_to_file)) + log.info("Zip file `{zip}` was created with mode {mode}".format(zip=folder_name + '.zip', mode=save_to_file)) except Exception: - section.errored("Failed to close zip file: {file}".format( - file=folder_name + '.zip')) + section.errored("Failed to close zip file: {file}".format(file=folder_name + '.zip')) try: shutil.rmtree(folder_name) - log.info( - "Folder `{folder}` was deleted because the folder was zipped". - format(folder=folder_name)) + log.info("Folder `{folder}` was deleted because the folder was zipped".format(folder=folder_name)) except Exception: - section.errored( - "Failed to delete folder which was zipped. Folder: {folder}". - format(folder=folder_name)) + section.errored("Failed to delete folder which was zipped. Folder: {folder}".format(folder=folder_name)) if sleep_time and sleep_if_cmd_executed: - log.info( - "Sleeping for {sleep_time} seconds".format(sleep_time=sleep_time)) + log.info("Sleeping for {sleep_time} seconds".format(sleep_time=sleep_time)) time.sleep(sleep_time) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/powercycler/base.py b/pkgs/sdk-pkg/src/genie/libs/sdk/powercycler/base.py index c41fad613..687154842 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/powercycler/base.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/powercycler/base.py @@ -2,6 +2,8 @@ import logging import time +log = logging.getLogger(__name__) + from .snmp_client import SNMPClient, SNMPv3Client try: import pysnmp @@ -12,13 +14,12 @@ usmAesCfb256Protocol, usmNoPrivProtocol pysnmp_installed = True except ImportError: + log.debug('traceback:', exc_info=True) pysnmp_installed = False # Unicon from unicon.eal.dialogs import Statement, Dialog -log = logging.getLogger(__name__) - class PowerCyclerMeta(type): diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/actions_helper.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/actions_helper.py index 60f333c77..2c8bdcd6c 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/actions_helper.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/actions_helper.py @@ -1229,7 +1229,7 @@ def _condition_validator(items): left_hand = output['left_hand_value'] left_hand = left_hand if isinstance(left_hand, (float, int)) else left_hand.strip() - log.debug('right_hand: {}, operation {}, left_hand'.format(right_hand, operation, left_hand)) + log.debug('right_hand: {}, operation {}, left_hand {}'.format(right_hand, operation, left_hand)) result = _evaluate_operator(right_hand, operation=operation, value=left_hand)