diff --git a/README.md b/README.md index 03e0b2769..9d88f4433 100644 --- a/README.md +++ b/README.md @@ -68,3 +68,4 @@ created a new API. * [robot](pkgs/robot-pkg/changelog/CHANGELOG.md) > Copyright (c) 2020 Cisco Systems, Inc. and/or its affiliates +# Trigger pipeline diff --git a/pkgs/clean-pkg/changelog/2024/august.rst b/pkgs/clean-pkg/changelog/2024/august.rst index 37d93d50f..e69de29bb 100644 --- a/pkgs/clean-pkg/changelog/2024/august.rst +++ b/pkgs/clean-pkg/changelog/2024/august.rst @@ -1,28 +0,0 @@ --------------------------------------------------------------------------------- - New --------------------------------------------------------------------------------- - -* iosxe - * connect stage - * add password recovery for connect stage. - -* clean-pkg - * updated the default keep configuration - - --------------------------------------------------------------------------------- - Fix --------------------------------------------------------------------------------- - -* iosxe - * set controller mode stage - * the stage is now working properly fix the issue with stage and reload stage - * Modified install_image - * Added new flag skip_save_running_config to skip the step to save the the running configuration to the startup config. - -* generic - * Modified configure_management - * Added `alias_as_hostname` argument - * Allows user to use the alias as the device hostname - - 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 new file mode 100644 index 000000000..646742385 --- /dev/null +++ b/pkgs/clean-pkg/changelog/changelog_modify_iosxe_ChangeBootVariable_stage_20240918204515.rst @@ -0,0 +1,6 @@ +-------------------------------------------------------------------------------- + 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/clean-pkg/sdk_generator/output/github_clean.json b/pkgs/clean-pkg/sdk_generator/output/github_clean.json index 3a041d3bc..c37ac04b6 100644 --- a/pkgs/clean-pkg/sdk_generator/output/github_clean.json +++ b/pkgs/clean-pkg/sdk_generator/output/github_clean.json @@ -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#L2111" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2120" } } }, @@ -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#L2167" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2176" }, "linux": { "folders": { @@ -354,7 +354,7 @@ "os": "iosxe" }, "uid": "CopyToDevice", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1466" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1475" } }, "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\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", "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#L548" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L554" }, "iosxr": { "folders": { @@ -583,7 +583,7 @@ "os": "iosxe" }, "uid": "InstallPackages", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L809" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L815" } } }, @@ -597,7 +597,7 @@ "os": "iosxe" }, "uid": "InstallRemoveInactive", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L465" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L471" } } }, @@ -698,7 +698,7 @@ "os": "iosxe" }, "uid": "Reload", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L893" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L899" } }, "module_name": "stages.stages", @@ -716,7 +716,7 @@ "os": "iosxe" }, "uid": "ResetConfiguration", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2359" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2374" } } }, @@ -731,7 +731,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\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\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\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", "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 +750,7 @@ "os": "iosxe" }, "uid": "RommonBoot", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1207" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1213" } } }, @@ -785,7 +785,7 @@ "os": "iosxe" }, "uid": "SetControllerMode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2547" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2562" } } }, @@ -856,7 +856,7 @@ "os": "iosxe" }, "uid": "TftpBoot", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L196" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L202" }, "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 1eb1a5752..d9610ab10 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.8' +__version__ = '24.9' __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 66ae3e764..c6ce1a583 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 @@ -103,7 +103,6 @@ def tftp_device_recovery(spawn, timeout, device, tftp_boot, item, recovery_passw Returns: None """ - dialog = TftpRommonDialog() # Add a statement to the dialog which will match the device hostname @@ -113,6 +112,17 @@ def tftp_device_recovery(spawn, timeout, device, tftp_boot, item, recovery_passw action=print_message, args={'message': 'Device has reached privileged exec prompt'})) + credentials = device.credentials + + if recovery_username is None: + recovery_username = to_plaintext(credentials.get('default', {}).get('username')) + + if recovery_password is None: + recovery_password = to_plaintext(credentials.get('default', {}).get('password')) + + if recovery_en_password is None: + recovery_en_password = to_plaintext(credentials.get('enable', {}).get('password')) + dialog.dialog.process( spawn, timeout=timeout, diff --git a/pkgs/clean-pkg/src/genie/libs/clean/recovery/recovery.py b/pkgs/clean-pkg/src/genie/libs/clean/recovery/recovery.py index f93eee80c..7fd2e03ca 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/recovery/recovery.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/recovery/recovery.py @@ -286,8 +286,9 @@ def recovery_processor( if hasattr(device, 'is_ha') and device.is_ha: log.info('Device is HA! checking all the subconnections.') for index, connection in enumerate(device.subconnections,1): - bring_to_any_state(connection, connection_timeout) - log.info(f'subconnection {index} is in {connection.state_machine.current_state}') + if device.get_rp_state(target=connection.alias) != 'IN_CHASSIS_STANDBY': + bring_to_any_state(connection, connection_timeout) + log.info(f'subconnection {index} is in {connection.state_machine.current_state}') else: bring_to_any_state(device, connection_timeout) log.info(f'Device is in {device.state_machine.current_state}') diff --git a/pkgs/conf-pkg/changelog/2024/september.rst b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/asr1k/tests/test_change_boot_variable/__init__.py similarity index 100% rename from pkgs/conf-pkg/changelog/2024/september.rst rename to pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/asr1k/tests/test_change_boot_variable/__init__.py diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/asr1k/tests/test_change_boot_variable/mock_data/iosxe/mock_data.yaml b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/asr1k/tests/test_change_boot_variable/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..cd1da679c --- /dev/null +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/asr1k/tests/test_change_boot_variable/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,143 @@ +connect: &connect + preface: | + Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''. + prompt: "%N#" + +change_boot_variable_1: + <<: *connect + commands: + ? '' + : new_state: execute_1 + +execute_1: + commands: + show version | include operating mode: '' + config term: + new_state: configure_1 + write memory: | + Building configuration... + [OK] + show bootvar: | + BOOT variable = bootflash:/image.SSA.XYZ,12; + CONFIG_FILE variable = + BOOTLDR variable does not exist + Configuration register is 0x2102 + + Standby BOOT variable = bootflash:/image.SSA.XYZ,12; + Standby CONFIG_FILE variable = + Standby BOOTLDR variable does not exist + Standby Configuration register is 0x2102 + prompt: "%N#" + +configure_1: + commands: + no boot system: "" + end: + new_state: execute_1 + line console: + new_state: configure_line + boot system bootflash:/image.SSA.XYZ: "" + config-register 0x2102: "" + prompt: "%N(config)#" + +change_boot_variable_2: + <<: *connect + commands: + ? '' + : new_state: execute_2 + +execute_2: + commands: + show version | include operating mode: '' + show version: | + show version + Cisco IOS XE Software, Version BLD_POLARIS_DEV_LATEST_20240916_114854 + Cisco IOS Software [IOSXE], ASR1000 Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Experimental Version 17.17.20240916:124022 [BLD_POLARIS_DEV_LATEST_20240916_114854:/nobackup/mcpre/s2c-build-ws 103] + Copyright (c) 1986-2024 by Cisco Systems, Inc. + Compiled Mon 16-Sep-24 05:40 by mcpre + + + Cisco IOS-XE software, Copyright (c) 2005-2024 by cisco Systems, Inc. + All rights reserved. Certain components of Cisco IOS-XE software are + licensed under the GNU General Public License ("GPL") Version 2.0. The + software code licensed under GPL Version 2.0 is free software that comes + with ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such + GPL code under the terms of GPL Version 2.0. For more details, see the + documentation or "License Notice" file accompanying the IOS-XE software, + or the applicable URL provided on the flyer accompanying the IOS-XE + software. + + + ROM: 17.3(1r) + + R2 uptime is 18 hours, 55 minutes + Uptime for this control processor is 18 hours, 57 minutes + System returned to ROM by Reload Command + System image file is "harddisk:packages.conf" + Last reload reason: Reload Command + + + + This product contains cryptographic features and is subject to United + States and local country laws governing import, export, transfer and + use. Delivery of Cisco cryptographic products does not imply + third-party authority to import, export, distribute or use encryption. + Importers, exporters, distributors and users are responsible for + compliance with U.S. and local country laws. By using this product you + agree to comply with applicable laws and regulations. If you are unable + to comply with U.S. and local laws, return this product immediately. + + A summary of U.S. laws governing Cisco cryptographic products may be found at: + http://www.cisco.com/wwl/export/crypto/tool/stqrg.html + + If you require further assistance please contact us by sending email to + export@cisco.com. + + License Type: Smart License is permanent + License Level: advipservices + Next reload license Level: advipservices + + Smart Licensing Status: Smart Licensing Using Policy + + cisco ASR1006-X (RP3) processor (revision RP3) with 4087430K/24590K bytes of memory. + Processor board ID FXS2239Q329 + Router operating mode: Autonomous + 20 Gigabit Ethernet interfaces + 2 Ten Gigabit Ethernet interfaces + 32768K bytes of non-volatile configuration memory. + 8388608K bytes of physical memory. + 7600127K bytes of eUSB flash at bootflash:. + 97620247K bytes of SATA hard disk at harddisk:. + + Configuration register is 0x2102 + config term: + new_state: configure_2 + write memory: | + Building configuration... + [OK] + show bootvar: | + BOOT variable = harddisk:packages.conf,12; + CONFIG_FILE variable = + BOOTLDR variable does not exist + Configuration register is 0x2102 + + Standby BOOT variable = harddisk:packages.conf,12; + Standby CONFIG_FILE variable = + Standby BOOTLDR variable does not exist + Standby Configuration register is 0x2102 + prompt: "%N#" + +configure_2: + commands: + no boot system: "" + end: + new_state: execute_2 + line console: + new_state: configure_line + boot system harddisk:packages.conf: "" + config-register 0x2102: "" + prompt: "%N(config)#" diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/asr1k/tests/test_change_boot_variable/test_change_boot_variable.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/asr1k/tests/test_change_boot_variable/test_change_boot_variable.py new file mode 100644 index 000000000..236a6491d --- /dev/null +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/asr1k/tests/test_change_boot_variable/test_change_boot_variable.py @@ -0,0 +1,92 @@ +import unittest + +from pyats.results import Passed +from pyats.topology import loader +from pyats.aetest.steps import Steps + +from genie.libs.clean.stages.iosxe.stages import ChangeBootVariable + + +class TestChangeBootVariable1(unittest.TestCase): + """ Run unit testing on a mocked IOSXE asr1k device """ + + def test_change_boot_variable_pass(self): + testbed = """ + devices: + router: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir mock_data --state change_boot_variable_1 + protocol: unknown + os: iosxe + platform: asr1k + model: ASR1001-HX + type: router + custom: + abstraction: + order: [os, platform, model] + """ + testbed = loader.load(testbed) + device = testbed.devices['router'] + device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + # Make sure we have a unique Steps() object for result verification + steps = Steps() + + # And we want the following methods to be mocked to simulate the stage. + change_boot_variable = ChangeBootVariable() + + image = 'bootflash:/image.SSA.XYZ' + + change_boot_variable(steps=steps, device=device, images=[image]) + + # Check the results is as expected. + self.assertEqual(Passed, steps.details[0].result) + + def test_change_boot_variable_with_current_running_image(self): + testbed = """ + devices: + router: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir mock_data --state change_boot_variable_2 + protocol: unknown + os: iosxe + platform: asr1k + model: ASR1001-HX + type: router + custom: + abstraction: + order: [os, platform, model] + """ + testbed = loader.load(testbed) + device = testbed.devices['router'] + device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + # Make sure we have a unique Steps() object for result verification + steps = Steps() + + # And we want the following methods to be mocked to simulate the stage. + change_boot_variable = ChangeBootVariable() + + image = 'bootflash:/image.SSA.XYZ' + + with self.assertLogs(level='INFO') as log: + change_boot_variable(steps=steps, device=device, images=[image], current_running_image=True) + self.assertIn("INFO:genie.libs.clean.stages.iosxe.stages:" + + "Verifying next reload boot variables Using the running image due to 'current_running_image: True'", + log.output) + + # Check the results is as expected. + self.assertEqual(Passed, steps.details[0].result) 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 d5317caed..9a295eb69 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 @@ -36,7 +36,7 @@ from unicon.eal.dialogs import Statement, Dialog from unicon.core.errors import SubCommandFailure from unicon.plugins.generic.statements import GenericStatements -from unicon.core.errors import UniconAuthenticationError +from unicon.core.errors import UniconAuthenticationError, UniconBackendDecodeError # Logger log = logging.getLogger(__name__) @@ -133,7 +133,7 @@ def configure_boot_variable(self, steps, device, images, timeout=TIMEOUT, try: output = device.parse('show version') - images = [output['version']['system_image']] + images = self.running_images = [output['version']['system_image']] except Exception as e: step.failed("Failed to retrieve the running image. Cannot " "set boot variables", @@ -172,10 +172,16 @@ def write_memory(self, steps, device, timeout=TIMEOUT): else: step.passed("Successfully executed 'write memory'") - def verify_boot_variable(self, steps, device, images): + 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 not device.api.verify_boot_variable(boot_images=images): step.failed("Boot variables are NOT correctly set") else: @@ -560,7 +566,7 @@ class InstallImage(BaseStage): 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. @@ -1245,6 +1251,8 @@ class RommonBoot(BaseStage): 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. rommon_timeout (int, optional): Timeout after bringing the device to rommon. Default to 15 sec. @@ -1266,6 +1274,7 @@ class RommonBoot(BaseStage): save_system_config: False timeout: 600 config_reg_timeout: 10 + config_register: 0x0 There is more than one ip address, one for each supervisor. @@ -1307,7 +1316,7 @@ class RommonBoot(BaseStage): ETHER_PORT = 0 ROMMON_TIMEOUT = 15 RECONNECT_TIMEOUT = 90 - + CONFIG_REGISTER = "0x0" # ============ # Stage Schema @@ -1327,6 +1336,7 @@ class RommonBoot(BaseStage): Optional('timeout'): int, Optional('ether_port'): int, Optional('rommon_timeout'): int, + Optional('config_register'): str, } # ============================== @@ -1355,11 +1365,10 @@ 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, 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() - time.sleep(rommon_timeout) + device.rommon(config_register=config_register) except Exception as e: step.failed("Failed to bring device to rommon!", from_exception=e) @@ -2217,7 +2226,6 @@ def connect(self, steps, device, via=VIA, alias=ALIAS, timeout=TIMEOUT, with steps.start("Connecting to the device") as step: 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 @@ -2236,11 +2244,17 @@ def connect(self, steps, device, via=VIA, alias=ALIAS, timeout=TIMEOUT, via=via, alias=alias, mit=True) + try: if alias: getattr(device, alias).connect() else: device.connect() + except UniconBackendDecodeError: + log.info("Console speed mismatch. Trying to recover") + device.destroy_all() + 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.') @@ -2346,6 +2360,7 @@ def connect(self, steps, device, via=VIA, alias=ALIAS, timeout=TIMEOUT, # set mit to False to initialize the connection device.default.mit=False + device.default.learn_hostname = False with steps.start("Initialize the device connection") as step: try: @@ -2675,15 +2690,15 @@ def set_controller_mode( r'(.*?)Would you like to enter the initial configuration dialog\? \[yes/no\]:\s*', action=f'sendline(no)', loop_continue=True, - continue_timer=False), - - + continue_timer=False), + + generic_statments.syslog_msg_stmt, - + generic_statments.enable_secret_stmt, - + generic_statments.enter_your_selection_stmt, - + ]) try: @@ -2749,11 +2764,11 @@ def 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. ") - - else: + + else: if delete_inactive_versions and self.non_active_version: for version in self.non_active_version: device.execute( @@ -2762,4 +2777,4 @@ def delete_inactive_versions( device.execute("show sdwan software") log.info( f"Non active versions {self.non_active_version} are deleted." - ) \ No newline at end of file + ) diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_connect.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_connect.py index d5170825a..fcee83a45 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_connect.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_connect.py @@ -10,6 +10,8 @@ from unicon.plugins.tests.mock.mock_device_iosxe import MockDeviceTcpWrapperIOSXE import unicon +from unicon.core.errors import UniconBackendDecodeError + unicon.settings.Settings.POST_DISCONNECT_WAIT_SEC = 0 unicon.settings.Settings.GRACEFUL_DISCONNECT_WAIT_SEC = 0.2 @@ -59,7 +61,7 @@ def setUpClass(self): def tearDownClass(self): self.device.disconnect() self.md.stop() - + def test_connect(self): steps = Steps() self.connect = Connect() @@ -67,3 +69,14 @@ def test_connect(self): self.assertEqual(Passed, steps.details[0].result) + @patch('unicon.eal.backend.pty_backend.Spawn._read', Mock(return_value=b'\xcej')) + def test_connect_speed_fail(self): + steps = Steps() + self.device.api.configure_management_console = MagicMock() + try: + self.device.disconnect() + self.connect = Connect() + self.connect(steps=steps, device=self.device) + except: + ... + self.device.api.configure_management_console.assert_called_once() \ No newline at end of file diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_rommon_boot.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_rommon_boot.py index 4dade178a..83757aba5 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_rommon_boot.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_rommon_boot.py @@ -109,6 +109,13 @@ def test_write_memory_fail(self): "Failed to write memory", from_exception=api_exception) + def test_go_to_rommon(self): + steps = mock.MagicMock() + self.device.rommon = mock.Mock() + self.cls.go_to_rommon(steps, self.device, config_register="0x40") + steps.start.assert_called_with("Bring device down to rommon mode") + self.device.rommon.assert_called_once() + @mock.patch('genie.libs.clean.stages.iosxe.stages._disconnect_reconnect') def test_reconnect_pass(self, _disconnect_reconnect): steps = mock.MagicMock() @@ -139,5 +146,3 @@ def test_reconnect_fail(self, _disconnect_reconnect): # with steps.start('...') as step_context: step_context = steps.start.return_value.__enter__.return_value step_context.failed.assert_called_with("Failed to reconnect") - - diff --git a/pkgs/clean-pkg/src/genie/libs/clean/tests/test_clean.py b/pkgs/clean-pkg/src/genie/libs/clean/tests/test_clean.py index d3d4d1e69..7df7198bd 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/tests/test_clean.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/tests/test_clean.py @@ -10,6 +10,7 @@ from genie.libs.clean.stages.image_handler import BaseImageHandler from genie.conf.base import Device from genie.abstract.package import AbstractTree +from genie.libs.clean.utils import validate_clean from pyats.log.utils import banner from pyats import results @@ -587,3 +588,41 @@ def test_discover_image_handler_image_override_default(self): clean_testcase.discover() self.assertEqual(clean_testcase.image_handler.override_stage_images, True) + + +class TestValidateClean(unittest.TestCase): + + @mock.patch('genie.libs.clean.clean.load_clean_json', mock.Mock(side_effect=clean_json)) + def test_validate_clean_image_management_stage(self): + expected_result = {'warnings': [], 'exceptions': []} + clean_yaml = """cleaners: + DeviceClean: + module: genie.libs.clean + devices: [router] + +devices: + router: + images: + - /auto/release/path/image.bin + + image_management: + override_stage_images: False + + connect: + + order: + - 'connect' +""" + testbed_yaml = """ +testbed: + name: SAMPLE-TESTBED + +devices: + router: + os: iosxe + connections: + defaults: + class: unicon.Unicon +""" + actual_result = validate_clean(clean_yaml, testbed_yaml) + self.assertEqual(expected_result, actual_result) diff --git a/pkgs/clean-pkg/src/genie/libs/clean/utils.py b/pkgs/clean-pkg/src/genie/libs/clean/utils.py index db1699212..38d8d15ee 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/utils.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/utils.py @@ -379,7 +379,8 @@ def validate_clean(clean_file, testbed_file, lint=True): # these sections are not true stages and therefore cant be loaded sections_to_ignore = [ 'images', - 'order' + 'order', + 'image_management' ] base_schema = { @@ -462,6 +463,7 @@ def validate_clean(clean_file, testbed_file, lint=True): schema.update({Optional('order'): list}) schema.update({Optional('device_recovery'): dict}) schema.update({Optional('images'): Or(list, dict)}) + schema.update({Optional('image_management'): dict}) clean_data = clean_dict["devices"][dev] diff --git a/pkgs/conf-pkg/src/genie/libs/conf/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/__init__.py index d52d7934d..003535d38 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.8' +__version__ = '24.9' __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/device/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/device/__init__.py index 65160d9b1..200d86616 100644 --- a/pkgs/conf-pkg/src/genie/libs/conf/device/__init__.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/device/__init__.py @@ -7,6 +7,7 @@ 'EmulatedDevice', ) +import logging import importlib import warnings import abc @@ -20,7 +21,9 @@ from genie.conf.base.cli import CliConfigBuilder from genie.libs.conf.address_family import AddressFamily +from genie.libs.parser.utils.common import Common +logger = logging.getLogger(__name__) class UnsupportedDeviceOsWarning(UserWarning): pass @@ -89,6 +92,31 @@ def __new__(cls, name, *args, **kwargs): def learn_interface_mac_addresses(self): return NotImplemented # Not an error; Just not supported. + + def learn_interfaces(self, include_management=False, timeout=300): + ''' Learn device interfaces and add interfaces if they dont already exist in device.interfaces. + Api to learn interfaces of the device and add the interfaces if the dont exist in device.interfaces. + Args: + include_management(`bool`): Don't include the management interface, unless it is set to True + timeout(`int`): Timeout for learn, default to 300 seconds + Return: + None + Examples: + Learn interfaces and add them if they don't already exists. + >>> device.learn_interfaces() + ''' + ifaces = self.learn('interface', brief=True, timeout=timeout).to_dict() + for ifname, ifdata in ifaces.get('info', {}).items(): + ifname = Common.convert_intf_name(ifname) + if ifname not in self.interfaces: + if self.api.is_management_interface(ifname) and not include_management: + continue + enabled = ifdata.get('enabled') + try: + iface = genie.libs.conf.interface.Interface(device=self, name=ifname, enabled=enabled) + iface.type = iface._interface_name_types[0] + except Exception as e: + logger.warning(f'interface {ifname}: {e}') def build_config(self, apply=True, attributes=None): """method to build the configuration of the device diff --git a/pkgs/conf-pkg/src/genie/libs/conf/device/tests/interface_output.py b/pkgs/conf-pkg/src/genie/libs/conf/device/tests/interface_output.py new file mode 100644 index 000000000..8ef1c5ced --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/device/tests/interface_output.py @@ -0,0 +1,461 @@ + +''' +Interface Genie Ops Object Outputs for IOSXR IOSXE NXOS. +''' + + +class InterfaceOutput(object): + IosxrInterfaceOpsOutput_info = { + "info":{ + "Null0": { + "mtu": 1500, + "type": "Null", + "enabled": True, + "bandwidth": 0, + "counters": { + "in_octets": 0, + "out_broadcast_pkts": 0, + "out_pkts": 0, + "in_discards": 0, + "in_pkts": 0, + "in_multicast_pkts": 0, + "in_broadcast_pkts": 0, + "rate": { + "out_rate": 0, + "out_rate_pkts": 0, + "in_rate_pkts": 0, + "load_interval": 5, + "in_rate": 0 + }, + "last_clear": "never", + "out_multicast_pkts": 0, + "out_octets": 0 + }, + "encapsulation": { + "encapsulation": "Null" + }, + }, + "MgmtEth0/0/CPU0/0": { + "mtu": 1514, + "mac_address": "5254.00c3.6c43", + "flow_control": { + "flow_control_receive": False, + "flow_control_send": False + }, + "type": "Management Ethernet", + "enabled": False, + "encapsulation": { + "encapsulation": "ARPA" + }, + "auto_negotiate": True, + "bandwidth": 0, + "counters": { + "out_broadcast_pkts": 0, + "in_multicast_pkts": 0, + "in_crc_errors": 0, + "in_pkts": 0, + "in_errors": 0, + "in_broadcast_pkts": 0, + "out_multicast_pkts": 0, + "out_errors": 0, + "in_octets": 0, + "rate": { + "out_rate": 0, + "out_rate_pkts": 0, + "in_rate_pkts": 0, + "load_interval": 5, + "in_rate": 0 + }, + "out_pkts": 0, + "in_discards": 0, + "last_clear": "never", + "out_octets": 0 + }, + "duplex_mode": "duplex unknown", + "port_speed": "0Kb/s", + "phys_address": "5254.00c3.6c43", + "ipv6": { + "enabled": False + } + }, + "GigabitEthernet0/0/0/5": { + "ipv6": { + "enabled": False + } + }, + "GigabitEthernet0/0/0/4": { + "ipv6": { + "enabled": False + } + }, + "GigabitEthernet0/0/0/0": { + "mtu": 1600, + "mac_address": "aaaa.bbbb.cccc", + "description": "desc", + "duplex_mode": "full", + "type": "GigabitEthernet", + "enabled": False, + "encapsulation": { + "encapsulation": "ARPA" + }, + "auto_negotiate": True, + "ipv4": { + "10.1.3.1/24": { + "ip": "10.1.3.1", + "prefix_length": "24", + }, + + }, + "bandwidth": 768, + "accounting": { + "arp": { + "chars_in": 378, + "chars_out": 378, + "pkts_in": 9, + "pkts_out": 9 + }, + "ipv4_multicast": { + "chars_in": 0, + "chars_out": 843700, + "pkts_in": 0, + "pkts_out": 10514 + }, + "ipv4_unicast": { + "chars_in": 1226852, + "chars_out": 887519, + "pkts_in": 19254, + "pkts_out": 13117 + } + }, + "counters": { + "out_broadcast_pkts": 0, + "in_multicast_pkts": 0, + "in_crc_errors": 0, + "in_pkts": 0, + "in_errors": 0, + "in_broadcast_pkts": 0, + "out_multicast_pkts": 0, + "out_errors": 0, + "in_octets": 0, + "rate": { + "out_rate": 0, + "out_rate_pkts": 0, + "in_rate_pkts": 0, + "load_interval": 30, + "in_rate": 0 + }, + "out_pkts": 0, + "in_discards": 0, + "last_clear": "never", + "out_octets": 0 + }, + "flow_control": { + "flow_control_receive": False, + "flow_control_send": False + }, + "port_speed": "1000Mb/s", + "phys_address": "5254.0077.9407", + "ipv6": { + "2001:db8:2:2::2/64": { + "status": "tentative", + "ip": "2001:db8:2:2::2", + "prefix_length": "64" + }, + "2001:db8:1:1::1/64": { + "status": "tentative", + "ip": "2001:db8:1:1::1", + "prefix_length": "64" + }, + "enabled": False, + "2001:db8:4:4::4/64": { + "status": "tentative", + "route_tag": "10", + "ip": "2001:db8:4:4::4", + "prefix_length": "64" + }, + "2001:db8:3:3:a8aa:bbff:febb:cccc/64": { + "status": "tentative", + "ip": "2001:db8:3:3:a8aa:bbff:febb:cccc", + "prefix_length": "64", + "eui64": True + } + } + }, + "GigabitEthernet0/0/0/1": { + "vrf": "VRF1", + "ipv6": { + '2001:db8:1:5::1/64': { + 'ip': '2001:db8:1:5::1', + 'prefix_length': '64' + }, + 'enabled': True}, + 'ipv4': { + '10.1.5.1/24': { + 'ip': '10.1.5.1', + 'prefix_length': '24', + 'route_tag': 50}, + '10.2.2.2/24': { + 'ip': '10.2.2.2', + 'prefix_length': '24', + 'secondary': True}}, + + "accounting": { + "arp": { + "chars_in": 378, + "chars_out": 378, + "pkts_in": 9, + "pkts_out": 9 + }, + "ipv4_multicast": { + "chars_in": 0, + "chars_out": 844816, + "pkts_in": 0, + "pkts_out": 10530 + }, + "ipv4_unicast": { + "chars_in": 843784, + "chars_out": 1764, + "pkts_in": 10539, + "pkts_out": 26 + } + } + }, + "GigabitEthernet0/0/0/6": { + "ipv6": { + "enabled": False + } + }, + "GigabitEthernet0/0/0/0.20": { + "mtu": 1604, + "counters": { + "in_octets": 0, + "out_broadcast_pkts": 0, + "out_pkts": 0, + "in_discards": 0, + "in_pkts": 0, + "in_multicast_pkts": 0, + "in_broadcast_pkts": 0, + "rate": { + "out_rate": 0, + "out_rate_pkts": 0, + "in_rate_pkts": 0, + "load_interval": 5, + "in_rate": 0 + }, + "last_clear": "never", + "out_multicast_pkts": 0, + "out_octets": 0 + }, + "enabled": False, + "bandwidth": 768, + "vlan_id": '20', + "encapsulation": { + "encapsulation": "802.1Q Virtual LAN", + "first_dot1q": "20" + }, + "ipv6": { + "enabled": False + } + }, + "GigabitEthernet0/0/0/2": { + "vrf": "VRF2", + "ipv6": { + "enabled": False + } + }, + "GigabitEthernet0/0/0/3": { + "ipv6": { + "enabled": False + } + }, + "GigabitEthernet0/0/0/0.10": { + "mtu": 1608, + "counters": { + "in_octets": 0, + "out_broadcast_pkts": 0, + "out_pkts": 0, + "in_discards": 0, + "in_pkts": 0, + "in_multicast_pkts": 0, + "in_broadcast_pkts": 0, + "rate": { + "out_rate": 0, + "out_rate_pkts": 0, + "in_rate_pkts": 0, + "load_interval": 5, + "in_rate": 0 + }, + "last_clear": "never", + "out_multicast_pkts": 0, + "out_octets": 0 + }, + "enabled": False, + "bandwidth": 768, + "vlan_id": '10', + "encapsulation": { + "encapsulation": "802.1Q Virtual LAN", + "first_dot1q": "10", + "second_dot1q": "10" + }, + "ipv6": { + '2001:db8:1:3::1/64': { + 'ip': '2001:db8:1:3::1', + 'prefix_length': '64'}, + "enabled": False + } + } + } + } + NxosInterfaceOpsOutput_info={ + 'info': + { + 'Ethernet1/1': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2aa0', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/10': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ac4', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/11': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ac8', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/12': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2acc', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/13': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ad0', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/14': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ad4', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/15': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ad8', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/16': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2adc', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/17': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'up', + 'phys_address': '188b.9df3.2ae0', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/18': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ae4', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet2/1': {'vrf': 'VRF1'}, + 'Mgmt0': {'bandwidth': 1000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a98', + 'mtu': 1500, + 'oper_status': 'up', + 'phys_address': '188b.9df3.2a98', + 'port_channel': {'port_channel_member': False}, + 'type': 'GigabitEthernet', + 'vrf': 'management'}, + 'Null0': {'vrf': 'default'} + }} + IosxeInterfaceOutput_info = { + 'info':{ + 'GigabitEthernet0/0/0': {'bandwidth': 1000000, + 'delay': 10, + 'enabled': False, + 'ipv6': {'FE80::72EA:1AFF:FEB5:49B0': {'ip': 'FE80::72EA:1AFF:FEB5:49B0', + 'origin': 'link_layer', + 'status': 'tentative'}}, + 'mac_address': '70ea.1ab5.49b0', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '70ea.1ab5.49b0', + 'port_channel': {'port_channel_member': False}, + 'switchport_enable': False, + 'type': 'ISR4221-2x1GE'}, + 'GigabitEthernet0/0/1': {'bandwidth': 1000000, + 'delay': 10, + 'enabled': False, + 'mac_address': '70ea.1ab5.49b1', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '70ea.1ab5.49b1', + 'port_channel': {'port_channel_member': False}, + 'switchport_enable': False, + 'type': 'ISR4221-2x1GE'}, + 'GigabitEthernet0/1/0': {'bandwidth': 1000000, + 'delay': 10, + 'enabled': False, + 'mac_address': '70ea.1ab5.49b8', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '70ea.1ab5.49b8', + 'port_channel': {'port_channel_member': False}, + 'switchport_enable': False, + 'type': 'NIM-1GE-CU-SFP'}, + 'GigabitEthernet0/2/0': {'bandwidth': 1000000, + 'delay': 10, + 'enabled': False, + 'mac_address': '70ea.1ab5.49c0', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '70ea.1ab5.49c0', + 'port_channel': {'port_channel_member': False}, + 'switchport_enable': False, + 'type': 'NIM-1GE-CU-SFP'}, + 'GigabitEthernet1/0/1': {'switchport_enable': False, 'vrf': 'VRF1'}, + 'GigabitEthernet1/0/2': {'switchport_enable': False, 'vrf': 'Mgmt-intf'}}} \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/device/tests/test_device.py b/pkgs/conf-pkg/src/genie/libs/conf/device/tests/test_device.py index 75cd6aaa0..ed7e54a03 100755 --- a/pkgs/conf-pkg/src/genie/libs/conf/device/tests/test_device.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/device/tests/test_device.py @@ -20,7 +20,7 @@ from genie.libs.conf.device.pagent import Device as PagentDevice from genie.libs.conf.device.spirent import Device as SpirentDevice - +from genie.libs.conf.tests.device.interface_output import InterfaceOutput class test_device(TestCase): def test_init(self): @@ -93,7 +93,48 @@ def test_htlapi_traffic_control(self): dev.default = MagicMock() dev.traffic_control(param='value') dev.default.traffic_control.assert_has_calls([call(param='value')]) - + +class TestLearnInterface(unittest.TestCase): + + def test_learn_interfaces_iosxe(self): + self.dev1 = Device(name='PE1', os='iosxe') + xe_interfaces = {'GigabitEthernet0/1/0', 'GigabitEthernet0/0/1', 'GigabitEthernet0/0/0', 'GigabitEthernet1/0/1', 'GigabitEthernet1/0/2', 'GigabitEthernet0/2/0'} + + self.dev1.learn = MagicMock() + learn_1_return_value = MagicMock() + learn_1_return_value.to_dict = MagicMock(return_value=InterfaceOutput.IosxeInterfaceOutput_info) + self.dev1.learn.return_value = learn_1_return_value + self.dev1.api.is_management_interface = MagicMock(return_value=False) + self.assertEqual(len(self.dev1.interfaces), 0) + self.dev1.learn_interfaces() + self.assertEqual(set(self.dev1.interfaces.keys()), xe_interfaces) + + def test_learn_interfaces_iosxr(self): + self.dev2 = Device(name='PE1', os='iosxr') + xr_interfaces = {'Null0', 'GigabitEthernet0/0/0/5', 'GigabitEthernet0/0/0/0.20', 'GigabitEthernet0/0/0/4', 'GigabitEthernet0/0/0/0.10', 'MgmtEth0/0/CPU0/0', + 'GigabitEthernet0/0/0/6', 'GigabitEthernet0/0/0/1', 'GigabitEthernet0/0/0/0', 'GigabitEthernet0/0/0/2', 'GigabitEthernet0/0/0/3'} + self.dev2.learn = MagicMock() + learn_2_return_value = MagicMock() + learn_2_return_value.to_dict = MagicMock(return_value=InterfaceOutput.IosxrInterfaceOpsOutput_info) + self.dev2.learn.return_value = learn_2_return_value + self.dev2.api.is_management_interface = MagicMock(return_value=False) + self.assertEqual(len(self.dev2.interfaces), 0) + self.dev2.learn_interfaces() + self.assertEqual(set(self.dev2.interfaces.keys()), xr_interfaces) + # self.dev3.learn.side_effect = InterfaceOutput.NxosInterfaceOpsOutput_info + + def test_learn_interfaces_nxos(self): + self.dev3 = Device(name='PE1', os='nxos') + xr_interfaces = {'Ethernet1/17', 'Mgmt0', 'Ethernet1/15', 'Ethernet1/18', 'Null0', 'Ethernet1/10', 'Ethernet1/12', 'Ethernet1/1', + 'Ethernet2/1', 'Ethernet1/13', 'Ethernet1/14', 'Ethernet1/16', 'Ethernet1/11'} + self.dev3.learn = MagicMock() + learn_3_return_value = MagicMock() + learn_3_return_value.to_dict = MagicMock(return_value=InterfaceOutput.NxosInterfaceOpsOutput_info) + self.dev3.learn.return_value = learn_3_return_value + self.dev3.api.is_management_interface = MagicMock(return_value=False) + self.assertEqual(len(self.dev3.interfaces), 0) + self.dev3.learn_interfaces() + self.assertEqual(set(self.dev3.interfaces.keys()), xr_interfaces) if __name__ == '__main__': unittest.main() diff --git a/pkgs/conf-pkg/src/genie/libs/conf/interface/ios/interface.py b/pkgs/conf-pkg/src/genie/libs/conf/interface/ios/interface.py index 8f7b87e4a..b756415bb 100755 --- a/pkgs/conf-pkg/src/genie/libs/conf/interface/ios/interface.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/interface/ios/interface.py @@ -184,6 +184,7 @@ def __init__(self, *args, **kwargs): class LoopbackInterface(VirtualInterface, genie.libs.conf.interface.LoopbackInterface): _interface_name_types = ( + 'loopback', 'Loopback', ) @@ -194,6 +195,7 @@ def __init__(self, *args, **kwargs): class EthernetInterface(PhysicalInterface, genie.libs.conf.interface.EthernetInterface): _interface_name_types = ( + 'ethernet', 'Ethernet', # TODO verify 'FastEthernet', 'GigabitEthernet', # TODO verify diff --git a/pkgs/conf-pkg/src/genie/libs/conf/interface/iosxr/interface.py b/pkgs/conf-pkg/src/genie/libs/conf/interface/iosxr/interface.py index 159970596..684ddb0ee 100755 --- a/pkgs/conf-pkg/src/genie/libs/conf/interface/iosxr/interface.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/interface/iosxr/interface.py @@ -1934,8 +1934,8 @@ class MgmtMultilinkController(Controller): class LoopbackInterface(VirtualInterface, genie.libs.conf.interface.LoopbackInterface): _interface_name_types = ( + 'loopback', 'Loopback', - 'loopback' ) def __init__(self, *args, **kwargs): @@ -1945,6 +1945,7 @@ def __init__(self, *args, **kwargs): class EthernetInterface(PhysicalInterface, genie.libs.conf.interface.EthernetInterface): _interface_name_types = ( + 'ethernet', 'FastEthernet', 'FASTETHERNET', 'GigabitEthernet', diff --git a/pkgs/conf-pkg/src/genie/libs/conf/lldp/iosxr/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/lldp/iosxr/__init__.py new file mode 100644 index 000000000..32c1aed74 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/lldp/iosxr/__init__.py @@ -0,0 +1,2 @@ +from genie import abstract +abstract.declare_token(os='iosxr') \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/lldp/iosxr/lldp.py b/pkgs/conf-pkg/src/genie/libs/conf/lldp/iosxr/lldp.py new file mode 100644 index 000000000..d9cbe94a5 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/lldp/iosxr/lldp.py @@ -0,0 +1,62 @@ +# import python +from abc import ABC + +# import genie +from genie.conf.base.config import CliConfig +from genie.conf.base.cli import CliConfigBuilder +from genie.conf.base.attributes import UnsupportedAttributeWarning, \ + AttributesHelper, DeviceSubAttributes + + +class Lldp(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) + + # lldp run + if attributes.value('enabled'): + configurations.append_line( + attributes.format('lldp')) + + if apply: + if configurations: + self.device.configure(configurations) + else: + return CliConfig(device=self.device, unconfig=unconfig, + cli_config=configurations) + + def build_unconfig(self, apply=True, attributes=None, **kwargs): + return self.build_config(apply=apply, attributes=attributes, + unconfig=True, **kwargs) + + class InterfaceAttributes(ABC): + + def build_config(self, apply=True, attributes=None, + unconfig=False, **kwargs): + assert not apply + assert not kwargs, kwargs + attributes = AttributesHelper(self, attributes) + configurations = CliConfigBuilder(unconfig=unconfig) + + with configurations.submode_context( + attributes.format('interface {intf}', force=True)): + # lldp transmit + # lldp receive + if attributes.value('if_enabled'): + configurations.append_line( + attributes.format('lldp transmit')) + configurations.append_line( + attributes.format('lldp receive')) + + return str(configurations) + + def build_unconfig(self, apply=True, attributes=None, + **kwargs): + return self.build_config(apply=apply, + attributes=attributes, + unconfig=True, **kwargs) \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/lldp/nxos/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/lldp/nxos/__init__.py new file mode 100644 index 000000000..ffdfe79a0 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/lldp/nxos/__init__.py @@ -0,0 +1,2 @@ +from genie import abstract +abstract.declare_token(os='nxos') \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/lldp/nxos/lldp.py b/pkgs/conf-pkg/src/genie/libs/conf/lldp/nxos/lldp.py new file mode 100644 index 000000000..08d37e564 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/lldp/nxos/lldp.py @@ -0,0 +1,63 @@ + +# import python +from abc import ABC + +# import genie +from genie.conf.base.config import CliConfig +from genie.conf.base.cli import CliConfigBuilder +from genie.conf.base.attributes import UnsupportedAttributeWarning, \ + AttributesHelper, DeviceSubAttributes + + +class Lldp(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) + + # lldp run + if attributes.value('enabled'): + configurations.append_line( + attributes.format('feature lldp')) + + if apply: + if configurations: + self.device.configure(configurations) + else: + return CliConfig(device=self.device, unconfig=unconfig, + cli_config=configurations) + + def build_unconfig(self, apply=True, attributes=None, **kwargs): + return self.build_config(apply=apply, attributes=attributes, + unconfig=True, **kwargs) + + class InterfaceAttributes(ABC): + + def build_config(self, apply=True, attributes=None, + unconfig=False, **kwargs): + assert not apply + assert not kwargs, kwargs + attributes = AttributesHelper(self, attributes) + configurations = CliConfigBuilder(unconfig=unconfig) + + with configurations.submode_context( + attributes.format('interface {intf}', force=True)): + # lldp transmit + # lldp receive + if attributes.value('if_enabled'): + configurations.append_line( + attributes.format('lldp transmit')) + configurations.append_line( + attributes.format('lldp receive')) + + return str(configurations) + + def build_unconfig(self, apply=True, attributes=None, + **kwargs): + return self.build_config(apply=apply, + attributes=attributes, + unconfig=True, **kwargs) \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/mcast/iosxe/tests/test_mcast.py b/pkgs/conf-pkg/src/genie/libs/conf/mcast/iosxe/tests/test_mcast.py index 62bed0931..164462806 100644 --- a/pkgs/conf-pkg/src/genie/libs/conf/mcast/iosxe/tests/test_mcast.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/mcast/iosxe/tests/test_mcast.py @@ -19,14 +19,14 @@ class test_mcast_mroute(TestCase): def setUp(self): - + # Set Genie Tb testbed = Testbed() Genie.testbed = testbed - + # Device self.dev1 = Device(name='PE1', testbed=testbed, os='iosxe') - + # Mcast object self.mcast = Mcast() diff --git a/pkgs/filetransferutils-pkg/changelog/2024/september.rst b/pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/__init__.py similarity index 100% rename from pkgs/filetransferutils-pkg/changelog/2024/september.rst rename to pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/__init__.py diff --git a/pkgs/health-pkg/changelog/2024/september.rst b/pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/iosxe/__init__.py similarity index 100% rename from pkgs/health-pkg/changelog/2024/september.rst rename to pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/iosxe/__init__.py diff --git a/pkgs/conf-pkg/src/genie/libs/conf/lldp/iosxe/tests/test_lldp.py b/pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/iosxe/test_lldp.py similarity index 100% rename from pkgs/conf-pkg/src/genie/libs/conf/lldp/iosxe/tests/test_lldp.py rename to pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/iosxe/test_lldp.py diff --git a/pkgs/robot-pkg/changelog/2024/september.rst b/pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/iosxr/__init__.py similarity index 100% rename from pkgs/robot-pkg/changelog/2024/september.rst rename to pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/iosxr/__init__.py diff --git a/pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/iosxr/test_lldp.py b/pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/iosxr/test_lldp.py new file mode 100644 index 000000000..26bc26035 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/iosxr/test_lldp.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +# Python +import unittest +from unittest.mock import Mock + +# Genie +from genie.tests.conf import TestCase +from genie.conf import Genie +from genie.conf.base import Testbed, Device + +# Stp +from genie.libs.conf.lldp import Lldp + + +class test_lldp(TestCase): + + def setUp(self): + + # Set Genie Tb + testbed = Testbed() + Genie.testbed = testbed + + # Device + self.dev1 = Device(name='PE1', testbed=testbed, os='iosxr') + + def test_lldp_full_config(self): + + # For failures + self.maxDiff = None + + # Pim object + lldp = Lldp() + self.dev1.add_feature(lldp) + + lldp.device_attr[self.dev1].enabled = True + + cfgs = lldp.build_config(apply=False) + # Check config built correctly + self.assertMultiLineEqual(str(cfgs[self.dev1.name]), '\n'.\ + join([ + 'lldp', + ])) + + cfgs = lldp.build_unconfig(apply=False) + + # Check config built correctly + self.assertMultiLineEqual(str(cfgs[self.dev1.name]), '\n'.\ + join([ + 'no lldp', + ])) + + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/nxos/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/nxos/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/nxos/test_lldp.py b/pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/nxos/test_lldp.py new file mode 100644 index 000000000..71c9bbdfc --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/tests/lldp/nxos/test_lldp.py @@ -0,0 +1,54 @@ + +# Python +import unittest +from unittest.mock import Mock + +# Genie +from genie.tests.conf import TestCase +from genie.conf import Genie +from genie.conf.base import Testbed, Device + +# Stp +from genie.libs.conf.lldp import Lldp + + +class test_lldp(TestCase): + + def setUp(self): + + # Set Genie Tb + testbed = Testbed() + Genie.testbed = testbed + + # Device + self.dev1 = Device(name='PE1', testbed=testbed, os='nxos') + + def test_lldp_full_config(self): + + # For failures + self.maxDiff = None + + # Pim object + lldp = Lldp() + self.dev1.add_feature(lldp) + + lldp.device_attr[self.dev1].enabled = True + + cfgs = lldp.build_config(apply=False) + # Check config built correctly + self.assertMultiLineEqual(str(cfgs[self.dev1.name]), '\n'.\ + join([ + 'feature lldp', + ])) + + cfgs = lldp.build_unconfig(apply=False) + + # Check config built correctly + self.assertMultiLineEqual(str(cfgs[self.dev1.name]), '\n'.\ + join([ + 'no feature lldp', + ])) + + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py index f5c97f1e5..38bfc4729 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.8' +__version__ = '24.9' __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/filetransferutils-pkg/src/genie/libs/filetransferutils/plugins/iosxr/fileutils.py b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/plugins/iosxr/fileutils.py index e068694fd..8bd657489 100644 --- a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/plugins/iosxr/fileutils.py +++ b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/plugins/iosxr/fileutils.py @@ -1,7 +1,9 @@ """ File utils base class for IOSXR devices. """ +import logging # Parent inheritance from .. import FileUtils as FileUtilsDeviceBase +from urllib.parse import urlparse # Dir parser try: @@ -14,7 +16,8 @@ # Unicon from unicon.core.errors import SubCommandFailure - +DEFAULT_PORTS = {'ftp': 21, 'tftp': 69, 'scp': 22, 'sftp': 22, 'http': 80} +logger = logging.getLogger(__name__) class FileUtils(FileUtilsDeviceBase): def copyfile(self, @@ -507,3 +510,46 @@ def send_cli_to_device(self, return output else: raise SubCommandFailure('File was not successfully copied') + + def validate_and_update_url(self, url, device=None, **kwargs ): + """Validate the url and replace the hostname/address with a + reachable address from the testbed""" + parsed_url = urlparse(url) + protocol = self.get_protocol(url) + if protocol != 'ftp': + return super().validate_and_update_url(url, device=device, **kwargs) + if hasattr(device,'version') and device.version: + version = device.version + else: + try: + out = device.parse('show version') + except Exception as e: + logger.error(f'Could not copy file because of {e}') + raise e + version = out.get('software_version') + if version and int(version.split('.')[0]) >= 7: + # if there is a host name, this means the address is remote + if parsed_url.hostname: + # get hostname to check for valid ip + hostname = self.get_hostname(parsed_url.hostname, device=device, **kwargs) + + # Append port if it's defined + server_block = self.get_server_block( + server_name_or_ip = parsed_url.hostname, device = device) + port = server_block.get('port') + if port and port != DEFAULT_PORTS[protocol]: + hostname = '%s:%s' % (hostname, str(port)) + # Make sure we don't replace the protocol when the hostname has the + # same name eg. ftp://ftp/path/to/file + if protocol and url.startswith(protocol): + url = protocol + url[len(protocol):].replace( + parsed_url.hostname, hostname, 1) + else: + url = url.replace(parsed_url.hostname, hostname, 1) + return url + + # just return url if it's local + else: + return url + else: + return super().validate_and_update_url(url, device=None, **kwargs) \ No newline at end of file diff --git a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/tests/iosxr/test_filetransferutils.py b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/tests/iosxr/test_filetransferutils.py index a877f3e28..fc454f033 100644 --- a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/tests/iosxr/test_filetransferutils.py +++ b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/tests/iosxr/test_filetransferutils.py @@ -108,6 +108,14 @@ class test_filetransferutils(unittest.TestCase): Transferred 11332 Bytes 11332 bytes copied in 0 sec (251822)bytes/sec ''' + raw8 = ''' + copy ftp://SERVER-IP/IOS-eXR/7.4.2/ASR9K.IOS-eXR7.4.2.All-SMUs.20230501.tar harddisk:/tmp-ALL-v7.4.2-PyATS/ASR9K.IOS-eXR7.4.2.All-SMUs.20230501.tar + Thu Feb 29 10:32:44.460 EST + Source username: [anonymous]?SERVER-USERNAME + Source password: + Destination filename [/harddisk:/tmp-ALL-v7.4.2-PyATS/ASR9K.IOS-eXR7.4.2.All-SMUs.20230501.tar]? + Accessing ftp://SERVER-USERNAME:*@SERVER-IP/IOS-eXR/7.4.2/ASR9K.IOS-eXR7.4.2.All-SMUs.20230501.tar + ''' outputs = {} outputs['copy disk0:/fake_config_2.tcl ' 'ftp://myuser:mypw@1.1.1.1//auto/tftp-ssr/fake_config_2.tcl'] = raw1 @@ -118,6 +126,7 @@ class test_filetransferutils(unittest.TestCase): outputs['copy running-config ftp://10.1.6.242//auto/tftp-ssr/fake_config_2.tcl'] = \ raw6 outputs['sftp running-config myuser@1.1.1.1:/home/virl'] = raw7 + outputs['copy running-config ftp://1.1.1.1//home/virl'] = raw7 def mapper(self, key, timeout=None, reply= None, prompt_recovery=False, error_pattern=None): return self.outputs[key] @@ -125,6 +134,8 @@ def test_copyfile(self): self.device.execute = Mock() self.device.execute.side_effect = self.mapper + self.device.parse = Mock() + self.device.parse.return_value = {'software_version':'6.1.2'} # Call copyfiles self.fu_device.copyfile(source='disk0:/fake_config_2.tcl', @@ -204,6 +215,17 @@ def test_copyconfiguration(self): self.fu_device.copyconfiguration(source='running-config', destination='ftp://10.1.6.242//auto/tftp-ssr/fake_config_2.tcl', timeout_seconds=300, device=self.device) + + def test_copyfile_ftp(self): + self.device.execute = Mock() + self.device.parse = Mock() + self.device.parse.return_value = {'software_version':'7.1.2'} + self.device.execute.side_effect = self.mapper + + # Call copyfiles + self.fu_device.copyfile(source='running-config', + destination='ftp://1.1.1.1//home/virl', + device=self.device) if __name__ == '__main__': diff --git a/pkgs/health-pkg/src/genie/libs/health/__init__.py b/pkgs/health-pkg/src/genie/libs/health/__init__.py index 5d66bde09..80c8edd7e 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.8' +__version__ = '24.9' __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/august.rst b/pkgs/ops-pkg/changelog/2024/august.rst index fe67f0e01..e69de29bb 100644 --- a/pkgs/ops-pkg/changelog/2024/august.rst +++ b/pkgs/ops-pkg/changelog/2024/august.rst @@ -1,9 +0,0 @@ --------------------------------------------------------------------------------- - New --------------------------------------------------------------------------------- - -* iosxe - * cat9k - * Use the cmd string format instead of importing the module. - - diff --git a/pkgs/ops-pkg/changelog/2024/september.rst b/pkgs/ops-pkg/changelog/2024/september.rst deleted file mode 100644 index fe67f0e01..000000000 --- a/pkgs/ops-pkg/changelog/2024/september.rst +++ /dev/null @@ -1,9 +0,0 @@ --------------------------------------------------------------------------------- - New --------------------------------------------------------------------------------- - -* iosxe - * cat9k - * Use the cmd string format instead of importing the module. - - diff --git a/pkgs/ops-pkg/ops_generator/output/github_ops.json b/pkgs/ops-pkg/ops_generator/output/github_ops.json index 8f6436610..e483e8682 100644 --- a/pkgs/ops-pkg/ops_generator/output/github_ops.json +++ b/pkgs/ops-pkg/ops_generator/output/github_ops.json @@ -564,7 +564,7 @@ "os": "iosxe" }, "uid": "interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/interface.py#L17" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/interface.py#L20" }, "iosxr": { "class": "Interface", @@ -580,6 +580,19 @@ "nxos": { "class": "Interface", "doc": "Interface Genie Ops Object", + "folders": { + "rev1": { + "class": "Interface", + "doc": "Interface Genie Ops Object", + "module_name": "interface.nxos.rev1.interface", + "package": "genie.libs.ops", + "tokens": { + "revision": "1" + }, + "uid": "interface", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/rev1/interface.py#L21" + } + }, "module_name": "interface.nxos.interface", "package": "genie.libs.ops", "tokens": { @@ -1730,6 +1743,9 @@ "cat9k", "xml", "yang" + ], + "revision": [ + "1" ] }, "vlan": { diff --git a/pkgs/ops-pkg/src/genie/libs/ops/__init__.py b/pkgs/ops-pkg/src/genie/libs/ops/__init__.py index cd3223852..d25c59f7e 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.8' +__version__ = '24.9' __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/ops-pkg/src/genie/libs/ops/igmp/iosxe/igmp.py b/pkgs/ops-pkg/src/genie/libs/ops/igmp/iosxe/igmp.py index 1f49e07da..dbe74e6c6 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/igmp/iosxe/igmp.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/igmp/iosxe/igmp.py @@ -1,4 +1,4 @@ -''' +''' IGMP Genie Ops Object for IOSXE - CLI. ''' # super class @@ -19,7 +19,7 @@ def keys(self, item): def learn(self): '''Learn IGMP Ops''' - # get vrf list + # get vrf list self.add_leaf(cmd=ShowVrfDetail, src='', dest='list_of_vrfs', @@ -30,9 +30,9 @@ def learn(self): vrf_list = ['default'] try: vrf_list.extend(self.list_of_vrfs) - except: + except Exception: pass - else: + else: # delete the list_of_vrfs in the info table del self.list_of_vrfs @@ -45,13 +45,13 @@ def learn(self): # create kwargs vrf_name = '' if vrf == 'default' else vrf - + ######################################################################## # info ######################################################################## # max_groups - self.add_leaf(cmd='show ip igmp vrf {vrf} interface'.format(vrf=vrf), + self.add_leaf(cmd=f'show ip igmp vrf {vrf} interface' if vrf_name else 'show ip igmp interface', src='[vrf][(?P.*)][global_max_groups]', dest='info[vrfs][(?P.*)][max_groups]', vrf=vrf_name) @@ -67,27 +67,27 @@ def learn(self): # -- enable, last_member_query_interval, group_policy # -- max_groups, query_interval, query_max_response_time # -- oper_status, querier - # + # # immediate_leave, robustness_variable are not supported on iosxe req_keys = ['[enable]', '[last_member_query_interval]', '[group_policy]', '[max_groups]', '[query_interval]', '[query_max_response_time]', '[oper_status]', '[querier]'] for key in req_keys: - self.add_leaf(cmd='show ip igmp vrf {vrf} interface'.format(vrf=vrf), + self.add_leaf(cmd=f'show ip igmp vrf {vrf} interface' if vrf_name else 'show ip igmp interface', src=src + '[{}]'.format(key), dest=dest + '[{}]'.format(key), vrf=vrf_name) # version - self.add_leaf(cmd='show ip igmp vrf {vrf} interface'.format(vrf=vrf), + self.add_leaf(cmd=f'show ip igmp vrf {vrf} interface' if vrf_name else 'show ip igmp interface', src=src + '[router_version]', dest=dest + '[version]', vrf=vrf_name) # interfaces # -- joined_group - self.add_leaf(cmd='show ip igmp vrf {vrf} interface'.format(vrf=vrf), + self.add_leaf(cmd=f'show ip igmp vrf {vrf} interface' if vrf_name else 'show ip igmp interface', src=src + '[joined_group]', dest=dest + '[joined_group]', vrf=vrf_name, @@ -112,7 +112,7 @@ def learn(self): '[group][(?P.*)][source][(?P.*)][expire]', '[group][(?P.*)][source][(?P.*)][last_reporter]'] for key in req_keys: - self.add_leaf(cmd='show ip igmp vrf {vrf} groups detail'.format(vrf=vrf), + self.add_leaf(cmd=f'show ip igmp vrf {vrf} groups detail' if vrf_name else 'show ip igmp groups detail', src=src + '[{}]'.format(key), dest=dest + '[{}]'.format(key), vrf=vrf_name) @@ -120,7 +120,6 @@ def learn(self): # make to write in cache self.make() - if not hasattr(self, 'info'): continue @@ -143,12 +142,11 @@ def learn(self): req_keys = ['[ssm_map][(?P.*)][source_addr]', '[ssm_map][(?P.*)][group_address]'] for key in req_keys: - self.add_leaf(cmd='show ip igmp vrf {vrf} ssm-mapping {group}' \ - .format(vrf=vrf, group=group), + self.add_leaf(cmd=f'show ip igmp vrf {vrf} ssm-mapping {group}' if vrf_name else + f'show ip igmp ssm-mapping {group}', src=src + '[{}]'.format(key), dest=dest + '[{}]'.format(key), group=group, vrf=vrf_name) - # make to write in cache - self.make(final_call=True) \ No newline at end of file + self.make(final_call=True) diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/cheetah/ap/interface.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/cheetah/ap/interface.py index e82f363a5..4bf1130e3 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/interface/cheetah/ap/interface.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/cheetah/ap/interface.py @@ -10,7 +10,7 @@ class Interface(SuperInterface): '''Interface Genie Ops Object''' - def learn(self, custom=None, interface=None, vrf=None, address_family=None): + def learn(self, custom=None, interface=None, vrf=None, address_family=None, **kwargs): '''Learn Interface Ops''' ######################################################################## # info diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/asr1k/interface.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/asr1k/interface.py index a06e4f1b2..c2b8016aa 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/asr1k/interface.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/asr1k/interface.py @@ -14,7 +14,7 @@ class Interface(CommonInterface): '''Interface Genie Ops Object''' - def learn(self, interface='', address_family='', custom=None): + def learn(self, interface='', address_family='', custom=None, **kwargs): '''Learn Interface Ops''' # ====================================================================== diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/cat3k/c3850/interface.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/cat3k/c3850/interface.py index 3f6d76165..70eb8dd66 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/cat3k/c3850/interface.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/cat3k/c3850/interface.py @@ -14,7 +14,7 @@ class Interface(CommonInterface): '''Interface Genie Ops Object''' - def learn(self, interface='', address_family='', custom=None): + def learn(self, interface='', address_family='', custom=None, **kwargs): '''Learn Interface Ops''' # ====================================================================== diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/interface.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/interface.py index 4e5eda9ee..5b093d1d6 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/interface.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/interface.py @@ -2,22 +2,25 @@ Interface Genie Ops Object for IOSXE - CLI. ''' - +import logging # super class from genie.libs.ops.interface.interface import Interface as SuperInterface # commands show_vrf = "show vrf" show_interfaces = "show interfaces" +show_interfaces_include = "line protocol|Hardware is|BW" show_ip_interface = "show ip interface" +show_ip_interface_include = "line protocol|Internet address" show_ipv6_interface = "show ipv6 interface" +show_ipv6_interface_include = "protocol|address|subnet" show_interfaces_accounting = "show interfaces accounting" class Interface(SuperInterface): '''Interface Genie Ops Object''' - def learn(self, custom=None, interface=None, vrf=None, address_family=None): + def learn(self, custom=None, interface=None, vrf=None, address_family=None, brief=False, **kwargs): '''Learn Interface Ops''' ######################################################################## # info @@ -31,25 +34,48 @@ def learn(self, custom=None, interface=None, vrf=None, address_family=None): '[mac_address]', '[auto_negotiate]', '[port_channel]', '[duplex_mode]', '[medium]', '[delay]'] + # Attribute filtering is not working for show_vrf, disabling and restoring after + + # save attributes + attrs = self.attributes + self.attributes = None + self.maker.attributes = None self.add_leaf(cmd=show_vrf, src='vrf[(?P.*)][interfaces]', dest='info[vrf][(?P.*)][interfaces]', vrf=vrf) self.make() + # restore attributes + self.attributes = attrs + self.maker.attributes = attrs + if vrf: for intf in self.info['vrf'][vrf]['interfaces']: for key in req_keys: - self.add_leaf(cmd=show_interfaces, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), - interface=intf) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=intf, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=intf) else: for key in req_keys: - self.add_leaf(cmd=show_interfaces, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), - interface=interface) - + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=interface, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=interface) # make to write in cache @@ -118,10 +144,17 @@ def learn(self, custom=None, interface=None, vrf=None, address_family=None): 'out_errors', 'last_clear'] for key in req_keys: - self.add_leaf(cmd=show_interfaces, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), - interface=intf) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=intf, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=intf) # Global source - counters | rate src = '[(?P.*)][counters][rate]' @@ -130,10 +163,17 @@ def learn(self, custom=None, interface=None, vrf=None, address_family=None): req_keys = ['load_interval', 'in_rate', 'in_rate_pkts', 'out_rate', 'out_rate_pkts'] for key in req_keys: - self.add_leaf(cmd=show_interfaces, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), - interface=intf) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=intf, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=intf) # ====================================================================== # encapsulation @@ -146,10 +186,17 @@ def learn(self, custom=None, interface=None, vrf=None, address_family=None): req_keys = ['encapsulation', 'first_dot1q', 'second_dot1q'] for key in req_keys: - self.add_leaf(cmd=show_interfaces, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), - interface=intf) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=intf, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=intf) # ====================================================================== # accounting @@ -159,22 +206,23 @@ def learn(self, custom=None, interface=None, vrf=None, address_family=None): src = '[(?P.*)]' dest = 'info[(?P.*)]' - cmd = show_interfaces_accounting - if custom and cmd in custom.keys(): - if 'intf' in custom[cmd].keys(): - self.add_leaf(cmd=cmd, - src=src + '[accounting]', - dest=dest + '[accounting]', - interface=custom[cmd]['intf']) - else: - self.add_leaf(cmd=cmd, - src=src + '[accounting]', - dest=dest + '[accounting]') + if not brief: + cmd = show_interfaces_accounting + if custom and cmd in custom.keys(): + if 'intf' in custom[cmd].keys(): + self.add_leaf(cmd=cmd, + src=src + '[accounting]', + dest=dest + '[accounting]', + interface=custom[cmd]['intf']) + else: + self.add_leaf(cmd=cmd, + src=src + '[accounting]', + dest=dest + '[accounting]') - self.add_leaf(cmd=cmd, - src=src + '[accounting]', - dest=dest + '[accounting]', - interface=intf) + self.add_leaf(cmd=cmd, + src=src + '[accounting]', + dest=dest + '[accounting]', + interface=intf) # ====================================================================== # ipv4 @@ -188,19 +236,32 @@ def learn(self, custom=None, interface=None, vrf=None, address_family=None): req_keys = ['ip', 'prefix_length', 'secondary', 'origin'] # custom for key in req_keys: - self.add_leaf(cmd=show_ip_interface, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), interface=intf) + if brief: + self.add_leaf(cmd=show_ip_interface, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf, + include=show_ip_interface_include) + else: + self.add_leaf(cmd=show_ip_interface, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf) # route_tag --- This is not supported on IOSXE # secondary_vrf --- This is not supported on IOSXE # unnumbered - self.add_leaf(cmd=show_interfaces, - src='[(?P.*)][ipv4][unnumbered]', - dest='info[(?P.*)][ipv4][unnumbered]', - interface=intf) + if brief: + self.add_leaf(cmd=show_interfaces, + src='[(?P.*)][ipv4][unnumbered]', + dest='info[(?P.*)][ipv4][unnumbered]', + interface=intf, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src='[(?P.*)][ipv4][unnumbered]', + dest='info[(?P.*)][ipv4][unnumbered]', + interface=intf) # ====================================================================== # ipv6 @@ -215,9 +276,16 @@ def learn(self, custom=None, interface=None, vrf=None, address_family=None): 'unnumbered'] for key in req_keys: - self.add_leaf(cmd=show_ipv6_interface, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), interface=intf) + if brief: + self.add_leaf(cmd=show_ipv6_interface, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=intf, + include=show_ipv6_interface_include) + else: + self.add_leaf(cmd=show_ipv6_interface, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf) else: src = '[(?P.*)][counters]' dest = 'info[(?P.*)][counters]' @@ -231,10 +299,16 @@ def learn(self, custom=None, interface=None, vrf=None, address_family=None): for key in req_keys: - self.add_leaf(cmd=show_interfaces, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), - interface=interface) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=interface, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface) # Global source - counters | rate @@ -244,10 +318,17 @@ def learn(self, custom=None, interface=None, vrf=None, address_family=None): req_keys = ['load_interval', 'in_rate', 'in_rate_pkts', 'out_rate', 'out_rate_pkts'] for key in req_keys: - self.add_leaf(cmd=show_interfaces, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), - interface=interface) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=interface, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=interface) # ====================================================================== # encapsulation @@ -261,10 +342,17 @@ def learn(self, custom=None, interface=None, vrf=None, address_family=None): req_keys = ['encapsulation', 'first_dot1q', 'second_dot1q'] for key in req_keys: - self.add_leaf(cmd=show_interfaces, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), - interface=interface) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=interface, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=interface) # ====================================================================== # accounting @@ -274,22 +362,23 @@ def learn(self, custom=None, interface=None, vrf=None, address_family=None): src = '[(?P.*)]' dest = 'info[(?P.*)]' - cmd = show_interfaces_accounting - if custom and cmd in custom.keys(): - if 'intf' in custom[cmd].keys(): - self.add_leaf(cmd=cmd, - src=src + '[accounting]', - dest=dest + '[accounting]', - interface=custom[cmd]['intf']) - else: - self.add_leaf(cmd=cmd, - src=src + '[accounting]', - dest=dest + '[accounting]') + if not brief: + cmd = show_interfaces_accounting + if custom and cmd in custom.keys(): + if 'intf' in custom[cmd].keys(): + self.add_leaf(cmd=cmd, + src=src + '[accounting]', + dest=dest + '[accounting]', + interface=custom[cmd]['intf']) + else: + self.add_leaf(cmd=cmd, + src=src + '[accounting]', + dest=dest + '[accounting]') - self.add_leaf(cmd=cmd, - src=src + '[accounting]', - dest=dest + '[accounting]', - interface=interface) + self.add_leaf(cmd=cmd, + src=src + '[accounting]', + dest=dest + '[accounting]', + interface=interface) # ====================================================================== @@ -304,9 +393,17 @@ def learn(self, custom=None, interface=None, vrf=None, address_family=None): req_keys = ['ip', 'prefix_length', 'secondary', 'origin'] # custom for key in req_keys: - self.add_leaf(cmd=show_ip_interface, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), interface=interface) + if brief: + self.add_leaf(cmd=show_ip_interface, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=interface, + include=show_ip_interface_include) + else: + self.add_leaf(cmd=show_ip_interface, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=interface) # route_tag --- This is not supported on IOSXE @@ -314,10 +411,17 @@ def learn(self, custom=None, interface=None, vrf=None, address_family=None): # secondary_vrf --- This is not supported on IOSXE # unnumbered - self.add_leaf(cmd=show_interfaces, - src='[(?P.*)][ipv4][unnumbered]', - dest='info[(?P.*)][ipv4][unnumbered]', - interface=interface) + if brief: + self.add_leaf(cmd=show_interfaces, + src='[(?P.*)][ipv4][unnumbered]', + dest='info[(?P.*)][ipv4][unnumbered]', + interface=interface, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src='[(?P.*)][ipv4][unnumbered]', + dest='info[(?P.*)][ipv4][unnumbered]', + interface=interface) # ====================================================================== # ipv6 @@ -333,9 +437,17 @@ def learn(self, custom=None, interface=None, vrf=None, address_family=None): 'unnumbered'] for key in req_keys: - self.add_leaf(cmd=show_ipv6_interface, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), interface=interface) + if brief: + self.add_leaf(cmd=show_ipv6_interface, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=interface, + include=show_ipv6_interface_include) + else: + self.add_leaf(cmd=show_ipv6_interface, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), + interface=interface) # route_tag --- This is not supported on IOSXE diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/tests/interface_output.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/tests/interface_output.py index 8e7823853..712d9da4a 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/tests/interface_output.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/tests/interface_output.py @@ -988,3 +988,79 @@ class InterfaceOutput(object): "bandwidth": 1000000 }, } + + ShowInterfaces_Brief =''' + GigabitEthernet0/0/0 is administratively down, line protocol is down + Hardware is ISR4221-2x1GE, address is 70ea.1ab5.49b0 (bia 70ea.1ab5.49b0) + MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, + GigabitEthernet0/0/1 is administratively down, line protocol is down + Hardware is ISR4221-2x1GE, address is 70ea.1ab5.49b1 (bia 70ea.1ab5.49b1) + MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, + GigabitEthernet0/1/0 is administratively down, line protocol is down + Hardware is NIM-1GE-CU-SFP, address is 70ea.1ab5.49b8 (bia 70ea.1ab5.49b8) + MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, + GigabitEthernet0/2/0 is administratively down, line protocol is down + Hardware is NIM-1GE-CU-SFP, address is 70ea.1ab5.49c0 (bia 70ea.1ab5.49c0) + MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, + ''' + ShowIpInterface_Brief = ''' + GigabitEthernet0/0/0 is administratively down, line protocol is down + GigabitEthernet0/0/1 is administratively down, line protocol is down + GigabitEthernet0/1/0 is administratively down, line protocol is down + GigabitEthernet0/2/0 is administratively down, line protocol is down + ''' + ShowIpv6Interface_Brief = ''' + GigabitEthernet0/0/0 is administratively down, line protocol is down + IPv6 is tentative, link-local address is FE80::72EA:1AFF:FEB5:49B0 [TEN] + No Virtual link-local address(es): + Stateless address autoconfig enabled + No global unicast address is configured + Joined group address(es): + Hosts use stateless autoconfig for addresses. + ''' + InterfaceOpsBriefOutput_info = { + 'GigabitEthernet0/0/0': {'bandwidth': 1000000, + 'delay': 10, + 'enabled': False, + 'ipv6': {'FE80::72EA:1AFF:FEB5:49B0': {'ip': 'FE80::72EA:1AFF:FEB5:49B0', + 'origin': 'link_layer', + 'status': 'tentative'}}, + 'mac_address': '70ea.1ab5.49b0', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '70ea.1ab5.49b0', + 'port_channel': {'port_channel_member': False}, + 'switchport_enable': False, + 'type': 'ISR4221-2x1GE'}, + 'GigabitEthernet0/0/1': {'bandwidth': 1000000, + 'delay': 10, + 'enabled': False, + 'mac_address': '70ea.1ab5.49b1', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '70ea.1ab5.49b1', + 'port_channel': {'port_channel_member': False}, + 'switchport_enable': False, + 'type': 'ISR4221-2x1GE'}, + 'GigabitEthernet0/1/0': {'bandwidth': 1000000, + 'delay': 10, + 'enabled': False, + 'mac_address': '70ea.1ab5.49b8', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '70ea.1ab5.49b8', + 'port_channel': {'port_channel_member': False}, + 'switchport_enable': False, + 'type': 'NIM-1GE-CU-SFP'}, + 'GigabitEthernet0/2/0': {'bandwidth': 1000000, + 'delay': 10, + 'enabled': False, + 'mac_address': '70ea.1ab5.49c0', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '70ea.1ab5.49c0', + 'port_channel': {'port_channel_member': False}, + 'switchport_enable': False, + 'type': 'NIM-1GE-CU-SFP'}, + 'GigabitEthernet1/0/1': {'switchport_enable': False, 'vrf': 'VRF1'}, + 'GigabitEthernet1/0/2': {'switchport_enable': False, 'vrf': 'Mgmt-intf'}} \ No newline at end of file diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/tests/test_interface.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/tests/test_interface.py index 492064ef4..46d039d4e 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/tests/test_interface.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxe/tests/test_interface.py @@ -32,6 +32,12 @@ outputs['show ip interface'] = InterfaceOutput.ShowIpInterfaces_all outputs['show ipv6 interface'] = InterfaceOutput.ShowIpv6Interfaces_all outputs['show interfaces accounting'] = InterfaceOutput.ShowInterfacesAccounting_all +outputs['show interfaces accounting'] = InterfaceOutput.ShowInterfacesAccounting_all +outputs['show interfaces accounting'] = InterfaceOutput.ShowInterfacesAccounting_all +outputs['show interfaces | include line protocol|Hardware is|BW'] = InterfaceOutput.ShowInterfaces_Brief +outputs['show ip interface | include line protocol|Internet address'] = InterfaceOutput.ShowIpInterface_Brief +outputs['show ipv6 interface | include protocol|address|subnet'] = InterfaceOutput.ShowIpv6Interface_Brief + def mapper(key, **kwargs): return outputs[key] @@ -157,5 +163,14 @@ def test_incomplete_output(self): self.assertDictEqual(intf.info, expect_dict) + def test_brief_output(self): + self.maxDiff = None + intf = Interface(device=self.device) + + # Learn the feature + intf.learn(brief=True) + # Verify Ops was created successfully + self.assertDictEqual(intf.info, InterfaceOutput.InterfaceOpsBriefOutput_info) + if __name__ == '__main__': unittest.main() diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxr/interface.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxr/interface.py index 0985a37d4..cba4a8e2a 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxr/interface.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/iosxr/interface.py @@ -20,7 +20,7 @@ class Interface(SuperInterface): '''Interface Genie Ops Object''' - def learn(self, custom=None, interface=None, vrf=None, address_family=None): + def learn(self, custom=None, interface=None, vrf=None, address_family=None, **kwargs): '''Learn Interface Ops''' ######################################################################## # info diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/interface.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/interface.py index 45af45105..0e6a7850c 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/interface.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/interface.py @@ -7,12 +7,12 @@ # super class from genie.libs.ops.interface.interface import Interface as SuperInterface -# nxos show_interface -from genie.libs.parser.nxos.show_interface import ShowInterface, ShowVrfAllInterface,\ +from genie.libs.parser.nxos.show_interface import ShowVrfAllInterface,\ ShowIpv6InterfaceVrfAll, ShowIpInterfaceVrfAll,\ ShowInterfaceSwitchport from genie.libs.parser.nxos.show_routing import ShowRoutingIpv6VrfAll, ShowRoutingVrfAll - +show_interfaces = "show interface" +show_interfaces_include = '" is (up|down)|Hardware:|BW"' class Interface(SuperInterface): '''Interface Genie Ops Object''' @@ -20,7 +20,7 @@ class Interface(SuperInterface): def convert_intf_name(self, item): return item.capitalize() - def learn(self, interface=None, vrf=None, address_family=None): + def learn(self, interface=None, vrf=None, address_family=None, brief=False, **kwargs ): '''Learn Interface Ops''' ######################################################################## # info @@ -54,18 +54,28 @@ def learn(self, interface=None, vrf=None, address_family=None): if vrf: for intf in self.info: for src_key_path, dest_key_path in req_keys_path.items(): - self.add_leaf(cmd=ShowInterface, - src=src + src_key_path, - dest=dest + dest_key_path, - interface=intf) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + src_key_path, + dest=dest + dest_key_path, + interface=intf, include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + src_key_path, + dest=dest + dest_key_path, + interface=intf) else: for src_key_path, dest_key_path in req_keys_path.items(): - self.add_leaf(cmd=ShowInterface, - src=src + src_key_path, - dest=dest + dest_key_path, - interface=interface) - - + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + src_key_path, + dest=dest + dest_key_path, + interface=interface, include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + src_key_path, + dest=dest + dest_key_path, + interface=interface) req_keys = ['access_vlan', 'trunk_vlans', 'switchport_mode', @@ -73,18 +83,24 @@ def learn(self, interface=None, vrf=None, address_family=None): if vrf: for intf in self.info: for key in req_keys: - self.add_leaf(cmd=ShowInterfaceSwitchport, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), interface=intf) + if not brief: + self.add_leaf(cmd=ShowInterfaceSwitchport, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf) # ====================================================================== # flow_control # ====================================================================== # flow_control - self.add_leaf(cmd=ShowInterface, - src=src + '[flow_control]', - dest=dest + '[flow_control]', interface=intf) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[flow_control]', + dest=dest + '[flow_control]', interface=intf, include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[flow_control]', + dest=dest + '[flow_control]', interface=intf) # ====================================================================== # accounting @@ -97,10 +113,14 @@ def learn(self, interface=None, vrf=None, address_family=None): # ====================================================================== # port_channel - self.add_leaf(cmd=ShowInterface, - src=src + '[port_channel]', - dest=dest + '[port_channel]', interface=intf) - + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[port_channel]', + dest=dest + '[port_channel]', interface=intf, include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[port_channel]', + dest=dest + '[port_channel]', interface=intf) # ====================================================================== # counters # ====================================================================== @@ -117,9 +137,15 @@ def learn(self, interface=None, vrf=None, address_family=None): 'out_errors', 'last_clear','out_mac_pause_frames'] for key in req_keys: - self.add_leaf(cmd=ShowInterface, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), interface=intf) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf, include=show_interfaces_include ) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf ) + # Global source - counters | rate @@ -130,7 +156,12 @@ def learn(self, interface=None, vrf=None, address_family=None): 'out_rate', 'out_rate_pkts'] for key in req_keys: - self.add_leaf(cmd=ShowInterface, + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf, include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, src=src + '[{}]'.format(key), dest=dest + '[{}]'.format(key), interface=intf) @@ -146,23 +177,34 @@ def learn(self, interface=None, vrf=None, address_family=None): req_keys = ['encapsulation', 'first_dot1q', 'native_vlan'] for key in req_keys: - self.add_leaf(cmd=ShowInterface, + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf, include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, src=src + '[{}]'.format(key), dest=dest + '[{}]'.format(key), interface=intf) else: - for key in req_keys: - self.add_leaf(cmd=ShowInterfaceSwitchport, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), interface=interface) + if not brief: + for key in req_keys: + self.add_leaf(cmd=ShowInterfaceSwitchport, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface) # ====================================================================== # flow_control # ====================================================================== # flow_control - self.add_leaf(cmd=ShowInterface, - src=src + '[flow_control]', - dest=dest + '[flow_control]', interface=interface) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[flow_control]', + dest=dest + '[flow_control]', interface=interface, include= show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[flow_control]', + dest=dest + '[flow_control]', interface=interface) # ====================================================================== # accounting @@ -175,10 +217,14 @@ def learn(self, interface=None, vrf=None, address_family=None): # ====================================================================== # port_channel - self.add_leaf(cmd=ShowInterface, - src=src + '[port_channel]', - dest=dest + '[port_channel]', interface=interface) - + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[port_channel]', + dest=dest + '[port_channel]', interface=interface, include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[port_channel]', + dest=dest + '[port_channel]', interface=interface) # ====================================================================== # counters # ====================================================================== @@ -195,9 +241,14 @@ def learn(self, interface=None, vrf=None, address_family=None): 'out_errors', 'last_clear', 'out_mac_pause_frames'] for key in req_keys: - self.add_leaf(cmd=ShowInterface, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), interface=interface) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface, include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface) # Global source - counters | rate src = '[(?P{convert_intf_name})][counters][rate]' @@ -207,9 +258,15 @@ def learn(self, interface=None, vrf=None, address_family=None): 'out_rate', 'out_rate_pkts'] for key in req_keys: - self.add_leaf(cmd=ShowInterface, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), interface=interface) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface, include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface) + # ====================================================================== # encapsulation @@ -222,9 +279,14 @@ def learn(self, interface=None, vrf=None, address_family=None): req_keys = ['encapsulation', 'first_dot1q', 'native_vlan'] for key in req_keys: - self.add_leaf(cmd=ShowInterface, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), interface=interface) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface, include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface) # ====================================================================== # ipv4 @@ -236,57 +298,67 @@ def learn(self, interface=None, vrf=None, address_family=None): dest = 'info[(?P{convert_intf_name})][ipv4][(?P.*)]' req_keys = ['ip', 'prefix_length', 'secondary'] - - for key in req_keys: - self.add_leaf(cmd=ShowIpInterfaceVrfAll, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), interface=interface, vrf=vrf) + if not brief: + for key in req_keys: + self.add_leaf(cmd=ShowIpInterfaceVrfAll, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface, vrf=vrf) if vrf: for intf in self.info: - self.add_leaf(cmd=ShowInterface, - src=src + '[route_tag]', - dest=dest + '[route_tag]', interface=intf) + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[route_tag]', + dest=dest + '[route_tag]', interface=intf, include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[route_tag]', + dest=dest + '[route_tag]', interface=intf) else: # route_tag - self.add_leaf(cmd=ShowInterface, - src=src + '[route_tag]', - dest=dest + '[route_tag]', interface=interface) - + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[route_tag]', + dest=dest + '[route_tag]', interface=interface, include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[route_tag]', + dest=dest + '[route_tag]', interface=interface) # secondary_vrf --- This is not supported on NXOS # unnumbered - self.add_leaf(cmd=ShowIpInterfaceVrfAll, - src='[(?P{convert_intf_name})][ipv4][unnumbered]', - dest='info[(?P{convert_intf_name})][ipv4][unnumbered]', - interface=interface, vrf=vrf) - - # get routing output - self.add_leaf(cmd=ShowRoutingVrfAll, - src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][ubest_num]', - dest='info[routing_v4][(?P.*)][(?P.*)][ubest_num]', vrf=vrf) - - # get routing output - self.add_leaf(cmd=ShowRoutingVrfAll, - src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][mbest_num]', - dest='info[routing_v4][(?P.*)][(?P.*)][mbest_num]', vrf=vrf) - - # get routing output - self.add_leaf(cmd=ShowRoutingVrfAll, - src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][attach]', - dest='info[routing_v4][(?P.*)][(?P.*)][attach]', vrf=vrf) - - src = '[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][best_route]'\ - '[(?P.*)][nexthop][(?P.*)][protocol][(?P.*)]' - dest = 'info[routing_v4][(?P.*)][(?P.*)][best_route][(?P.*)]'\ - '[nexthop][(?P.*)][protocol][(?P.*)]' - - req_keys = ['route_table', 'interface', 'preference', 'metric', 'protocol_id', 'attribute', - 'tag', 'mpls', 'mpls_vpn', 'evpn', 'segid', 'tunnelid', 'encap'] + if not brief: + self.add_leaf(cmd=ShowIpInterfaceVrfAll, + src='[(?P{convert_intf_name})][ipv4][unnumbered]', + dest='info[(?P{convert_intf_name})][ipv4][unnumbered]', + interface=interface, vrf=vrf) - for key in req_keys: + # get routing output + self.add_leaf(cmd=ShowRoutingVrfAll, + src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][ubest_num]', + dest='info[routing_v4][(?P.*)][(?P.*)][ubest_num]', vrf=vrf) + + # get routing output self.add_leaf(cmd=ShowRoutingVrfAll, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), vrf=vrf) + src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][mbest_num]', + dest='info[routing_v4][(?P.*)][(?P.*)][mbest_num]', vrf=vrf) + + # get routing output + self.add_leaf(cmd=ShowRoutingVrfAll, + src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][attach]', + dest='info[routing_v4][(?P.*)][(?P.*)][attach]', vrf=vrf) + + src = '[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][best_route]'\ + '[(?P.*)][nexthop][(?P.*)][protocol][(?P.*)]' + dest = 'info[routing_v4][(?P.*)][(?P.*)][best_route][(?P.*)]'\ + '[nexthop][(?P.*)][protocol][(?P.*)]' + + req_keys = ['route_table', 'interface', 'preference', 'metric', 'protocol_id', 'attribute', + 'tag', 'mpls', 'mpls_vpn', 'evpn', 'segid', 'tunnelid', 'encap'] + + for key in req_keys: + self.add_leaf(cmd=ShowRoutingVrfAll, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), vrf=vrf) # ====================================================================== # ipv6 @@ -298,40 +370,39 @@ def learn(self, interface=None, vrf=None, address_family=None): dest = 'info[(?P{convert_intf_name})][ipv6][(?P.*)]' req_keys = ['ip', 'prefix_length', 'anycast', 'status'] + if not brief: + for key in req_keys: + self.add_leaf(cmd=ShowIpv6InterfaceVrfAll, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface, vrf=vrf) - for key in req_keys: - self.add_leaf(cmd=ShowIpv6InterfaceVrfAll, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), interface=interface, vrf=vrf) - - - # get routing output - self.add_leaf(cmd=ShowRoutingIpv6VrfAll, - src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][ubest_num]', - dest='info[routing_v6][(?P.*)][(?P.*)][ubest_num]', vrf=vrf) + # get routing output + self.add_leaf(cmd=ShowRoutingIpv6VrfAll, + src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][ubest_num]', + dest='info[routing_v6][(?P.*)][(?P.*)][ubest_num]', vrf=vrf) - # get routing output - self.add_leaf(cmd=ShowRoutingIpv6VrfAll, - src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][mbest_num]', - dest='info[routing_v6][(?P.*)][(?P.*)][mbest_num]', vrf=vrf) + # get routing output + self.add_leaf(cmd=ShowRoutingIpv6VrfAll, + src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][mbest_num]', + dest='info[routing_v6][(?P.*)][(?P.*)][mbest_num]', vrf=vrf) - # get routing output - self.add_leaf(cmd=ShowRoutingIpv6VrfAll, - src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][attach]', - dest='info[routing_v6][(?P.*)][(?P.*)][attach]', vrf=vrf) + # get routing output + self.add_leaf(cmd=ShowRoutingIpv6VrfAll, + src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][attach]', + dest='info[routing_v6][(?P.*)][(?P.*)][attach]', vrf=vrf) - src = '[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][best_route]'\ - '[(?P.*)][nexthop][(?P.*)][protocol][(?P.*)]' - dest = 'info[routing_v6][(?P.*)][(?P.*)][best_route][(?P.*)]'\ - '[nexthop][(?P.*)][protocol][(?P.*)]' + src = '[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][best_route]'\ + '[(?P.*)][nexthop][(?P.*)][protocol][(?P.*)]' + dest = 'info[routing_v6][(?P.*)][(?P.*)][best_route][(?P.*)]'\ + '[nexthop][(?P.*)][protocol][(?P.*)]' - req_keys = ['route_table', 'interface', 'preference', 'metric', 'protocol_id', 'attribute', - 'tag', 'mpls', 'mpls_vpn', 'evpn', 'segid', 'tunnelid', 'encap'] + req_keys = ['route_table', 'interface', 'preference', 'metric', 'protocol_id', 'attribute', + 'tag', 'mpls', 'mpls_vpn', 'evpn', 'segid', 'tunnelid', 'encap'] - for key in req_keys: - self.add_leaf(cmd=ShowRoutingIpv6VrfAll, - src=src + '[{}]'.format(key), - dest=dest + '[{}]'.format(key), vrf=vrf) + for key in req_keys: + self.add_leaf(cmd=ShowRoutingIpv6VrfAll, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), vrf=vrf) # make to write in cache self.make(final_call=True) diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/rev1/__init__.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/rev1/__init__.py new file mode 100644 index 000000000..829c4007d --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/rev1/__init__.py @@ -0,0 +1,2 @@ +from genie import abstract +abstract.declare_token(revision='1') \ No newline at end of file diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/rev1/interface.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/rev1/interface.py new file mode 100644 index 000000000..d226f6612 --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/rev1/interface.py @@ -0,0 +1,495 @@ +''' +Interface Genie Ops Object for NXOS - CLI. +''' + +import re + +# super class +from genie.libs.ops.interface.interface import Interface as SuperInterface + +# nxos show_interface +from genie.libs.parser.nxos.show_interface import ShowInterface, ShowVrfAllInterface,\ + ShowIpv6InterfaceVrfAll, ShowIpInterfaceVrfAll,\ + ShowInterfaceSwitchport +from genie.libs.parser.nxos.show_routing import ShowRoutingIpv6VrfAll, ShowRoutingVrfAll +from genie.libs.parser.utils.common import Common + +show_interfaces = "show interface" +show_interfaces_include = '" is (up|down)|Hardware:|BW"' + + +class Interface(SuperInterface): + '''Interface Genie Ops Object''' + + def convert_intf_name(self, item): + return Common.convert_intf_name(item) + + def learn(self, interface=None, vrf=None, address_family=None, brief=False, **kwargs): + '''Learn Interface Ops''' + ######################################################################## + # info + ######################################################################## + self.callables = {'convert_intf_name': self.convert_intf_name} + + # save attributes + attrs = self.attributes + # Override attributes + self.attributes = None + self.maker.attributes = None + + # Global source + src = '[(?P{convert_intf_name})]' + dest = 'info[(?P{convert_intf_name})]' + req_keys_path = {'[description]': '[description]', + '[types]': '[type]', + '[oper_status]': '[oper_status]', + '[last_link_flapped]': '[last_change]', + '[phys_address]': '[phys_address]', + '[port_speed]': '[port_speed]', + '[mtu]': '[mtu]', + '[enabled]': '[enabled]', + '[encapsulations][first_dot1q]': '[vlan_id]', + '[mac_address]': '[mac_address]', + '[auto_negotiate]': '[auto_negotiate]', + '[duplex_mode]': '[duplex_mode]', + '[medium]': '[medium]', + '[delay]': '[delay]', + '[bandwidth]': '[bandwidth]', + } + # vrf + self.add_leaf(cmd=ShowVrfAllInterface, + src=src + '[vrf]', + dest=dest + '[vrf]', interface=interface, vrf=vrf) + self.make() + if vrf: + for intf in self.info: + for src_key_path, dest_key_path in req_keys_path.items(): + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + src_key_path, + dest=dest + dest_key_path, + interface=intf, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + src_key_path, + dest=dest + dest_key_path, + interface=intf) + else: + for src_key_path, dest_key_path in req_keys_path.items(): + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + src_key_path, + dest=dest + dest_key_path, + interface=interface, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + src_key_path, + dest=dest + dest_key_path, + interface=interface) + + req_keys = ['access_vlan', 'trunk_vlans', 'switchport_mode', + 'switchport_enable', 'native_vlan'] + if vrf: + for intf in self.info: + for key in req_keys: + self.add_leaf(cmd=ShowInterfaceSwitchport, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf) + + # ====================================================================== + # flow_control + # ====================================================================== + + # flow_control + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[flow_control]', + dest=dest + '[flow_control]', interface=intf, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[flow_control]', + dest=dest + '[flow_control]', interface=intf) + + # ====================================================================== + # accounting + # ====================================================================== + + # accounting N/A + + # ====================================================================== + # port_channel + # ====================================================================== + + # port_channel + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[port_channel]', + dest=dest + '[port_channel]', interface=intf, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[port_channel]', + dest=dest + '[port_channel]', interface=intf) + + # ====================================================================== + # counters + # ====================================================================== + # Global source + src = '[(?P{convert_intf_name})][counters]' + dest = 'info[(?P{convert_intf_name})][counters]' + + req_keys = ['in_pkts', 'in_octets', 'in_unicast_pkts', + 'in_broadcast_pkts', 'in_multicast_pkts', + 'in_discards', 'in_errors', 'in_unknown_protos', + 'in_mac_pause_frames', 'in_oversize_frames', + 'in_crc_errors', 'out_pkts', 'out_octets', 'out_unicast_pkts', + 'out_broadcast_pkts', 'out_multicast_pkts', 'out_discard', + 'out_errors', 'last_clear','out_mac_pause_frames'] + + for key in req_keys: + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf) + + + # Global source - counters | rate + src = '[(?P{convert_intf_name})][counters][rate]' + dest = 'info[(?P{convert_intf_name})][counters][rate]' + + req_keys = ['load_interval', 'in_rate', 'in_rate_pkts', + 'out_rate', 'out_rate_pkts'] + + for key in req_keys: + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf) + + # ====================================================================== + # encapsulation + # ====================================================================== + + + # Global source + src = '[(?P{convert_intf_name})][encapsulations]' + dest = 'info[(?P{convert_intf_name})][encapsulation]' + + req_keys = ['encapsulation', 'first_dot1q', 'native_vlan'] + + for key in req_keys: + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=intf) + else: + for key in req_keys: + self.add_leaf(cmd=ShowInterfaceSwitchport, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface) + + # ====================================================================== + # flow_control + # ====================================================================== + + # flow_control + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[flow_control]', + dest=dest + '[flow_control]', interface=interface, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[flow_control]', + dest=dest + '[flow_control]', interface=interface) + + # ====================================================================== + # accounting + # ====================================================================== + + # accounting N/A + + # ====================================================================== + # port_channel + # ====================================================================== + + # port_channel + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[port_channel]', + dest=dest + '[port_channel]', interface=interface, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[port_channel]', + dest=dest + '[port_channel]', interface=interface) + + # ====================================================================== + # counters + # ====================================================================== + # Global source + src = '[(?P{convert_intf_name})][counters]' + dest = 'info[(?P{convert_intf_name})][counters]' + + req_keys = ['in_pkts', 'in_octets', 'in_unicast_pkts', + 'in_broadcast_pkts', 'in_multicast_pkts', + 'in_discards', 'in_errors', 'in_unknown_protos', + 'in_mac_pause_frames', 'in_oversize_frames', + 'in_crc_errors', 'out_pkts', 'out_octets', 'out_unicast_pkts', + 'out_broadcast_pkts', 'out_multicast_pkts', 'out_discard', + 'out_errors', 'last_clear', 'out_mac_pause_frames'] + + for key in req_keys: + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface) + + # Global source - counters | rate + src = '[(?P{convert_intf_name})][counters][rate]' + dest = 'info[(?P{convert_intf_name})][counters][rate]' + + req_keys = ['load_interval', 'in_rate', 'in_rate_pkts', + 'out_rate', 'out_rate_pkts'] + + for key in req_keys: + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface) + + # ====================================================================== + # encapsulation + # ====================================================================== + + # Global source + src = '[(?P{convert_intf_name})][encapsulations]' + dest = 'info[(?P{convert_intf_name})][encapsulation]' + + req_keys = ['encapsulation', 'first_dot1q', 'native_vlan'] + + for key in req_keys: + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface) + + # ====================================================================== + # ipv4 + # ====================================================================== + + if not address_family or address_family.lower() == 'ipv4': + # Global source + src = '[(?P{convert_intf_name})][ipv4][(?P.*)]' + dest = 'info[(?P{convert_intf_name})][ipv4][(?P.*)]' + + req_keys = ['ip', 'prefix_length', 'secondary'] + + for key in req_keys: + self.add_leaf(cmd=ShowIpInterfaceVrfAll, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface, vrf=vrf) + if vrf: + for intf in self.info: + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[route_tag]', + dest=dest + '[route_tag]', interface=intf, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[route_tag]', + dest=dest + '[route_tag]', interface=intf) + else: + # route_tag + if brief: + self.add_leaf(cmd=show_interfaces, + src=src + '[route_tag]', + dest=dest + '[route_tag]', interface=interface, + include=show_interfaces_include) + else: + self.add_leaf(cmd=show_interfaces, + src=src + '[route_tag]', + dest=dest + '[route_tag]', interface=interface) + + # secondary_vrf --- This is not supported on NXOS + # unnumbered + self.add_leaf(cmd=ShowIpInterfaceVrfAll, + src='[(?P{convert_intf_name})][ipv4][unnumbered]', + dest='info[(?P{convert_intf_name})][ipv4][unnumbered]', + interface=interface, vrf=vrf) + + # get routing output + self.add_leaf(cmd=ShowRoutingVrfAll, + src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][ubest_num]', + dest='info[routing_v4][(?P.*)][(?P.*)][ubest_num]', vrf=vrf) + + # get routing output + self.add_leaf(cmd=ShowRoutingVrfAll, + src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][mbest_num]', + dest='info[routing_v4][(?P.*)][(?P.*)][mbest_num]', vrf=vrf) + + # get routing output + self.add_leaf(cmd=ShowRoutingVrfAll, + src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][attach]', + dest='info[routing_v4][(?P.*)][(?P.*)][attach]', vrf=vrf) + + src = '[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][best_route]'\ + '[(?P.*)][nexthop][(?P.*)][protocol][(?P.*)]' + dest = 'info[routing_v4][(?P.*)][(?P.*)][best_route][(?P.*)]'\ + '[nexthop][(?P.*)][protocol][(?P.*)]' + + req_keys = ['route_table', 'interface', 'preference', 'metric', 'protocol_id', 'attribute', + 'tag', 'mpls', 'mpls_vpn', 'evpn', 'segid', 'tunnelid', 'encap'] + + for key in req_keys: + self.add_leaf(cmd=ShowRoutingVrfAll, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), vrf=vrf) + + # ====================================================================== + # ipv6 + # ====================================================================== + + if not address_family or address_family.lower() == 'ipv6': + # Global source + src = '[(?P{convert_intf_name})][ipv6][(?P.*)]' + dest = 'info[(?P{convert_intf_name})][ipv6][(?P.*)]' + + req_keys = ['ip', 'prefix_length', 'anycast', 'status'] + + for key in req_keys: + self.add_leaf(cmd=ShowIpv6InterfaceVrfAll, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), interface=interface, vrf=vrf) + + + # get routing output + self.add_leaf(cmd=ShowRoutingIpv6VrfAll, + src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][ubest_num]', + dest='info[routing_v6][(?P.*)][(?P.*)][ubest_num]', vrf=vrf) + + # get routing output + self.add_leaf(cmd=ShowRoutingIpv6VrfAll, + src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][mbest_num]', + dest='info[routing_v6][(?P.*)][(?P.*)][mbest_num]', vrf=vrf) + + # get routing output + self.add_leaf(cmd=ShowRoutingIpv6VrfAll, + src='[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][attach]', + dest='info[routing_v6][(?P.*)][(?P.*)][attach]', vrf=vrf) + + src = '[vrf][(?P.*)][address_family][(?P.*)][ip][(?P.*)][best_route]'\ + '[(?P.*)][nexthop][(?P.*)][protocol][(?P.*)]' + dest = 'info[routing_v6][(?P.*)][(?P.*)][best_route][(?P.*)]'\ + '[nexthop][(?P.*)][protocol][(?P.*)]' + + req_keys = ['route_table', 'interface', 'preference', 'metric', 'protocol_id', 'attribute', + 'tag', 'mpls', 'mpls_vpn', 'evpn', 'segid', 'tunnelid', 'encap'] + + for key in req_keys: + self.add_leaf(cmd=ShowRoutingIpv6VrfAll, + src=src + '[{}]'.format(key), + dest=dest + '[{}]'.format(key), vrf=vrf) + + # make to write in cache + self.make(final_call=True) + + # eui_64 + # if has ip like 2001:db8::5054:ff:fed5:63f9, eui_64 is True + p = re.compile(r'([a-z0-9]+):([\w\:]+)?ff:([a-z0-9]+):([a-z0-9]+)') + if hasattr(self, 'info'): + for intf in self.info: + # check vrf + if 'vrf' in self.info[intf]: + if 'routing_v4' in self.info and \ + self.info[intf]['vrf'] in self.info['routing_v4']: + dict_v4 = self.info['routing_v4'][self.info[intf]['vrf']] + else: + dict_v4 = {} + + if 'routing_v6' in self.info and \ + self.info[intf]['vrf'] in self.info['routing_v6']: + dict_v6 = self.info['routing_v6'][self.info[intf]['vrf']] + else: + dict_v6 = {} + else: + continue + + for key in self.info[intf]: + if key == 'ipv4' or key == 'ipv6': + for ip in self.info[intf][key].keys(): + if p.match(ip): + self.info[intf][key][ip]['eui_64'] = True + + # route_tag and origin of ipv4/ipv6 + self.ret_dict = {} + routing_dict = dict_v4 if key == 'ipv4' else dict_v6 + + if ip in routing_dict: + self._match_keys(dic=routing_dict[ip], + match={'interface': intf}) + + for protocol in self.ret_dict: + if 'tag' in self.ret_dict[protocol]: + self.info[intf][key][ip]['route_tag'] = \ + self.ret_dict[protocol]['tag'] + self.info[intf][key][ip]['origin'] = protocol + + # Delete ret_dict + del self.ret_dict + + # delete the routing attribute which is only used + # for getting route_tag and origin + for key in ['routing_v4', 'routing_v6']: + if key in self.info: + del(self.info[key]) + + def _match_keys(self, dic, match): + '''find entry in the dic when values are same to match. + will return the upper level dictionary contains those values + ''' + if isinstance(dic, dict): + for key, value in match.items(): + for dic_key in dic: + if key in dic[dic_key] and dic[dic_key][key] == value: + self.ret_dict.update(dic) + break + elif not isinstance(dic[dic_key], dict): + pass + else: + self._match_keys(dic=dic[dic_key], match=match) + return(self.ret_dict) \ No newline at end of file diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/tests/interface_output.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/tests/interface_output.py index e66089d1c..5e975ad6f 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/tests/interface_output.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/tests/interface_output.py @@ -132,6 +132,149 @@ class InterfaceOutput(object): 0 lost carrier 0 no carrier 0 babble 0 output discard 0 Tx pause ''' + + ShowInterfaceBrief = ''' + mgmt0 is up + admin state is up, + Hardware: GigabitEthernet, address: 188b.9df3.2a98 (bia 188b.9df3.2a98) + MTU 1500 bytes, BW 1000000 Kbit , DLY 10 usec + Ethernet1/1 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2aa0) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/2 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2aa4) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/3 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2aa8) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/4 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2aac) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/5 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2ab0) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/6 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2ab4) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/7 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2ab8) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/8 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2abc) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/9 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2ac0) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/10 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2ac4) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/11 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2ac8) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/12 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2acc) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/13 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2ad0) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/14 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2ad4) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/15 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2ad8) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/16 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2adc) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/17 is up + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2ae0) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/18 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2ae4) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/19 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2ae8) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/20 is up + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2aec) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/21 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2af0) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/22 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2af4) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/23 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2af8) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/24 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2afc) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/25 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2b00) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/26 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2b04) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/27 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2b08) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/28 is down (Link not connected) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2b0c) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/29 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2b10) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/30 is down (Link not connected) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2b14) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/31 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2b18) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/32 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000/25000/40000/100000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2b1c) + MTU 1500 bytes, BW 100000000 Kbit , DLY 10 usec + Ethernet1/33 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2b20) + MTU 1500 bytes, BW 10000000 Kbit , DLY 10 usec + Ethernet1/34 is down (XCVR not inserted) + admin state is up, Dedicated Interface + Hardware: 100/1000/10000 Ethernet, address: 188b.9df3.2a9f (bia 188b.9df3.2b21) + MTU 1500 bytes, BW 10000000 Kbit , DLY 10 usec + ''' ShowInterface_eth2 = ''' Ethernet2/1 is up @@ -1437,3 +1580,467 @@ class InterfaceOutput(object): 'port_speed': '1000', 'type': 'Ethernet', 'vrf': 'management'}} + + InterfaceBriefOpsOutput_info={ + 'Ethernet1/1': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2aa0', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/10': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ac4', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/11': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ac8', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/12': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2acc', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/13': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ad0', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/14': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ad4', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/15': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ad8', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/16': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2adc', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/17': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'up', + 'phys_address': '188b.9df3.2ae0', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/18': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ae4', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/19': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ae8', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/2': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2aa4', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/20': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'up', + 'phys_address': '188b.9df3.2aec', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/21': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2af0', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/22': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2af4', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/23': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2af8', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/24': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2afc', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/25': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2b00', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/26': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2b04', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/27': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2b08', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/28': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2b0c', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/29': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2b10', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/3': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2aa8', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/30': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2b14', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/31': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2b18', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/32': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2b1c', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/33': {'bandwidth': 10000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2b20', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000 Ethernet'}, + 'Ethernet1/34': {'bandwidth': 10000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2b21', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000 Ethernet'}, + 'Ethernet1/4': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2aac', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/5': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ab0', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/6': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ab4', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/7': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ab8', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/8': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2abc', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet1/9': {'bandwidth': 100000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a9f', + 'mtu': 1500, + 'oper_status': 'down', + 'phys_address': '188b.9df3.2ac0', + 'port_channel': {'port_channel_member': False}, + 'type': '100/1000/10000/25000/40000/100000 Ethernet'}, + 'Ethernet2/1': {'vrf': 'VRF1'}, + 'Ethernet2/1.10': {'vrf': 'default'}, + 'Ethernet2/1.20': {'vrf': 'default'}, + 'Ethernet2/10': {'vrf': 'default'}, + 'Ethernet2/11': {'vrf': 'default'}, + 'Ethernet2/12': {'vrf': 'default'}, + 'Ethernet2/13': {'vrf': 'default'}, + 'Ethernet2/14': {'vrf': 'default'}, + 'Ethernet2/15': {'vrf': 'default'}, + 'Ethernet2/16': {'vrf': 'default'}, + 'Ethernet2/17': {'vrf': 'default'}, + 'Ethernet2/18': {'vrf': 'default'}, + 'Ethernet2/19': {'vrf': 'default'}, + 'Ethernet2/20': {'vrf': 'default'}, + 'Ethernet2/21': {'vrf': 'default'}, + 'Ethernet2/22': {'vrf': 'default'}, + 'Ethernet2/23': {'vrf': 'default'}, + 'Ethernet2/24': {'vrf': 'default'}, + 'Ethernet2/25': {'vrf': 'default'}, + 'Ethernet2/26': {'vrf': 'default'}, + 'Ethernet2/27': {'vrf': 'default'}, + 'Ethernet2/28': {'vrf': 'default'}, + 'Ethernet2/29': {'vrf': 'default'}, + 'Ethernet2/30': {'vrf': 'default'}, + 'Ethernet2/31': {'vrf': 'default'}, + 'Ethernet2/32': {'vrf': 'default'}, + 'Ethernet2/33': {'vrf': 'default'}, + 'Ethernet2/34': {'vrf': 'default'}, + 'Ethernet2/35': {'vrf': 'default'}, + 'Ethernet2/36': {'vrf': 'default'}, + 'Ethernet2/37': {'vrf': 'default'}, + 'Ethernet2/38': {'vrf': 'default'}, + 'Ethernet2/39': {'vrf': 'default'}, + 'Ethernet2/4': {'vrf': 'default'}, + 'Ethernet2/40': {'vrf': 'default'}, + 'Ethernet2/41': {'vrf': 'default'}, + 'Ethernet2/42': {'vrf': 'default'}, + 'Ethernet2/43': {'vrf': 'default'}, + 'Ethernet2/44': {'vrf': 'default'}, + 'Ethernet2/45': {'vrf': 'default'}, + 'Ethernet2/46': {'vrf': 'default'}, + 'Ethernet2/47': {'vrf': 'default'}, + 'Ethernet2/48': {'vrf': 'default'}, + 'Ethernet2/5': {'vrf': 'default'}, + 'Ethernet2/6': {'vrf': 'default'}, + 'Ethernet2/7': {'vrf': 'default'}, + 'Ethernet2/8': {'vrf': 'default'}, + 'Ethernet2/9': {'vrf': 'default'}, + 'Ethernet3/1': {'vrf': 'default'}, + 'Ethernet3/10': {'vrf': 'default'}, + 'Ethernet3/11': {'vrf': 'default'}, + 'Ethernet3/12': {'vrf': 'default'}, + 'Ethernet3/13': {'vrf': 'default'}, + 'Ethernet3/14': {'vrf': 'default'}, + 'Ethernet3/15': {'vrf': 'default'}, + 'Ethernet3/16': {'vrf': 'default'}, + 'Ethernet3/17': {'vrf': 'default'}, + 'Ethernet3/18': {'vrf': 'default'}, + 'Ethernet3/19': {'vrf': 'default'}, + 'Ethernet3/2': {'vrf': 'default'}, + 'Ethernet3/20': {'vrf': 'default'}, + 'Ethernet3/21': {'vrf': 'default'}, + 'Ethernet3/22': {'vrf': 'default'}, + 'Ethernet3/23': {'vrf': 'default'}, + 'Ethernet3/24': {'vrf': 'default'}, + 'Ethernet3/25': {'vrf': 'default'}, + 'Ethernet3/26': {'vrf': 'default'}, + 'Ethernet3/27': {'vrf': 'default'}, + 'Ethernet3/28': {'vrf': 'default'}, + 'Ethernet3/29': {'vrf': 'default'}, + 'Ethernet3/3': {'vrf': 'default'}, + 'Ethernet3/30': {'vrf': 'default'}, + 'Ethernet3/31': {'vrf': 'default'}, + 'Ethernet3/32': {'vrf': 'default'}, + 'Ethernet3/33': {'vrf': 'default'}, + 'Ethernet3/34': {'vrf': 'default'}, + 'Ethernet3/35': {'vrf': 'default'}, + 'Ethernet3/36': {'vrf': 'default'}, + 'Ethernet3/37': {'vrf': 'default'}, + 'Ethernet3/38': {'vrf': 'default'}, + 'Ethernet3/39': {'vrf': 'default'}, + 'Ethernet3/4': {'vrf': 'default'}, + 'Ethernet3/40': {'vrf': 'default'}, + 'Ethernet3/41': {'vrf': 'default'}, + 'Ethernet3/42': {'vrf': 'default'}, + 'Ethernet3/43': {'vrf': 'default'}, + 'Ethernet3/44': {'vrf': 'default'}, + 'Ethernet3/45': {'vrf': 'default'}, + 'Ethernet3/46': {'vrf': 'default'}, + 'Ethernet3/47': {'vrf': 'default'}, + 'Ethernet3/48': {'vrf': 'default'}, + 'Ethernet3/5': {'vrf': 'default'}, + 'Ethernet3/6': {'vrf': 'default'}, + 'Ethernet3/7': {'vrf': 'default'}, + 'Ethernet3/8': {'vrf': 'default'}, + 'Ethernet3/9': {'vrf': 'default'}, + 'Ethernet4/1': {'vrf': 'default'}, + 'Ethernet4/10': {'vrf': 'default'}, + 'Ethernet4/11': {'vrf': 'default'}, + 'Ethernet4/12': {'vrf': 'default'}, + 'Ethernet4/13': {'vrf': 'default'}, + 'Ethernet4/14': {'vrf': 'default'}, + 'Ethernet4/15': {'vrf': 'default'}, + 'Ethernet4/16': {'vrf': 'default'}, + 'Ethernet4/17': {'vrf': 'default'}, + 'Ethernet4/18': {'vrf': 'default'}, + 'Ethernet4/19': {'vrf': 'default'}, + 'Ethernet4/2': {'vrf': 'default'}, + 'Ethernet4/20': {'vrf': 'default'}, + 'Ethernet4/21': {'vrf': 'default'}, + 'Ethernet4/22': {'vrf': 'default'}, + 'Ethernet4/23': {'vrf': 'default'}, + 'Ethernet4/24': {'vrf': 'default'}, + 'Ethernet4/25': {'vrf': 'default'}, + 'Ethernet4/26': {'vrf': 'default'}, + 'Ethernet4/27': {'vrf': 'default'}, + 'Ethernet4/28': {'vrf': 'default'}, + 'Ethernet4/29': {'vrf': 'default'}, + 'Ethernet4/3': {'vrf': 'default'}, + 'Ethernet4/30': {'vrf': 'default'}, + 'Ethernet4/31': {'vrf': 'default'}, + 'Ethernet4/32': {'vrf': 'default'}, + 'Ethernet4/33': {'vrf': 'default'}, + 'Ethernet4/34': {'vrf': 'default'}, + 'Ethernet4/35': {'vrf': 'default'}, + 'Ethernet4/36': {'vrf': 'default'}, + 'Ethernet4/37': {'vrf': 'default'}, + 'Ethernet4/38': {'vrf': 'default'}, + 'Ethernet4/39': {'vrf': 'default'}, + 'Ethernet4/4': {'vrf': 'default'}, + 'Ethernet4/40': {'vrf': 'default'}, + 'Ethernet4/41': {'vrf': 'default'}, + 'Ethernet4/42': {'vrf': 'default'}, + 'Ethernet4/43': {'vrf': 'default'}, + 'Ethernet4/44': {'vrf': 'default'}, + 'Ethernet4/45': {'vrf': 'default'}, + 'Ethernet4/46': {'vrf': 'default'}, + 'Ethernet4/47': {'vrf': 'default'}, + 'Ethernet4/48': {'vrf': 'default'}, + 'Ethernet4/5': {'vrf': 'default'}, + 'Ethernet4/6': {'vrf': 'default'}, + 'Ethernet4/7': {'vrf': 'default'}, + 'Ethernet4/8': {'vrf': 'default'}, + 'Ethernet4/9': {'vrf': 'default'}, + 'Mgmt0': {'bandwidth': 1000000, + 'delay': 10, + 'enabled': True, + 'mac_address': '188b.9df3.2a98', + 'mtu': 1500, + 'oper_status': 'up', + 'phys_address': '188b.9df3.2a98', + 'port_channel': {'port_channel_member': False}, + 'type': 'GigabitEthernet', + 'vrf': 'management'}, + 'Null0': {'vrf': 'default'} +} \ No newline at end of file diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/tests/test_interface.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/tests/test_interface.py index 22e01c2ec..41de9a8c9 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/tests/test_interface.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/tests/test_interface.py @@ -25,6 +25,7 @@ outputs['show vrf VRF1 interface Ethernet2/1'] = InterfaceOutput.ShowVrfAllInterface_vrf1_eth2 outputs['show interface Ethernet2/1 switchport'] = InterfaceOutput.ShowInterfaceSwitchport_eth2 outputs['show ip interface Ethernet2/1 vrf VRF1'] = InterfaceOutput.ShowIpInterfaceVrfAll_all +outputs['show interface | include " is (up|down)|Hardware:|BW"'] = InterfaceOutput.ShowInterfaceBrief def mapper(key, **kwargs): return outputs[key] @@ -59,6 +60,7 @@ def test_complete_output(self): # Verify Ops was created successfully self.assertDictEqual(intf.info, InterfaceOutput.InterfaceOpsOutput_info) + def test_custom_output(self): self.maxDiff = None intf = Interface(device=self.device) @@ -74,6 +76,7 @@ def test_custom_output(self): # Verify Ops was created successfully self.assertDictEqual(intf.info, InterfaceOutput.InterfaceOpsOutput_custom_info) + def test_empty_output(self): self.maxDiff = None intf = Interface(device=self.device) @@ -100,6 +103,7 @@ def test_empty_output(self): outputs['show interface switchport'] = InterfaceOutput.ShowInterfaceSwitchport_all outputs['show ip interface vrf all'] = InterfaceOutput.ShowIpInterfaceVrfAll_all outputs['show ipv6 interface vrf all'] = InterfaceOutput.ShowIpv6InterfaceVrfAll_all + def test_selective_attribute(self): self.maxDiff = None intf = Interface(device=self.device) @@ -142,7 +146,22 @@ def test_incomplete_output(self): # Verify Ops was created successfully self.assertDictEqual(intf.info, expect_dict) + + def test_brief_output(self): + self.maxDiff = None + intf = Interface(device=self.device) + # Get outputs + + intf.maker.outputs[ShowRoutingVrfAll] = \ + {"{'vrf':''}":InterfaceOutput.ShowRoutingVrfAll} + intf.maker.outputs[ShowRoutingIpv6VrfAll] = \ + {"{'vrf':''}":InterfaceOutput.ShowRoutingIpv6VrfAll} + + # Learn the feature + intf.learn(brief=True) + # # Verify Ops was created successfully + self.assertDictEqual(intf.info, InterfaceOutput.InterfaceBriefOpsOutput_info) if __name__ == '__main__': unittest.main() diff --git a/pkgs/ops-pkg/src/genie/libs/ops/mcast/iosxe/mcast.py b/pkgs/ops-pkg/src/genie/libs/ops/mcast/iosxe/mcast.py index 213f67c7f..d935c1d9b 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/mcast/iosxe/mcast.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/mcast/iosxe/mcast.py @@ -1,4 +1,4 @@ -''' +''' MCAST Genie Ops Object for IOSXE - CLI. ''' # super class @@ -24,7 +24,7 @@ def get_vrfs(self, item): def learn(self): '''Learn Mcast Ops''' - # get vrf list + # get vrf list self.add_leaf(cmd=ShowVrfDetail, src='', dest='list_of_vrfs', @@ -35,9 +35,9 @@ def learn(self): vrf_list = ['default'] try: vrf_list.extend(self.list_of_vrfs) - except: + except Exception: pass - else: + else: # delete the list_of_vrfs in the info table del self.list_of_vrfs @@ -50,20 +50,19 @@ def learn(self): # create kwargs vrf_name = '' if vrf == 'default' else vrf - ######################################################################## # info ######################################################################## # enable - ipv4 - self.add_leaf(cmd='show ip multicast vrf {vrf}'.format(vrf=vrf), + self.add_leaf(cmd=f'show ip multicast vrf {vrf}' if vrf_name else 'show ip multicast', src='[vrf][(?P.*)][enable]', dest='info[vrf][(?P.*)][address_family][ipv4][enable]', vrf=vrf_name) # multipath - ipv4 - self.add_leaf(cmd='show ip multicast vrf {vrf}'.format(vrf=vrf), + self.add_leaf(cmd=f'show ip multicast vrf {vrf}' if vrf_name else 'show ip multicast', src='[vrf][(?P.*)][multipath]', dest='info[vrf][(?P.*)][address_family][ipv4][multipath]', vrf=vrf_name) @@ -73,7 +72,7 @@ def learn(self): src='[vrf][(?P.*)][interface][(?P.*)][pim_enabled]', dest='info[vrf][(?P.*)][interface][(?P.*)][pim_enabled]', vrf=vrf_name) - + # multipath - ipv6 from show run @@ -83,7 +82,7 @@ def learn(self): '[mroute][(?P.*)][path][(?P.*)]' for key in ['neighbor_address', 'admin_distance']: - self.add_leaf(cmd='show ip mroute vrf {vrf} static'.format(vrf=vrf), + self.add_leaf(cmd=f'show ip mroute vrf {vrf} static' if vrf_name else 'show ip mroute static', src=info_src+'[{key}]'.format(key=key), dest=info_dest+'[{key}]'.format(key=key), vrf=vrf_name) @@ -113,7 +112,7 @@ def learn(self): try: ipv6_mroute_list = self.table['vrf'][vrf]['address_family']['ipv6']['multicast_group'].keys() - except: + except Exception: ipv6_mroute_list = [] # ipv6 - neighbor_address, interface_name, admin_distance @@ -136,11 +135,11 @@ def learn(self): if self.info['vrf'][vrf]['interface'][intf]['pim_enabled']: self.info['vrf'][vrf]['address_family']['ipv6']['enable'] = True break - except: + except Exception: pass # delete unused ops attribute try: del(self.info['vrf'][vrf]['interface']) - except: - pass \ No newline at end of file + except Exception: + pass diff --git a/pkgs/ops-pkg/src/genie/libs/ops/mld/iosxe/mld.py b/pkgs/ops-pkg/src/genie/libs/ops/mld/iosxe/mld.py index 600902dee..bfbc0d141 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/mld/iosxe/mld.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/mld/iosxe/mld.py @@ -1,4 +1,4 @@ -''' +''' MLD Genie Ops Object for IOSXE - CLI. ''' # super class @@ -12,14 +12,14 @@ class Mld(SuperMld): '''MLD Genie Ops Object''' def keys(self, item): - '''return only the key as list from the item''' + '''return only the key as list from the item''' if isinstance(item, dict): return list(item.keys()) def learn(self): '''Learn MLD Ops''' - # get vrf list + # get vrf list self.add_leaf(cmd=ShowVrfDetail, src='', dest='list_of_vrfs', @@ -32,7 +32,7 @@ def learn(self): vrf_list.extend(self.list_of_vrfs) except AttributeError: pass - else: + else: # delete the list_of_vrfs in the info table del self.list_of_vrfs @@ -45,7 +45,7 @@ def learn(self): # create kwargs vrf_name = '' if vrf == 'default' else vrf - + ######################################################################## # info ######################################################################## @@ -66,9 +66,9 @@ def learn(self): # -- enable, group_policy # -- max_groups, query_interval, query_max_response_time # -- oper_status, querier, version - # + # # immediate_leave, robustness_variable, joined_group are not supported on iosxe - req_keys = ['[enable]', + req_keys = ['[enable]', '[group_policy]', '[max_groups]', '[query_interval]', '[query_max_response_time]', '[oper_status]', '[querier]', '[version]'] @@ -121,11 +121,11 @@ def learn(self): req_keys = ['[ssm_map][(?P.*)][source_addr]', '[ssm_map][(?P.*)][group_address]'] for key in req_keys: - self.add_leaf(cmd='show ipv6 mld vrf {vrf} ssm-map {group}'.format(vrf=vrf, group=group), + self.add_leaf(cmd=f'show ipv6 mld vrf {vrf} ssm-map {group}' if vrf_name else + f'show ipv6 mld ssm-map {group}', src=src + '[{}]'.format(key), dest=dest + '[{}]'.format(key), group=group, vrf=vrf_name) - # make to write in cache - self.make(final_call=True) \ No newline at end of file + self.make(final_call=True) diff --git a/pkgs/ops-pkg/src/genie/libs/ops/static_routing/iosxe/static_routing.py b/pkgs/ops-pkg/src/genie/libs/ops/static_routing/iosxe/static_routing.py index f6b306394..5bb342c18 100755 --- a/pkgs/ops-pkg/src/genie/libs/ops/static_routing/iosxe/static_routing.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/static_routing/iosxe/static_routing.py @@ -67,7 +67,7 @@ def learn(self): '[routes][(?P.*)]' dest_static_routing_route = 'info' + src_static_routing_route - self.add_leaf(cmd='show ip static route vrf {vrf}'.format(vrf=vrf), + self.add_leaf(cmd=f'show ip static route vrf {vrf}' if vrf_name else 'show ip static route', src=src_static_routing_route + '[route]', dest=dest_static_routing_route + '[route]', vrf=vrf_name) @@ -75,21 +75,19 @@ def learn(self): src_static_routing_intf = src_static_routing_route +'[next_hop][outgoing_interface][(?P.*)]' dest_static_routing_intf = 'info' + src_static_routing_intf - - req_key =['outgoing_interface','active','preference'] + req_key =['outgoing_interface', 'active', 'preference'] for key in req_key: - self.add_leaf(cmd='show ip static route vrf {vrf}'.format(vrf=vrf), + self.add_leaf(cmd=f'show ip static route vrf {vrf}' if vrf_name else 'show ip static route', src=src_static_routing_intf + '[{}]'.format(key), dest=dest_static_routing_intf + '[{}]'.format(key), vrf=vrf_name) - src_static_routing_hop = src_static_routing_route +'[next_hop][next_hop_list][(?P.*)]' dest_static_routing_hop = 'info' + src_static_routing_hop req_key = ['index', 'active', 'next_hop', 'outgoing_interface', 'preference'] for key in req_key: - self.add_leaf(cmd='show ip static route vrf {vrf}'.format(vrf=vrf), + self.add_leaf(cmd=f'show ip static route vrf {vrf}' if vrf_name else 'show ip static route', src=src_static_routing_hop + '[{}]'.format(key), dest=dest_static_routing_hop + '[{}]'.format(key), vrf=vrf_name) @@ -98,14 +96,14 @@ def learn(self): ############################################## #### Ipv6 ########## - self.add_leaf(cmd='show ipv6 static vrf {vrf} detail'.format(vrf=vrf), + self.add_leaf(cmd=f'show ipv6 static vrf {vrf} detail' if vrf_name else 'show ipv6 static detail', src=src_static_routing_route + '[route]', dest=dest_static_routing_route + '[route]', vrf = vrf_name) req_key = ['outgoing_interface', 'active', 'preference'] for key in req_key: - self.add_leaf(cmd='show ipv6 static vrf {vrf} detail'.format(vrf=vrf), + self.add_leaf(cmd=f'show ipv6 static vrf {vrf} detail' if vrf_name else 'show ipv6 static detail', src=src_static_routing_intf + '[{}]'.format(key), dest=dest_static_routing_intf + '[{}]'.format(key), vrf=vrf_name) @@ -113,7 +111,7 @@ def learn(self): req_key = ['index', 'active', 'next_hop', 'outgoing_interface', 'preference'] for key in req_key: - self.add_leaf(cmd='show ipv6 static vrf {vrf} detail'.format(vrf=vrf), + self.add_leaf(cmd=f'show ipv6 static vrf {vrf} detail' if vrf_name else 'show ipv6 static detail', src=src_static_routing_hop + '[{}]'.format(key), dest=dest_static_routing_hop + '[{}]'.format(key), vrf=vrf_name) @@ -123,4 +121,4 @@ def learn(self): class StaticRoute(Base): # Keeping it for backward compatibility - pass \ No newline at end of file + pass diff --git a/pkgs/robot-pkg/src/genie/libs/robot/__init__.py b/pkgs/robot-pkg/src/genie/libs/robot/__init__.py index a4432b570..11840c113 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.8' +__version__ = '24.9' __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/august.rst b/pkgs/sdk-pkg/changelog/2024/august.rst index c9ba02722..e69de29bb 100644 --- a/pkgs/sdk-pkg/changelog/2024/august.rst +++ b/pkgs/sdk-pkg/changelog/2024/august.rst @@ -1,121 +0,0 @@ --------------------------------------------------------------------------------- - New --------------------------------------------------------------------------------- - -* iosxe - * Added configure_macro_name - * API to configure 'macro name {macro_name}'. - * Enhanced existing api configure_macro_global_apply - * Modified API to configure 'macro global apply {macro_name} {variables} {values} '. - * Added configure_ip_pim_vrf_ssm_range - * API to configure ip pim vrf ssm range - * Added unconfigure_ip_pim_vrf_ssm_range - * API to unconfigure ip pim vrf ssm range - * Added configure_ip_msdp_vrf_peer - * API to configure msdp vrf peer - * Added unconfigure_ip_msdp_vrf_peer - * API to unconfigure msdp vrf peer - * Added config_prp_sup_vlan_aware - * prp channel-group 1 supervisionFrameOption vlan-aware-enable - * Added unconfig_prp_sup_vlan_aware - * no prp channel-group 1 supervisionFrameOption vlan-aware-enable - * Added config_prp_sup_vlan_aware_allowed_vlan_list - * prp channel-group 1 supervisionFrameOption vlan-aware-allowed-vlan 30,40 - * Added unconfig_prp_sup_vlan_aware_allowed_vlan_list - * no prp channel-group 1 supervisionFrameOption vlan-aware-allowed-vlan - * Added config_prp_static_vdan_entry - * prp channel-group 1 vdanMacaddress 000001000011 vlan-id 10 - * Added unconfig_prp_static_vdan_entry - * no prp channel-group 1 vdanMacaddress 000001000011 - * Added config_prp_sup_vlan_aware_reject_untagged - * prp channel-group 1 supervisionFrameOption vlan-aware-reject-untagged - * Added def unconfig_prp_sup_vlan_aware_reject_untagged(device, interface) - * no prp channel-group 1 supervisionFrameOption vlan-aware-reject-untagged - * Added config_prp_sup_vlan_id - * prp channel-group 1 supervisionFrameoption vlan-id 10 - * Added unconfig_prp_sup_vlan_id - * no prp channel-group 1 supervisionFrameoption vlan-id 10 - * Added config_prp_sup_vlan_tagged - * prp channel-group 1 supervisionFrameOption vlan-tagged - * Added unconfig_prp_sup_vlan_tagged - * no prp channel-group 1 supervisionFrameOption vlan-tagged - * Updated the config using f-strings - * config = f"prp channel-group {interface} supervisionFrameOption vlan-aware-enable" - * Updated api config_prp_static_vdan_entry as configure_prp_static_vdan_entry_with_vlan - * prp channel-group 1 vdanMacaddress 000001000011 vlan-id 10 - * Added configure_prp_static_vdan_entry - * prp channel-group 1 vdanMacaddress 000001000012 - * Added configure_interface_cts_role_based_sgt_map - * API to configure interface cts role based sgt map - * Added unconfigure_interface_cts_role_based_sgt_map - * API to unconfigure interface cts role based sgt map - * Added debug_platform_software_fed_drop_capture - * added api to debug_platform_software_fed_drop_capture - * Added debug_platform_software_fed_drop_capture_action - * added api to debug_platform_software_fed_drop_capture_action - * Added debug_platform_software_fed_drop_capture_buffer - * added api to debug_platform_software_fed_drop_capture_buffer - * Added configure_ignore_startup_config - * added api to configure_ignore_startup_config - * Added unconfigure_ignore_startup_config - * added api to unconfigure_ignore_startup_config - * Added verify_ignore_startup_config - * added api to verify_ignore_startup_config - * Added new API get_interfaces_switchport_state - * get_interfaces_switchport_state - Get switchport state for interfaces - * Added configure_radius_attribute_policy_name_globally - * Added unconfigure_radius_attribute_policy_name_globally - * Added configure_radius_attribute_policy_name_under_server - * Added unconfigure_radius_attribute_policy_name_under_server - * Added configure_radius_attribute_policy_name_under_servergroup - * Added unconfigure_radius_attribute_policy_name_under_servergroup - -* iosxe/cat9k - * Added send_break_boot - * send break boot command for cat9k devices - -* sdk/triggers - * blitz - * Added new action check_yang_subscribe - - --------------------------------------------------------------------------------- - Fix --------------------------------------------------------------------------------- - -* iosxe - * send_break_boot - * update the pattern for break boot for iosxe - * Fixed clear_logging_onboard_rp_active_standby - * added optional variable 'log_name' - * Fixed confirm_iox_enabled_requested_storage_media - * Added mod_storage_string and sso_storage_strings to support modular - * Fixed configure_app_management_networking - * Fixed returns True or False instead of none - * Fixed issue with 'verify_interface_config_duplex' API - * API not working fine when any other config present under interface for auto duplex. - * Fixed issue with 'verify_interface_config_speed' API - * API not working fine when any other config present under interface for auto speed. - * Modified verify_current_image - * Added provision to compare images based on regex if regex_search parameter is True - * ASR1K - * Added verify_current_image - * Passing regex_search as True to compare images based on regex - * Modified configure_management - * Added `alias_as_hostname` argument - * Allows user to use the alias as the device hostname - * Modified health_logging - * Fixed logic error with log count - -* execute - * execute power cycle - * add try except for destroying device object. - -* abstracted_libs - * Modified __init__.py file to import all modules available in the abstracted_libs folder - -* power cycler - * snmp client - * update the logic to work with tuple instead of iterator. - - diff --git a/pkgs/sdk-pkg/changelog/2024/september.rst b/pkgs/sdk-pkg/changelog/2024/september.rst deleted file mode 100644 index c9ba02722..000000000 --- a/pkgs/sdk-pkg/changelog/2024/september.rst +++ /dev/null @@ -1,121 +0,0 @@ --------------------------------------------------------------------------------- - New --------------------------------------------------------------------------------- - -* iosxe - * Added configure_macro_name - * API to configure 'macro name {macro_name}'. - * Enhanced existing api configure_macro_global_apply - * Modified API to configure 'macro global apply {macro_name} {variables} {values} '. - * Added configure_ip_pim_vrf_ssm_range - * API to configure ip pim vrf ssm range - * Added unconfigure_ip_pim_vrf_ssm_range - * API to unconfigure ip pim vrf ssm range - * Added configure_ip_msdp_vrf_peer - * API to configure msdp vrf peer - * Added unconfigure_ip_msdp_vrf_peer - * API to unconfigure msdp vrf peer - * Added config_prp_sup_vlan_aware - * prp channel-group 1 supervisionFrameOption vlan-aware-enable - * Added unconfig_prp_sup_vlan_aware - * no prp channel-group 1 supervisionFrameOption vlan-aware-enable - * Added config_prp_sup_vlan_aware_allowed_vlan_list - * prp channel-group 1 supervisionFrameOption vlan-aware-allowed-vlan 30,40 - * Added unconfig_prp_sup_vlan_aware_allowed_vlan_list - * no prp channel-group 1 supervisionFrameOption vlan-aware-allowed-vlan - * Added config_prp_static_vdan_entry - * prp channel-group 1 vdanMacaddress 000001000011 vlan-id 10 - * Added unconfig_prp_static_vdan_entry - * no prp channel-group 1 vdanMacaddress 000001000011 - * Added config_prp_sup_vlan_aware_reject_untagged - * prp channel-group 1 supervisionFrameOption vlan-aware-reject-untagged - * Added def unconfig_prp_sup_vlan_aware_reject_untagged(device, interface) - * no prp channel-group 1 supervisionFrameOption vlan-aware-reject-untagged - * Added config_prp_sup_vlan_id - * prp channel-group 1 supervisionFrameoption vlan-id 10 - * Added unconfig_prp_sup_vlan_id - * no prp channel-group 1 supervisionFrameoption vlan-id 10 - * Added config_prp_sup_vlan_tagged - * prp channel-group 1 supervisionFrameOption vlan-tagged - * Added unconfig_prp_sup_vlan_tagged - * no prp channel-group 1 supervisionFrameOption vlan-tagged - * Updated the config using f-strings - * config = f"prp channel-group {interface} supervisionFrameOption vlan-aware-enable" - * Updated api config_prp_static_vdan_entry as configure_prp_static_vdan_entry_with_vlan - * prp channel-group 1 vdanMacaddress 000001000011 vlan-id 10 - * Added configure_prp_static_vdan_entry - * prp channel-group 1 vdanMacaddress 000001000012 - * Added configure_interface_cts_role_based_sgt_map - * API to configure interface cts role based sgt map - * Added unconfigure_interface_cts_role_based_sgt_map - * API to unconfigure interface cts role based sgt map - * Added debug_platform_software_fed_drop_capture - * added api to debug_platform_software_fed_drop_capture - * Added debug_platform_software_fed_drop_capture_action - * added api to debug_platform_software_fed_drop_capture_action - * Added debug_platform_software_fed_drop_capture_buffer - * added api to debug_platform_software_fed_drop_capture_buffer - * Added configure_ignore_startup_config - * added api to configure_ignore_startup_config - * Added unconfigure_ignore_startup_config - * added api to unconfigure_ignore_startup_config - * Added verify_ignore_startup_config - * added api to verify_ignore_startup_config - * Added new API get_interfaces_switchport_state - * get_interfaces_switchport_state - Get switchport state for interfaces - * Added configure_radius_attribute_policy_name_globally - * Added unconfigure_radius_attribute_policy_name_globally - * Added configure_radius_attribute_policy_name_under_server - * Added unconfigure_radius_attribute_policy_name_under_server - * Added configure_radius_attribute_policy_name_under_servergroup - * Added unconfigure_radius_attribute_policy_name_under_servergroup - -* iosxe/cat9k - * Added send_break_boot - * send break boot command for cat9k devices - -* sdk/triggers - * blitz - * Added new action check_yang_subscribe - - --------------------------------------------------------------------------------- - Fix --------------------------------------------------------------------------------- - -* iosxe - * send_break_boot - * update the pattern for break boot for iosxe - * Fixed clear_logging_onboard_rp_active_standby - * added optional variable 'log_name' - * Fixed confirm_iox_enabled_requested_storage_media - * Added mod_storage_string and sso_storage_strings to support modular - * Fixed configure_app_management_networking - * Fixed returns True or False instead of none - * Fixed issue with 'verify_interface_config_duplex' API - * API not working fine when any other config present under interface for auto duplex. - * Fixed issue with 'verify_interface_config_speed' API - * API not working fine when any other config present under interface for auto speed. - * Modified verify_current_image - * Added provision to compare images based on regex if regex_search parameter is True - * ASR1K - * Added verify_current_image - * Passing regex_search as True to compare images based on regex - * Modified configure_management - * Added `alias_as_hostname` argument - * Allows user to use the alias as the device hostname - * Modified health_logging - * Fixed logic error with log count - -* execute - * execute power cycle - * add try except for destroying device object. - -* abstracted_libs - * Modified __init__.py file to import all modules available in the abstracted_libs folder - -* power cycler - * snmp client - * update the logic to work with tuple instead of iterator. - - diff --git a/pkgs/sdk-pkg/changelog/changelog_configure_crypto_pki_profile_20240826.rst b/pkgs/sdk-pkg/changelog/changelog_configure_crypto_pki_profile_20240826.rst new file mode 100644 index 000000000..dbc780f38 --- /dev/null +++ b/pkgs/sdk-pkg/changelog/changelog_configure_crypto_pki_profile_20240826.rst @@ -0,0 +1,11 @@ +-------------------------------------------------------------------------------- + NEW +-------------------------------------------------------------------------------- +* IOSXE + * Created new api configure_crypto_pki_profile. + * API to create a pki enrollment profile. + * Created new api unconfigure_crypto_pki_profile. + * API to deleted an enrollment profile. + * Created new api to delete an inprogress pki trustpoint enrollment. + * API to deleted an enrollment of trustpoint. + diff --git a/pkgs/sdk-pkg/sdk_generator/output/github_apis.json b/pkgs/sdk-pkg/sdk_generator/output/github_apis.json index c6dedd1c3..eb0a64d70 100644 --- a/pkgs/sdk-pkg/sdk_generator/output/github_apis.json +++ b/pkgs/sdk-pkg/sdk_generator/output/github_apis.json @@ -331,7 +331,7 @@ "os": "iosxe" }, "uid": "change_pki_server_state", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L883" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L989" } } }, @@ -620,14 +620,14 @@ "clear_controllers_ethernet_controller": { "folders": { "iosxe": { - "doc": " clear controllers ethernet-controller\n Args:\n device ('obj'): device to execute on\n Return:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.platform.utils", + "doc": " API to clear controllers ethernet-controller\n Args:\n device ('obj'): Device object\n interface ('str', Optional): Interface name to clear controllers\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.controllers.clear", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "clear_controllers_ethernet_controller", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/utils.py#L505" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/controllers/clear.py#L7" } } }, @@ -683,7 +683,7 @@ "os": "iosxe" }, "uid": "clear_crypto_ikev2_stats", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1109" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1112" } } }, @@ -2019,6 +2019,20 @@ } } }, + "clear_platform_qos_statistics_iif_id": { + "folders": { + "iosxe": { + "doc": " clear platform hardware qos statistics internal cpu policer\n Args:\n device ('obj'): Device object\n state ('str'): Switch state active or standby\n switch ('str', optional): Switch string\n iif_id('int'): iif id (1-4294967295)\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.platform.clear", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "clear_platform_qos_statistics_iif_id", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/clear.py#L125" + } + } + }, "clear_platform_qos_statistics_internal_cpu_policer": { "folders": { "iosxe": { @@ -2563,7 +2577,7 @@ "os": "iosxe" }, "uid": "config_interface_prpchannel", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9556" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9558" } } }, @@ -2619,7 +2633,7 @@ "os": "iosxe" }, "uid": "config_ip_domain_lookup", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8487" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8489" } } }, @@ -2773,7 +2787,7 @@ "os": "iosxe" }, "uid": "config_link_local_ip_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7395" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7397" } } }, @@ -2787,7 +2801,7 @@ "os": "iosxe" }, "uid": "config_load_interval_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8142" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8144" } } }, @@ -3809,6 +3823,76 @@ } } }, + "configure_access_list_extend": { + "folders": { + "iosxe": { + "doc": " Configures access-list extend\n Args:\n device ('obj'): device to use\n access_list_name ('str'): access list name\n sequence_number ('int'): sequence number\n access_type ('str'): access type(i.e deny/permit)\n protocol_name ('str'): protocol name(i.e udp/tcp)\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.acl.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_access_list_extend", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L2284" + } + } + }, + "configure_access_list_extend_with_dst_address_and_gt_port": { + "folders": { + "iosxe": { + "doc": " Configures access-list extend with destination address and gt port config\n Args:\n device ('obj'): device to use\n access_list_name ('str'): access list name\n sequence_number ('int'): sequence number\n access_type ('str'): access type(i.e deny/permit)\n protocol_name ('str'): protocol name(i.e udp/tcp)\n port_num1 ('int'): first port number \n port_num2 ('int'): second port number \n dst_address ('str'): destinamtion address\n port_num3 ('int'): third port number \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.acl.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_access_list_extend_with_dst_address_and_gt_port", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L2231" + } + } + }, + "configure_access_list_extend_with_dst_address_and_port": { + "folders": { + "iosxe": { + "doc": " Configures access-list extend with destination address and ports\n Args:\n device ('obj'): device to use\n access_list_name ('str'): access list name\n sequence_number ('int'): sequence number\n access_type ('str'): access type(i.e deny/permit)\n protocol_name ('str'): protocol name(i.e udp/tcp)\n dst_address ('str'): destinamtion address\n dst_wildcard_bits ('str'): destination wildcard bits\n port_num1 ('int'): first port number \n port_num2 ('int'): second port number \n \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.acl.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_access_list_extend_with_dst_address_and_port", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L2175" + } + } + }, + "configure_access_list_extend_with_port": { + "folders": { + "iosxe": { + "doc": " Configures access-list extend with ranges\n Args:\n device ('obj'): device to use\n access_list_name ('str'): access list name\n sequence_number ('int'): sequence number\n access_type ('str'): access type(i.e deny/permit)\n protocol_name ('str'): protocol name(i.e udp/tcp)\n port_num1 ('int'): first port number \n port_num2 ('int'): second port number \n port_num3 ('int'): third port number \n port_num4 ('int'): fourth port number \n \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.acl.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_access_list_extend_with_port", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L2203" + } + } + }, + "configure_access_list_extend_with_range_and_eq_port": { + "folders": { + "iosxe": { + "doc": " Configures access-list extend with range and eq port config\n Args:\n device ('obj'): device to use\n access_list_name ('str'): access list name\n sequence_number ('int'): sequence number\n access_type ('str'): access type(i.e deny/permit)\n protocol_name ('str'): protocol name(i.e udp/tcp)\n port_num1 ('int'): first port number \n port_num2 ('int'): second port number \n port_num3 ('int'): third port number \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.acl.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_access_list_extend_with_range_and_eq_port", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L2258" + } + } + }, "configure_access_map_match_ip_address_action_forward": { "folders": { "iosxe": { @@ -4565,6 +4649,20 @@ } } }, + "configure_auto_off_optics": { + "folders": { + "iosxe": { + "doc": "\n Args:\n device ('obj'): Device object\n switch_number('int'): switch number\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.sustainability.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_auto_off_optics", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sustainability/configure.py#L431" + } + } + }, "configure_auto_qos": { "folders": { "iosxe": { @@ -5257,7 +5355,7 @@ "configure_boot_level_licence": { "folders": { "iosxe": { - "doc": " Config boot level license on Device\n Args:\n device ('obj'): Device object\n network-advantage ('bool'): boot level network-advantage\n network-essentials ('bool'): boot level network-essentials\n network-premier ('bool'): boot level network-premier\n addon ('bool'): addon option for license\n adventerprise ('bool'): boot level adventerprise\n advipservices ('bool'): boot level advipservices\n ipbase ('bool'): boot level ipbase\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring boot level license\n ", + "doc": " Config boot level license on Device\n Args:\n device ('obj'): Device object\n network-advantage ('bool'): boot level network-advantage\n network-essentials ('bool'): boot level network-essentials\n network-premier ('bool'): boot level network-premier\n addon ('bool'): addon option for license\n adventerprise ('bool'): boot level adventerprise\n advipservices ('bool'): boot level advipservices\n ipbase ('bool'): boot level ipbase\n advantage ('bool'): boot level advantage\n essentials ('bool'): boot level essentials\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring boot level license\n ", "module_name": "iosxe.system.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -5965,7 +6063,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#L5854" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5948" } } }, @@ -6245,7 +6343,7 @@ "os": "iosxe" }, "uid": "configure_console_default_privilege_level", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8778" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8780" } } }, @@ -6385,7 +6483,7 @@ "os": "iosxe" }, "uid": "configure_crypto_ikev2_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L973" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L976" } } }, @@ -6399,7 +6497,7 @@ "os": "iosxe" }, "uid": "configure_crypto_ikev2_proposal", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L609" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L612" } } }, @@ -6413,7 +6511,7 @@ "os": "iosxe" }, "uid": "configure_crypto_ipsec_nat_transparency", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L660" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L663" } } }, @@ -6455,7 +6553,7 @@ "os": "iosxe" }, "uid": "configure_crypto_map", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1131" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1134" } } }, @@ -6501,6 +6599,20 @@ } } }, + "configure_crypto_pki_profile": { + "folders": { + "iosxe": { + "doc": "\n configure crypto pki enrollment profile\n Args:\n device('obj'): Device object\n prof_name('string'): crypto pki enrollment profile name\n method_est('bool'): use EST method\n enrollment_http_username('string'): http authentication username\n enrollment_http_password_type('bool'): http password type\n enrollment_http_password('string'): http authentication password \n enrollment_url('string'): http or tftp url used for enrollment to CA\n source_interface('string'): source interface for enrollment\n vrf('string'): used for crf config\n no_config('string'): used for unconfiguration of sub configs used in trustpoint\n exit_flag('bool'): used for exit\n Returns: \n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.pki.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_crypto_pki_profile", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L498" + } + } + }, "configure_crypto_pki_server": { "folders": { "iosxe": { @@ -6775,14 +6887,14 @@ "configure_default_spanning_tree": { "folders": { "iosxe": { - "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", + "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", "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/spanning_tree/configure.py#L640" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L2089" } } }, @@ -6814,6 +6926,20 @@ } } }, + "configure_default_stack_power_auto_off": { + "folders": { + "iosxe": { + "doc": " Configure default stack power auto-off\n Args:\n device ('obj'): Device object\n stack_name ('str'): Stack name\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.platform.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "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" + } + } + }, "configure_default_stack_power_ecomode": { "folders": { "iosxe": { @@ -6824,7 +6950,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#L5650" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5649" } } }, @@ -7266,7 +7392,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#L6003" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6097" } } }, @@ -7280,7 +7406,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#L5882" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5976" } } }, @@ -7322,7 +7448,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#L5933" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6027" } } }, @@ -7364,7 +7490,7 @@ "os": "iosxe" }, "uid": "configure_dialer_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8992" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8994" } } }, @@ -7560,7 +7686,7 @@ "os": "iosxe" }, "uid": "configure_dual_port_interface_media_type", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9863" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9865" } } }, @@ -8577,6 +8703,20 @@ } } }, + "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 ", + "module_name": "iosxe.flow.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_fnf_flow_record_match_flow", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/configure.py#L1625" + } + } + }, "configure_fnf_monitor_datalink_interface": { "folders": { "iosxe": { @@ -8657,7 +8797,7 @@ "os": "iosxe" }, "uid": "configure_generate_self_certificate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1159" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1162" } } }, @@ -8699,7 +8839,7 @@ "os": "iosxe" }, "uid": "configure_glbp_details_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9382" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9384" } } }, @@ -8727,7 +8867,7 @@ "os": "iosxe" }, "uid": "configure_global_interface_template_sticky", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9077" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9079" } } }, @@ -8801,6 +8941,25 @@ } } }, + "configure_hostname": { + "doc": " To configure the hostname\n Args:\n device (`obj`): Device object\n hostname (`str`): Hostname to be configured.\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "folders": { + "nxos": { + "doc": " To configure the hostname\n Args:\n device (`obj`): Device object\n hostname (`str`): Hostname to be configured.\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "nxos.platform.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "nxos" + }, + "uid": "configure_hostname", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/platform/configure.py#L13" + } + }, + "module_name": "configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_hostname", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/configure.py#L13" + }, "configure_hqos_policer_map": { "folders": { "iosxe": { @@ -8909,7 +9068,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#L5690" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5784" } } }, @@ -8979,7 +9138,21 @@ "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#L5820" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5914" + } + } + }, + "configure_hw_module_switch_number_auto_off_led": { + "folders": { + "iosxe": { + "doc": " configure_hw_module_switch_number_auto_off_led\n Args:\n device ('obj'): device to use\n switch_number ('str'): switch number\n Returns:\n None\n Raises:\n SubCommandFailure exception\n ", + "module_name": "iosxe.platform.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "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" } } }, @@ -8993,7 +9166,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#L5574" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5573" } } }, @@ -9250,7 +9423,7 @@ "configure_ikev2_profile_pre_share": { "folders": { "iosxe": { - "doc": " Configure Ikev2 Profile with pre-share option\n Args:\n device ('obj') : device to use\n profile_name ('str) Ikev2 Profile Name\n auth_local ('str,optional). Authentication local (Default is pre-share)\n auth_remote ('str',optional) Authentication (i.e esp-sha-hmac) (Default is pre-share)\n keyring ('str',optional) Ikev2 Keyring name (needs to be pre-configured) (Default is None)\n address ('str',optional) Matching address (i.e 100.0.0.2) (Default is None)\n mask ('str',optional) Address Mask (i.e 255.255.255.255 or 64) (Default is '')\n Optional for IPv4, mandatory for IPv6\n protocol ('str',optional) Protocol being used on address (Default is ipv4)\n dpd_interval ('str',optional) DPD interval (Default None)\n dpd_retry ('str',optional) DPD Retries (Default 2)\n dpd_type ('str',optional) DPD type (ie periodic or on-demand) (Default periodic)\n fvrf ('str',optional) FVRF name (Default None)\n lifetime ('str',optional) lifetime in secs (Default is None)\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Configure Ikev2 Profile with pre-share option\n Args:\n device ('obj') : device to use\n profile_name ('str) Ikev2 Profile Name\n auth_local ('str,optional). Authentication local (Default is pre-share)\n auth_remote ('str',optional) Authentication (i.e esp-sha-hmac) (Default is pre-share)\n keyring ('str',optional) Ikev2 Keyring name (needs to be pre-configured) (Default is None)\n address ('str',optional) Matching address (i.e 100.0.0.2) (Default is None)\n mask ('str',optional) Address Mask (i.e 255.255.255.255 or 64) (Default is '')\n Optional for IPv4, mandatory for IPv6\n protocol ('str',optional) Protocol being used on address (Default is ipv4)\n dpd_interval ('str',optional) DPD interval (Default None)\n dpd_retry ('str',optional) DPD Retries (Default 2)\n dpd_type ('str',optional) DPD type (ie periodic or on-demand) (Default periodic)\n fvrf ('str',optional) FVRF name (Default None)\n lifetime ('str',optional) lifetime in secs (Default is None)\n local_interface ('str', optional) interface name (Default is None)\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.ipsec.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -9341,7 +9514,7 @@ "os": "iosxe" }, "uid": "configure_interface_authentication_violation", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8450" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8452" } } }, @@ -9355,7 +9528,7 @@ "os": "iosxe" }, "uid": "configure_interface_bandwidth", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8365" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8367" } } }, @@ -9411,7 +9584,7 @@ "os": "iosxe" }, "uid": "configure_interface_default_snmp_trap_mac_notification_change", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7671" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7673" } } }, @@ -9565,7 +9738,7 @@ "os": "iosxe" }, "uid": "configure_interface_flow_control", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7699" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7701" } } }, @@ -9677,7 +9850,7 @@ "os": "iosxe" }, "uid": "configure_interface_ip_nbar", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9498" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9500" } } }, @@ -9691,7 +9864,7 @@ "os": "iosxe" }, "uid": "configure_interface_ip_tcp_adjust_mss", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7247" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7249" } } }, @@ -9705,7 +9878,7 @@ "os": "iosxe" }, "uid": "configure_interface_ip_verify_source", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8102" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8104" } } }, @@ -9761,7 +9934,7 @@ "os": "iosxe" }, "uid": "configure_interface_ip_wccp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8684" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8686" } } }, @@ -9803,7 +9976,7 @@ "os": "iosxe" }, "uid": "configure_interface_ipv6_tcp_adjust_mss", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7287" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7289" } } }, @@ -9859,7 +10032,7 @@ "os": "iosxe" }, "uid": "configure_interface_keepalive", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8263" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8265" } } }, @@ -9873,7 +10046,7 @@ "os": "iosxe" }, "uid": "configure_interface_l2protocol_tunnel", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8289" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8291" } } }, @@ -9901,7 +10074,7 @@ "os": "iosxe" }, "uid": "configure_interface_lacp_fast_switchover", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7503" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7505" } } }, @@ -9915,7 +10088,7 @@ "os": "iosxe" }, "uid": "configure_interface_lacp_max_bundle", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7560" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7562" } } }, @@ -9999,21 +10172,21 @@ "os": "iosxe" }, "uid": "configure_interface_monitor_session_mtu", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/span/configure.py#L388" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/span/configure.py#L217" } } }, "configure_interface_monitor_session_no_mtu": { "folders": { "iosxe": { - "doc": " configure monitor session on device by setting destination no mtu\n Args:\n device ('obj'): Device object\n session_name ('str'): Session name\n mtu ('str'): mtu size\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " configure monitor session on device by setting destination no mtu\n Args:\n device ('obj'): Device object\n session_name ('str'): Session name\n mtu ('str'): mtu size, (196-9000)\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.span.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_interface_monitor_session_no_mtu", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/span/configure.py#L412" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/span/configure.py#L241" } } }, @@ -10027,7 +10200,7 @@ "os": "iosxe" }, "uid": "configure_interface_monitor_session_shutdown", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7788" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7790" } } }, @@ -10041,7 +10214,7 @@ "os": "iosxe" }, "uid": "configure_interface_monitor_session_shutdown_erspan_dest", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/span/configure.py#L367" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/span/configure.py#L196" } } }, @@ -10083,7 +10256,7 @@ "os": "iosxe" }, "uid": "configure_interface_no_switchport_voice_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9053" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9055" } } }, @@ -10223,7 +10396,7 @@ "os": "iosxe" }, "uid": "configure_interface_pvlan_mapping", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9273" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9275" } } }, @@ -10265,7 +10438,7 @@ "os": "iosxe" }, "uid": "configure_interface_range_no_shutdown", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9910" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9912" } } }, @@ -10279,7 +10452,7 @@ "os": "iosxe" }, "uid": "configure_interface_range_no_switchport", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9642" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9644" } } }, @@ -10293,7 +10466,7 @@ "os": "iosxe" }, "uid": "configure_interface_range_shutdown", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9888" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9890" } } }, @@ -10307,7 +10480,7 @@ "os": "iosxe" }, "uid": "configure_interface_range_switchport_mode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10076" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10078" } } }, @@ -10363,7 +10536,7 @@ "os": "iosxe" }, "uid": "configure_interface_snmp_trap_mac_notification_change", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7615" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7617" } } }, @@ -10494,7 +10667,7 @@ "os": "iosxe" }, "uid": "configure_interface_switchport", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7876" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7878" } } }, @@ -10774,7 +10947,7 @@ "os": "iosxe" }, "uid": "configure_interface_tunnel_mode_ipsec", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1246" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1249" } } }, @@ -10830,7 +11003,7 @@ "os": "iosxe" }, "uid": "configure_interface_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9620" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9622" } } }, @@ -11352,7 +11525,7 @@ "os": "iosxe" }, "uid": "configure_ip_dlep", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7896" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7898" } } }, @@ -11464,7 +11637,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#L5669" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5763" } } }, @@ -11905,14 +12078,14 @@ "configure_ip_multicast_routing_distributed": { "folders": { "iosxe": { - "doc": "Configure IP multicast routing\n Args:\n device (`obj`): Device object\n no_spd (): If True, turn off selective packet discard. Default False.\n punt_limit (`str` or `int`): Punt limit. Acceptable values are:\n integer (packets per second)\n default\n disable\n Return:\n None\n Raise:\n SubCommandFailure: Failure while configuring\n ", - "module_name": "iosxe.multicast.configure", + "doc": " configure ip multicast routing on device\n Args:\n device (`obj`): Device object\n Returns:\n None\n ", + "module_name": "iosxe.mcast.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_ip_multicast_routing_distributed", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/multicast/configure.py#L450" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mcast/configure.py#L48" } } }, @@ -12080,7 +12253,7 @@ "os": "iosxe" }, "uid": "configure_ip_on_atm_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9707" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9709" } } }, @@ -12364,6 +12537,20 @@ } } }, + "configure_ip_sgacl": { + "folders": { + "iosxe": { + "doc": "Configure ip sgacl\n Example: ip access-list role-based PERMIT\n permit ip log\n Args:\n device ('obj'): device to use\n acl_action ('str'): (permit | deny) permits or denies traffic\n ip_protocol_version ('str'): define ip (or) ipv6\n Returns:\n None\n Raises: \n SubCommandFailure\n ", + "module_name": "iosxe.acl.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_ip_sgacl", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L2307" + } + } + }, "configure_ip_source_binding": { "folders": { "iosxe": { @@ -12388,7 +12575,7 @@ "os": "iosxe" }, "uid": "configure_ip_ssh_client_algorithm_encryption", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1295" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1300" } } }, @@ -12402,7 +12589,7 @@ "os": "iosxe" }, "uid": "configure_ip_ssh_client_algorithm_kex", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1278" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1283" } } }, @@ -12416,7 +12603,7 @@ "os": "iosxe" }, "uid": "configure_ip_ssh_client_algorithm_mac", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1261" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1266" } } }, @@ -12430,7 +12617,7 @@ "os": "iosxe" }, "uid": "configure_ip_ssh_server_algorithm_encryption", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1346" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1351" } } }, @@ -12444,7 +12631,7 @@ "os": "iosxe" }, "uid": "configure_ip_ssh_server_algorithm_hostkey", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1363" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1368" } } }, @@ -12458,7 +12645,7 @@ "os": "iosxe" }, "uid": "configure_ip_ssh_server_algorithm_kex", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1329" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1334" } } }, @@ -12472,7 +12659,7 @@ "os": "iosxe" }, "uid": "configure_ip_ssh_server_algorithm_mac", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1312" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1317" } } }, @@ -12500,7 +12687,7 @@ "os": "iosxe" }, "uid": "configure_ip_ssh_version", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L918" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L923" } } }, @@ -12584,7 +12771,7 @@ "os": "iosxe" }, "uid": "configure_ipsec_df_bit", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L730" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L733" } } }, @@ -12598,7 +12785,7 @@ "os": "iosxe" }, "uid": "configure_ipsec_fragmentation", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L698" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L701" } } }, @@ -12612,7 +12799,7 @@ "os": "iosxe" }, "uid": "configure_ipsec_ike_sa_strength_enforcement", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1281" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1284" } } }, @@ -12640,7 +12827,7 @@ "os": "iosxe" }, "uid": "configure_ipsec_sa_global", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L765" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L768" } } }, @@ -12878,14 +13065,14 @@ "os": "iosxe" }, "uid": "configure_ipv6_address_config", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8873" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8875" } } }, "configure_ipv6_address_on_hsrp_interface": { "folders": { "iosxe": { - "doc": " Configure ipv6 address on hsrp interface\n Args:\n device (`obj`): Device object\n interface ('str'): Interface to configure hsrp\n version (`int`): version number\n ipv6_address ('str') : ipv6 address\n priority ('str', optional) : config custom priority to hsrp\n preempt ('str', optional) : config custom preempt delay sync to hsrp\n hello_interval ('str', optional) : config the hello time for hsrp session\n hold_time ('str', optional) : config the hold time for hsrp session\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Configure ipv6 address on hsrp interface\n Args:\n device (`obj`): Device object\n interface ('str'): Interface to configure hsrp\n groupnumber('int'): Group number\n version (`int`): version number\n ipv6_address ('str') : ipv6 address\n priority ('str', optional) : config custom priority to hsrp\n preempt ('str', optional) : config custom preempt delay sync to hsrp\n hello_interval ('str', optional) : config the hello time for hsrp session\n hold_time ('str', optional) : config the hold time for hsrp session\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "iosxe.interface.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -12948,7 +13135,7 @@ "os": "iosxe" }, "uid": "configure_ipv6_dhcp_client_pd_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8076" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8078" } } }, @@ -13466,7 +13653,7 @@ "os": "iosxe" }, "uid": "configure_ipv6_nd_suppress_ra", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8798" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8800" } } }, @@ -13620,7 +13807,7 @@ "os": "iosxe" }, "uid": "configure_ipv6_prefix_name_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8055" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8057" } } }, @@ -14484,7 +14671,7 @@ "os": "iosxe" }, "uid": "configure_line_vty_needs_enhancement", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L956" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L961" } } }, @@ -15149,7 +15336,7 @@ "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#L6120" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6214" } } }, @@ -15163,7 +15350,7 @@ "os": "iosxe" }, "uid": "configure_management", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L683" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L688" } } }, @@ -15213,7 +15400,7 @@ "os": "iosxe" }, "uid": "configure_management_gnmi", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L999" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1004" } } }, @@ -15255,7 +15442,7 @@ "os": "iosxe" }, "uid": "configure_management_netconf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L610" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L615" } } }, @@ -15283,7 +15470,7 @@ "os": "iosxe" }, "uid": "configure_management_protocols", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L638" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L643" } } }, @@ -15360,7 +15547,7 @@ "configure_management_vty_lines": { "folders": { "iosxe": { - "doc": "\n Configure device for management via vty lines.\n\n Args:\n device ('obj'): device object\n authentication ('str'): authentication details\n transport ('str'): transport details\n\n Returns:\n None\n ", + "doc": "\n Configure device for management via vty lines.\n\n Args:\n device ('obj'): device object\n authentication ('str'): authentication details\n transport ('str'): transport details\n stackable ('bool'): stackable set as True if device is stack else False\n\n Returns:\n None\n ", "module_name": "iosxe.management.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -15959,6 +16146,20 @@ } } }, + "configure_medium_p2p_interface": { + "folders": { + "iosxe": { + "doc": " Configure medium p2p 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 medium p2p on interface\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "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" + } + } + }, "configure_member_vfi_on_vlan_configuration": { "folders": { "iosxe": { @@ -16186,7 +16387,7 @@ "os": "iosxe" }, "uid": "configure_monitor_erspan_source_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8401" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8403" } } }, @@ -16396,7 +16597,7 @@ "os": "iosxe" }, "uid": "configure_mtc", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L793" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L798" } } }, @@ -16718,7 +16919,7 @@ "os": "iosxe" }, "uid": "configure_netconf_yang_intelligent_sync", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L886" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L891" } } }, @@ -16806,6 +17007,20 @@ } } }, + "configure_no_pki_enroll": { + "folders": { + "iosxe": { + "doc": "\n Configuring crypto pki enroll\n Args:\n device ('obj'): Device object\n tp_name ('str'): name of the trustpoint\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.pki.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_no_pki_enroll", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L1064" + } + } + }, "configure_no_ptp_enable_on_interface": { "folders": { "iosxe": { @@ -17547,12 +17762,12 @@ } }, "configure_peripheral_terminal_server": { - "doc": " configure terminal server lines for peripherals \n Args:\n device: device object\n ", + "doc": " configure terminal server lines for peripherals\n Args:\n device: device object\n ", "folders": {}, "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "configure_peripheral_terminal_server", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4574" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4575" }, "configure_pfs_enable_or_disable_under_gkm_group": { "folders": { @@ -17578,7 +17793,7 @@ "os": "iosxe" }, "uid": "configure_phymode_ignore_linkup_fault", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10012" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10014" } } }, @@ -17592,7 +17807,7 @@ "os": "iosxe" }, "uid": "configure_physical_interface_vmi", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7977" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7979" } } }, @@ -17662,7 +17877,7 @@ "os": "iosxe" }, "uid": "configure_pki_authenticate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L631" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L737" } } }, @@ -17676,7 +17891,7 @@ "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#L913" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L1019" } } }, @@ -17690,7 +17905,7 @@ "os": "iosxe" }, "uid": "configure_pki_enroll", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L559" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L665" } } }, @@ -17718,7 +17933,7 @@ "os": "iosxe" }, "uid": "configure_pki_export", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L797" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L903" } } }, @@ -17746,7 +17961,7 @@ "os": "iosxe" }, "uid": "configure_pki_import", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L669" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L775" } } }, @@ -17788,7 +18003,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#L5724" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5818" } } }, @@ -17802,7 +18017,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#L6047" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6141" } } }, @@ -17961,7 +18176,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#L5748" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5842" } } }, @@ -18157,7 +18372,7 @@ "os": "iosxe" }, "uid": "configure_portchannel_dpi_algorithm", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8632" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8634" } } }, @@ -18171,7 +18386,7 @@ "os": "iosxe" }, "uid": "configure_power_efficient_ethernet_auto", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7768" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7770" } } }, @@ -18255,7 +18470,7 @@ "os": "iosxe" }, "uid": "configure_print_timestamp_for_show_command", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8759" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8761" } } }, @@ -19739,7 +19954,7 @@ "os": "iosxe" }, "uid": "configure_service_instance", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9420" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9422" } } }, @@ -20642,14 +20857,14 @@ "configure_snmp_server_manager": { "folders": { "iosxe": { - "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", + "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", "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/snmp/configure.py#L508" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3014" } } }, @@ -20821,6 +21036,20 @@ } } }, + "configure_spanning_tree_bridge_assurance": { + "folders": { + "iosxe": { + "doc": "\n Configures spanning-tree Bridge Assurance\n Args:\n device ('obj') : Device object\n Returns:\n None\n ", + "module_name": "iosxe.spanning_tree.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_spanning_tree_bridge_assurance", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py#L880" + } + } + }, "configure_spanning_tree_etherchannel_misconfig": { "folders": { "iosxe": { @@ -20937,6 +21166,25 @@ "folders": { "iosxe": { "doc": " Configures 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": { + "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", + "package": "genie.libs.sdk.apis", + "tokens": { + "model": "c9610" + }, + "uid": "configure_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#L14" + } + }, + "tokens": { + "platform": "cat9k" + } + } + }, "module_name": "iosxe.spanning_tree.configure", "package": "genie.libs.sdk.apis", "tokens": { @@ -20947,6 +21195,34 @@ } } }, + "configure_spanning_tree_portfast_bridge_assurance": { + "folders": { + "iosxe": { + "doc": " Configures Spanning Tree Portfast_bridge_assurance\n Args:\n device ('obj') : device to use\n option ('str'): normal / edge / network / edge bpduguard / edge bpdufilter\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_spanning_tree_portfast_bridge_assurance", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py#L913" + } + } + }, + "configure_spanning_tree_portfast_bridge_assurance_on_interface": { + "folders": { + "iosxe": { + "doc": " Configures Spanning Tree Portfast bridge assurance on interface\n Args:\n device ('obj') : device to use\n interface ('str'): enable spanning-tree portfast bridge assurance on this interface\n option('str'): edge trunk/network\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_spanning_tree_portfast_bridge_assurance_on_interface", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py#L955" + } + } + }, "configure_spanning_tree_portfast_default": { "folders": { "iosxe": { @@ -21055,7 +21331,7 @@ "os": "iosxe" }, "uid": "configure_ssh_certificate_profile", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1168" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1173" } } }, @@ -21069,7 +21345,7 @@ "os": "iosxe" }, "uid": "configure_ssh_server_algorithm", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1215" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1220" } } }, @@ -21087,6 +21363,20 @@ } } }, + "configure_stack_power_auto_off": { + "folders": { + "iosxe": { + "doc": " Configure stack power auto-off\n Args:\n device ('obj'): Device object\n stack_name ('str'): Stack name\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.platform.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "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" + } + } + }, "configure_stack_power_default_mode": { "folders": { "iosxe": { @@ -21111,7 +21401,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#L5611" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5610" } } }, @@ -21433,7 +21723,7 @@ "os": "iosxe" }, "uid": "configure_sub_interface_encapsulation_dot1q", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10194" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10196" } } }, @@ -21447,7 +21737,7 @@ "os": "iosxe" }, "uid": "configure_sub_interface_range", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10052" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10054" } } }, @@ -21538,14 +21828,14 @@ "configure_switch_provision": { "folders": { "iosxe": { - "doc": " Configure switch provision for switch\n Args:\n device ('obj'): Device object\n switch_number('int'): switch number\n model ('str'): switch model\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.platform.configure", + "doc": " Configures switch provisioning / offline configuration\n Example : switch 3 provision c9300-24h\n\n Args:\n device ('obj'): device to use\n switch_number('int'): switch number (Range 1-16)\n sku_type('str'): type of switch\n\n Returns:\n None\n\n Raises: \n SubCommandFailure\n ", + "module_name": "iosxe.offline_provisioning.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_switch_provision", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L554" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/offline_provisioning/configure.py#L11" } } }, @@ -21657,7 +21947,7 @@ "os": "iosxe" }, "uid": "configure_switchport_protected", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8221" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8223" } } }, @@ -21671,7 +21961,7 @@ "os": "iosxe" }, "uid": "configure_switchport_pvlan_trunk_allowed_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9183" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9185" } } }, @@ -21685,7 +21975,7 @@ "os": "iosxe" }, "uid": "configure_switchport_pvlan_trunk_native_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9229" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9231" } } }, @@ -21759,6 +22049,20 @@ } } }, + "configure_switchport_trunk_native_vlan_tag": { + "folders": { + "iosxe": { + "doc": " configure switchport trunk native vlan tag\n Args:\n device ('obj') : device to use\n interface ('str') : interface to configure\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_switchport_trunk_native_vlan_tag", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10228" + } + } + }, "configure_switchport_trunk_pruning_vlan": { "folders": { "iosxe": { @@ -21853,7 +22157,7 @@ "os": "iosxe" }, "uid": "configure_system_debounce_link_down_timer", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9953" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9955" } } }, @@ -21867,7 +22171,7 @@ "os": "iosxe" }, "uid": "configure_system_debounce_link_up_timer", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9933" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9935" } } }, @@ -22162,7 +22466,7 @@ } }, "configure_terminal_line_speed": { - "doc": " Configure terminal line speed\n Args:\n device: device object\n terminal_line(int): line number\n speed(int): speed to configure\n ", + "doc": " Configure terminal line speed\n Args:\n device: device object\n terminal_device: terminal device object\n terminal_line(int): line number\n speed(int): speed to configure\n ", "folders": {}, "module_name": "utils", "package": "genie.libs.sdk.apis", @@ -22179,7 +22483,7 @@ "os": "iosxe" }, "uid": "configure_terminal_settings", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/system/configure.py#L79" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/system/configure.py#L85" } } }, @@ -22347,7 +22651,7 @@ "os": "iosxe" }, "uid": "configure_tunnel_with_ipsec", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1018" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1021" } } }, @@ -22424,14 +22728,14 @@ "configure_udld_message_time": { "folders": { "iosxe": { - "doc": " Configures UDLD Message Time on Target Device globally \n Args:\n device ('obj') : device to use\n message_time ('int') : Time in seconds between sending of messages 1-90\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.udld.configure", + "doc": " Configures udld message time\n Example : udld message time 30\n Args:\n device ('obj'): device to use\n time ('int'): Time in seconds between sending of messages in steady state\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.platform.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "configure_udld_message_time", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/udld/configure.py#L95" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2497" } } }, @@ -22631,6 +22935,20 @@ } } }, + "configure_vlan_dot1q_tag_native": { + "folders": { + "iosxe": { + "doc": " configure vlan dot1q tag native\n Args:\n device ('obj') : device to use\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.dot1q.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "configure_vlan_dot1q_tag_native", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1q/configure.py#L14" + } + } + }, "configure_vlan_group_list": { "folders": { "iosxe": { @@ -22907,7 +23225,7 @@ "os": "iosxe" }, "uid": "configure_vrrp_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7365" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7367" } } }, @@ -22921,7 +23239,7 @@ "os": "iosxe" }, "uid": "configure_vrrp_version_on_device", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7350" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7352" } } }, @@ -24559,7 +24877,7 @@ "os": "iosxe" }, "uid": "disable_switchport_trunk_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9361" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9363" } } }, @@ -25282,7 +25600,7 @@ "os": "iosxe" }, "uid": "enable_switchport_protected_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9663" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9665" } } }, @@ -26679,7 +26997,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#L6083" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6177" } } }, @@ -26753,6 +27071,62 @@ } } }, + "execute_monitor_capture_class_map": { + "folders": { + "iosxe": { + "doc": "\n Execute monitor capture class-map \n Example: monitor capture test class-map myclassmap\n Args:\n device ('obj'): Device Object\n capture_name ('str'): Name of Capture\n class_name ('str'): Class name\n ", + "module_name": "iosxe.flow.execute", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "execute_monitor_capture_class_map", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/execute.py#L96" + } + } + }, + "execute_monitor_capture_clear": { + "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.execute", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "execute_monitor_capture_clear", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/execute.py#L111" + } + } + }, + "execute_monitor_capture_file_location_flash": { + "folders": { + "iosxe": { + "doc": "\n Execute:\n - monitor capture file location flash:\n - monitor capture file location flash: ring size \n Example:\n - monitor capture test file location flash:testin.pcap\n - monitor capture test file location flash:testin.pcap ring 4 size 1\n Args:\n device ('obj'): Device Object\n capture_name ('str'): Name of Capture\n file_name ('str'): Name of file\n number_of_file (int): Number of File (<2-10> Number of files in the file ring)\n size_of_file (int): File size (<1-100> Total size of file(s) in MB)\n ", + "module_name": "iosxe.flow.execute", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "execute_monitor_capture_file_location_flash", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/execute.py#L59" + } + } + }, + "execute_monitor_capture_start_capture_filter": { + "folders": { + "iosxe": { + "doc": "\n Execute monitor capture start capture-filter \n Example: monitor capture test start capture-filter ANY\n Args:\n device ('obj'): Device Object\n capture_name ('str'): Name of Capture\n capture_filter ('str'): Capture filter String\n ", + "module_name": "iosxe.flow.execute", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "execute_monitor_capture_start_capture_filter", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/execute.py#L44" + } + } + }, "execute_more_file": { "folders": { "iosxe": { @@ -26998,6 +27372,18 @@ }, "iosxe": { "doc": "Set config register to load image in boot variable\n Args:\n device ('obj'): Device object\n config_reg ('str'): Hexadecimal value to set the config register to\n timeout ('int'): Max time to set config-register in seconds\n ", + "folders": { + "ie3k": { + "doc": "Set config register to load image in boot variable \n ", + "module_name": "iosxe.ie3k.platform.execute", + "package": "genie.libs.sdk.apis", + "tokens": { + "platform": "ie3k" + }, + "uid": "execute_set_config_register", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/platform/execute.py#L25" + } + }, "module_name": "iosxe.platform.execute", "package": "genie.libs.sdk.apis", "tokens": { @@ -28751,7 +29137,7 @@ "uid": "get_boot_variables", "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/platform/get.py#L11" }, - "platform": { + "ie3k": { "doc": "Get current or next-reload boot variables on the device\n Args:\n device (`obj`): Device object\n boot_var (`str`): Type of boot variable to return to caller(Eg:current, next)\n output (`str`): output from show boot\n Returns:\n List of boot images or []\n ", "module_name": "iosxe.ie3k.platform.get", "package": "genie.libs.sdk.apis", @@ -37500,6 +37886,16 @@ }, "uid": "is_management_interface", "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/management/verify.py#L2" + }, + "nxos": { + "doc": " Verify if interface is a management interface\n\n Args:\n name (str): Interface name\n\n Returns:\n True or False\n ", + "module_name": "nxos.management.verify", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "nxos" + }, + "uid": "is_management_interface", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/management/verify.py#L3" } } }, @@ -38085,7 +38481,7 @@ "os": "iosxe" }, "uid": "no_shut_interface_range", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10148" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10150" } } }, @@ -38099,7 +38495,7 @@ "os": "iosxe" }, "uid": "no_shut_sub_interface_range", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10171" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10173" } } }, @@ -39973,7 +40369,7 @@ "os": "iosxe" }, "uid": "shutdown_interface_range", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10125" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10127" } } }, @@ -40001,7 +40397,7 @@ "os": "iosxe" }, "uid": "shutdown_sub_interface_range", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10102" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10104" } } }, @@ -40329,6 +40725,20 @@ } } }, + "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 ", + "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" + } + } + }, "test_platform_software_usb_fake_insert_remove": { "folders": { "iosxe": { @@ -40376,6 +40786,7 @@ "c9400", "c9500", "c9600", + "c9610", "c9800" ], "os": [ @@ -40644,7 +41055,7 @@ "os": "iosxe" }, "uid": "unconfig_diagnostic_monitor_threshold", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8166" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8168" } } }, @@ -40854,7 +41265,7 @@ "os": "iosxe" }, "uid": "unconfig_interface_prpchannel", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9589" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9591" } } }, @@ -40882,7 +41293,7 @@ "os": "iosxe" }, "uid": "unconfig_ip_domain_lookup", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8512" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8514" } } }, @@ -41292,6 +41703,20 @@ } } }, + "unconfigure_aaa_accounting_dot1x_default_start_stop_group": { + "folders": { + "iosxe": { + "doc": "api for no aaa accounting dot1x default start-stop group \n\n Args:\n device ('obj') : Device object\n server_group_name ('str') : Server-group name [Command accounting supports only tacacs group]\n Return:\n None\n Raise:\n SubCommandFailure: failed to configure aaa accounting dot1x default start-stop group \n ", + "module_name": "iosxe.aaa.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_aaa_accounting_dot1x_default_start_stop_group", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py#L3073" + } + } + }, "unconfigure_aaa_accounting_exec_default_start_stop_group": { "folders": { "iosxe": { @@ -41992,6 +42417,20 @@ } } }, + "unconfigure_auto_off_optics": { + "folders": { + "iosxe": { + "doc": "\n Args:\n device ('obj'): Device object\n switch_number('int'): switch number\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.sustainability.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_auto_off_optics", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sustainability/configure.py#L449" + } + } + }, "unconfigure_auto_qos": { "folders": { "iosxe": { @@ -42487,7 +42926,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#L5868" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5962" } } }, @@ -42655,7 +43094,7 @@ "os": "iosxe" }, "uid": "unconfigure_crypto_ikev2_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L999" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1002" } } }, @@ -42669,7 +43108,7 @@ "os": "iosxe" }, "uid": "unconfigure_crypto_ikev2_proposal", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L641" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L644" } } }, @@ -42683,7 +43122,7 @@ "os": "iosxe" }, "uid": "unconfigure_crypto_ipsec_nat_transparency", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L679" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L682" } } }, @@ -42743,6 +43182,20 @@ } } }, + "unconfigure_crypto_pki_profile": { + "folders": { + "iosxe": { + "doc": "\n unconfiguring crypto pki profile enrollment\n Args:\n device ('obj'): Device object\n prof_name ('str'): Name of the trsutpoint\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.pki.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_crypto_pki_profile", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L572" + } + } + }, "unconfigure_crypto_pki_server": { "folders": { "iosxe": { @@ -42753,7 +43206,7 @@ "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#L498" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L604" } } }, @@ -43220,7 +43673,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#L6025" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6119" } } }, @@ -43234,7 +43687,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#L5909" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6003" } } }, @@ -43276,7 +43729,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#L5968" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6062" } } }, @@ -44340,7 +44793,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#L5705" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5799" } } }, @@ -44410,7 +44863,21 @@ "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#L5837" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5931" + } + } + }, + "unconfigure_hw_module_switch_number_auto_off_led": { + "folders": { + "iosxe": { + "doc": " unconfigure_hw_module_switch_number_auto_off_led\n Args:\n device ('obj'): device to use\n switch_number ('str'): switch number\n Returns:\n None\n Raises:\n SubCommandFailure exception\n ", + "module_name": "iosxe.platform.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "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" } } }, @@ -44424,7 +44891,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#L5593" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5592" } } }, @@ -44674,7 +45141,7 @@ "os": "iosxe" }, "uid": "unconfigure_ikev2_profile_pre_share", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L588" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L591" } } }, @@ -44716,7 +45183,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_access_session", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7327" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7329" } } }, @@ -44758,7 +45225,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_authentication_violation", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8469" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8471" } } }, @@ -44772,7 +45239,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_bandwidth", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8383" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8385" } } }, @@ -44898,7 +45365,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_duplex_mode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8615" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8617" } } }, @@ -44926,7 +45393,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_flow_control", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7723" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7725" } } }, @@ -45010,7 +45477,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_ip_nbar", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9527" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9529" } } }, @@ -45024,7 +45491,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_ip_tcp_adjust_mss", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7268" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7270" } } }, @@ -45038,7 +45505,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_ip_verify_source", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8123" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8125" } } }, @@ -45066,7 +45533,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_ipv6_tcp_adjust_mss", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7308" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7310" } } }, @@ -45094,7 +45561,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_l2protocol_tunnel", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8331" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8333" } } }, @@ -45108,7 +45575,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_lacp_fast_switchover", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7533" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7535" } } }, @@ -45122,7 +45589,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_lacp_max_bundle", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7588" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7590" } } }, @@ -45262,7 +45729,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_pvlan_host_assoc", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9142" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9144" } } }, @@ -45276,7 +45743,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_pvlan_mapping", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9294" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9296" } } }, @@ -45290,7 +45757,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_pvlan_mode_with_submode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8970" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8972" } } }, @@ -45346,7 +45813,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_service_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9092" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9094" } } }, @@ -45360,7 +45827,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_snmp_trap_mac_notification_change", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7643" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7645" } } }, @@ -45402,7 +45869,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_speed", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9687" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9689" } } }, @@ -45514,7 +45981,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_switchport_port_security", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8188" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8190" } } }, @@ -45542,7 +46009,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_switchport_pvlan_association", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9119" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9121" } } }, @@ -45556,7 +46023,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_switchport_pvlan_mapping", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9161" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9163" } } }, @@ -45570,7 +46037,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_switchport_trunk_allowed_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8008" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8010" } } }, @@ -45626,7 +46093,7 @@ "os": "iosxe" }, "uid": "unconfigure_interface_tunnel_mode_ipsec", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1264" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1267" } } }, @@ -46018,7 +46485,7 @@ "os": "iosxe" }, "uid": "unconfigure_ip_dlep", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7947" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7949" } } }, @@ -46431,14 +46898,14 @@ "unconfigure_ip_multicast_routing_distributed": { "folders": { "iosxe": { - "doc": "Unconfigure IP multicast routing\n Args:\n device (`obj`): Device object\n no_spd (): Selective packet discard\n punt_limit (`str` or `int`): Punt limit. Acceptable values are:\n integer (packets per second)\n default\n disable\n Return:\n None\n Raise:\n SubCommandFailure: Failure while configuring\n ", - "module_name": "iosxe.multicast.configure", + "doc": "Unconfigure ip multicast routing on device\n Args:\n device (`obj`): Device object\n Returns:\n None\n ", + "module_name": "iosxe.mcast.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "unconfigure_ip_multicast_routing_distributed", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/multicast/configure.py#L481" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mcast/configure.py#L63" } } }, @@ -46592,7 +47059,7 @@ "os": "iosxe" }, "uid": "unconfigure_ip_on_atm_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9806" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9808" } } }, @@ -46606,7 +47073,7 @@ "os": "iosxe" }, "uid": "unconfigure_ip_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8538" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8540" } } }, @@ -46876,6 +47343,20 @@ } } }, + "unconfigure_ip_sgacl": { + "folders": { + "iosxe": { + "doc": "Unconfigure ip sgacl\n Example: no ip access-list role-based PERMIT\n Args:\n device ('obj'): device to use\n acl_action ('str'): (permit | deny) permits or denies traffic\n Returns:\n None\n Raises: \n SubCommandFailure\n ", + "module_name": "iosxe.acl.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_ip_sgacl", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L2330" + } + } + }, "unconfigure_ip_source_binding": { "folders": { "iosxe": { @@ -46914,7 +47395,7 @@ "os": "iosxe" }, "uid": "unconfigure_ip_ssh_version", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L937" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L942" } } }, @@ -46984,7 +47465,7 @@ "os": "iosxe" }, "uid": "unconfigure_ipsec_df_bit", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L872" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L875" } } }, @@ -46998,7 +47479,7 @@ "os": "iosxe" }, "uid": "unconfigure_ipsec_fragmentation", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L840" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L843" } } }, @@ -47012,7 +47493,7 @@ "os": "iosxe" }, "uid": "unconfigure_ipsec_ike_sa_strength_enforcement", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1297" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1300" } } }, @@ -47040,7 +47521,7 @@ "os": "iosxe" }, "uid": "unconfigure_ipsec_sa_global", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L907" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L910" } } }, @@ -47159,14 +47640,14 @@ "unconfigure_ipv6_acl": { "folders": { "iosxe": { - "doc": " Unconfigure IPv6 ACL\n\n Args:\n device (`obj`): Device object\n acl_name ('str'): access-list name\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.ogacl.configure", + "doc": " Unconfigure IPv6 ACL\n\n Args:\n device (`obj`): Device object\n acl_name ('str'): access-list name to unconfigure\n Returns:\n None\n Raises:\n SubCommandFailure\n \n ", + "module_name": "iosxe.acl.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "unconfigure_ipv6_acl", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L372" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L499" } } }, @@ -47208,7 +47689,7 @@ "os": "iosxe" }, "uid": "unconfigure_ipv6_address_autoconfig", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8951" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8953" } } }, @@ -47222,7 +47703,7 @@ "os": "iosxe" }, "uid": "unconfigure_ipv6_address_config", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8912" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8914" } } }, @@ -47236,7 +47717,7 @@ "os": "iosxe" }, "uid": "unconfigure_ipv6_address_test", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8852" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8854" } } }, @@ -47684,7 +48165,7 @@ "os": "iosxe" }, "uid": "unconfigure_ipv6_nd_suppress_ra", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8816" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8818" } } }, @@ -47852,7 +48333,7 @@ "os": "iosxe" }, "uid": "unconfigure_ipv6_redirects", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8834" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8836" } } }, @@ -48118,7 +48599,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#L6101" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6195" } } }, @@ -48937,7 +49418,7 @@ "os": "iosxe" }, "uid": "unconfigure_management_credentials", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1134" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1139" } } }, @@ -48951,7 +49432,7 @@ "os": "iosxe" }, "uid": "unconfigure_management_netconf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L982" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L987" } } }, @@ -49319,6 +49800,20 @@ } } }, + "unconfigure_medium_p2p_interface": { + "folders": { + "iosxe": { + "doc": " Unconfigure medium p2p 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 unconfiguring medium p2p on interface\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "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" + } + } + }, "unconfigure_mka_keychain_on_interface": { "folders": { "iosxe": { @@ -49441,7 +49936,7 @@ "os": "iosxe" }, "uid": "unconfigure_monitor_erspan_source_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8425" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8427" } } }, @@ -49525,7 +50020,7 @@ "os": "iosxe" }, "uid": "unconfigure_mtc", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L867" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L872" } } }, @@ -49539,7 +50034,7 @@ "os": "iosxe" }, "uid": "unconfigure_mtc_parameters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L832" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L837" } } }, @@ -49833,7 +50328,7 @@ "os": "iosxe" }, "uid": "unconfigure_netconf_yang_intelligent_sync", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L902" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L907" } } }, @@ -49847,7 +50342,7 @@ "os": "iosxe" }, "uid": "unconfigure_netconf_yang_polling", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L777" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L782" } } }, @@ -50071,7 +50566,7 @@ "os": "iosxe" }, "uid": "unconfigure_ospfv3_authentication_null", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1220" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L1223" } } }, @@ -50197,7 +50692,7 @@ "os": "iosxe" }, "uid": "unconfigure_phymode_ignore_linkup_fault", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10032" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10034" } } }, @@ -50281,7 +50776,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#L5736" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5830" } } }, @@ -50295,7 +50790,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#L6065" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L6159" } } }, @@ -50393,7 +50888,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#L5805" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5899" } } }, @@ -50463,7 +50958,7 @@ "os": "iosxe" }, "uid": "unconfigure_port_channel_ip", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8709" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8711" } } }, @@ -50519,7 +51014,7 @@ "os": "iosxe" }, "uid": "unconfigure_portchannel_dpi_algorithm", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8658" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8660" } } }, @@ -50533,7 +51028,7 @@ "os": "iosxe" }, "uid": "unconfigure_power_efficient_ethernet_auto", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8037" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8039" } } }, @@ -50617,7 +51112,7 @@ "os": "iosxe" }, "uid": "unconfigure_profile_on_tunnel_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7742" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L7744" } } }, @@ -51471,7 +51966,7 @@ "os": "iosxe" }, "uid": "unconfigure_service_instance", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9465" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9467" } } }, @@ -52063,6 +52558,20 @@ } } }, + "unconfigure_spanning_tree_bridge_assurance": { + "folders": { + "iosxe": { + "doc": " \n UnConfigures spanning-tree Bridge assurance\n Args:\n device ('obj') : Device object\n Returns:\n None\n ", + "module_name": "iosxe.spanning_tree.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_spanning_tree_bridge_assurance", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py#L897" + } + } + }, "unconfigure_spanning_tree_etherchannel_misconfig": { "folders": { "iosxe": { @@ -52147,6 +52656,34 @@ } } }, + "unconfigure_spanning_tree_portfast_bridge_assurance": { + "folders": { + "iosxe": { + "doc": " Unconfigures Spanning Tree Portfast\n Args:\n device ('obj') : device to use\n option ('str'): normal / edge / network / edge bpduguard / edge bpdufilter\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.spanning_tree.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_spanning_tree_portfast_bridge_assurance", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py#L934" + } + } + }, + "unconfigure_spanning_tree_portfast_bridge_assurance_on_interface": { + "folders": { + "iosxe": { + "doc": " Unconfigures Spanning Tree Portfast bridge assurance on interface\n Args:\n device ('obj') : device to use\n interface ('str'): enable spanning-tree portfast bridge assurance on this interface\n option('str'): edge trunk/network\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.spanning_tree.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_spanning_tree_portfast_bridge_assurance_on_interface", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py#L978" + } + } + }, "unconfigure_spanning_tree_portfast_on_interface": { "folders": { "iosxe": { @@ -52241,7 +52778,7 @@ "os": "iosxe" }, "uid": "unconfigure_ssh_certificate_profile", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1197" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1202" } } }, @@ -52255,7 +52792,7 @@ "os": "iosxe" }, "uid": "unconfigure_ssh_server_algorithm", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1238" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L1243" } } }, @@ -52273,6 +52810,20 @@ } } }, + "unconfigure_stack_power_auto_off": { + "folders": { + "iosxe": { + "doc": " Unconfigure stack power auto-off\n Args:\n device ('obj'): Device object\n stack_name ('str'): Stack name\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.platform.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "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" + } + } + }, "unconfigure_stack_power_ecomode": { "folders": { "iosxe": { @@ -52283,7 +52834,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#L5630" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5629" } } }, @@ -52584,14 +53135,14 @@ "unconfigure_switch_provision": { "folders": { "iosxe": { - "doc": " Unconfigure switch provision for switch\n Args:\n device ('obj'): Device object\n switch_number('int'): switch number\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.platform.configure", + "doc": " Unconfigures switch provisioning\n Example : no switch 3 provision\n\n Args:\n device ('obj'): device to use\n switch_number('int'): switch number (Range 1-16)\n\n Returns:\n None\n\n Raises: \n SubCommandFailure\n ", + "module_name": "iosxe.offline_provisioning.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "unconfigure_switch_provision", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L572" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/offline_provisioning/configure.py#L33" } } }, @@ -52619,7 +53170,7 @@ "os": "iosxe" }, "uid": "unconfigure_switchport_protected", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8242" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8244" } } }, @@ -52633,7 +53184,7 @@ "os": "iosxe" }, "uid": "unconfigure_switchport_pvlan_trunk_allowed_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9207" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9209" } } }, @@ -52647,7 +53198,7 @@ "os": "iosxe" }, "uid": "unconfigure_switchport_pvlan_trunk_native_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9251" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9253" } } }, @@ -52661,7 +53212,7 @@ "os": "iosxe" }, "uid": "unconfigure_switchport_trunk_allowed_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9315" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9317" } } }, @@ -52675,7 +53226,21 @@ "os": "iosxe" }, "uid": "unconfigure_switchport_trunk_native_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9338" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9340" + } + } + }, + "unconfigure_switchport_trunk_native_vlan_tag": { + "folders": { + "iosxe": { + "doc": " unconfigure switchport trunk native vlan tag\n Args:\n device ('obj') : device to use\n interface ('str') : interface to configure\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.interface.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_switchport_trunk_native_vlan_tag", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L10246" } } }, @@ -52717,7 +53282,7 @@ "os": "iosxe" }, "uid": "unconfigure_system_debounce_link_down_timer", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9992" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9994" } } }, @@ -52731,7 +53296,7 @@ "os": "iosxe" }, "uid": "unconfigure_system_debounce_link_up_timer", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9973" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9975" } } }, @@ -52913,7 +53478,7 @@ "os": "iosxe" }, "uid": "unconfigure_trustpoint", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L527" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L633" } } }, @@ -53032,14 +53597,14 @@ "unconfigure_udld_message_time": { "folders": { "iosxe": { - "doc": " Unconfigures UDLD Message Time on Target Device globally\n Args:\n device ('obj') : device to use\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.udld.configure", + "doc": " Unconfigures udld message time\n Example : no udld message time\n\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.platform.configure", "package": "genie.libs.sdk.apis", "tokens": { "os": "iosxe" }, "uid": "unconfigure_udld_message_time", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/udld/configure.py#L113" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L2425" } } }, @@ -53197,6 +53762,20 @@ } } }, + "unconfigure_vlan_dot1q_tag_native": { + "folders": { + "iosxe": { + "doc": " unconfigure vlan dot1q tag native\n Args:\n device ('obj') : device to use\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "iosxe.dot1q.configure", + "package": "genie.libs.sdk.apis", + "tokens": { + "os": "iosxe" + }, + "uid": "unconfigure_vlan_dot1q_tag_native", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1q/configure.py#L31" + } + } + }, "unconfigure_vlan_group_list": { "folders": { "iosxe": { @@ -53533,7 +54112,7 @@ "os": "iosxe" }, "uid": "unshut_port_channel", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8737" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8739" } } }, diff --git a/pkgs/sdk-pkg/sdk_generator/output/github_triggers.json b/pkgs/sdk-pkg/sdk_generator/output/github_triggers.json index ba7a628ac..af5fb7ad5 100644 --- a/pkgs/sdk-pkg/sdk_generator/output/github_triggers.json +++ b/pkgs/sdk-pkg/sdk_generator/output/github_triggers.json @@ -3723,7 +3723,7 @@ "interval": 10, "max_time": 180 }, - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/modify/bgp/iosxr/modify.py" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/modify/bgp/iosxe/modify.py" }, "top": { "contribute": false, @@ -3800,7 +3800,7 @@ "interval": 10, "max_time": 180 }, - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/modify/bgp/iosxr/modify.py" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/modify/bgp/iosxe/modify.py" }, "top": { "contribute": false, @@ -3958,7 +3958,7 @@ "interval": 10, "max_time": 180 }, - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/modify/interface/iosxr/modify.py" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/modify/interface/iosxe/modify.py" }, "top": { "contribute": false, @@ -8511,7 +8511,7 @@ "interval": 10, "max_time": 180 }, - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/shutnoshut/interface/iosxr/shutnoshut.py" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/shutnoshut/interface/iosxe/shutnoshut.py" }, "top": { "contribute": false, @@ -9016,7 +9016,7 @@ "interval": 10, "max_time": 180 }, - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/unconfigconfig/bgp/iosxr/unconfigconfig.py" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/unconfigconfig/bgp/iosxe/unconfigconfig.py" }, "top": { "contribute": false, @@ -9818,7 +9818,7 @@ "interval": 10, "max_time": 180 }, - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/unconfigconfig/bgp/iosxr/unconfigconfig.py" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/unconfigconfig/bgp/iosxe/unconfigconfig.py" }, "top": { "contribute": false, diff --git a/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json b/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json index d0e770d60..f642c290f 100644 --- a/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json +++ b/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json @@ -3463,7 +3463,7 @@ "attempt": 5, "interval": 10 }, - "schema": "{Any (str) *: {Optional (str) oper_status: , Optional (str) line_protocol: , Optional (str) enabled: , Optional (str) is_deleted: , Optional (str) connected: , Optional (str) err_disabled: , Optional (str) suspended: , Optional (str) description: , Optional (str) type: , Optional (str) link_state: , Optional (str) port_speed: , Optional (str) duplex_mode: , Optional (str) link_type: , Optional (str) media_type: , Optional (str) mtu: , Optional (str) maximum_active_vcs: , Optional (str) vcs_per_vp: , Optional (str) vc_idle_disconnect_time: , Optional (str) vc_auto_creation: , Optional (str) current_vccs: , Optional (str) aal5_crc_errors: , Optional (str) aal5_oversized_sdus: , Optional (str) aal5_sar_timeouts: , Optional (str) vaccess_status: , Optional (str) vaccess_loopback: , Optional (str) base_pppoatm: , Optional (str) dtr_pulsed: , Optional (str) sub_mtu: , Optional (str) medium: , Optional (str) reliability: , Optional (str) txload: , Optional (str) rxload: , Optional (str) mac_address: , Optional (str) phys_address: , Optional (str) delay: , Optional (str) carrier_delay: , Optional (str) carrier_delay_up: , Optional (str) carrier_delay_down: , Optional (str) keepalive: , Optional (str) auto_negotiate: , Optional (str) arp_type: , Optional (str) arp_timeout: , Optional (str) last_input: , Optional (str) last_output: , Optional (str) output_hang: , Optional (str) autostate: , Optional (str) tunnel_source_ip: , Optional (str) tunnel_source_interface: , Optional (str) tunnel_destination_ip: , Optional (str) tunnel_protocol: , Optional (str) tunnel_ttl: , Optional (str) tunnel_transport_mtu: , Optional (str) tunnel_transmit_bandwidth: , Optional (str) tunnel_receive_bandwidth: , Optional (str) tunnel_protection: , Optional (str) tunnel_profile: , Optional (str) carrier_transitions: , Optional (str) queues: {Optional (str) input_queue_size: , Optional (str) input_queue_max: , Optional (str) input_queue_drops: , Optional (str) input_queue_flushes: , Optional (str) total_output_drop: , Optional (str) queue_strategy: , Optional (str) output_queue_size: , Optional (str) output_queue_max: , Optional (str) threshold: , Optional (str) drops: }, Optional (str) flow_control: {Optional (str) receive: , Optional (str) send: }, Optional (str) port_channel: {Optional (str) port_channel_member: , Optional (str) port_channel_int: , Optional (str) port_channel_member_intfs: , Optional (str) active_members: , Optional (str) num_of_pf_jumbo_supported_members: }, Optional (str) bandwidth: , Optional (str) counters: {Optional (str) rate: {Optional (str) load_interval: , Optional (str) in_rate: , Optional (str) in_rate_pkts: , Optional (str) out_rate: , Optional (str) out_rate_pkts: , Optional (str) in_rate_bps: , Optional (str) in_rate_pps: , Optional (str) out_rate_bps: , Optional (str) out_rate_pps: }, Optional (str) in_multicast_pkts: , Optional (str) in_broadcast_pkts: , Optional (str) in_crc_errors: , Optional (str) in_giants: , Optional (str) in_pkts: , Optional (str) in_frame: , Optional (str) in_runts: , Optional (str) in_overrun: , Optional (str) in_ignored: , Optional (str) in_watchdog: , Optional (str) in_with_dribble: , Optional (str) in_octets: , Optional (str) in_errors: , Optional (str) in_abort: , Optional (str) in_no_buffer: , Optional (str) in_throttles: , Optional (str) in_mac_pause_frames: , Optional (str) out_pkts: , Optional (str) out_octets: , Optional (str) out_multicast_pkts: , Optional (str) out_broadcast_pkts: , Optional (str) out_errors: , Optional (str) out_collision: , Optional (str) out_interface_resets: , Optional (str) out_unknown_protocl_drops: , Optional (str) out_babbles: , Optional (str) out_deferred: , Optional (str) out_underruns: , Optional (str) out_late_collision: , Optional (str) out_lost_carrier: , Optional (str) out_no_carrier: , Optional (str) out_babble: , Optional (str) out_mac_pause_frames: , Optional (str) out_buffer_failure: , Optional (str) out_buffers_swapped: , Optional (str) last_clear: }, Optional (str) encapsulations: {Optional (str) encapsulation: , Optional (str) first_dot1q: , Optional (str) second_dot1q: , Optional (str) native_vlan: }, Optional (str) ipv4: {Any (str) *: {Optional (str) ip: , Optional (str) prefix_length: , Optional (str) secondary: }, Optional (str) unnumbered: {'interface_ref': }}}}", + "schema": "{Any (str) *: {Optional (str) oper_status: , Optional (str) line_protocol: , Optional (str) enabled: , Optional (str) is_deleted: , Optional (str) connected: , Optional (str) err_disabled: , Optional (str) suspended: , Optional (str) description: , Optional (str) type: , Optional (str) link_state: , Optional (str) port_speed: , Optional (str) duplex_mode: , Optional (str) link_type: , Optional (str) media_type: , Optional (str) mtu: , Optional (str) maximum_active_vcs: , Optional (str) vcs_per_vp: , Optional (str) vc_idle_disconnect_time: , Optional (str) vc_auto_creation: , Optional (str) current_vccs: , Optional (str) aal5_crc_errors: , Optional (str) aal5_oversized_sdus: , Optional (str) aal5_sar_timeouts: , Optional (str) vaccess_status: , Optional (str) vaccess_loopback: , Optional (str) base_pppoatm: , Optional (str) dtr_pulsed: , Optional (str) sub_mtu: , Optional (str) medium: , Optional (str) reliability: , Optional (str) txload: , Optional (str) rxload: , Optional (str) mac_address: , Optional (str) phys_address: , Optional (str) delay: , Optional (str) carrier_delay: , Optional (str) carrier_delay_up: , Optional (str) carrier_delay_down: , Optional (str) keepalive: , Optional (str) auto_negotiate: , Optional (str) arp_type: , Optional (str) arp_timeout: , Optional (str) last_input: , Optional (str) last_output: , Optional (str) output_hang: , Optional (str) autostate: , Optional (str) tunnel_source_ip: , Optional (str) tunnel_source_interface: , Optional (str) tunnel_destination_ip: , Optional (str) tunnel_protocol: , Optional (str) tunnel_ttl: , Optional (str) tunnel_transport_mtu: , Optional (str) tunnel_transmit_bandwidth: , Optional (str) tunnel_receive_bandwidth: , Optional (str) tunnel_protection: , Optional (str) tunnel_profile: , Optional (str) carrier_transitions: , Optional (str) queues: {Optional (str) input_queue_size: , Optional (str) input_queue_max: , Optional (str) input_queue_drops: , Optional (str) input_queue_flushes: , Optional (str) total_output_drop: , Optional (str) queue_strategy: , Optional (str) output_queue_size: , Optional (str) output_queue_max: , Optional (str) threshold: , Optional (str) drops: }, Optional (str) flow_control: {Optional (str) receive: , Optional (str) send: }, Optional (str) port_channel: {Optional (str) port_channel_member: , Optional (str) port_channel_int: , Optional (str) port_channel_member_intfs: , Optional (str) active_members: , Optional (str) num_of_pf_jumbo_supported_members: }, Optional (str) bandwidth: Or (, ), Optional (str) counters: {Optional (str) rate: {Optional (str) load_interval: , Optional (str) in_rate: , Optional (str) in_rate_pkts: , Optional (str) out_rate: , Optional (str) out_rate_pkts: , Optional (str) in_rate_bps: , Optional (str) in_rate_pps: , Optional (str) out_rate_bps: , Optional (str) out_rate_pps: }, Optional (str) in_multicast_pkts: , Optional (str) in_broadcast_pkts: , Optional (str) in_crc_errors: , Optional (str) in_giants: , Optional (str) in_pkts: , Optional (str) in_frame: , Optional (str) in_runts: , Optional (str) in_overrun: , Optional (str) in_ignored: , Optional (str) in_watchdog: , Optional (str) in_with_dribble: , Optional (str) in_octets: , Optional (str) in_errors: , Optional (str) in_abort: , Optional (str) in_no_buffer: , Optional (str) in_throttles: , Optional (str) in_mac_pause_frames: , Optional (str) in_drops: , Optional (str) out_pkts: , Optional (str) out_octets: , Optional (str) out_multicast_pkts: , Optional (str) out_broadcast_pkts: , Optional (str) out_errors: , Optional (str) out_collision: , Optional (str) out_interface_resets: , Optional (str) out_unknown_protocl_drops: , Optional (str) out_babbles: , Optional (str) out_deferred: , Optional (str) out_underruns: , Optional (str) out_late_collision: , Optional (str) out_lost_carrier: , Optional (str) out_no_carrier: , Optional (str) out_babble: , Optional (str) out_mac_pause_frames: , Optional (str) out_buffer_failure: , Optional (str) out_buffers_swapped: , Optional (str) out_drops: , Optional (str) last_clear: }, Optional (str) encapsulations: {Optional (str) encapsulation: , Optional (str) first_dot1q: , Optional (str) second_dot1q: , Optional (str) native_vlan: }, Optional (str) ipv4: {Any (str) *: {Optional (str) ip: , Optional (str) prefix_length: , Optional (str) secondary: }, Optional (str) unnumbered: {'interface_ref': }}, Optional (str) peer_ip: , Optional (str) vc_id: }}", "source": { "class": "genie.harness.base.Template" }, @@ -3480,7 +3480,7 @@ "attempt": 5, "interval": 10 }, - "schema": "{Any (str) *: {Optional (str) oper_status: , Optional (str) line_protocol: , Optional (str) enabled: , Optional (str) is_deleted: , Optional (str) connected: , Optional (str) err_disabled: , Optional (str) suspended: , Optional (str) description: , Optional (str) type: , Optional (str) link_state: , Optional (str) port_speed: , Optional (str) duplex_mode: , Optional (str) link_type: , Optional (str) media_type: , Optional (str) mtu: , Optional (str) maximum_active_vcs: , Optional (str) vcs_per_vp: , Optional (str) vc_idle_disconnect_time: , Optional (str) vc_auto_creation: , Optional (str) current_vccs: , Optional (str) aal5_crc_errors: , Optional (str) aal5_oversized_sdus: , Optional (str) aal5_sar_timeouts: , Optional (str) vaccess_status: , Optional (str) vaccess_loopback: , Optional (str) base_pppoatm: , Optional (str) dtr_pulsed: , Optional (str) sub_mtu: , Optional (str) medium: , Optional (str) reliability: , Optional (str) txload: , Optional (str) rxload: , Optional (str) mac_address: , Optional (str) phys_address: , Optional (str) delay: , Optional (str) carrier_delay: , Optional (str) carrier_delay_up: , Optional (str) carrier_delay_down: , Optional (str) keepalive: , Optional (str) auto_negotiate: , Optional (str) arp_type: , Optional (str) arp_timeout: , Optional (str) last_input: , Optional (str) last_output: , Optional (str) output_hang: , Optional (str) autostate: , Optional (str) tunnel_source_ip: , Optional (str) tunnel_source_interface: , Optional (str) tunnel_destination_ip: , Optional (str) tunnel_protocol: , Optional (str) tunnel_ttl: , Optional (str) tunnel_transport_mtu: , Optional (str) tunnel_transmit_bandwidth: , Optional (str) tunnel_receive_bandwidth: , Optional (str) tunnel_protection: , Optional (str) tunnel_profile: , Optional (str) carrier_transitions: , Optional (str) queues: {Optional (str) input_queue_size: , Optional (str) input_queue_max: , Optional (str) input_queue_drops: , Optional (str) input_queue_flushes: , Optional (str) total_output_drop: , Optional (str) queue_strategy: , Optional (str) output_queue_size: , Optional (str) output_queue_max: , Optional (str) threshold: , Optional (str) drops: }, Optional (str) flow_control: {Optional (str) receive: , Optional (str) send: }, Optional (str) port_channel: {Optional (str) port_channel_member: , Optional (str) port_channel_int: , Optional (str) port_channel_member_intfs: , Optional (str) active_members: , Optional (str) num_of_pf_jumbo_supported_members: }, Optional (str) bandwidth: , Optional (str) counters: {Optional (str) rate: {Optional (str) load_interval: , Optional (str) in_rate: , Optional (str) in_rate_pkts: , Optional (str) out_rate: , Optional (str) out_rate_pkts: , Optional (str) in_rate_bps: , Optional (str) in_rate_pps: , Optional (str) out_rate_bps: , Optional (str) out_rate_pps: }, Optional (str) in_multicast_pkts: , Optional (str) in_broadcast_pkts: , Optional (str) in_crc_errors: , Optional (str) in_giants: , Optional (str) in_pkts: , Optional (str) in_frame: , Optional (str) in_runts: , Optional (str) in_overrun: , Optional (str) in_ignored: , Optional (str) in_watchdog: , Optional (str) in_with_dribble: , Optional (str) in_octets: , Optional (str) in_errors: , Optional (str) in_abort: , Optional (str) in_no_buffer: , Optional (str) in_throttles: , Optional (str) in_mac_pause_frames: , Optional (str) out_pkts: , Optional (str) out_octets: , Optional (str) out_multicast_pkts: , Optional (str) out_broadcast_pkts: , Optional (str) out_errors: , Optional (str) out_collision: , Optional (str) out_interface_resets: , Optional (str) out_unknown_protocl_drops: , Optional (str) out_babbles: , Optional (str) out_deferred: , Optional (str) out_underruns: , Optional (str) out_late_collision: , Optional (str) out_lost_carrier: , Optional (str) out_no_carrier: , Optional (str) out_babble: , Optional (str) out_mac_pause_frames: , Optional (str) out_buffer_failure: , Optional (str) out_buffers_swapped: , Optional (str) last_clear: }, Optional (str) encapsulations: {Optional (str) encapsulation: , Optional (str) first_dot1q: , Optional (str) second_dot1q: , Optional (str) native_vlan: }, Optional (str) ipv4: {Any (str) *: {Optional (str) ip: , Optional (str) prefix_length: , Optional (str) secondary: }, Optional (str) unnumbered: {'interface_ref': }}}}", + "schema": "{Any (str) *: {Optional (str) oper_status: , Optional (str) line_protocol: , Optional (str) enabled: , Optional (str) is_deleted: , Optional (str) connected: , Optional (str) err_disabled: , Optional (str) suspended: , Optional (str) description: , Optional (str) type: , Optional (str) link_state: , Optional (str) port_speed: , Optional (str) duplex_mode: , Optional (str) link_type: , Optional (str) media_type: , Optional (str) mtu: , Optional (str) maximum_active_vcs: , Optional (str) vcs_per_vp: , Optional (str) vc_idle_disconnect_time: , Optional (str) vc_auto_creation: , Optional (str) current_vccs: , Optional (str) aal5_crc_errors: , Optional (str) aal5_oversized_sdus: , Optional (str) aal5_sar_timeouts: , Optional (str) vaccess_status: , Optional (str) vaccess_loopback: , Optional (str) base_pppoatm: , Optional (str) dtr_pulsed: , Optional (str) sub_mtu: , Optional (str) medium: , Optional (str) reliability: , Optional (str) txload: , Optional (str) rxload: , Optional (str) mac_address: , Optional (str) phys_address: , Optional (str) delay: , Optional (str) carrier_delay: , Optional (str) carrier_delay_up: , Optional (str) carrier_delay_down: , Optional (str) keepalive: , Optional (str) auto_negotiate: , Optional (str) arp_type: , Optional (str) arp_timeout: , Optional (str) last_input: , Optional (str) last_output: , Optional (str) output_hang: , Optional (str) autostate: , Optional (str) tunnel_source_ip: , Optional (str) tunnel_source_interface: , Optional (str) tunnel_destination_ip: , Optional (str) tunnel_protocol: , Optional (str) tunnel_ttl: , Optional (str) tunnel_transport_mtu: , Optional (str) tunnel_transmit_bandwidth: , Optional (str) tunnel_receive_bandwidth: , Optional (str) tunnel_protection: , Optional (str) tunnel_profile: , Optional (str) carrier_transitions: , Optional (str) queues: {Optional (str) input_queue_size: , Optional (str) input_queue_max: , Optional (str) input_queue_drops: , Optional (str) input_queue_flushes: , Optional (str) total_output_drop: , Optional (str) queue_strategy: , Optional (str) output_queue_size: , Optional (str) output_queue_max: , Optional (str) threshold: , Optional (str) drops: }, Optional (str) flow_control: {Optional (str) receive: , Optional (str) send: }, Optional (str) port_channel: {Optional (str) port_channel_member: , Optional (str) port_channel_int: , Optional (str) port_channel_member_intfs: , Optional (str) active_members: , Optional (str) num_of_pf_jumbo_supported_members: }, Optional (str) bandwidth: Or (, ), Optional (str) counters: {Optional (str) rate: {Optional (str) load_interval: , Optional (str) in_rate: , Optional (str) in_rate_pkts: , Optional (str) out_rate: , Optional (str) out_rate_pkts: , Optional (str) in_rate_bps: , Optional (str) in_rate_pps: , Optional (str) out_rate_bps: , Optional (str) out_rate_pps: }, Optional (str) in_multicast_pkts: , Optional (str) in_broadcast_pkts: , Optional (str) in_crc_errors: , Optional (str) in_giants: , Optional (str) in_pkts: , Optional (str) in_frame: , Optional (str) in_runts: , Optional (str) in_overrun: , Optional (str) in_ignored: , Optional (str) in_watchdog: , Optional (str) in_with_dribble: , Optional (str) in_octets: , Optional (str) in_errors: , Optional (str) in_abort: , Optional (str) in_no_buffer: , Optional (str) in_throttles: , Optional (str) in_mac_pause_frames: , Optional (str) in_drops: , Optional (str) out_pkts: , Optional (str) out_octets: , Optional (str) out_multicast_pkts: , Optional (str) out_broadcast_pkts: , Optional (str) out_errors: , Optional (str) out_collision: , Optional (str) out_interface_resets: , Optional (str) out_unknown_protocl_drops: , Optional (str) out_babbles: , Optional (str) out_deferred: , Optional (str) out_underruns: , Optional (str) out_late_collision: , Optional (str) out_lost_carrier: , Optional (str) out_no_carrier: , Optional (str) out_babble: , Optional (str) out_mac_pause_frames: , Optional (str) out_buffer_failure: , Optional (str) out_buffers_swapped: , Optional (str) out_drops: , Optional (str) last_clear: }, Optional (str) encapsulations: {Optional (str) encapsulation: , Optional (str) first_dot1q: , Optional (str) second_dot1q: , Optional (str) native_vlan: }, Optional (str) ipv4: {Any (str) *: {Optional (str) ip: , Optional (str) prefix_length: , Optional (str) secondary: }, Optional (str) unnumbered: {'interface_ref': }}, Optional (str) peer_ip: , Optional (str) vc_id: }}", "source": { "class": "genie.harness.base.Template" }, @@ -8380,7 +8380,7 @@ "devices": [ "uut" ], - "doc": "parser for:\n show nve vni", + "doc": "parser for:\n show nve vni\n show nve vni ", "groups": [], "schema": "{Any (str) *: {'vni': {Any (str) *: {'vni': , 'mcast': , 'vni_state': , 'mode': , 'type': , 'flags': }}}}", "source": { @@ -9381,7 +9381,7 @@ "ios": { "doc": "Parser for show stack-power", "groups": [], - "schema": "{'power_stack': {Any (str) *: {'mode': , 'topology': , 'total_power': , 'reserved_power': , 'allocated_power': , Optional (str) unused_power: , Optional (str) available_power: , 'switch_num': , 'power_supply_num': , Optional (str) power_stack_detail: {'stack_mode': , 'stack_topology': , Optional (str) stack_ecomode: , 'switch': {Any (str) *: {'power_budget': , 'power_allocated': , 'low_port_priority_value': , 'high_port_priority_value': , 'switch_priority_value': , 'port_1_status': , 'port_2_status': , 'neighbor_on_port_1': , 'neighbor_on_port_2': , Optional (str) ecomode: , Optional (str) capacity: }}}, Optional (str) switches: {Any (str) *: {'power_supply_a': Or (, ), 'power_supply_b': Or (, ), 'power_budget': Or (, ), 'allocated_power': Or (, ), 'available_power': Or (, ), 'consumed_power_sys': Or (, ), 'consumed_power_poe': Or (, )}}}}, Optional (str) totals: {'total_allocated_power': Or (, ), 'total_available_power': Or (, ), 'total_consumed_power_sys': Or (, ), 'total_consumed_power_poe': Or (, )}}", + "schema": "{'power_stack': {Any (str) *: {'mode': , 'topology': , 'total_power': , 'reserved_power': , 'allocated_power': , Optional (str) unused_power: , Optional (str) available_power: , 'switch_num': , 'power_supply_num': , Optional (str) power_stack_detail: {'stack_mode': , 'stack_topology': , Optional (str) Stack_total_input_power: , Optional (str) stack_auto_off: , Optional (str) power_supply_auto_off: , 'switch': {Any (str) *: {'power_budget': , 'power_allocated': , 'low_port_priority_value': , 'high_port_priority_value': , 'switch_priority_value': , 'port_1_status': , 'port_2_status': , 'neighbor_on_port_1': , 'neighbor_on_port_2': , Optional (str) auto_off: , Optional (str) capacity: }}}, Optional (str) switches: {Any (str) *: {'power_supply_a': Or (, ), 'power_supply_b': Or (, ), 'power_budget': Or (, ), 'allocated_power': Or (, ), 'available_power': Or (, ), 'consumed_power_sys': Or (, ), 'consumed_power_poe': Or (, )}}}}, Optional (str) totals: {'total_allocated_power': Or (, ), 'total_available_power': Or (, ), 'total_consumed_power_sys': Or (, ), 'total_consumed_power_poe': Or (, )}}", "source": { "class": "genie.harness.base.Template" }, @@ -9394,7 +9394,7 @@ "doc": "Parser for \n * show stack-power\n * show stack-power budgeting\n ", "exclude": [], "groups": [], - "schema": "{'power_stack': {Any (str) *: {'mode': , 'topology': , 'total_power': , 'reserved_power': , 'allocated_power': , Optional (str) unused_power: , Optional (str) available_power: , 'switch_num': , 'power_supply_num': , Optional (str) power_stack_detail: {'stack_mode': , 'stack_topology': , Optional (str) stack_ecomode: , 'switch': {Any (str) *: {'power_budget': , 'power_allocated': , 'low_port_priority_value': , 'high_port_priority_value': , 'switch_priority_value': , 'port_1_status': , 'port_2_status': , 'neighbor_on_port_1': , 'neighbor_on_port_2': , Optional (str) ecomode: , Optional (str) capacity: }}}, Optional (str) switches: {Any (str) *: {'power_supply_a': Or (, ), 'power_supply_b': Or (, ), 'power_budget': Or (, ), 'allocated_power': Or (, ), 'available_power': Or (, ), 'consumed_power_sys': Or (, ), 'consumed_power_poe': Or (, )}}}}, Optional (str) totals: {'total_allocated_power': Or (, ), 'total_available_power': Or (, ), 'total_consumed_power_sys': Or (, ), 'total_consumed_power_poe': Or (, )}}", + "schema": "{'power_stack': {Any (str) *: {'mode': , 'topology': , 'total_power': , 'reserved_power': , 'allocated_power': , Optional (str) unused_power: , Optional (str) available_power: , 'switch_num': , 'power_supply_num': , Optional (str) power_stack_detail: {'stack_mode': , 'stack_topology': , Optional (str) Stack_total_input_power: , Optional (str) stack_auto_off: , Optional (str) power_supply_auto_off: , 'switch': {Any (str) *: {'power_budget': , 'power_allocated': , 'low_port_priority_value': , 'high_port_priority_value': , 'switch_priority_value': , 'port_1_status': , 'port_2_status': , 'neighbor_on_port_1': , 'neighbor_on_port_2': , Optional (str) auto_off: , Optional (str) capacity: }}}, Optional (str) switches: {Any (str) *: {'power_supply_a': Or (, ), 'power_supply_b': Or (, ), 'power_budget': Or (, ), 'allocated_power': Or (, ), 'available_power': Or (, ), 'consumed_power_sys': Or (, ), 'consumed_power_poe': Or (, )}}}}, Optional (str) totals: {'total_allocated_power': Or (, ), 'total_available_power': Or (, ), 'total_consumed_power_sys': Or (, ), 'total_consumed_power_poe': Or (, )}}", "source": { "class": "genie.harness.base.Template" }, @@ -9790,7 +9790,7 @@ "c9500": { "doc": "Parser for show version", "groups": [], - "schema": "{'version': {Optional (str) xe_version: , 'version_short': , 'os': , Optional (str) code_name: , 'platform': , 'version': , Optional (str) label: , Optional (str) build_label: , 'image_id': , 'rom': , 'bootldr_version': , 'hostname': , 'uptime': , 'uptime_this_cp': , 'returned_to_rom_by': , 'system_image': , 'last_reload_reason': , 'chassis': , 'processor_type': , 'main_mem': , 'processor_board_id': , Optional (str) curr_config_register: , Optional (str) revision: , 'compiled_date': , 'compiled_by': , 'mac_address': , 'mb_assembly_num': , 'mb_sn': , 'model_rev_num': , 'mb_rev_num': , 'model_num': , Optional (str) system_sn: , Optional (str) mem_size: {Any (str) *: }, Optional (str) license_level: , Optional (str) next_reload_license_level: , Optional (str) defect_id: {Any (str) *: {Optional (str) type: , Optional (str) sum_version: , Optional (str) state: , Optional (str) file_name: }}, 'smart_licensing_status': , Optional (str) number_of_intfs: {Any (str) *: }, Optional (str) disks: {Any (str) *: {'disk_size': }}}}", + "schema": "{'version': {Optional (str) xe_version: , 'version_short': , 'os': , Optional (str) code_name: , 'platform': , 'version': , Optional (str) label: , Optional (str) build_label: , 'image_id': , 'rom': , 'bootldr_version': , 'bootldr': , 'hostname': , 'uptime': , 'uptime_this_cp': , 'returned_to_rom_by': , 'system_image': , 'last_reload_reason': , 'chassis': , 'processor_type': , 'main_mem': , 'processor_board_id': , Optional (str) curr_config_register: , Optional (str) revision: , 'compiled_date': , 'compiled_by': , 'mac_address': , 'mb_assembly_num': , 'mb_sn': , 'model_rev_num': , 'mb_rev_num': , 'model_num': , Optional (str) system_sn: , Optional (str) mem_size: {Any (str) *: }, Optional (str) license_level: , Optional (str) next_reload_license_level: , Optional (str) defect_id: {Any (str) *: {Optional (str) type: , Optional (str) sum_version: , Optional (str) state: , Optional (str) file_name: }}, 'smart_licensing_status': , Optional (str) number_of_intfs: {Any (str) *: }, Optional (str) disks: {Any (str) *: {'disk_size': }}}}", "source": { "class": "genie.harness.base.Template" }, diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/__init__.py index fc0a1d1b2..01eb03f3e 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.8' +__version__ = '24.9' __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/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/configure.py new file mode 100644 index 000000000..77d5b4932 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/configure.py @@ -0,0 +1,30 @@ +'''Common configure functions''' + +# Python +import logging + +# Unicon +from unicon.core.errors import SubCommandFailure +from unicon.eal.dialogs import Dialog, Statement + +# Logger +log = logging.getLogger(__name__) + +def configure_hostname(device, hostname): + """ To configure the hostname + Args: + device (`obj`): Device object + hostname (`str`): Hostname to be configured. + Returns: + None + Raises: + SubCommandFailure + """ + + try: + device.configure(f'hostname {hostname}') + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not configure hostname on {device}. Error:\n{error}" + .format(device=device.name, error=e) + ) 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 02dd76dde..096759027 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 @@ -3068,4 +3068,22 @@ def unconfigure_radius_attribute_policy_name_under_servergroup(device, server_gr try: device.configure(cmd) except SubCommandFailure as e: - raise SubCommandFailure(f'Failed unconfiguring radius attribute policy-name under radius server group {word}. Error:\n{e}') \ No newline at end of file + 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 + + Args: + device ('obj') : Device object + server_group_name ('str') : Server-group name [Command accounting supports only tacacs group] + Return: + None + Raise: + SubCommandFailure: failed to configure aaa accounting dot1x default start-stop group + ''' + + cmd = f"no aaa accounting dot1x default start-stop group {server_group_name}" + 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 diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py index 219ad66d8..8860f8476 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py @@ -2171,3 +2171,178 @@ def configure_type_access_list_action(device, type, name, action, action_type=No device.configure(config) except SubCommandFailure as e: raise SubCommandFailure(f"Failed to configure {type} acl on the device {device.name}. Error:\n{e}") + +def configure_access_list_extend_with_dst_address_and_port(device, access_list_name, sequence_number, access_type, protocol_name, dst_address, dst_wildcard_bits, port_num1, port_num2): + """ Configures access-list extend with destination address and ports + Args: + device ('obj'): device to use + access_list_name ('str'): access list name + sequence_number ('int'): sequence number + access_type ('str'): access type(i.e deny/permit) + protocol_name ('str'): protocol name(i.e udp/tcp) + dst_address ('str'): destinamtion address + dst_wildcard_bits ('str'): destination wildcard bits + port_num1 ('int'): first port number + port_num2 ('int'): second port number + + Returns: + None + Raises: + SubCommandFailure + """ + log.debug(f"configure access-list extend with {dst_address} and {port_num1} and {port_num2}") + + config = [f"ip access-list extended {access_list_name}", + f"{sequence_number} {access_type} {protocol_name} any {dst_address} {dst_wildcard_bits} range {port_num1} {port_num2}"] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure access-list extend with {dst_address} and {port_num1} and {port_num2}. Error:\n{e}") + +def configure_access_list_extend_with_port(device, access_list_name, sequence_number, access_type, protocol_name, port_num1, port_num2, port_num3, port_num4): + """ Configures access-list extend with ranges + Args: + device ('obj'): device to use + access_list_name ('str'): access list name + sequence_number ('int'): sequence number + access_type ('str'): access type(i.e deny/permit) + protocol_name ('str'): protocol name(i.e udp/tcp) + port_num1 ('int'): first port number + port_num2 ('int'): second port number + port_num3 ('int'): third port number + port_num4 ('int'): fourth port number + + Returns: + None + Raises: + SubCommandFailure + """ + log.debug(f"configure access-list extend with ranges on device {device}") + + config = [f"ip access-list extended {access_list_name}", + f"{sequence_number} {access_type} {protocol_name} any range {port_num1} {port_num2} any range {port_num3} {port_num4}"] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure access-list extend with ranges on device {device}.Error:\n{e}") + +def configure_access_list_extend_with_dst_address_and_gt_port(device, access_list_name, sequence_number, access_type, protocol_name, port_num1, port_num2, dst_address, port_num3): + """ Configures access-list extend with destination address and gt port config + Args: + device ('obj'): device to use + access_list_name ('str'): access list name + sequence_number ('int'): sequence number + access_type ('str'): access type(i.e deny/permit) + protocol_name ('str'): protocol name(i.e udp/tcp) + port_num1 ('int'): first port number + port_num2 ('int'): second port number + dst_address ('str'): destinamtion address + port_num3 ('int'): third port number + Returns: + None + Raises: + SubCommandFailure + """ + log.debug(f"configure access-list extend with destination address and gt port config on device {device}") + + config = [f"ip access-list extended {access_list_name}", + f"{sequence_number} {access_type} {protocol_name} any range {port_num1} {port_num2} host {dst_address} gt {port_num3}"] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure access-list extend with destination address and gt port config on device {device}.Error:\n{e}") + +def configure_access_list_extend_with_range_and_eq_port(device, access_list_name, sequence_number, access_type, protocol_name, port_num1, port_num2, port_num3): + """ Configures access-list extend with range and eq port config + Args: + device ('obj'): device to use + access_list_name ('str'): access list name + sequence_number ('int'): sequence number + access_type ('str'): access type(i.e deny/permit) + protocol_name ('str'): protocol name(i.e udp/tcp) + port_num1 ('int'): first port number + port_num2 ('int'): second port number + port_num3 ('int'): third port number + Returns: + None + Raises: + SubCommandFailure + """ + log.debug(f"configure access-list extend with range and eq port config on device {device}") + + config = [f"ip access-list extended {access_list_name}", + f"{sequence_number} {access_type} {protocol_name} any range {port_num1} {port_num2} any eq {port_num3}"] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure access-list extend with range and eq port config on device {device}.Error:\n{e}") + +def configure_access_list_extend(device, access_list_name, sequence_number, access_type, protocol_name): + """ Configures access-list extend + Args: + device ('obj'): device to use + access_list_name ('str'): access list name + sequence_number ('int'): sequence number + access_type ('str'): access type(i.e deny/permit) + protocol_name ('str'): protocol name(i.e udp/tcp) + Returns: + None + Raises: + SubCommandFailure + """ + log.debug(f"configure access-list extend on device {device}") + + config = [f"ip access-list extended {access_list_name}", + f"{sequence_number} {access_type} {protocol_name} any any"] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure access-list extend on device {device}.Error:\n{e}") + +def configure_ip_sgacl(device, acl_action, ip_protocol_version): + """Configure ip sgacl + Example: ip access-list role-based PERMIT + permit ip log + Args: + device ('obj'): device to use + acl_action ('str'): (permit | deny) permits or denies traffic + ip_protocol_version ('str'): define ip (or) ipv6 + Returns: + None + Raises: + SubCommandFailure + """ + acl_action = acl_action.strip().lower() + if acl_action not in ('permit', 'deny'): + log.error("Invalid action type") + config = [f"{ip_protocol_version} access-list role-based {acl_action}", + f"{acl_action} {ip_protocol_version} log"] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to configure ip sgacl on the device {device.name}. Error:\n{e}") + +def unconfigure_ip_sgacl(device, acl_action, ip_protocol_version): + """Unconfigure ip sgacl + Example: no ip access-list role-based PERMIT + Args: + device ('obj'): device to use + acl_action ('str'): (permit | deny) permits or denies traffic + Returns: + None + Raises: + SubCommandFailure + """ + acl_action = acl_action.strip().lower() + if acl_action not in ('permit', 'deny'): + log.error("Invalid action type") + config = [f"no {ip_protocol_version} access-list role-based {acl_action}"] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to unconfigure ip sgacl on the device {device.name}. Error:\n{e}") \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9610/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9610/__init__.py new file mode 100644 index 000000000..9c5d5abf8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9610/__init__.py @@ -0,0 +1,2 @@ +from genie import abstract +abstract.declare_token(model='c9610') diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9610/spanning_tree/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9610/spanning_tree/__init__.py new file mode 100644 index 000000000..e69de29bb 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 new file mode 100755 index 000000000..e321e8876 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cat9k/c9610/spanning_tree/configure.py @@ -0,0 +1,40 @@ +''' 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}' + ) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1q/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1q/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1q/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1q/configure.py new file mode 100644 index 000000000..830129c2d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1q/configure.py @@ -0,0 +1,47 @@ +import logging +import re +from genie.libs.parser.utils.common import Common +from unicon.eal.dialogs import Dialog, Statement +from unicon.core.errors import ( + SubCommandFailure, + StateMachineError, + TimeoutError, + ConnectionError, +) + +log = logging.getLogger(__name__) + +def configure_vlan_dot1q_tag_native(device): + """ configure vlan dot1q tag native + Args: + device ('obj') : device to use + Returns: + None + Raises: + SubCommandFailure + """ + log.debug(f'configure vlan dot1q tag native on {device}') + cmd = ["vlan dot1q tag native"] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f'Could not configure vlan dot1q tag native on {device}.Error:\n{e}') + +def unconfigure_vlan_dot1q_tag_native(device): + """ unconfigure vlan dot1q tag native + Args: + device ('obj') : device to use + Returns: + None + Raises: + SubCommandFailure + """ + log.debug(f'unconfigure vlan dot1q tag native on {device}') + cmd = ["no vlan dot1q tag native"] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f'Could not unconfigure vlan dot1q tag native on {device}.Error:\n{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 1e29f133c..b68a5faa5 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 @@ -1620,3 +1620,30 @@ def unconfigure_datalink_flow_monitor(device, interface, flow_name, direction): except SubCommandFailure as e: raise SubCommandFailure( f"Failed to unconfigure datalink flow monitor device {device.name}. Error:\n{e}") + + +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 + record_name ('str'): Flow record name + flow_name ('str'): cts or direction or observation + cts_type ('str', optional): source or destination. Default is None + + 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') + elif flow_name == 'cts' and cts_type: + config.append(f'match flow cts {cts_type} group-tag') + try: + device.configure(config) + except SubCommandFailure: + raise SubCommandFailure(f'Could not configure flow record {record_name}') 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 0a2f29a08..b7546b6d3 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 @@ -40,3 +40,84 @@ def execute_set_fnf_verbose(device): except SubCommandFailure as e: raise SubCommandFailure( f'Could not set platform software trace fed switch active fnf verbose on device. Error:\n{e}') + +def execute_monitor_capture_start_capture_filter(device, capture_name, capture_filter): + """ + Execute monitor capture start capture-filter + Example: monitor capture test start capture-filter ANY + Args: + device ('obj'): Device Object + capture_name ('str'): Name of Capture + capture_filter ('str'): Capture filter String + """ + cmd = f"monitor capture {capture_name} start capture-filter {capture_filter}" + try: + 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: + - monitor capture file location flash: + - monitor capture file location flash: ring size + Example: + - monitor capture test file location flash:testin.pcap + - monitor capture test file location flash:testin.pcap ring 4 size 1 + Args: + device ('obj'): Device Object + capture_name ('str'): Name of Capture + file_name ('str'): Name of file + number_of_file (int): Number of File (<2-10> Number of files in the file ring) + size_of_file (int): File size (<1-100> Total size of file(s) in MB) + """ + cmd = [ + f'monitor capture {capture_name} file location flash:{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: + command = cmd[3] + else: + command = cmd[2] + if size_of_file: + command = cmd[1] + else: + command = cmd[0] + try: + 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 + Example: monitor capture test class-map myclassmap + Args: + device ('obj'): Device Object + capture_name ('str'): Name of Capture + class_name ('str'): Class name + """ + cmd = f"monitor capture {capture_name} class-map {class_name}" + try: + 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 + 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}") \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/__init__.py new file mode 100644 index 000000000..10976dac0 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/__init__.py @@ -0,0 +1,2 @@ +from genie import abstract +abstract.declare_token(platform='ie3k') diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/platform/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/platform/__init__.py index 10976dac0..e69de29bb 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/platform/__init__.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/platform/__init__.py @@ -1,2 +0,0 @@ -from genie import abstract -abstract.declare_token(platform='ie3k') diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/platform/execute.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/platform/execute.py new file mode 100644 index 000000000..b07426714 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ie3k/platform/execute.py @@ -0,0 +1,29 @@ +'''IOSXE execute functions for platform''' + +# Python +import re +import logging +import time + +# pyATS +from pyats.async_ import pcall +from pyats.utils.fileutils import FileUtils + +# Genie +from genie.utils import Dq +from genie.harness.utils import connect_device +from genie.utils.timeout import Timeout +from genie.metaparser.util.exceptions import SchemaEmptyParserError + +# Unicon +from unicon.eal.dialogs import Statement, Dialog +from unicon.core.errors import StateMachineError,SubCommandFailure + +# Logger +log = logging.getLogger(__name__) + +def execute_set_config_register(): + '''Set config register to load image in boot variable + ''' + + log.info("Config register configuration not supported on IOT platforms") \ 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 index e2926d0c3..46c54d1a0 100644 --- 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 @@ -7211,12 +7211,13 @@ def configure_hsrp_version_on_interface(device, interface, version): f"Failed to configure hsrp version on interface. Error:\n{e}" ) -def configure_ipv6_address_on_hsrp_interface(device, interface, version, ipv6_address, priority=None, +def configure_ipv6_address_on_hsrp_interface(device, interface, groupnumber, version, ipv6_address, priority=None, preempt=None, hello_interval=None, hold_time=None): """ Configure ipv6 address on hsrp interface Args: device (`obj`): Device object interface ('str'): Interface to configure hsrp + groupnumber('int'): Group number version (`int`): version number ipv6_address ('str') : ipv6 address priority ('str', optional) : config custom priority to hsrp @@ -7229,13 +7230,14 @@ def configure_ipv6_address_on_hsrp_interface(device, interface, version, ipv6_ad SubCommandFailure """ configs = [f"interface {interface}", - f"standby {version} ipv6 {ipv6_address}"] + f"standby version {version}", + f"standby {groupnumber} ipv6 {ipv6_address}"] if priority: - configs.append(f"standby {version} priority {priority}") + configs.append(f"standby {groupnumber} priority {priority}") if preempt: - configs.append(f"standby {version} preempt delay sync {preempt}") + configs.append(f"standby {groupnumber} preempt delay sync {preempt}") if hello_interval and hold_time: - configs.append(f"standby {version} timers {hello_interval} {hold_time}") + configs.append(f"standby {groupnumber} timers {hello_interval} {hold_time}") try: device.configure(configs) @@ -10221,4 +10223,80 @@ def configure_sub_interface_encapsulation_dot1q( device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure( - f"Could not Configure sub_interface_encapsulation_dot1q on interface {physical_port}. Error: {e}") \ No newline at end of file + f"Could not Configure sub_interface_encapsulation_dot1q on interface {physical_port}. Error: {e}") + +def configure_switchport_trunk_native_vlan_tag(device, interface): + """ configure switchport trunk native vlan tag + Args: + device ('obj') : device to use + interface ('str') : interface to configure + Returns: + None + Raises: + SubCommandFailure + """ + log.debug(f'configure switchport trunk native vlan tag on {device}') + cmd = [f"interface {interface}","switchport trunk native vlan tag"] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + 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: + device ('obj') : device to use + interface ('str') : interface to configure + Returns: + None + Raises: + SubCommandFailure + """ + log.debug(f'unconfigure switchport trunk native vlan tag on {device}') + cmd = [f"interface {interface}","no switchport trunk native vlan tag"] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f'Could not unconfigure switchport trunk native vlan tag on {device}.Error:\n{e}') + +def configure_medium_p2p_interface(device, interface): + """ Configure medium p2p on interface + Args: + device ('obj'): Device object + interface ('str'): which interface to configure + Return: + None + Raise: + SubCommandFailure: Failed configuring medium p2p on interface + """ + + log.debug("Configure medium p2p on interface") + cmd =[f"interface {interface}", "medium p2p"] + try: + device.configure(cmd) + 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: + device ('obj'): Device object + interface ('str'): which interface to configure + Return: + None + Raise: + SubCommandFailure: Failed unconfiguring medium p2p on interface + """ + + log.debug("Unconfigure medium p2p on interface") + cmd =[f"interface {interface}", "no medium p2p"] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to unconfigure medium p2p on interface, Error:\n{e}" + ) \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py index bda0a7257..02668de7f 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py @@ -532,7 +532,7 @@ def unconfigure_crypto_ikev2_keyring(device,keyring): def configure_ikev2_profile_pre_share(device, profile_name, auth_local='pre-share', auth_remote='pre-share', keyring=None, address=None, mask='', protocol='ipv4', dpd_interval=None, dpd_retry='2', dpd_type='periodic', - fvrf=None, lifetime=None): + fvrf=None, lifetime=None, local_interface=None): """ Configure Ikev2 Profile with pre-share option Args: @@ -549,7 +549,8 @@ def configure_ikev2_profile_pre_share(device, profile_name, auth_local='pre-shar dpd_retry ('str',optional) DPD Retries (Default 2) dpd_type ('str',optional) DPD type (ie periodic or on-demand) (Default periodic) fvrf ('str',optional) FVRF name (Default None) - lifetime ('str',optional) lifetime in secs (Default is None) + lifetime ('str',optional) lifetime in secs (Default is None) + local_interface ('str', optional) interface name (Default is None) Returns: None Raises: @@ -577,6 +578,8 @@ def configure_ikev2_profile_pre_share(device, profile_name, auth_local='pre-shar retry=dpd_retry, type=dpd_type)) if lifetime: config_list.append("lifetime {lifetime}".format(lifetime=lifetime)) + if local_interface: + config_list.append("match address local interface {local_interface}".format(local_interface=local_interface)) try: device.configure(config_list) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py index c301d9613..1ac0321c2 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py @@ -557,7 +557,7 @@ def configure_management_telnet(device, def configure_management_vty_lines(device, authentication=None, - transport=None): + transport=None, stackable=True): ''' Configure device for management via vty lines. @@ -565,6 +565,7 @@ def configure_management_vty_lines(device, device ('obj'): device object authentication ('str'): authentication details transport ('str'): transport details + stackable ('bool'): stackable set as True if device is stack else False Returns: None @@ -591,8 +592,12 @@ def configure_management_vty_lines(device, username = creds.get(authentication, {}).get('username') password = to_plaintext(creds.get(authentication, {}).get('password', '')) - if username and password and f'login authentication {authentication}' not in output: - vty_config.append(f'login authentication {authentication}') + if stackable: + if username and password and f'login authentication {authentication}' not in output: + vty_config.append(f'login authentication {authentication}') + else: + if username and password and f'login local' not in output: + vty_config.append(f'login local') # find all transports all_transports = re.findall(r'transport input (.*)', output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py index 36b789aa4..d13961999 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py @@ -495,6 +495,112 @@ def configure_trustpoint(device, ) ) +def configure_crypto_pki_profile(device, + prof_name, + method_est=False, + enrollment_http_username=None, + enrollment_http_password_type=None, + enrollment_http_password=None, + enrollment_url=None, + source_interface=None, + exit_flag=False, + no_config=None, + vrf=None +): + + ''' + configure crypto pki enrollment profile + Args: + device('obj'): Device object + prof_name('string'): crypto pki enrollment profile name + method_est('bool'): use EST method + enrollment_http_username('string'): http authentication username + enrollment_http_password_type('bool'): http password type + enrollment_http_password('string'): http authentication password + enrollment_url('string'): http or tftp url used for enrollment to CA + source_interface('string'): source interface for enrollment + vrf('string'): used for crf config + no_config('string'): used for unconfiguration of sub configs used in trustpoint + exit_flag('bool'): used for exit + Returns: + None + Raises: + SubCommandFailure + ''' + + logger.debug("configuring crypto pki profile enrollment") + + tp_config = [f"crypto pki profile enrollment {prof_name}"] + + if method_est: + tp_config.append("method-est") + + if enrollment_http_username is not None: + assert enrollment_http_password is not None, "A password is required when enrollment_http_username is given" + if enrollment_http_password_type is not None: + tp_config.append(f"enrollment http username {enrollment_http_username} password {enrollment_http_password_type} {enrollment_http_password}") + else: + tp_config.append(f"enrollment http username {enrollment_http_username} password {enrollment_http_password}") + + if enrollment_url is not None: + if vrf is not None: + tp_config.append(f"enrollment url {enrollment_url} vrf {vrf}") + else: + tp_config.append(f"enrollment url {enrollment_url}") + + if source_interface is not None: + tp_config.append(f"source interface {source_interface}") + + if no_config is not None: + tp_config.append(f"no {no_config}") + + if exit_flag: + tp_config.append("exit") + + error_patterns = ["The command you have entered is available in the IOS.sh", + ] + + try: + device.configure(tp_config, error_pattern = error_patterns) + except SubCommandFailure as e: + raise SubCommandFailure( + logger.error("Failed to configure trust point", + "Error:\n{error}".format(error=e) + ) + ) + +def unconfigure_crypto_pki_profile(device, + prof_name): + ''' + unconfiguring crypto pki profile enrollment + Args: + device ('obj'): Device object + prof_name ('str'): Name of the trsutpoint + Returns: + None + Raises: + SubCommandFailure + ''' + + dialog = Dialog([ + Statement(pattern=r'.*Are you sure you want to do this.*', + action=f'sendline(yes)', + loop_continue=True, + continue_timer=False) + ]) + + logger.debug("Unconfiguring crypto pki profile enrollment") + + tp_unconfig = (f"no crypto pki profile enrollment {prof_name}") + try: + device.configure(tp_unconfig, reply=dialog, error_pattern=["Can't find profile"]) + except SubCommandFailure as e: + raise SubCommandFailure( + logger.error("Failed to unconfigure enrollment profile" + "Error:\n{error}".format(error=e) + ) + ) + def unconfigure_crypto_pki_server(device, server_name): ''' @@ -954,4 +1060,27 @@ def cert_key_handler(spawn, data): "Could not Paste certificate on device " "Error: {error}".format(error=e) ) + +def configure_no_pki_enroll(device, tp_name): + ''' + Configuring crypto pki enroll + Args: + device ('obj'): Device object + tp_name ('str'): name of the trustpoint + Returns: + None + Raises: + SubCommandFailure + ''' + logger.debug("Cancelling crypto pki enroll server") + pki_no_enroll_config = (f"no crypto pki enroll {tp_name}") + try: + device.configure(pki_no_enroll_config) + except SubCommandFailure as e: + raise SubCommandFailure( + logger.error("failed to cancel crypto pki enroll" + "Error:\n{error}".format(error=e) + ) + ) + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/clear.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/clear.py index d89ab5eb5..78d789deb 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/clear.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/clear.py @@ -120,4 +120,31 @@ def clear_active_punt_ios_cause(device, state=None): except SubCommandFailure as e: raise SubCommandFailure( 'Could not clear punt ios-cause on {device}. Error:\n{error}'.format(device=device.name, error=e) - ) \ No newline at end of file + ) + +def clear_platform_qos_statistics_iif_id(device, state, iif_id, switch=None): + """ clear platform hardware qos statistics internal cpu policer + Args: + device ('obj'): Device object + state ('str'): Switch state active or standby + switch ('str', optional): Switch string + iif_id('int'): iif id (1-4294967295) + Returns: + None + Raises: + SubCommandFailure + """ + log.debug(f"clear platform hardware fed switch qos statistics iif_id on {device}") + + command = f"clear platform hardware fed {state} qos statistics iif_id {iif_id}" + if switch: + command = f"clear platform hardware fed {switch} {state} qos statistics iif_id {iif_id}" + + try: + device.execute(command) + + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not clear qos statistics iif_id on {device}. Error:\n{error}".format(device=device, error=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 fb919ee2c..faffab57b 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 @@ -1,4 +1,4 @@ -'''IOSXE execute functions for platform''' +'''IOSXE configure functions for platform''' # Python import logging @@ -5570,7 +5570,6 @@ def configure_event_manager(device, event, description,event_run_option, except SubCommandFailure as e: raise SubCommandFailure(f"Failed to configure event manager applet on device {device.name}. Error:\n{e}") - def configure_hw_module_switch_number_ecomode_led(device, switch_number='all'): """ configure_hw_module_switch_number_ecomode_led @@ -5666,6 +5665,101 @@ def configure_default_stack_power_ecomode(device, stack_name): f"could not configure default stack power ecomode {device}. Error:\n{e}" ) +def configure_hw_module_switch_number_auto_off_led(device, switch_number='all'): + + """ configure_hw_module_switch_number_auto_off_led + Args: + device ('obj'): device to use + switch_number ('str'): switch number + Returns: + None + Raises: + SubCommandFailure exception + """ + + cmd = [f"hw-module switch {switch_number} auto-off led"] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to configure hw-module auto-off led on device {device.name}. Error:\n{e}") + + +def unconfigure_hw_module_switch_number_auto_off_led(device, switch_number='all'): + + """ unconfigure_hw_module_switch_number_auto_off_led + Args: + device ('obj'): device to use + switch_number ('str'): switch number + Returns: + None + Raises: + SubCommandFailure exception + """ + + cmd = [f"no hw-module switch {switch_number} auto-off led"] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to unconfigure hw-module auto-off led on device {device.name}. Error:\n{e}") + +def configure_stack_power_auto_off(device, stack_name): + """ Configure stack power auto-off + Args: + device ('obj'): Device object + stack_name ('str'): Stack name + Returns: + None + Raises: + SubCommandFailure + """ + cmd = [f"stack-power stack {stack_name}", + "auto-off",] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"could not configure stack power auto-off {device}. Error:\n{e}" + ) + +def unconfigure_stack_power_auto_off(device, stack_name): + """ Unconfigure stack power auto-off + Args: + device ('obj'): Device object + stack_name ('str'): Stack name + Returns: + None + Raises: + SubCommandFailure + """ + cmd = [f"stack-power stack {stack_name}", + "no auto-off",] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"could not unconfigure stack power auto-off {device}. Error:\n{e}" + ) + + +def configure_default_stack_power_auto_off(device, stack_name): + """ Configure default stack power auto-off + Args: + device ('obj'): Device object + stack_name ('str'): Stack name + Returns: + None + Raises: + SubCommandFailure + """ + cmd = [f"stack-power stack {stack_name}", + "default auto-off",] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"could not configure default stack power auto-off {device}. Error:\n{e}" + ) + def configure_ip_http_client_secure_trustpoint(device, trustpoint_name): """ Configures the secure trustpoint Example : ip http client secure-trustpoint {trustpoint_name} @@ -6152,4 +6246,3 @@ def send_configs(device, macro_configs): f"Failed to configure macro name {macro_name} on device {device.hostname}. 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 2537a82db..1b4cb3799 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 @@ -1802,3 +1802,23 @@ def test_platform_software_usb_fake_insert_remove(device, switch_num, usbflash, except SubCommandFailure as e: raise SubCommandFailure(f"Failed to perform fake insert/remove. Error:\n{e}") +def test_platform_software_fru_fake_insert_remove(device, switch_num, action): + """ + Execute 'test platform software fed switch {switch_num} fru {action}' command on the device. + + Args: + 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/span/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/span/configure.py index a863cef46..16f21b4ca 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/span/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/span/configure.py @@ -363,71 +363,4 @@ def config_erspan_monitor_session_filter(device, session_number, vlan): except SubCommandFailure as e: raise SubCommandFailure( f"Failed to configure filter on erspan monitor session :\n{e}" - ) -def configure_interface_monitor_session_shutdown_erspan_dest(device, session_name): - """ configure monitor session on device by doing shut of the erspan destination interface - Args: - device ('obj'): Device object - session_name ('str'): Session name - Returns: - None - Raises: - SubCommandFailure - """ - configs = [] - configs.append(f"monitor session {session_name} type erspan-destination") - configs.append(f"shutdown") - - try: - device.configure(configs) - except SubCommandFailure as e: - raise SubCommandFailure( - f"Failed to shut on erspan destination monitor session :\n{e}" - ) - -def configure_interface_monitor_session_mtu(device, session_name, mtu): - """ configure monitor session on device by setting destination mtu - Args: - device ('obj'): Device object - session_name ('str'): Session name - mtu ('str'): mtu size, (196-9000) - Returns: - None - Raises: - SubCommandFailure - """ - configs = [] - configs.append(f"monitor session {session_name} type erspan-source") - configs.append(f"destination") - configs.append(f"mtu {mtu}") - - try: - device.configure(configs) - except SubCommandFailure as e: - raise SubCommandFailure( - f"Failed to configure mtu on erspan monitor session :\n{e}" - ) - - -def configure_interface_monitor_session_no_mtu(device, session_name, mtu): - """ configure monitor session on device by setting destination no mtu - Args: - device ('obj'): Device object - session_name ('str'): Session name - mtu ('str'): mtu size - Returns: - None - Raises: - SubCommandFailure - """ - configs = [] - configs.append(f"monitor session {session_name} type erspan-source") - configs.append(f"destination") - configs.append(f"no mtu {mtu}") - - try: - device.configure(configs) - except SubCommandFailure as e: - raise SubCommandFailure( - f"Failed to configure no mtu on erspan monitor session :\n{e}" - ) + ) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py index 8ea01ceae..0ab792841 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py @@ -876,3 +876,124 @@ def configure_default_spanning_tree_vlan(device, vlan_range, option_type=None): device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f"Failed to configure spanning-tree mode mst on device. Error:\n{e}") + +def configure_spanning_tree_bridge_assurance(device): + """ + Configures spanning-tree Bridge Assurance + Args: + device ('obj') : Device object + Returns: + None + """ + + try: + output = device.configure("spanning-tree bridge assurance") + + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not Configure Spanning Tree Bridge Assurance - Error:\n{error}".format(error=e) + ) + +def unconfigure_spanning_tree_bridge_assurance(device): + """ + UnConfigures spanning-tree Bridge assurance + Args: + device ('obj') : Device object + Returns: + None + """ + try: + output = device.configure("no spanning-tree bridge assurance") + + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not UnConfigure Spanning Tree Bridge Assurance - Error:\n{error}".format(error=e) + ) + +def configure_spanning_tree_portfast_bridge_assurance(device, option): + """ Configures Spanning Tree Portfast_bridge_assurance + Args: + device ('obj') : device to use + option ('str'): normal / edge / network / edge bpduguard / edge bpdufilter + Returns: + None + Raises: + SubCommandFailure + """ + config = "spanning-tree portfast " + if option: + config += f" {option} default" + + try: + device.configure(config) + except SubCommandFailure as error: + raise SubCommandFailure( + f'Could not configure spanning-tree portfast bridge assurance - Error:\n{error}' + ) + +def unconfigure_spanning_tree_portfast_bridge_assurance(device, option): + """ Unconfigures Spanning Tree Portfast + Args: + device ('obj') : device to use + option ('str'): normal / edge / network / edge bpduguard / edge bpdufilter + Returns: + None + Raises: + SubCommandFailure + """ + config = "no spanning-tree portfast " + if option: + config += f" {option} default" + + try: + device.configure(config) + except SubCommandFailure as error: + raise SubCommandFailure( + f'Could not unconfigure spanning-tree portfast bridge assurance - Error:\n{error}' + ) + +def configure_spanning_tree_portfast_bridge_assurance_on_interface(device, interface, option): + """ Configures Spanning Tree Portfast bridge assurance on interface + Args: + device ('obj') : device to use + interface ('str'): enable spanning-tree portfast bridge assurance on this interface + option('str'): edge trunk/network + Returns: + None + Raises: + SubCommandFailure + """ + cmd = [ + f"interface {interface}", + f"spanning-tree portfast {option}" + ] + + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not configure the spanning-tree portfast bridge assurance on interface Error:\n{error}".format(error=e) + ) + +def unconfigure_spanning_tree_portfast_bridge_assurance_on_interface(device, interface, option): + """ Unconfigures Spanning Tree Portfast bridge assurance on interface + Args: + device ('obj') : device to use + interface ('str'): enable spanning-tree portfast bridge assurance on this interface + option('str'): edge trunk/network + Returns: + None + Raises: + SubCommandFailure + """ + cmd = [ + f"interface {interface}", + f"no spanning-tree portfast {option}" + ] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not Unconfigure the spanning-tree portfast bridge assurance on interface Error:\n{error}".format(error=e) + ) + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sustainability/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sustainability/configure.py index a0b13f183..2aad7c7bd 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sustainability/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sustainability/configure.py @@ -428,6 +428,44 @@ def unconfigure_ecomode_optics(device, switch_number): f"Could not unconfigure serdes shutdown {device}. Error:\n{e}" ) +def configure_auto_off_optics(device, switch_number): + """ + Args: + device ('obj'): Device object + switch_number('int'): switch number + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f"hw-module switch {switch_number} auto-off optics" + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure serdes shutdown {device}. Error:\n{e}" + ) + +def unconfigure_auto_off_optics(device, switch_number): + """ + Args: + device ('obj'): Device object + switch_number('int'): switch number + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f"no hw-module switch {switch_number} auto-off optics" + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not unconfigure serdes shutdown {device}. Error:\n{e}" + ) + + + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/system/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/system/configure.py index e9f0e1ad0..20c97562d 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/system/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/system/configure.py @@ -32,7 +32,7 @@ def config_license(device, license): def configure_boot_level_licence(device, nw_advantage=False, nw_essentials=False, nw_premier=False, addon=False, adventerprise=False, advipservices=False, - ipbase=False): + ipbase=False, advantage=False, essentials=False): """ Config boot level license on Device Args: device ('obj'): Device object @@ -43,6 +43,8 @@ def configure_boot_level_licence(device, nw_advantage=False, nw_essentials=False adventerprise ('bool'): boot level adventerprise advipservices ('bool'): boot level advipservices ipbase ('bool'): boot level ipbase + advantage ('bool'): boot level advantage + essentials ('bool'): boot level essentials Return: None Raise: @@ -69,6 +71,10 @@ def configure_boot_level_licence(device, nw_advantage=False, nw_essentials=False cmd += " network-premier" if addon: cmd += " addon dna-premier" + elif advantage: + cmd += " advantage" + elif essentials: + cmd += " essentials" try: device.configure(cmd) except SubCommandFailure as e: diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/management/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/management/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/management/verify.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/management/verify.py new file mode 100644 index 000000000..2ac97bf87 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/management/verify.py @@ -0,0 +1,16 @@ +import re + +def is_management_interface(device, name): + ''' Verify if interface is a management interface + + Args: + name (str): Interface name + + Returns: + True or False + ''' + + if re.match('^mgmt0$', name): + return True + + return False \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/platform/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/platform/configure.py new file mode 100644 index 000000000..55c75b1da --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/platform/configure.py @@ -0,0 +1,30 @@ +'''NXOS configure functions for platform''' + +# Python +import logging + +# Unicon +from unicon.core.errors import SubCommandFailure +from unicon.eal.dialogs import Dialog, Statement + +# Logger +log = logging.getLogger(__name__) + +def configure_hostname(device, hostname): + """ To configure the hostname + Args: + device (`obj`): Device object + hostname (`str`): Hostname to be configured. + Returns: + None + Raises: + SubCommandFailure + """ + + try: + device.configure(f'switchname {hostname}') + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not configure hostname on {device}. Error:\n{error}" + .format(device=device.name, error=e) + ) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/configure/configure_hostname/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/configure/configure_hostname/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/configure/configure_hostname/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/configure/configure_hostname/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ab75552dc --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/configure/configure_hostname/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + hostname test-device: "hostname test-device\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: test-device(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: test-device(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: test-device# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/configure/configure_hostname/test_api_configure_hostname.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/configure/configure_hostname/test_api_configure_hostname.py new file mode 100644 index 000000000..0ab4cdd42 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/configure/configure_hostname/test_api_configure_hostname.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.configure import configure_hostname + + +class TestConfigureHostname(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + test-device: + 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: cat9k + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['test-device'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_hostname(self): + result = configure_hostname(self.device, 'test-device') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/unconfigure_aaa_accounting_dot1x_default_start_stop_group/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/unconfigure_aaa_accounting_dot1x_default_start_stop_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/unconfigure_aaa_accounting_dot1x_default_start_stop_group/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/unconfigure_aaa_accounting_dot1x_default_start_stop_group/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..05f810735 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/unconfigure_aaa_accounting_dot1x_default_start_stop_group/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no aaa accounting dot1x default start-stop group srvgrp: "no aaa accounting dot1x\ + \ default start-stop group srvgrp\r\n" + no logging console: '' + prompt: T6_C9200L_STK(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T6_C9200L_STK(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: T6_C9200L_STK# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/unconfigure_aaa_accounting_dot1x_default_start_stop_group/test_api_unconfigure_aaa_accounting_dot1x_default_start_stop_group.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/unconfigure_aaa_accounting_dot1x_default_start_stop_group/test_api_unconfigure_aaa_accounting_dot1x_default_start_stop_group.py new file mode 100644 index 000000000..a3b780667 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/aaa/configure/unconfigure_aaa_accounting_dot1x_default_start_stop_group/test_api_unconfigure_aaa_accounting_dot1x_default_start_stop_group.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.aaa.configure import unconfigure_aaa_accounting_dot1x_default_start_stop_group + + +class TestUnconfigureAaaAccountingDot1xDefaultStartStopGroup(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + T6_C9200L_STK: + 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: svl + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['T6_C9200L_STK'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_aaa_accounting_dot1x_default_start_stop_group(self): + result = unconfigure_aaa_accounting_dot1x_default_start_stop_group(self.device, 'srvgrp') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..94c20e271 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + 120 permit icmp any any: "120 permit icmp any any\r\n" + end: + new_state: execute + ip access-list extended ACL_1: "ip access-list extended ACL_1\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/acl/configure/configure_access_list_extend/test_api_configure_access_list_extend.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend/test_api_configure_access_list_extend.py new file mode 100644 index 000000000..59b3e359a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend/test_api_configure_access_list_extend.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.acl.configure import configure_access_list_extend + + +class TestConfigureAccessListExtend(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_access_list_extend(self): + result = configure_access_list_extend(self.device, 'ACL_1', 120, 'permit', 'icmp') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_dst_address_and_gt_port/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_dst_address_and_gt_port/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_dst_address_and_gt_port/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_dst_address_and_gt_port/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..76c5b50a8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_dst_address_and_gt_port/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,41 @@ +configure: + commands: + 70 permit udp any range 14000 14449 host 206.203.117.19 gt 2023: "70 permit udp\ + \ any range 14000 14449 host 206.203.117.1\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\ + \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b$dp\ + \ any range 14000 14449 host 206.203.117.19 \b\b\b\b\b\b\b\b\b gt 2023\r\ + \n" + end: + new_state: execute + ip access-list extended ACL_1: "ip access-list extended ACL_1\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/acl/configure/configure_access_list_extend_with_dst_address_and_gt_port/test_api_configure_access_list_extend_with_dst_address_and_gt_port.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_dst_address_and_gt_port/test_api_configure_access_list_extend_with_dst_address_and_gt_port.py new file mode 100644 index 000000000..aefaa3165 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_dst_address_and_gt_port/test_api_configure_access_list_extend_with_dst_address_and_gt_port.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.acl.configure import configure_access_list_extend_with_dst_address_and_gt_port + + +class TestConfigureAccessListExtendWithDstAddressAndGtPort(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_access_list_extend_with_dst_address_and_gt_port(self): + result = configure_access_list_extend_with_dst_address_and_gt_port(self.device, 'ACL_1', 70, 'permit', 'udp', 14000, 14449, '206.203.117.19', 2023) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_dst_address_and_port/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_dst_address_and_port/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_dst_address_and_port/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_dst_address_and_port/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..9713d4c5a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_dst_address_and_port/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + 10 deny udp any 8.33.237.0 0.0.0.255 range 10000 13000: "10 deny udp any 8.33.237.0\ + \ 0.0.0.255 range 10000 13000\r\n" + end: + new_state: execute + ip access-list extended ACL_1: "ip access-list extended ACL_1\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/acl/configure/configure_access_list_extend_with_dst_address_and_port/test_api_configure_access_list_extend_with_dst_address_and_port.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_dst_address_and_port/test_api_configure_access_list_extend_with_dst_address_and_port.py new file mode 100644 index 000000000..a0c503ab8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_dst_address_and_port/test_api_configure_access_list_extend_with_dst_address_and_port.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.acl.configure import configure_access_list_extend_with_dst_address_and_port + + +class TestConfigureAccessListExtendWithDstAddressAndPort(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_access_list_extend_with_dst_address_and_port(self): + result = configure_access_list_extend_with_dst_address_and_port(self.device, 'ACL_1', 10, 'deny', 'udp', '8.33.237.0', '0.0.0.255', 10000, 13000) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_port/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_port/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_port/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_port/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..f13f52dbf --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_port/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,40 @@ +configure: + commands: + 50 permit udp any range 14000 14449 any range 8000 8999: "50 permit udp any range\ + \ 14000 14449 any range 8000 899\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\ + \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b$dp any range\ + \ 14000 14449 any range 8000 8999 \b\b\b\b\b\b\b\b\b\r\n" + end: + new_state: execute + ip access-list extended ACL_1: "ip access-list extended ACL_1\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/acl/configure/configure_access_list_extend_with_port/test_api_configure_access_list_extend_with_port.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_port/test_api_configure_access_list_extend_with_port.py new file mode 100644 index 000000000..2ac34c07d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_port/test_api_configure_access_list_extend_with_port.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.acl.configure import configure_access_list_extend_with_port + + +class TestConfigureAccessListExtendWithPort(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_access_list_extend_with_port(self): + result = configure_access_list_extend_with_port(self.device, 'ACL_1', 50, 'permit', 'udp', 14000, 14449, 8000, 8999) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_range_and_eq_port/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_range_and_eq_port/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_range_and_eq_port/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_range_and_eq_port/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ca6a80990 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_range_and_eq_port/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + 110 permit udp any range 50000 50019 any eq 3479: "110 permit udp any range 50000\ + \ 50019 any eq 3479\r\n" + end: + new_state: execute + ip access-list extended ACL_1: "ip access-list extended ACL_1\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/acl/configure/configure_access_list_extend_with_range_and_eq_port/test_api_configure_access_list_extend_with_range_and_eq_port.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_range_and_eq_port/test_api_configure_access_list_extend_with_range_and_eq_port.py new file mode 100644 index 000000000..c73e31f29 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_list_extend_with_range_and_eq_port/test_api_configure_access_list_extend_with_range_and_eq_port.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.acl.configure import configure_access_list_extend_with_range_and_eq_port + + +class TestConfigureAccessListExtendWithRangeAndEqPort(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_access_list_extend_with_range_and_eq_port(self): + result = configure_access_list_extend_with_range_and_eq_port(self.device, 'ACL_1', 110, 'permit', 'udp', 50000, 50019, 3479) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_sgacl/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_sgacl/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_sgacl/cd b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_sgacl/cd new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_sgacl/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_sgacl/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..6a8102ab8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_sgacl/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + ipv6 access-list role-based permit: "ipv6 access-list role-based permit\r\n" + line console 0: + new_state: configure_line + no logging console: '' + permit ipv6 log: "permit ipv6 log\r\n" + prompt: mac-gen1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: mac-gen1(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: mac-gen1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_sgacl/python b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_sgacl/python new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_sgacl/test_api_configure_ip_sgacl.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_sgacl/test_api_configure_ip_sgacl.py new file mode 100644 index 000000000..b0051f45b --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_sgacl/test_api_configure_ip_sgacl.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.acl.configure import configure_ip_sgacl + + +class TestConfigureIpSgacl(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + mac-gen1: + 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: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['mac-gen1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ip_sgacl(self): + result = configure_ip_sgacl(self.device, 'permit', 'ipv6') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_ip_sgacl/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_ip_sgacl/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_ip_sgacl/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_ip_sgacl/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..d7478ad20 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_ip_sgacl/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no ipv6 access-list role-based permit: "no ipv6 access-list role-based permit\r\ + \n" + no logging console: '' + prompt: mac-gen1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: mac-gen1(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: mac-gen1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_ip_sgacl/test_api_unconfigure_ip_sgacl.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_ip_sgacl/test_api_unconfigure_ip_sgacl.py new file mode 100644 index 000000000..42edb77d6 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_ip_sgacl/test_api_unconfigure_ip_sgacl.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.acl.configure import unconfigure_ip_sgacl + + +class TestUnconfigureIpSgacl(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + mac-gen1: + 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: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['mac-gen1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_ip_sgacl(self): + result = unconfigure_ip_sgacl(self.device, 'permit', 'ipv6') + 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/configure_spanning_tree_portfast/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9610/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/c9610/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/c9610/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/c9610/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/c9610/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/c9610/spanning_tree/configure/configure_spanning_tree_portfast/test_api_configure_spanning_tree_portfast.py new file mode 100644 index 000000000..d3c9d179a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cat9k/c9610/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.c9610.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/dot1q/configure/configure_vlan_dot1q_tag_native/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1q/configure/configure_vlan_dot1q_tag_native/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1q/configure/configure_vlan_dot1q_tag_native/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1q/configure/configure_vlan_dot1q_tag_native/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..174cadc0a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1q/configure/configure_vlan_dot1q_tag_native/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: '' + vlan dot1q tag native: "vlan dot1q tag native\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/dot1q/configure/configure_vlan_dot1q_tag_native/test_api_configure_vlan_dot1q_tag_native.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1q/configure/configure_vlan_dot1q_tag_native/test_api_configure_vlan_dot1q_tag_native.py new file mode 100644 index 000000000..89479401c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1q/configure/configure_vlan_dot1q_tag_native/test_api_configure_vlan_dot1q_tag_native.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.dot1q.configure import configure_vlan_dot1q_tag_native + + +class TestConfigureVlanDot1qTagNative(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_vlan_dot1q_tag_native(self): + result = configure_vlan_dot1q_tag_native(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1q/configure/unconfigure_vlan_dot1q_tag_native/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1q/configure/unconfigure_vlan_dot1q_tag_native/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1q/configure/unconfigure_vlan_dot1q_tag_native/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1q/configure/unconfigure_vlan_dot1q_tag_native/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..eae8918fd --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1q/configure/unconfigure_vlan_dot1q_tag_native/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 vlan dot1q tag native: "no vlan dot1q tag native\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/dot1q/configure/unconfigure_vlan_dot1q_tag_native/test_api_unconfigure_vlan_dot1q_tag_native.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1q/configure/unconfigure_vlan_dot1q_tag_native/test_api_unconfigure_vlan_dot1q_tag_native.py new file mode 100644 index 000000000..1bbf1c901 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1q/configure/unconfigure_vlan_dot1q_tag_native/test_api_unconfigure_vlan_dot1q_tag_native.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.dot1q.configure import unconfigure_vlan_dot1q_tag_native + + +class TestUnconfigureVlanDot1qTagNative(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_unconfigure_vlan_dot1q_tag_native(self): + result = unconfigure_vlan_dot1q_tag_native(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/configure_fnf_flow_record_match_flow/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/configure_fnf_flow_record_match_flow/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/configure_fnf_flow_record_match_flow/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/configure_fnf_flow_record_match_flow/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..f02340134 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/configure_fnf_flow_record_match_flow/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,41 @@ +configure: + commands: + end: + new_state: execute + flow record map1: "flow record map1\r\n" + flow record map2: "flow record map2\r\n" + line console 0: + new_state: configure_line + match flow cts destination group-tag: "javelin-morph-bgl16-(config-flow-record)#match\ + \ flow cts destination group-tag\r\n" + match flow observation point: "javelin-morph-bgl16-(config-flow-record)#match\ + \ flow observation point\r\n" + no logging console: '' + prompt: javelin-morph-bgl16-full-tb2-dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: javelin-morph-bgl16-full-tb2-dut1(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: javelin-morph-bgl16-full-tb2-dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/configure_fnf_flow_record_match_flow/test_api_configure_fnf_flow_record_match_flow.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/configure_fnf_flow_record_match_flow/test_api_configure_fnf_flow_record_match_flow.py new file mode 100644 index 000000000..67ea8a75f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/configure_fnf_flow_record_match_flow/test_api_configure_fnf_flow_record_match_flow.py @@ -0,0 +1,40 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.flow.configure import configure_fnf_flow_record_match_flow + + +class TestConfigureFnfFlowRecordMatchFlow(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + javelin-morph-bgl16-full-tb2-dut1: + 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['javelin-morph-bgl16-full-tb2-dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_fnf_flow_record_match_flow(self): + result = configure_fnf_flow_record_match_flow(self.device, 'map1', 'observation', None) + expected_output = None + self.assertEqual(result, expected_output) + + def test_configure_fnf_flow_record_match_flow_1(self): + result = configure_fnf_flow_record_match_flow(self.device, 'map2', 'cts', 'destination') + 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_class_map/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_class_map/__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_class_map/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_class_map/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ee2d5fa9b --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_class_map/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_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 + monitor capture test class-map myclassmap: + response: + - "Class-map myclassmap not found\r\n\r\nFailed to attach existing class-map" + response_type: circular + 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/flow/execute/execute_monitor_capture_class_map/test_api_execute_monitor_capture_class_map.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_class_map/test_api_execute_monitor_capture_class_map.py new file mode 100644 index 000000000..9b302b57c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_class_map/test_api_execute_monitor_capture_class_map.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_class_map + + +class TestExecuteMonitorCaptureClassMap(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_execute_monitor_capture_class_map(self): + result = execute_monitor_capture_class_map(self.device, 'test', 'myclassmap') + 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_clear/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_clear/__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_clear/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_clear/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..f554b68f5 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_clear/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_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 + monitor capture test clear: + response: + - Clear not supported for capture configured with file options + response_type: circular + 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/flow/execute/execute_monitor_capture_clear/test_api_execute_monitor_capture_clear.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_clear/test_api_execute_monitor_capture_clear.py new file mode 100644 index 000000000..727b9dbb4 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_clear/test_api_execute_monitor_capture_clear.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_clear + + +class TestExecuteMonitorCaptureClear(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_execute_monitor_capture_clear(self): + result = execute_monitor_capture_clear(self.device, 'test') + 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_file_location_flash/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_file_location_flash/__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_file_location_flash/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_file_location_flash/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..420283466 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_file_location_flash/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_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 + monitor capture test file location flash:testin.pcap size 1: + response: + - '' + response_type: circular + 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/flow/execute/execute_monitor_capture_file_location_flash/test_api_execute_monitor_capture_file_location_flash.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_file_location_flash/test_api_execute_monitor_capture_file_location_flash.py new file mode 100644 index 000000000..88b2dccc5 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_file_location_flash/test_api_execute_monitor_capture_file_location_flash.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_file_location_flash + + +class TestExecuteMonitorCaptureFileLocationFlash(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_execute_monitor_capture_file_location_flash(self): + result = execute_monitor_capture_file_location_flash(self.device, 'test', 'testin.pcap', 4, 1) + 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_start_capture_filter/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_start_capture_filter/__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_start_capture_filter/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_start_capture_filter/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..c87516ff8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_start_capture_filter/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_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 + monitor capture test start capture-filter ANY: + response: + - 'Capture point does not exist : test' + response_type: circular + 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/flow/execute/execute_monitor_capture_start_capture_filter/test_api_execute_monitor_capture_start_capture_filter.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_start_capture_filter/test_api_execute_monitor_capture_start_capture_filter.py new file mode 100644 index 000000000..b98342882 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/execute/execute_monitor_capture_start_capture_filter/test_api_execute_monitor_capture_start_capture_filter.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_start_capture_filter + + +class TestExecuteMonitorCaptureStartCaptureFilter(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_execute_monitor_capture_start_capture_filter(self): + result = execute_monitor_capture_start_capture_filter(self.device, 'test', 'ANY') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ie3k/platform/execute/execute_set_config_register/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ie3k/platform/execute/execute_set_config_register/__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_ipv6_address_on_hsrp_interface/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ipv6_address_on_hsrp_interface/mock_data/iosxe/mock_data.yaml index 7e44351ab..72e12f2fd 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ipv6_address_on_hsrp_interface/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ipv6_address_on_hsrp_interface/mock_data/iosxe/mock_data.yaml @@ -2,28 +2,31 @@ configure: commands: end: new_state: execute - interface vlan16: "interface vlan16\r\n" + interface Vlan600: "interface Vlan600\r\n" line console 0: new_state: configure_line no logging console: '' - standby 0 preempt delay sync 0: "standby 0 preempt delay sync 0\r\n" - standby 0 ipv6 10::3/64: "standby 0 ipv6 10::3/64\r\n" - standby 0 timers 1 4: "standby 0 timers 1 4\r\n" - prompt: 9300-1(config)# + standby 3 preempt delay sync 10: "standby 3 preempt delay sync 10\r\n" + standby 3 priority 100: "standby 3 priority 100\r\n" + standby 3 ipv6 2001:db8:10::100/64: "standby 3 ipv6 2001:db8:10::100/64\r\n" + standby 3 timers 10 20: "standby 3 timers 10 20\r\n" + standby version 2: "standby version 2\r\n" + prompt: platform-Prom-1(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: 9300-1(config-line)# + prompt: platform-Prom-1(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: 9300-1# + prompt: platform-Prom-1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ipv6_address_on_hsrp_interface/test_api_configure_ipv6_address_on_hsrp_interface.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ipv6_address_on_hsrp_interface/test_api_configure_ipv6_address_on_hsrp_interface.py index 78291c5c6..f929823c8 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ipv6_address_on_hsrp_interface/test_api_configure_ipv6_address_on_hsrp_interface.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_ipv6_address_on_hsrp_interface/test_api_configure_ipv6_address_on_hsrp_interface.py @@ -10,7 +10,7 @@ class TestConfigureIpv6AddressOnHsrpInterface(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - 9300-1: + platform-Prom-1: connections: defaults: class: unicon.Unicon @@ -19,10 +19,10 @@ def setUpClass(self): protocol: unknown os: iosxe platform: cat9k - type: C9300 + type: c9500 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['9300-1'] + self.device = self.testbed.devices['platform-Prom-1'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -30,6 +30,6 @@ def setUpClass(self): ) def test_configure_ipv6_address_on_hsrp_interface(self): - result = configure_ipv6_address_on_hsrp_interface(self.device, 'vlan16', 0, '10::3/64', None, '0', '1', '4') + result = configure_ipv6_address_on_hsrp_interface(self.device, 'Vlan600', 3, 2, '2001:db8:10::100/64', '100', '10', '10', '20') expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_medium_p2p_interface/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_medium_p2p_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_medium_p2p_interface/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_medium_p2p_interface/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..e88f44d0a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_medium_p2p_interface/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface HundredGigE1/0/49: "interface HundredGigE1/0/49\r\n" + line console 0: + new_state: configure_line + medium p2p: "medium p2p\r\n" + 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 + 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/interface/configure/configure_medium_p2p_interface/test_api_configure_medium_p2p_interface.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_medium_p2p_interface/test_api_configure_medium_p2p_interface.py new file mode 100644 index 000000000..18984ee38 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_medium_p2p_interface/test_api_configure_medium_p2p_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_medium_p2p_interface + + +class TestConfigureMediumP2pInterface(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_configure_medium_p2p_interface(self): + result = configure_medium_p2p_interface(self.device, 'HundredGigE1/0/49') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_switchport_trunk_native_vlan_tag/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_switchport_trunk_native_vlan_tag/__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_switchport_trunk_native_vlan_tag/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_switchport_trunk_native_vlan_tag/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..529b7f09f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_switchport_trunk_native_vlan_tag/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +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: '' + switchport trunk native vlan tag: "switchport trunk native vlan tag\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_switchport_trunk_native_vlan_tag/test_api_configure_switchport_trunk_native_vlan_tag.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_switchport_trunk_native_vlan_tag/test_api_configure_switchport_trunk_native_vlan_tag.py new file mode 100644 index 000000000..95405dcf9 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/configure_switchport_trunk_native_vlan_tag/test_api_configure_switchport_trunk_native_vlan_tag.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import configure_switchport_trunk_native_vlan_tag + + +class TestConfigureSwitchportTrunkNativeVlanTag(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_switchport_trunk_native_vlan_tag(self): + result = configure_switchport_trunk_native_vlan_tag(self.device, 'GigabitEthernet1/0/10') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_medium_p2p_interface/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_medium_p2p_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/unconfigure_medium_p2p_interface/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_medium_p2p_interface/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..de4fbe399 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_medium_p2p_interface/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface HundredGigE1/0/49: "interface HundredGigE1/0/49\r\n" + line console 0: + new_state: configure_line + no logging console: '' + no medium p2p: "no medium p2p\r\n" + 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 + 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/interface/configure/unconfigure_medium_p2p_interface/test_api_unconfigure_medium_p2p_interface.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_medium_p2p_interface/test_api_unconfigure_medium_p2p_interface.py new file mode 100644 index 000000000..67814e015 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_medium_p2p_interface/test_api_unconfigure_medium_p2p_interface.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import unconfigure_medium_p2p_interface + + +class TestUnconfigureMediumP2pInterface(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_unconfigure_medium_p2p_interface(self): + result = unconfigure_medium_p2p_interface(self.device, 'HundredGigE1/0/49') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_switchport_trunk_native_vlan_tag/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_switchport_trunk_native_vlan_tag/__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_switchport_trunk_native_vlan_tag/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_switchport_trunk_native_vlan_tag/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..a1cfe9920 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_switchport_trunk_native_vlan_tag/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +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: '' + no switchport trunk native vlan tag: "no switchport trunk native vlan tag\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/unconfigure_switchport_trunk_native_vlan_tag/test_api_unconfigure_switchport_trunk_native_vlan_tag.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_switchport_trunk_native_vlan_tag/test_api_unconfigure_switchport_trunk_native_vlan_tag.py new file mode 100644 index 000000000..35eb0e220 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_switchport_trunk_native_vlan_tag/test_api_unconfigure_switchport_trunk_native_vlan_tag.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import unconfigure_switchport_trunk_native_vlan_tag + + +class TestUnconfigureSwitchportTrunkNativeVlanTag(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_unconfigure_switchport_trunk_native_vlan_tag(self): + result = unconfigure_switchport_trunk_native_vlan_tag(self.device, 'GigabitEthernet1/0/10') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipsec/configure/configure_ikev2_profile_pre_share/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipsec/configure/configure_ikev2_profile_pre_share/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipsec/configure/configure_ikev2_profile_pre_share/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipsec/configure/configure_ikev2_profile_pre_share/mock_data/iosxe/mock_data.yaml index e023cd9d0..1d277bdb6 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipsec/configure/configure_ikev2_profile_pre_share/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipsec/configure/configure_ikev2_profile_pre_share/mock_data/iosxe/mock_data.yaml @@ -2,31 +2,37 @@ configure: commands: authentication local pre-share: " 1. A local and a remote authentication method.\r\ \n" - authentication remote pre-share: " 2. A match identity or a match certificate - or match any statement.\r\n" - crypto ikev2 profile test_ike_prof: "crypto ikev2 profile test_ike_prof\r\n" + authentication remote pre-share: " 2. A match identity or a match certificate\ + \ or match any statement.\r\n" + crypto ikev2 profile scale_ikev2_profile_v4_phy: "crypto ikev2 profile scale_ikev2_profile_v4_phy\r\ + \n" end: new_state: execute - keyring local 1: "match fvrf UNDERLAY\r\n" + keyring local ikev2_key_v4_phy: "match identity remote address 19.1.1.0 255.255.255.0\r\ + \n" line console 0: new_state: configure_line - match fvrf UNDERLAY: "IKEv2 profile MUST have:\r\n" + match address local interface TenGigabitEthernet1/0/1: "authentication local pre-share\r\ + \n" + match identity remote address 19.1.1.0 255.255.255.0: "IKEv2 profile MUST have:\r\ + \n" no logging console: '' - prompt: kparames_csr1(config)# + prompt: PE-B(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: kparames_csr1(config-line)# + prompt: PE-B(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 +41,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: kparames_csr1# + prompt: PE-B# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipsec/configure/configure_ikev2_profile_pre_share/test_api_configure_ikev2_profile_pre_share.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipsec/configure/configure_ikev2_profile_pre_share/test_api_configure_ikev2_profile_pre_share.py index 57e282cb6..fa279497a 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipsec/configure/configure_ikev2_profile_pre_share/test_api_configure_ikev2_profile_pre_share.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipsec/configure/configure_ikev2_profile_pre_share/test_api_configure_ikev2_profile_pre_share.py @@ -1,3 +1,4 @@ +import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.ipsec.configure import configure_ikev2_profile_pre_share @@ -7,22 +8,21 @@ class TestConfigureIkev2ProfilePreShare(unittest.TestCase): @classmethod def setUpClass(self): - testbed = """ + testbed = f""" devices: - kparames_csr1: + PE-B: 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: cat8k - model: c8000v - type: iosxe + platform: cat9k + type: c9300 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['kparames_csr1'] + self.device = self.testbed.devices['PE-B'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -30,6 +30,6 @@ def setUpClass(self): ) def test_configure_ikev2_profile_pre_share(self): - result = configure_ikev2_profile_pre_share(self.device, 'test_ike_prof', 'pre-share', 'pre-share', '1', None, '', 'ipv4', None, '2', 'periodic', 'UNDERLAY') + result = configure_ikev2_profile_pre_share(self.device, 'scale_ikev2_profile_v4_phy', 'pre-share', 'pre-share', 'ikev2_key_v4_phy', '19.1.1.0', '255.255.255.0', 'ipv4', None, '2', 'periodic', None, None, 'TenGigabitEthernet1/0/1') expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_vty_lines/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_vty_lines/mock_data/iosxe/mock_data.yaml index ecb9d5e1e..7c5aa57a1 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_vty_lines/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_vty_lines/mock_data/iosxe/mock_data.yaml @@ -1,32 +1,28 @@ configure: commands: - aaa authentication login default local: "aaa authentication login default local\r\ - \n" - aaa authorization exec default local: "aaa authorization exec default local\r\n" - aaa new-model: "aaa new-model\r\n" end: new_state: execute line console 0: new_state: configure_line - line vty 0 14: "line vty 0 14\r\n" + line vty 0 15: "line vty 0 15\r\n" no logging console: '' transport input telnet ssh: "transport input telnet ssh\r\n" - username admin password admin: "username admin password admin\r\n" - prompt: vmtb-isr4451(config)# + prompt: 9404R-dut3(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: vmtb-isr4451(config-line)# + prompt: 9404R-dut3(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: @@ -36,15 +32,11 @@ execute: new_state: configure show running-config | section line vty: response: - - |- - line vty 0 4 - exec-timeout 0 0 - transport input telnet ssh - line vty 5 14 - transport input telnet ssh + - "line vty 0 4\r\n exec-timeout 0 0\r\n login\r\n transport input telnet ssh\r\ + \nline vty 5 15\r\n login\r\n transport input telnet ssh" response_type: circular show version: '' + show version | include operating mode: '' term length 0: '' term width 0: '' - show version | include operating mode: '' - prompt: vmtb-isr4451# + prompt: 9404R-dut3# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_vty_lines/test_api_configure_management_vty_lines.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_vty_lines/test_api_configure_management_vty_lines.py index ec88539ec..2a0261649 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_vty_lines/test_api_configure_management_vty_lines.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_vty_lines/test_api_configure_management_vty_lines.py @@ -1,17 +1,16 @@ import os import unittest -from unittest.mock import Mock from pyats.topology import loader from genie.libs.sdk.apis.iosxe.management.configure import configure_management_vty_lines -class TestConfigureManagementTelnet(unittest.TestCase): +class TestConfigureManagementVtyLines(unittest.TestCase): @classmethod def setUpClass(self): testbed = f""" devices: - vmtb-isr4451: + 9404R-dut3: connections: defaults: class: unicon.Unicon @@ -19,18 +18,18 @@ 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: iosxe - type: iosxe + platform: cat9k + type: None """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['vmtb-isr4451'] + self.device = self.testbed.devices['9404R-dut3'] self.device.connect( learn_hostname=True, init_config_commands=[], init_exec_commands=[] ) - def test_configure_management_telnet(self): - result = configure_management_vty_lines(self.device) + def test_configure_management_vty_lines(self): + result = configure_management_vty_lines(self.device, 'None', 'telnet', False) expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_crypto_pki_profile/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_crypto_pki_profile/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_crypto_pki_profile/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_crypto_pki_profile/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..04120eaf7 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_crypto_pki_profile/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,43 @@ +configure: + commands: + crypto pki profile enrollment API_PROF: "crypto pki profile enrollment API_PROF\r\ + \n" + end: + new_state: execute + enrollment http username ashrishe password 0 nopassword: "enrollment http username\ + \ ashrishe password 0 nopassword\r\n" + enrollment url https://10.106.29.252:443: "enrollment url https://10.106.29.252:443\r\ + \n" + exit: "exit\r\n" + line console 0: + new_state: configure_line + method-est: "method-est\r\n" + no logging console: '' + prompt: dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: dut1(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: dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_crypto_pki_profile/test_api_configure_crypto_pki_profile.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_crypto_pki_profile/test_api_configure_crypto_pki_profile.py new file mode 100644 index 000000000..e8d3f7635 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_crypto_pki_profile/test_api_configure_crypto_pki_profile.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.pki.configure import configure_crypto_pki_profile + + +class TestConfigureCryptoPkiProfile(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + dut1: + 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['dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_crypto_pki_profile(self): + result = configure_crypto_pki_profile(self.device, 'API_PROF', True, 'ashrishe', '0', 'nopassword', 'https://10.106.29.252:443', None, True, None, None) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_no_pki_enroll/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_no_pki_enroll/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_no_pki_enroll/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_no_pki_enroll/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..bd7f1a3e8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_no_pki_enroll/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no crypto pki enroll tp_wo_pass_enc: "no crypto pki enroll tp_wo_pass_enc\r\n" + no logging console: '' + prompt: dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: dut1(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: dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_no_pki_enroll/test_api_configure_no_pki_enroll.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_no_pki_enroll/test_api_configure_no_pki_enroll.py new file mode 100644 index 000000000..9b61d194a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_no_pki_enroll/test_api_configure_no_pki_enroll.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.pki.configure import configure_no_pki_enroll + + +class TestConfigureNoPkiEnroll(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + dut1: + 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['dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_no_pki_enroll(self): + result = configure_no_pki_enroll(self.device, 'tp_wo_pass_enc') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/unconfigure_crypto_pki_profile/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/unconfigure_crypto_pki_profile/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/unconfigure_crypto_pki_profile/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/unconfigure_crypto_pki_profile/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..597cbfca3 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/unconfigure_crypto_pki_profile/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no crypto pki profile enrollment API_PROF: "no crypto pki profile enrollment API_PROF\r\ + \n" + no logging console: '' + prompt: dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: dut1(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: dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/unconfigure_crypto_pki_profile/test_api_unconfigure_crypto_pki_profile.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/unconfigure_crypto_pki_profile/test_api_unconfigure_crypto_pki_profile.py new file mode 100644 index 000000000..9c6687f76 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/unconfigure_crypto_pki_profile/test_api_unconfigure_crypto_pki_profile.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.pki.configure import unconfigure_crypto_pki_profile + + +class TestUnconfigureCryptoPkiProfile(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + dut1: + 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['dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_crypto_pki_profile(self): + result = unconfigure_crypto_pki_profile(self.device, 'API_PROF') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/clear/clear_platform_qos_statistics_iif_id/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/clear/clear_platform_qos_statistics_iif_id/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/clear/clear_platform_qos_statistics_iif_id/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/clear/clear_platform_qos_statistics_iif_id/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..53b915222 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/clear/clear_platform_qos_statistics_iif_id/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: C9300CR-matrix(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: C9300CR-matrix(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + clear platform hardware fed switch active qos statistics iif_id 16777217: + 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: C9300CR-matrix# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/clear/clear_platform_qos_statistics_iif_id/test_api_clear_platform_qos_statistics_iif_id.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/clear/clear_platform_qos_statistics_iif_id/test_api_clear_platform_qos_statistics_iif_id.py new file mode 100644 index 000000000..aebcb6e2b --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/clear/clear_platform_qos_statistics_iif_id/test_api_clear_platform_qos_statistics_iif_id.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.clear import clear_platform_qos_statistics_iif_id + + +class TestClearPlatformQosStatisticsIifId(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + C9300CR-matrix: + 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: cat900 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['C9300CR-matrix'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_clear_platform_qos_statistics_iif_id(self): + result = clear_platform_qos_statistics_iif_id(self.device, 'active', 16777217, 'switch') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_default_stack_power_auto_off/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_default_stack_power_auto_off/__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_default_stack_power_auto_off/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_default_stack_power_auto_off/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..be8f93db7 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_default_stack_power_auto_off/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + default auto-off: "default auto-off\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + stack-power stack Powerstack-2: "stack-power stack Powerstack-2\r\n" + prompt: Peer1-topo1-ott(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Peer1-topo1-ott(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: Peer1-topo1-ott# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_default_stack_power_auto_off/test_api_configure_default_stack_power_auto_off.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_default_stack_power_auto_off/test_api_configure_default_stack_power_auto_off.py new file mode 100644 index 000000000..dfa43e3d8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_default_stack_power_auto_off/test_api_configure_default_stack_power_auto_off.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_default_stack_power_auto_off + + +class TestConfigureDefaultStackPowerAutoOff(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Peer1-topo1-ott: + 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: c9300 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Peer1-topo1-ott'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_default_stack_power_auto_off(self): + result = configure_default_stack_power_auto_off(self.device, 'Powerstack-2') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_switch_number_auto_off_led/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_switch_number_auto_off_led/__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_hw_module_switch_number_auto_off_led/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_switch_number_auto_off_led/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..525804ea7 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_switch_number_auto_off_led/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + hw-module switch 1 auto-off led: "hw-module switch 1 auto-off led\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: Peer1-topo1-ott(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Peer1-topo1-ott(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: Peer1-topo1-ott# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_switch_number_auto_off_led/test_api_configure_hw_module_switch_number_auto_off_led.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_switch_number_auto_off_led/test_api_configure_hw_module_switch_number_auto_off_led.py new file mode 100644 index 000000000..be521d170 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_switch_number_auto_off_led/test_api_configure_hw_module_switch_number_auto_off_led.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_hw_module_switch_number_auto_off_led + + +class TestConfigureHwModuleSwitchNumberAutoOffLed(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Peer1-topo1-ott: + 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: c9300 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Peer1-topo1-ott'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_hw_module_switch_number_auto_off_led(self): + result = configure_hw_module_switch_number_auto_off_led(self.device, '1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_stack_power_auto_off/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_stack_power_auto_off/__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_stack_power_auto_off/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_stack_power_auto_off/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..256258e5d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_stack_power_auto_off/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + auto-off: "auto-off\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + stack-power stack Powerstack-2: "stack-power stack Powerstack-2\r\n" + prompt: Peer1-topo1-ott(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Peer1-topo1-ott(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: Peer1-topo1-ott# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_stack_power_auto_off/test_api_configure_stack_power_auto_off.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_stack_power_auto_off/test_api_configure_stack_power_auto_off.py new file mode 100644 index 000000000..1713552d4 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_stack_power_auto_off/test_api_configure_stack_power_auto_off.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_stack_power_auto_off + + +class TestConfigureStackPowerAutoOff(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Peer1-topo1-ott: + 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: c9300 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Peer1-topo1-ott'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_stack_power_auto_off(self): + result = configure_stack_power_auto_off(self.device, 'Powerstack-2') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_switch_number_auto_off_led/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_switch_number_auto_off_led/__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_hw_module_switch_number_auto_off_led/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_switch_number_auto_off_led/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..dacaa6782 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_switch_number_auto_off_led/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no hw-module switch 1 auto-off led: "no hw-module switch 1 auto-off led\r\n" + no logging console: '' + prompt: Peer1-topo1-ott(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Peer1-topo1-ott(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: Peer1-topo1-ott# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_switch_number_auto_off_led/test_api_unconfigure_hw_module_switch_number_auto_off_led.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_switch_number_auto_off_led/test_api_unconfigure_hw_module_switch_number_auto_off_led.py new file mode 100644 index 000000000..932f566ff --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_switch_number_auto_off_led/test_api_unconfigure_hw_module_switch_number_auto_off_led.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_hw_module_switch_number_auto_off_led + + +class TestUnconfigureHwModuleSwitchNumberAutoOffLed(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Peer1-topo1-ott: + 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: c9300 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Peer1-topo1-ott'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_hw_module_switch_number_auto_off_led(self): + result = unconfigure_hw_module_switch_number_auto_off_led(self.device, '1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_stack_power_auto_off/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_stack_power_auto_off/__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_stack_power_auto_off/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_stack_power_auto_off/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..36e0da8e4 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_stack_power_auto_off/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no auto-off: "no auto-off\r\n" + no logging console: '' + stack-power stack Powerstack-2: "stack-power stack Powerstack-2\r\n" + prompt: Peer1-topo1-ott(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Peer1-topo1-ott(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: Peer1-topo1-ott# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_stack_power_auto_off/test_api_unconfigure_stack_power_auto_off.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_stack_power_auto_off/test_api_unconfigure_stack_power_auto_off.py new file mode 100644 index 000000000..fe0341de0 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_stack_power_auto_off/test_api_unconfigure_stack_power_auto_off.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_stack_power_auto_off + + +class TestUnconfigureStackPowerAutoOff(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Peer1-topo1-ott: + 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: c9300 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Peer1-topo1-ott'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_stack_power_auto_off(self): + result = unconfigure_stack_power_auto_off(self.device, 'Powerstack-2') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/test_platform_software_fru_fake_insert_remove/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/test_platform_software_fru_fake_insert_remove/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/test_platform_software_fru_fake_insert_remove/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/test_platform_software_fru_fake_insert_remove/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..a073f399c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/test_platform_software_fru_fake_insert_remove/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: C9300CR-matrix(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: C9300CR-matrix(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 2 fru fake-remove: + response: + - '' + response_type: circular + prompt: C9300CR-matrix# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/test_platform_software_fru_fake_insert_remove/test_api_test_platform_software_fru_fake_insert_remove.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/test_platform_software_fru_fake_insert_remove/test_api_test_platform_software_fru_fake_insert_remove.py new file mode 100644 index 000000000..2619c0b2a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/test_platform_software_fru_fake_insert_remove/test_api_test_platform_software_fru_fake_insert_remove.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.execute import test_platform_software_fru_fake_insert_remove + + +class TestTestPlatformSoftwareFruFakeInsertRemove(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + C9300CR-matrix: + 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: cat900 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['C9300CR-matrix'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_test_platform_software_fru_fake_insert_remove(self): + result = test_platform_software_fru_fake_insert_remove(self.device, 2, 'fake-remove') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_bridge_assurance/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_bridge_assurance/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_bridge_assurance/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_bridge_assurance/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..feb649691 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_bridge_assurance/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: '' + spanning-tree bridge assurance: "spanning-tree bridge assurance\r\n" + prompt: mac-gen1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: mac-gen1(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: mac-gen1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_bridge_assurance/test_api_configure_spanning_tree_bridge_assurance.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_bridge_assurance/test_api_configure_spanning_tree_bridge_assurance.py new file mode 100644 index 000000000..06b3102b1 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_bridge_assurance/test_api_configure_spanning_tree_bridge_assurance.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.spanning_tree.configure import configure_spanning_tree_bridge_assurance + + +class TestConfigureSpanningTreeBridgeAssurance(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + mac-gen1: + 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: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['mac-gen1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_spanning_tree_bridge_assurance(self): + result = configure_spanning_tree_bridge_assurance(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..0a06ca709 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance/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: '' + spanning-tree portfast edge bpduguard default: "spanning-tree portfast edge\ + \ bpduguard default\r\n" + prompt: mac-gen1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: mac-gen1(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: mac-gen1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance/test_api_configure_spanning_tree_portfast_bridge_assurance.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance/test_api_configure_spanning_tree_portfast_bridge_assurance.py new file mode 100644 index 000000000..7b54a6371 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance/test_api_configure_spanning_tree_portfast_bridge_assurance.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.spanning_tree.configure import configure_spanning_tree_portfast_bridge_assurance + + +class TestConfigureSpanningTreePortfastBridgeAssurance(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + mac-gen1: + 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: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['mac-gen1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_spanning_tree_portfast_bridge_assurance(self): + result = configure_spanning_tree_portfast_bridge_assurance(self.device, 'edge bpduguard') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance_on_interface/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance_on_interface/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance_on_interface/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance_on_interface/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..8207081e0 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance_on_interface/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface TwentyFiveGigE3/0/2: "interface TwentyFiveGigE3/0/2\r\n" + line console 0: + new_state: configure_line + no logging console: '' + spanning-tree portfast edge trunk: "spanning-tree portfast edge trunk\r\n" + prompt: mac-gen1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: mac-gen1(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: mac-gen1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance_on_interface/test_api_configure_spanning_tree_portfast_bridge_assurance_on_interface.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance_on_interface/test_api_configure_spanning_tree_portfast_bridge_assurance_on_interface.py new file mode 100644 index 000000000..6350bcbd9 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_portfast_bridge_assurance_on_interface/test_api_configure_spanning_tree_portfast_bridge_assurance_on_interface.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.spanning_tree.configure import configure_spanning_tree_portfast_bridge_assurance_on_interface + + +class TestConfigureSpanningTreePortfastBridgeAssuranceOnInterface(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + mac-gen1: + 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: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['mac-gen1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_spanning_tree_portfast_bridge_assurance_on_interface(self): + result = configure_spanning_tree_portfast_bridge_assurance_on_interface(self.device, 'TwentyFiveGigE3/0/2', 'edge trunk') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_bridge_assurance/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_bridge_assurance/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_bridge_assurance/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_bridge_assurance/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..40a15e4e7 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_bridge_assurance/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 spanning-tree bridge assurance: "no spanning-tree bridge assurance\r\n" + prompt: mac-gen1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: mac-gen1(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: mac-gen1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_bridge_assurance/test_api_unconfigure_spanning_tree_bridge_assurance.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_bridge_assurance/test_api_unconfigure_spanning_tree_bridge_assurance.py new file mode 100644 index 000000000..f4eb723d7 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_bridge_assurance/test_api_unconfigure_spanning_tree_bridge_assurance.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.spanning_tree.configure import unconfigure_spanning_tree_bridge_assurance + + +class TestUnconfigureSpanningTreeBridgeAssurance(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + mac-gen1: + 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: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['mac-gen1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_spanning_tree_bridge_assurance(self): + result = unconfigure_spanning_tree_bridge_assurance(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..63cb98ce5 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance/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 spanning-tree portfast edge bpduguard default: "no spanning-tree portfast\ + \ edge bpduguard default\r\n" + prompt: mac-gen1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: mac-gen1(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: mac-gen1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance/test_api_unconfigure_spanning_tree_portfast_bridge_assurance.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance/test_api_unconfigure_spanning_tree_portfast_bridge_assurance.py new file mode 100644 index 000000000..1369bddce --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance/test_api_unconfigure_spanning_tree_portfast_bridge_assurance.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.spanning_tree.configure import unconfigure_spanning_tree_portfast_bridge_assurance + + +class TestUnconfigureSpanningTreePortfastBridgeAssurance(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + mac-gen1: + 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: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['mac-gen1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_spanning_tree_portfast_bridge_assurance(self): + result = unconfigure_spanning_tree_portfast_bridge_assurance(self.device, 'edge bpduguard') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance_on_interface/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance_on_interface/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance_on_interface/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance_on_interface/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..b5a35b7cb --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance_on_interface/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface TwentyFiveGigE3/0/2: "interface TwentyFiveGigE3/0/2\r\n" + line console 0: + new_state: configure_line + no logging console: '' + no spanning-tree portfast edge trunk: "no spanning-tree portfast edge trunk\r\n" + prompt: mac-gen1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: mac-gen1(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: mac-gen1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance_on_interface/test_api_unconfigure_spanning_tree_portfast_bridge_assurance_on_interface.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance_on_interface/test_api_unconfigure_spanning_tree_portfast_bridge_assurance_on_interface.py new file mode 100644 index 000000000..e48279a06 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_portfast_bridge_assurance_on_interface/test_api_unconfigure_spanning_tree_portfast_bridge_assurance_on_interface.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.spanning_tree.configure import unconfigure_spanning_tree_portfast_bridge_assurance_on_interface + + +class TestUnconfigureSpanningTreePortfastBridgeAssuranceOnInterface(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + mac-gen1: + 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: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['mac-gen1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_spanning_tree_portfast_bridge_assurance_on_interface(self): + result = unconfigure_spanning_tree_portfast_bridge_assurance_on_interface(self.device, 'TwentyFiveGigE3/0/2', 'edge trunk') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/configure_auto_off_optics/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/configure_auto_off_optics/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/configure_auto_off_optics/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/configure_auto_off_optics/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..db02cd7b7 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/configure_auto_off_optics/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + hw-module switch 1 auto-off optics: "hw-module switch 1 auto-off optics\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: Peer1-topo1-ott(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Peer1-topo1-ott(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: Peer1-topo1-ott# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/configure_auto_off_optics/test_api_configure_auto_off_optics.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/configure_auto_off_optics/test_api_configure_auto_off_optics.py new file mode 100644 index 000000000..4c3f58423 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/configure_auto_off_optics/test_api_configure_auto_off_optics.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.sustainability.configure import configure_auto_off_optics + + +class TestConfigureAutoOffOptics(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Peer1-topo1-ott: + 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: c9300 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Peer1-topo1-ott'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_auto_off_optics(self): + result = configure_auto_off_optics(self.device, '1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/unconfigure_auto_off_optics/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/unconfigure_auto_off_optics/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/unconfigure_auto_off_optics/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/unconfigure_auto_off_optics/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..164336833 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/unconfigure_auto_off_optics/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no hw-module switch 1 auto-off optics: "no hw-module switch 1 auto-off optics\r\ + \n" + no logging console: '' + prompt: Peer1-topo1-ott(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Peer1-topo1-ott(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: Peer1-topo1-ott# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/unconfigure_auto_off_optics/test_api_unconfigure_auto_off_optics.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/unconfigure_auto_off_optics/test_api_unconfigure_auto_off_optics.py new file mode 100644 index 000000000..e63c01936 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/sustainability/configure/unconfigure_auto_off_optics/test_api_unconfigure_auto_off_optics.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.sustainability.configure import unconfigure_auto_off_optics + + +class TestUnconfigureAutoOffOptics(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Peer1-topo1-ott: + 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: c9300 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Peer1-topo1-ott'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_auto_off_optics(self): + result = unconfigure_auto_off_optics(self.device, '1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/system/configure/configure_boot_level_licence/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/system/configure/configure_boot_level_licence/mock_data/iosxe/mock_data.yaml index e8225cd76..e9c7cdcf5 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/system/configure/configure_boot_level_licence/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/system/configure/configure_boot_level_licence/mock_data/iosxe/mock_data.yaml @@ -2,28 +2,29 @@ configure: commands: end: new_state: execute - license boot level ipbase: | - license boot level ipbase - % use 'write' command to make license boot config take effect on next boot - + license boot level advantage: "license boot level advantage\r\n% use 'write' command\ + \ to make license boot config take effect on next boot\r\n\r\n" + license boot level essentials: "license boot level essentials\r\n% use 'write'\ + \ command to make license boot config take effect on next boot\r\n\r\n" line console 0: new_state: configure_line no logging console: '' - prompt: BB_ASR1006-X(config)# + prompt: 9350-stack-1(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: BB_ASR1006-X(config-line)# + prompt: 9350-stack-1(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 +33,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: BB_ASR1006-X# + prompt: 9350-stack-1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/system/configure/configure_boot_level_licence/test_api_configure_boot_level_licence.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/system/configure/configure_boot_level_licence/test_api_configure_boot_level_licence.py index e045d3e2c..80da81d5c 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/system/configure/configure_boot_level_licence/test_api_configure_boot_level_licence.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/system/configure/configure_boot_level_licence/test_api_configure_boot_level_licence.py @@ -10,7 +10,7 @@ class TestConfigureBootLevelLicence(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - BB_ASR1006-X: + 9350-stack-1: 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: iosxe - type: iosxe + platform: cat9k + type: c9350 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['BB_ASR1006-X'] + self.device = self.testbed.devices['9350-stack-1'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -30,6 +30,11 @@ def setUpClass(self): ) def test_configure_boot_level_licence(self): - result = configure_boot_level_licence(self.device, False, False, False, True, False, False, True) + result = configure_boot_level_licence(self.device, False, False, False, False, False, False, False, True, False) + expected_output = None + self.assertEqual(result, expected_output) + + def test_configure_boot_level_licence_1(self): + result = configure_boot_level_licence(self.device, False, False, False, False, False, False, False, False, True) expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/no_enroll.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/no_enroll.yaml new file mode 100644 index 000000000..ca3c7094e --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/no_enroll.yaml @@ -0,0 +1,7 @@ +default: + arguments: + device: "dut1" + +configure_no_pki_enroll: + arguments: + tp_name: "tp_wo_pass_enc" diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/management/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/management/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/management/test_verify.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/management/test_verify.py new file mode 100644 index 000000000..955db2dd7 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/management/test_verify.py @@ -0,0 +1,13 @@ + +import unittest +from genie.libs.sdk.apis.nxos.management.verify import is_management_interface +from unittest.mock import Mock + +class TestManagementVerify(unittest.TestCase): + + def test_is_managment_interface(self): + device = Mock() + output = is_management_interface(device, 'Mgmt0') + self.assertEqual(output, False) + output = is_management_interface(device, 'mgmt0') + self.assertEqual(output, True) \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/platform/configure/configure_hostname/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/platform/configure/configure_hostname/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/platform/configure/configure_hostname/mock_data/nxos/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/platform/configure/configure_hostname/mock_data/nxos/mock_data.yaml new file mode 100644 index 000000000..d7d8472df --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/platform/configure/configure_hostname/mock_data/nxos/mock_data.yaml @@ -0,0 +1,34 @@ +configure: + commands: + end: + new_state: execute + line console: + new_state: configure_line + switchname test-device: "switchname test-device\r\r\n\r" + prompt: test-device(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + line vty: '' + terminal width 511: '' + prompt: test-device(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 + term length 0: '' + term width 511: '' + terminal session-timeout 0: '' + prompt: test-device# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/platform/configure/configure_hostname/test_api_configure_hostname.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/platform/configure/configure_hostname/test_api_configure_hostname.py new file mode 100644 index 000000000..dd7510729 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/platform/configure/configure_hostname/test_api_configure_hostname.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.nxos.platform.configure import configure_hostname + + +class TestConfigureHostname(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + test-device: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os nxos --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: nxos + platform: None + type: None + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['test-device'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_hostname(self): + result = configure_hostname(self.device, 'test-device') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/test_config_enroll_prof.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/test_config_enroll_prof.yaml new file mode 100644 index 000000000..4025f6d39 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/test_config_enroll_prof.yaml @@ -0,0 +1,12 @@ +default: + arguments: + device : 'host_router2' +configure_crypto_pki_profile: + arguments: + prof_name : 'API_PROF' + method_est : True + enrollment_http_username : 'ashrishe' + enrollment_http_password_type : "0" + enrollment_http_password : 'nopassword' + enrollment_url : 'https://10.106.29.252:443' + exit_flag : True 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 b6d1770dd..df2295f9c 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 @@ -128,13 +128,13 @@ def test_device_recovery_boot(self): with patch("genie.libs.sdk.apis.utils.pcall") as pcall_mock: device_recovery_boot(device) pcall_mock.assert_called_once() - + def test_configure_management_console(self): dev1 = MagicMock() terminal_device_1 = MagicMock() terminal_device_1.is_connected.side_effect =[False, True, True, True] dev1.api.configure_terminal_line_speed = MagicMock() - dev1.parse.return_value = {'baud_rate':{'tx':115200}} + dev1.parse.return_value = {'baud_rate':{'tx':115200}} dev1.connect = MagicMock() dev1.connect.side_effect = [Exception, Exception, True] dev1.peripherals = {'terminal_server': {'terminal_1': [{'line': 14}]}} @@ -152,7 +152,7 @@ def test_configure_management_console(self): dev2.api.configure_terminal_line_speed = MagicMock() dev2.connect.side_effect = [Exception, Exception, True] dev2.peripherals = {'terminal_server': {'terminal_2': [{'line': 14, 'speed': 9600}, {'line': 15, 'speed': 9600}]}} - dev1.parse.return_value = {'baud_rate':{'tx':115200}} + dev1.parse.return_value = {'baud_rate':{'tx':115200}} dev2.testbed.devices = {'terminal_2':terminal_device_2} dev2.state_machine.current_state = 'enable' configure_management_console(dev2) @@ -164,7 +164,7 @@ def test_configure_management_console(self): call(terminal_device_2, 14, 9600), call(terminal_device_2, 15, 9600),] self.assertEqual(dev2.api.configure_terminal_line_speed.mock_calls, expected_calls) - + dev3 = MagicMock() terminal_device_3 = MagicMock() terminal_device_3.is_connected.side_effect =[False, True] @@ -179,7 +179,7 @@ def test_configure_management_console(self): expected_calls = [ call(terminal_device_3,14, 9600)] self.assertEqual(dev3.api.configure_terminal_line_speed.mock_calls, expected_calls) - + dev4 = MagicMock() terminal_device_4 = MagicMock() terminal_device_4.is_connected.side_effect =[False, True, True, True] @@ -212,13 +212,13 @@ def test_configure_peripheral_terminal_server(self): dev1.peripherals = {'terminal_server': {'terminal_1': [{'line': 14, 'speed': 9600}, {'line': 15, 'speed': 9600}]}} dev1.testbed.devices = {'terminal_1':terminal_device} configure_peripheral_terminal_server(dev1) - + expected_calls = [ call(['line 14', 'speed 9600']), call(['line 15', 'speed 9600'])] - + self.assertEqual(terminal_device.configure.mock_calls, expected_calls) - + dev2 = MagicMock() dev2.os = 'iosxe' terminal_device = MagicMock() diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/unconfigtest_arguments.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/unconfigtest_arguments.yaml new file mode 100644 index 000000000..c57bcd5d6 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/unconfigtest_arguments.yaml @@ -0,0 +1,9 @@ +default: + arguments: + device : 'host_router2' + +unconfigure_crypto_pki_profile: + arguments: + prof_name : 'API_PROF' + + 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 25faf3eb3..f7a22eede 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py @@ -4384,7 +4384,7 @@ def device_recovery_boot(device, console_activity_pattern=None, console_breakboo log.info(f'There is no recovery info for device {device.name}') recovery_info = {} - console_activity_pattern = console_activity_pattern or recovery_info.get('console_activity_pattern') + console_activity_pattern = console_activity_pattern or recovery_info.get('console_activity_pattern') console_breakboot_char = console_breakboot_char or recovery_info.get('console_breakboot_char') or '\x03' console_breakboot_telnet_break = console_breakboot_telnet_break or recovery_info.get('console_breakboot_telnet_break') or False grub_breakboot_char = grub_breakboot_char or recovery_info.get('grub_breakboot_char') or 'c' @@ -4394,14 +4394,14 @@ def device_recovery_boot(device, console_activity_pattern=None, console_breakboo golden_image = golden_image or recovery_info.get('golden_image', []) tftp_boot = tftp_boot or recovery_info.get('tftp_boot', {}) - + log.info('Destroy device connection.') try: device.destroy() except Exception: log.warning("Failed to destroy the device connection but " "attempting to continue", exc_info=True) - + if golden_image: log.info(banner("Booting device '{}' with the Golden images".\ format(device.name))) @@ -4555,10 +4555,11 @@ def configure_management_console(device): device.testbed.devices[terminal_server].disconnect() -def configure_terminal_line_speed(device, terminal_line, speed): +def configure_terminal_line_speed(device, terminal_device, terminal_line, speed): ''' Configure terminal line speed Args: device: device object + terminal_device: terminal device object terminal_line(int): line number speed(int): speed to configure ''' @@ -4567,12 +4568,12 @@ def configure_terminal_line_speed(device, terminal_line, speed): cmd.append(f'speed {speed}') log.info(f'Configuring speed {speed} on line {terminal_line}') try: - device.configure(cmd) + terminal_device.configure(cmd) except SubCommandFailure as e: - log.exception(f"Failed to configure speed {speed} for line {terminal_line} for device {device}") - + log.exception(f"Failed to configure speed {speed} for line {terminal_line} for device {terminal_device}") + def configure_peripheral_terminal_server(device): - ''' configure terminal server lines for peripherals + ''' configure terminal server lines for peripherals Args: device: device object ''' @@ -4582,12 +4583,12 @@ def configure_peripheral_terminal_server(device): with ensure_connection(device.testbed.devices[terminal_server]): for line in terminal_server_lines: if isinstance(line, dict) and line.get('speed') and line.get('line'): - configure_terminal_line_speed(device.testbed.devices[terminal_server], line['line'], line['speed']) + configure_terminal_line_speed(device, device.testbed.devices[terminal_server], line['line'], line['speed']) else: log.error('the value for line or speed is not provided!') else: log.error(f'Terminal server {terminal_server} is not in the testbed or the line is not a list') else: log.error(f'Device {device} has no peripherals or terminal_server!') - + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/genie_yamls/nxos/trigger_datafile_nxos.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/genie_yamls/nxos/trigger_datafile_nxos.yaml index fc4d6540e..e4e5900c4 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/genie_yamls/nxos/trigger_datafile_nxos.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/genie_yamls/nxos/trigger_datafile_nxos.yaml @@ -1850,14 +1850,6 @@ TriggerAddRemoveBgpAggregateAddressIpv6: interval: 10 devices: ['uut'] -TriggerAddRemoveBgpNetworkIPv4: - groups: ['add-remove', 'bgp', 'L3'] - method: 'checkpoint' - timeout: - max_time: 180 - interval: 10 - devices: ['uut'] - TriggerAddRemoveBgpKeepaliveHoldtime: groups: ['add-remove', 'bgp', 'L3'] method: 'checkpoint' diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/genie_yamls/nxos/verification_datafile_nxos.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/genie_yamls/nxos/verification_datafile_nxos.yaml index b009ee8b5..add9cd9d3 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/genie_yamls/nxos/verification_datafile_nxos.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/genie_yamls/nxos/verification_datafile_nxos.yaml @@ -59,9 +59,6 @@ Verify_BgpIpMvpnRouteType_vrf_all_route_type_3: vrf: all Verify_BgpIpMvpnRouteType_vrf_all_route_type_4: devices: ['uut'] - iteration: - attempt: 15 - interval: 10 iteration: attempt: 15 interval: 10