diff --git a/Makefile b/Makefile index 6611338b2..fd7564784 100644 --- a/Makefile +++ b/Makefile @@ -46,12 +46,10 @@ CYTHON_CMD = compileAll RELATED_PKGS = genie.libs.health genie.libs.clean genie.libs.conf genie.libs.ops genie.libs.robot genie.libs.sdk RELATED_PKGS += genie.libs.filetransferutils # pinning the version of pysnmp and pyasn1 to fix the type error when using execute_power_cycle_device api -DEPENDENCIES = restview psutil==5.9.2 Sphinx wheel asynctest pysnmp-lextudio==5.0.29 pyasn1==0.4.8 +DEPENDENCIES = restview psutil Sphinx wheel asynctest pysnmp-lextudio==5.0.29 pyasn1==0.4.8 DEPENDENCIES += sphinx-rtd-theme==1.1.0 pyftpdlib tftpy\<0.8.1 robotframework # aiohttp-swagger 1.0.15 requires jinja2==2.11.2 and markupsafe==1.1.1 -DEPENDENCIES += Cython==3.0.0 requests ruamel.yaml grpcio protobuf jinja2==2.11.2 markupsafe==1.1.1 -# aiohttp requires charset-normalizer<3.0.0 -DEPENDENCIES += charset-normalizer==2.1.1 +DEPENDENCIES += Cython==3.0.0 requests ruamel.yaml grpcio protobuf jinja2==2.11.2 markupsafe==2.0.1 # Internal variables. # (note - build examples & templates last because it will fail uploading to pypi # due to duplicates, and we'll for now accept that error) diff --git a/pkgs/clean-pkg/changelog/2023/october.rst b/pkgs/clean-pkg/changelog/2023/october.rst new file mode 100644 index 000000000..5f5ac250f --- /dev/null +++ b/pkgs/clean-pkg/changelog/2023/october.rst @@ -0,0 +1,11 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- + +* recovery + * Update device recovery logic for checking the state machine. Instead of clearing the line + +* generic + * Update defaults for clean stages + + diff --git a/pkgs/clean-pkg/sdk_generator/output/github_clean.json b/pkgs/clean-pkg/sdk_generator/output/github_clean.json index 05a08e8d5..c5c12b959 100644 --- a/pkgs/clean-pkg/sdk_generator/output/github_clean.json +++ b/pkgs/clean-pkg/sdk_generator/output/github_clean.json @@ -12,7 +12,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "ApplyConfiguration", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L1607" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L1612" }, "iosxe": { "sdwan": { @@ -61,7 +61,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "BackupFileOnDevice", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L1932" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L1937" } }, "ChangeBootVariable": { @@ -130,11 +130,11 @@ }, "ConfigureManagement": { "com": { - "doc": "This stage configures the management IP settings on the device.\n\nStage Schema\n------------\nconfigure_management:\n\n address ('dict', optional): Address(es) to configure on the device (syntax: address/mask) (optional)\n ipv4 ('str') or ('list'): ipv4 address\n ipv6 ('str') or ('list'): ipv6 address\n\n gateway: (dict, optional) Gateway address(es) for default route\n ipv4 ('str') or ('list'): ipv4 gateway address\n ipv6 ('str') or ('list'): ipv6 gateway address\n\n vrf (str, optional): VRF to use for management interface\n\n interface (str, optional): Management interface to use\n\n routes ('dict', optional):\n ipv4 (list of 'dict'): ipv4 routes\n - subnet: (str) subnet including mask\n next_hop: (str) next_hop for this subnet\n ipv6 (list of 'dict'): ipv6 routes\n - subnet: (str) subnet including mask\n next_hop: (str) next_hop for this subnet\n\n dhcp_timeout ('int', optional): DHCP timeout in seconds (default: 30)\n\n protocols ('list', optional): [list of protocols]\n\n set_hostname (bool): Configure device hostname (default: False)\n\n\nExample\n-------\nconfigure_management:\n vrf: Mgmt-vrf\n\n", + "doc": "This stage configures the management IP settings on the device.\n\nStage Schema\n------------\nconfigure_management:\n\n address ('dict', optional): Address(es) to configure on the device (syntax: address/mask) (optional)\n ipv4 ('str') or ('list'): ipv4 address\n ipv6 ('str') or ('list'): ipv6 address\n\n gateway: (dict, optional) Gateway address(es) for default route\n ipv4 ('str') or ('list'): ipv4 gateway address\n ipv6 ('str') or ('list'): ipv6 gateway address\n\n vrf (str, optional): VRF to use for management interface\n\n interface (str, optional): Management interface to use\n\n routes ('dict', optional):\n ipv4 (list of 'dict'): ipv4 routes\n - subnet: (str) subnet including mask\n next_hop: (str) next_hop for this subnet\n ipv6 (list of 'dict'): ipv6 routes\n - subnet: (str) subnet including mask\n next_hop: (str) next_hop for this subnet\n\n dhcp_timeout ('int', optional): DHCP timeout in seconds (default: 30)\n\n protocols ('list', optional): [list of protocols]\n\n set_hostname (bool): Configure device hostname (default: True)\n\n\nExample\n-------\nconfigure_management:\n vrf: Mgmt-vrf\n\n", "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "ConfigureManagement", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L2841" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L2846" } }, "ConfigureReplace": { @@ -143,7 +143,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "ConfigureReplace", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1983" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1986" } }, "ConfigureRrmDcaChannel": { @@ -190,7 +190,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "CopyRunToFlash", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L2791" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L2796" } }, "CopyToDevice": { @@ -213,7 +213,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "CopyToDevice", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1356" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1359" } }, "CopyToLinux": { @@ -231,7 +231,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "DeleteBackupFromDevice", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L2027" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L2032" } }, "DeleteFiles": { @@ -240,7 +240,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "DeleteFiles", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L2250" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L2255" } }, "DeleteFilesFromServer": { @@ -249,7 +249,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "DeleteFilesFromServer", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L2151" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L2156" } }, "EraseApConfiguration": { @@ -269,7 +269,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "ExecuteCommand", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L1541" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L1546" } }, "ExpandImage": { @@ -319,7 +319,7 @@ "uid": "InstallImage", "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat3k/stages.py#L12" }, - "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 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 append_error_pattern (list, optional): List of regex strings to check for,\n to be appended to the default error pattern list. 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 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", "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "InstallImage", @@ -359,7 +359,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "InstallPackages", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L764" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L766" } }, "InstallRemoveInactive": { @@ -404,7 +404,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "PowerCycle", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L2687" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L2692" } }, "PrimeAp": { @@ -420,18 +420,18 @@ }, "Reload": { "com": { - "doc": " This stage reloads the device.\n\nStage Schema\n------------\nreload:\n\n reload_service_args (optional):\n\n timeout (int, optional): Maximum time in seconds allowed for the reload.\n Defaults to 800.\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n : \n Any other arguments that the Unicon reload service supports\n\n check_modules:\n\n check (bool, optional): Enable the checking of modules after reload.\n Defaults to True.\n\n timeout (int, optional): Maximum time in seconds allowed for verifying\n the modules are in a stable state. Defaults to 180.\n\n interval (int, optional): How often to check the module states in\n seconds. Defaults to 30.\n\n reconnect_via (str, optional): Specify which connection to use after reloading.\n Defaults to the 'default' connection in the testbed yaml file.\n\n\nExample\n-------\nreload:\n reload_service_args:\n timeout: 600\n reload_creds: clean_reload_creds\n prompt_recovery: True\n reconnect_sleep: 200 (Unicon NXOS reload service argument)\n check_modules:\n check: False\n", + "doc": " This stage reloads the device.\n\nStage Schema\n------------\nreload:\n\n reload_service_args (optional):\n\n timeout (int, optional): Maximum time in seconds allowed for the reload.\n Defaults to 800.\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n error_pattern (list, optional): List of regex patterns to check for errors.\n Defaults to an empty list (no error checking).\n\n : \n Any other arguments that the Unicon reload service supports\n\n check_modules:\n\n check (bool, optional): Enable the checking of modules after reload.\n Defaults to True.\n\n timeout (int, optional): Maximum time in seconds allowed for verifying\n the modules are in a stable state. Defaults to 180.\n\n interval (int, optional): How often to check the module states in\n seconds. Defaults to 30.\n\n reconnect_via (str, optional): Specify which connection to use after reloading.\n Defaults to the 'default' connection in the testbed yaml file.\n\n\nExample\n-------\nreload:\n reload_service_args:\n timeout: 600\n reload_creds: clean_reload_creds\n prompt_recovery: True\n check_modules:\n check: False\n", "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "Reload", "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L1369" }, "iosxe": { - "doc": " This stage reloads the device.\n\nStage Schema\n------------\nreload:\n license: (optional)\n check: (bool, optional): Enable the checking license inconsistency and fix\n\n reload_service_args (optional):\n\n timeout (int, optional): Maximum time in seconds allowed for the reload.\n Defaults to 800.\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n : \n Any other arguments that the Unicon reload service supports\n\n check_modules:\n\n check (bool, optional): Enable the checking of modules after reload.\n Defaults to True.\n\n timeout (int, optional): Maximum time in seconds allowed for verifying\n the modules are in a stable state. Defaults to 180.\n\n interval (int, optional): How often to check the module states in\n seconds. Defaults to 30.\n\n reconnect_via (str, optional): Specify which connection to use after reloading.\n Defaults to the 'default' connection in the testbed yaml file.\n\n\nExample\n-------\nreload:\n reload_service_args:\n timeout: 600\n reload_creds: clean_reload_creds\n prompt_recovery: True\n reconnect_sleep: 200 (Unicon NXOS reload service argument)\n check_modules:\n check: False\n", + "doc": " This stage reloads the device.\n\nStage Schema\n------------\nreload:\n license: (optional)\n check: (bool, optional): Enable the checking license inconsistency and fix\n\n reload_service_args (optional):\n\n timeout (int, optional): Maximum time in seconds allowed for the reload.\n Defaults to 800.\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n\n : \n Any other arguments that the Unicon reload service supports\n\n check_modules:\n\n check (bool, optional): Enable the checking of modules after reload.\n Defaults to True.\n\n timeout (int, optional): Maximum time in seconds allowed for verifying\n the modules are in a stable state. Defaults to 180.\n\n interval (int, optional): How often to check the module states in\n seconds. Defaults to 30.\n\n reconnect_via (str, optional): Specify which connection to use after reloading.\n Defaults to the 'default' connection in the testbed yaml file.\n\n\nExample\n-------\nreload:\n reload_service_args:\n timeout: 600\n reload_creds: clean_reload_creds\n prompt_recovery: True\n check_modules:\n check: False\n", "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "Reload", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L848" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L850" } }, "RevertVmSnapshot": { @@ -440,7 +440,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "RevertVmSnapshot", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L2320" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L2325" } }, "RommonBoot": { @@ -456,7 +456,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "RommonBoot", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1094" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1097" } }, "RunConfigure": { @@ -632,7 +632,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "VerifyRunningImage", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L1770" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py#L1775" }, "iosxe": { "cat9k": { diff --git a/pkgs/clean-pkg/src/genie/libs/clean/__init__.py b/pkgs/clean-pkg/src/genie/libs/clean/__init__.py index e12476002..ec6a5fdad 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__ = '23.9' +__version__ = '23.10' __author__ = 'Cisco Systems Inc.' __contact__ = ['asg-genie-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2019, Cisco Systems Inc.' diff --git a/pkgs/clean-pkg/src/genie/libs/clean/recovery/iosxe/dialogs.py b/pkgs/clean-pkg/src/genie/libs/clean/recovery/iosxe/dialogs.py index c5b1a2b93..2439e15aa 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/recovery/iosxe/dialogs.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/recovery/iosxe/dialogs.py @@ -54,11 +54,6 @@ class RommonDialog(TelnetDialog): def __init__(self): - # Login prompt - self.add_statement(Statement(pattern=r'^.*(Username|login): ?$', - action=print_message, - args={'message': 'Device reached login prompt before rommon prompt', - 'raise_exception': False})) # Would you like to enter the initial configuration dialog? [yes/no]: self.add_statement(Statement(pattern=r'^.*(initial|basic) configuration dialog *\?.*', @@ -112,7 +107,17 @@ def boot_device(spawn, session, context): @statement_decorator(r'^.*[Pp]assword( for )?(\\S+)?: ?$', loop_continue=True) def send_password(spawn, session, context): # Send password to teh device when prompted - spawn.sendline('{}'.format(context['password'])) + if context['pass_login']: + spawn.sendline('{}'.format(context['password'])) + time.sleep(0.5) + context['pass_login'] = 0 + else: + spawn.sendline('{}'.format(context['en_password'])) + + @statement_decorator(r'^.*([Uu]sername|[Ll]ogin): ?$', loop_continue=True) + def send_username(spawn, session, context): + # Send password to teh device when prompted + spawn.sendline('{}'.format(context['username'])) time.sleep(0.5) # grub> 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 f8ee92fdf..d93891682 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 @@ -16,6 +16,9 @@ RommonDialog, TftpRommonDialog) +#pyats +from pyats.utils.secret_strings import to_plaintext + # Logger log = logging.getLogger(__name__) @@ -113,7 +116,8 @@ def grub_breakboot(spawn, break_char): spawn = Spawn(spawn_command=start, settings=device.cli.settings, target=target, - logger=device.log) + logger=device.log, + device=device) # Stop the device from booting break_dialog = BreakBootDialog() @@ -168,13 +172,17 @@ def device_recovery(spawn, timeout, golden_image, recovery_password=None, **kwar Returns: None """ - + device = spawn.device + credentials = device.credentials dialog = RommonDialog() dialog.dialog.process( spawn, timeout=timeout, context={'boot_image': golden_image[0], - 'password': recovery_password}) + 'password': to_plaintext(credentials.get('default',{}).get('password')), + 'username': to_plaintext(credentials.get('default',{}).get('username')), + 'en_password': to_plaintext(credentials.get('enable',{}).get('password')), + 'pass_login':1}) def tftp_device_recovery(spawn, timeout, device, tftp_boot, item, recovery_password=None 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 396e7caac..6806ed408 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/recovery/recovery.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/recovery/recovery.py @@ -25,7 +25,6 @@ CONTINUE_RECOVERY = ['Connect'] - def _disconnect_reconnect(device): ''' Disconnect and reconnect the device @@ -34,12 +33,6 @@ def _disconnect_reconnect(device): Returns: None ''' - try: - if device.state_machine.current_state == 'rommon': - log.warning("Device is in rommon") - return False - except AttributeError: - pass # Disconnect from the device log.info("Disconnecting from device '{}'".format(device.name)) @@ -65,38 +58,27 @@ def _disconnect_reconnect(device): return True -def _connectivity(device, console_activity_pattern=None, console_breakboot_char=None, - console_breakboot_telnet_break=None, grub_activity_pattern=None, - grub_breakboot_char=None, break_count=10, - timeout=None, golden_image=None, tftp_boot=None, - recovery_password=None, clear_line=True, powercycler=True, - powercycler_delay=30, section=None, reconnect_delay=60, **kwargs): - - '''Powercycle the device and start the recovery process - Args: - device ('obj'): Device object - console_activity_pattern: - console_breakboot_char: - console_breakboot_telnet_break: Use telnet `send break` to interrupt boot - grub_activity_pattern: - grub_breakboot_char: - break_count ('int'): Number of sending break times - timeout ('int'): Recovery process timeout - golden_image ('dict'): information to load golden image on the device - tftp_boot ('dict'): Tftp boot information - recovery_password ('str'): Device password after recovery - powercycler: (Default: True) - clear_line: (Default: True) - powercycler_delay: , 'int'> (Default: 30) - reconnect_delay: , 'int'> (Default: 60) - Returns: - None +def _recovery_steps(device, clear_line=True, powercycler=True, + powercycler_delay=30, reconnect_delay=60, **kwargs): + + '''Steps to recover device + 1. First step clear line + 2. Second step power cycle the device + 3. Third step boot the device using golden image or tftp + + Args: + device ('obj'): Device object + powercycler: (Default: True) + clear_line: (Default: True) + powercycler_delay: , 'int'> (Default: 30) + reconnect_delay: , 'int'> (Default: 60) + Returns: + None ''' # Step-2: Clear console port line if clear_line: log.info(banner("Clearing the console port line")) - try: device.api.execute_clear_line() except Exception as e: @@ -114,6 +96,8 @@ def _connectivity(device, console_activity_pattern=None, console_breakboot_char= else: log.warning("Cannot re-connect to device '{}' after clearing " "console port line".format(device.name)) + else: + log.info('Clear line is not provided!') # Step-3: Powercycle device if powercycler: @@ -127,61 +111,17 @@ def _connectivity(device, console_activity_pattern=None, console_breakboot_char= else: log.info("Successfully powercycled device '{}' during recovery".\ format(device.name)) - - # Step-4: Boot device with given golden image - if golden_image: - log.info(banner("Booting device '{}' with the Golden images".\ - format(device.name))) - log.info("Golden image information found:\n{}".format(golden_image)) - elif tftp_boot: - log.info(banner("Booting device '{}' with the Tftp images".\ - format(device.name))) - log.info("Tftp boot information found:\n{}".format(tftp_boot)) else: - # This case is for the simple boot - # Not yet supported - raise Exception('Global recovery only support golden image and tftp ' - 'boot recovery and neither was provided') - - # Need to instantiate to get the device.start - # The device.start only works because of a|b - device.instantiate(connection_timeout=timeout) + log.info("powercycle is not provided!") - # For each default connection, start a fork to try to recover the device + # Step-4: Boot device with given golden image or by tftp boot try: - abstract = Lookup.from_device(device, packages={'clean': clean}) - # Item is needed to be able to know in which parallel child - # we are - - if device.is_ha and hasattr(device, 'subconnections'): - start = [i.start[0] for i in device.subconnections] - else: - start = device.start - - pcall( - abstract.clean.recovery.recovery.recovery_worker, - start=start, - ikwargs = [{'item': i} for i, _ in enumerate(start)], - ckwargs = { - 'device': device, - 'console_activity_pattern': console_activity_pattern, - 'console_breakboot_char': console_breakboot_char, - 'console_breakboot_telnet_break': console_breakboot_telnet_break, - 'grub_activity_pattern': grub_activity_pattern, - 'grub_breakboot_char': grub_breakboot_char, - 'break_count': break_count, - 'timeout': timeout, - 'golden_image': golden_image, - 'tftp_boot': tftp_boot, - 'recovery_password': recovery_password} - ) + device.api.device_recovery_boot() except Exception as e: - log.error(str(e)) - raise Exception("Failed to recover the device '{}'".\ - format(device.name)) + log.error(e) + raise Exception(f"Failed to boot the device {device.name}") else: - log.info("Successfully recovered the device '{}'".\ - format(device.name)) + log.info(f"successfully booted the device {device.name}") log.info('Sleeping for {r} before reconnection'.format(r=reconnect_delay)) time.sleep(reconnect_delay) @@ -220,6 +160,7 @@ def _connectivity(device, console_activity_pattern=None, console_breakboot_char= Optional('powercycler'): bool, Optional('powercycler_delay'): int, Optional('reconnect_delay'): int, + Optional('connection_timeout'):int, Optional('post_recovery_configuration'): str, }) def recovery_processor( @@ -239,6 +180,7 @@ def recovery_processor( powercycler_delay=30, reconnect_delay=60, post_recovery_configuration=None, + connection_timeout=45 ): ''' @@ -255,11 +197,14 @@ def recovery_processor( grub_breakboot_char: timeout: recovery_password: + recovery_username: + recovery_en_password: powercycler: (Default: True) powercycler_delay: , 'int'> (Default: 30) reconnect_delay: , 'int'> (Default: 60) clear_line: (Default: True) post_recovery_configuration: + connection_timeout: golden_image: kickstart: system: @@ -331,15 +276,73 @@ def recovery_processor( return log.info('Starting Device Recovery checks!') - # Get device device = section.parameters['device'] + recovery_is_required = False + # check if device is in any known state + log.info(f'Check device {device.name} has valid unicon state.') + try: + if device.is_ha: + log.info('Device is HA! checking all the subconnetions.') + 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}') + else: + bring_to_any_state(device, connection_timeout) + log.info(f'Device is in {device.state_machine.current_state}') - recovery_is_required = True + except Exception as e: + log.exception(f'Could not bring device to any valid state! Continue with recovery because of {e}.') + recovery_is_required = True + # Device is in rommon. try to boot the device before continuing with other recovery steps + if device.is_ha: + if not recovery_is_required and check_all_in_same_state(device, 'enable'): + log.info('Device is already connected. No need for device recovery.') + return + elif not recovery_is_required and check_all_in_same_state(device, 'rommon'): + log.info(f'device {device.name} is in rommon, booting the device!') + try: + device.api.device_recovery_boot() + except Exception as e: + log.exception('Could not boot device from rommon. Power cycling the device') + recovery_is_required = True + else: + log.info('Successfully booted the device. No need for device recovery.') + return - # Step 1 - Do we have connectivity to the device - Try to reconnect - if device.api.verify_connectivity() or _disconnect_reconnect(device): - recovery_is_required = False + # Device is in valid unicon state but its not rommon or enable will try to disconnect and connect. + elif not recovery_is_required and check_any_connection_in_rommon(device): + log.info("One of the subconnection's is in rommon.\n" + "device should be recovered.") + recovery_is_required = True + elif not recovery_is_required: + if not _disconnect_reconnect(device): + recovery_is_required =True + else: + log.info('Successfully disconnect and connect to device.\n' + 'No Need to recover the device.') + return + # Single RP devices + else: + if not recovery_is_required and device.state_machine.current_state == 'rommon': + log.info(f'device {device.name} is in rommon booting the device!') + try: + device.api.device_recovery_boot() + except Exception as e: + log.info('Could not boot device from rommon. Power cycling the device') + recovery_is_required = True + else: + log.info('Successfully booted the device. No need for device recovery.') + return + + # Device is in valid unicon state but its not rommon or enable will try to disconnect and connect. + elif not recovery_is_required and device.state_machine.current_state != 'enable': + if not _disconnect_reconnect(device): + recovery_is_required =True + else: + log.info('Successfully disconnect and connect to device.\n' + 'No Need to recover the device.') + return if recovery_is_required: # Not good! Lets attempt recovery @@ -350,18 +353,14 @@ def recovery_processor( log.info(banner('Recovery Processor')) log.info('''\ Recovery Steps: -1. Attempt to connect to the device - Failed -2. Disconnect and reconnect from the device - Failed -3. Clear line if provided -4. Powercycler the device if provided -5. From rommon, boot the device with golden image TFTP boot or type boot''') +1. Attempt to bring device to a valid state - Failed +2. Clear line if provided +3. Powercycler the device if provided +4. From rommon, boot the device with golden image or TFTP boot ''') try: - _connectivity(device, console_activity_pattern, console_breakboot_char, - console_breakboot_telnet_break, grub_activity_pattern, - grub_breakboot_char, break_count, timeout, - golden_image, tftp_boot, recovery_password, clear_line, powercycler, - powercycler_delay, section, reconnect_delay) + _recovery_steps(device, clear_line, powercycler, + powercycler_delay, reconnect_delay) except Exception as e: # Could not recover the device! log.error(banner("*** Terminating Genie Clean ***")) @@ -392,11 +391,33 @@ def recovery_processor( if recovery_is_required: section.passed("Device has been recovered. Continuing with pyATS Clean.") else: - log.info( - "Device '{}' is still connected. No need to recover the device.". - format(device.name)) - + log.info(f'Device {device.name} is still connected. No need to recover the device.') def block_section(section): if section.parent.parameters.get('block_section'): section.blocked('Recovery has failed to restore the device - Blocking clean') + +def bring_to_any_state(connection, connection_timeout): + '''Bring connection to any state + ''' + connection.spawn.sendline() + connection.state_machine.go_to('any', + connection.spawn, + timeout=connection_timeout, + context=connection.context) + +def check_all_in_same_state(device, state): + '''Check if all the subconnections are in same state + ''' + for connection in device.subconnections: + if connection.state_machine.current_state != state: + return False + return True + +def check_any_connection_in_rommon(device): + '''Check if all the subconnections are in same state + ''' + for connection in device.subconnections: + if connection.state_machine.current_state == 'rommon': + return True + return False diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat3k/stages.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat3k/stages.py index 9e2f0e5c6..de651d0db 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat3k/stages.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat3k/stages.py @@ -44,7 +44,6 @@ class InstallImage(IOSXEInstallImage): SAVE_SYSTEM_CONFIG = False INSTALL_TIMEOUT = 500 RELOAD_TIMEOUT = 800 - # ============ # Stage Schema # ============ @@ -102,7 +101,7 @@ def install_image(self, steps, device, images, save_system_config=SAVE_SYSTEM_CO action='sendline()', args=None, loop_continue=False, - continue_timer=False), + continue_timer=False), Statement(pattern=r"FAILED:.* ", action=None, loop_continue=False, @@ -113,7 +112,8 @@ def install_image(self, steps, device, images, save_system_config=SAVE_SYSTEM_CO device.reload('install add file {} activate commit'.format(images[0]), reply=install_add_one_shot_dialog, append_error_pattern=['FAILED:.* '], - timeout=install_timeout) + timeout=install_timeout, + device_recovery=False) except Exception as e: step.failed("Failed to install the image", from_exception=e) diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat3k/tests/test_install_image.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat3k/tests/test_install_image.py index d872c9874..6d4b9fd5b 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat3k/tests/test_install_image.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat3k/tests/test_install_image.py @@ -112,6 +112,6 @@ def test_iosxe_install_image(self): cls.install_image(steps=steps, device=device, images=['sftp://server/image.bin']) device.reload.assert_has_calls([ - call('install add file sftp://server/image.bin activate commit', reply=ANY, timeout=500, append_error_pattern=['FAILED:.* '])]) + call('install add file sftp://server/image.bin activate commit', reply=ANY, timeout=500, append_error_pattern=['FAILED:.* '], device_recovery=False)]) self.assertEqual(Passed, steps.details[0].result) \ No newline at end of file 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 5bb34d3ac..91e4ff21c 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 @@ -548,8 +548,8 @@ class InstallImage(BaseStage): prompt_recovery (bool, optional): Enable or disable the prompt recovery feature of unicon. Defaults to True. - append_error_pattern (list, optional): List of regex strings to check for, - to be appended to the default error pattern list. Default: [r"FAILED:.* ",] + error_pattern (list, optional): List of regex strings to check for errors. + Default: [r"FAILED:.* ",] : Any other arguments that the Unicon reload service supports @@ -573,7 +573,7 @@ class InstallImage(BaseStage): RELOAD_SERVICE_ARGS = { 'reload_creds': 'default', 'prompt_recovery': True, - 'append_error_pattern': [r"FAILED:.* ",], + 'error_pattern': [r"FAILED:.* ",], } ISSU = False SKIP_BOOT_VARIABLE = False @@ -594,7 +594,7 @@ class InstallImage(BaseStage): Optional('reload_service_args'): { Optional('reload_creds'): str, Optional('prompt_recovery'): bool, - Optional('append_error_pattern'): list, + Optional('error_pattern'): list, Any(): Any() } } @@ -702,6 +702,8 @@ def install_image(self, steps, device, images, # Set default reload args reload_args = self.RELOAD_SERVICE_ARGS.copy() + # Disable device recovery for reload + reload_args.update({'device_recovery': False}) # If user provides custom values, update the default with the user # provided. if reload_service_args: @@ -866,6 +868,7 @@ class Reload(BaseStage): prompt_recovery (bool, optional): Enable or disable the prompt recovery feature of unicon. Defaults to True. + : Any other arguments that the Unicon reload service supports @@ -891,7 +894,6 @@ class Reload(BaseStage): timeout: 600 reload_creds: clean_reload_creds prompt_recovery: True - reconnect_sleep: 200 (Unicon NXOS reload service argument) check_modules: check: False """ @@ -904,13 +906,13 @@ class Reload(BaseStage): RELOAD_SERVICE_ARGS = { 'timeout': 800, 'reload_creds': 'default', - 'prompt_recovery': True + 'prompt_recovery': True, } CHECK_MODULES = { 'check': True, 'timeout': 180, 'interval': 30, - 'ignore_modules': None + 'ignore_modules': None, } RECONNECT_VIA = None @@ -957,7 +959,8 @@ def reload(self, steps, device, reload_service_args=None): # the many optional arguments, we still need to default the others. self.RELOAD_SERVICE_ARGS.update(reload_service_args) self.reload_service_args = self.RELOAD_SERVICE_ARGS - + # Disable device_recovey for reload in unicon + self.reload_service_args.update({'device_recovery':False}) reload_dialog = Dialog([ Statement(pattern=r".*Do you wish to proceed with reload anyway\[confirm\].*", action='sendline(y)', @@ -2007,7 +2010,7 @@ class ConfigureReplace(BaseStage): exec_order = [ 'configure_replace', ] - + def configure_replace(self, steps, device, path, file, config_replace_options=CONFIG_REPLACE_OPTIONS, known_warnings=KNOWN_WARNINGS, timeout=TIMEOUT): """This step does a configure replace on the device.""" diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_image.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_image.py index 1724b2a8c..dacc41df8 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_image.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_image.py @@ -331,8 +331,8 @@ def test_iosxe_install_image_pass(self): device.reload.assert_has_calls([ call('install add file sftp://server/image.bin activate commit', reply=ANY, - reload_creds='default', prompt_recovery=True, append_error_pattern=['FAILED:.* '], - timeout=500) + reload_creds='default', prompt_recovery=True, error_pattern=['FAILED:.* '], + timeout=500, device_recovery=False) ]) self.assertEqual(Passed, steps.details[0].result) @@ -358,7 +358,7 @@ def test_iosxe_install_image_grub_boot_image(self): device.reload.assert_has_calls([ call('install add file sftp://server/image.bin activate commit', reply=ANY, - reload_creds='default', prompt_recovery=True, append_error_pattern=['FAILED:.* '], - grub_boot_image='packages.conf', timeout=500) + reload_creds='default', prompt_recovery=True, error_pattern=['FAILED:.* '], + grub_boot_image='packages.conf', device_recovery=False, timeout=500) ]) self.assertEqual(Passed, steps.details[0].result) diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py index 3ca7b35cc..aec49f139 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py @@ -197,7 +197,7 @@ def ping_server(self, steps, device, server, vrf=VRF, timeout=TIMEOUT, p2 = r'(?P\d+) +packets +transmitted, (?P\d+) +(packets )?received, (?P\S+)% +packet +loss' # Send count=3, Receive count=3 - # Send count=3, Receive count=3 from 172.25.195.115 + # Send count=3, Receive count=3 from 172.25.195.115 p3 = r'Send count=+(?P\d+), Receive count=+(?P\d+)' try: @@ -1385,6 +1385,9 @@ class Reload(BaseStage): prompt_recovery (bool, optional): Enable or disable the prompt recovery feature of unicon. Defaults to True. + error_pattern (list, optional): List of regex patterns to check for errors. + Defaults to an empty list (no error checking). + : Any other arguments that the Unicon reload service supports @@ -1410,7 +1413,6 @@ class Reload(BaseStage): timeout: 600 reload_creds: clean_reload_creds prompt_recovery: True - reconnect_sleep: 200 (Unicon NXOS reload service argument) check_modules: check: False """ @@ -1420,7 +1422,8 @@ class Reload(BaseStage): RELOAD_SERVICE_ARGS = { 'timeout': 800, 'reload_creds': 'default', - 'prompt_recovery': True + 'prompt_recovery': True, + 'error_pattern': [] } CHECK_MODULES = { 'check': True, @@ -1444,6 +1447,7 @@ class Reload(BaseStage): Optional('timeout'): int, Optional('reload_creds'): str, Optional('prompt_recovery'): bool, + Optional('error_pattern'): list, Any(): Any() }, Optional('reconnect_via'): str, @@ -1469,7 +1473,8 @@ def reload(self, steps, device, reload_service_args=None): # the many optional arguments, we still need to default the others. self.RELOAD_SERVICE_ARGS.update(reload_service_args) reload_service_args = self.RELOAD_SERVICE_ARGS - + # Disable device recovey for unicon service + reload_service_args.update({'device_recovery': False}) with steps.start(f"Reload {device.name}") as step: try: @@ -2869,7 +2874,7 @@ class ConfigureManagement(BaseStage): protocols ('list', optional): [list of protocols] - set_hostname (bool): Configure device hostname (default: False) + set_hostname (bool): Configure device hostname (default: True) Example @@ -2882,7 +2887,7 @@ class ConfigureManagement(BaseStage): # ================= # Argument Defaults # ================= - + SET_HOSTNAME = True # ============ # Stage Schema @@ -2914,7 +2919,7 @@ class ConfigureManagement(BaseStage): 'configure_management' ] - def configure_management(self, steps, device, **kwargs): + def configure_management(self, steps, device, set_hostname=SET_HOSTNAME, **kwargs): if 'configure_management' not in dir(device.api): self.passx('No support for configure_management API') @@ -2924,6 +2929,8 @@ def configure_management(self, steps, device, **kwargs): config_kwargs = {k: v for k, v in kwargs.items() if k in \ [k.schema for k in self.schema.keys()]} + config_kwargs['set_hostname'] = set_hostname + if hasattr(device, 'management') and device.management: device.api.configure_management(**config_kwargs) else: diff --git a/pkgs/clean-pkg/src/genie/libs/clean/tests/test_recovery.py b/pkgs/clean-pkg/src/genie/libs/clean/tests/test_recovery.py index 4260fb63b..284818ea5 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/tests/test_recovery.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/tests/test_recovery.py @@ -14,7 +14,7 @@ class MockDisconnectReconnect: def __init__(self, *args, **kwargs): - self.state = iter([False, False, True]) + self.state = iter([False, True, False, True]) def __call__(self, *arg, **kwargs): state = next(self.state) @@ -24,24 +24,72 @@ def __call__(self, *arg, **kwargs): mock_disconnect_reconnect = MockDisconnectReconnect() + class TestRecovery(unittest.TestCase): + def test_recovery_processor_device_in_rommon(self): + + section = Mock() + section.parent = Mock() + section.parent.history = ['Connect'] + section.parent.parameters = {} + section.parameters = {} + device = section.parameters['device'] = MagicMock() + device.is_ha = False + device.state_machine.go_to = MagicMock() + device.state_machine.current_state = 'rommon' + device.os = 'iosxe' + device.api.device_boot_recovery = Mock() + device.api.execute_power_cycle_device = Mock() + device.log = logger + + recovery_processor( + section, + console_activity_pattern='Initializing Hardware', + console_breakboot_telnet_break=True, + break_count=1, + golden_image=['bootflash:asr1000_golden.bin'], + reconnect_delay=1) + device.api.device_recovery_boot.assert_called_once() + device.api.execute_power_cycle_device.assert_not_called() + + def test_recovery_processor_device_in_rommon_ha(self): + section = Mock() + section.parent = Mock() + section.parent.history = ['Connect'] + section.parent.parameters = {} + section.parameters = {} + device = section.parameters['device'] = MagicMock() + device.is_ha = True + sub_con_1 = sub_con_2 = MagicMock() + sub_con_1.state_machine.current_state = sub_con_2.state_machine.current_state = 'rommon' + device.subconnections = [sub_con_1, sub_con_2] + device.api.device_boot_recovery = Mock() + device.api.execute_power_cycle_device = Mock() + recovery_processor( + section, + console_activity_pattern='Initializing Hardware', + console_breakboot_telnet_break=True, + break_count=1, + golden_image=['bootflash:asr1000_golden.bin'], + reconnect_delay=1) + device.api.device_recovery_boot.assert_called_once() + device.api.execute_power_cycle_device.assert_not_called() + @patch('genie.libs.clean.recovery.recovery._disconnect_reconnect', new=mock_disconnect_reconnect) - def test_recovery_processor_telnet_break(self): + def test_recovery_processor_recovery_failed(self): section = Mock() section.parent = Mock() section.parent.history = ['Connect'] section.parent.parameters = {} section.parameters = {} device = section.parameters['device'] = MagicMock() + device.state_machine.go_to = Mock(side_effect=Exception) device.os = 'iosxe' + device.api.device_boot_recovery = Mock() + device.api.execute_clear_line = Mock() + device.api.execute_power_cycle_device = Mock() device.is_ha = False - device.custom = {'abstraction': {'order': ['os']}} - device.cli.settings = Settings() - device.cli.settings.ENV = {} - device.start = ['mock_device_cli --os iosxe --state breakboot'] - device.api.verify_connectivity = Mock(return_value=False) - device.cli.sendline('breakboot') device.log = logger recovery_processor( section, @@ -50,4 +98,39 @@ def test_recovery_processor_telnet_break(self): break_count=1, golden_image=['bootflash:asr1000_golden.bin'], reconnect_delay=1) + device.api.device_recovery_boot.assert_called_once() + device.api.execute_clear_line.assert_called_once() + device.api.execute_power_cycle_device.assert_called_once() self.assertTrue(section.parent.parameters['block_section']) + + @patch('genie.libs.clean.recovery.recovery._disconnect_reconnect', new=mock_disconnect_reconnect) + def test_recovery_processor_recovery_failed_ha(self): + section = Mock() + section.parent = Mock() + section.parent.history = ['Connect'] + section.parent.parameters = {} + section.parameters = {} + device = section.parameters['device'] = MagicMock() + device.state_machine.go_to = Mock(side_effect=Exception) + device.os = 'iosxe' + device.api.device_boot_recovery = Mock() + device.api.execute_clear_line = Mock() + device.api.execute_power_cycle_device = Mock() + device.log = logger + device.is_ha = True + device.api.device_boot_recovery = Mock() + device.api.execute_clear_line = Mock() + sub_con_1 = sub_con_2 = MagicMock() + sub_con_1.state_machine.go_to = Mock(side_effect=Exception) + device.subconnections = [sub_con_1, sub_con_2] + recovery_processor( + section, + console_activity_pattern='Initializing Hardware', + console_breakboot_telnet_break=True, + break_count=1, + golden_image=['bootflash:asr1000_golden.bin'], + reconnect_delay=1) + device.api.device_recovery_boot.assert_called_once() + device.api.execute_clear_line.assert_called_once() + device.api.execute_power_cycle_device.assert_called_once() + self.assertTrue(section.parent.parameters['block_section']) \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_stack_power_stack/__init__.py b/pkgs/conf-pkg/changelog/2023/october.rst similarity index 100% rename from pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_stack_power_stack/__init__.py rename to pkgs/conf-pkg/changelog/2023/october.rst diff --git a/pkgs/conf-pkg/src/genie/libs/conf/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/__init__.py index 43c707895..7f7a4c8c9 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__ = '23.9' +__version__ = '23.10' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_stack_power_stack/__init__.py b/pkgs/filetransferutils-pkg/changelog/2023/october.rst similarity index 100% rename from pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_stack_power_stack/__init__.py rename to pkgs/filetransferutils-pkg/changelog/2023/october.rst diff --git a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py index 037708f32..c6a01cf31 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__ = '23.9' +__version__ = '23.10' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/health-pkg/changelog/2023/october.rst b/pkgs/health-pkg/changelog/2023/october.rst new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/health-pkg/src/genie/libs/health/__init__.py b/pkgs/health-pkg/src/genie/libs/health/__init__.py index 76958f171..f4b78b40b 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__ = '23.9' +__version__ = '23.10' __author__ = 'Cisco Systems Inc.' __contact__ = ['asg-genie-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2020, Cisco Systems Inc.' diff --git a/pkgs/ops-pkg/changelog/2023/october.rst b/pkgs/ops-pkg/changelog/2023/october.rst new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/ops-pkg/src/genie/libs/ops/__init__.py b/pkgs/ops-pkg/src/genie/libs/ops/__init__.py index fa8accb61..fd1ed0c6e 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__ = '23.9' +__version__ = '23.10' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/robot-pkg/changelog/2023/october.rst b/pkgs/robot-pkg/changelog/2023/october.rst new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/robot-pkg/src/genie/libs/robot/__init__.py b/pkgs/robot-pkg/src/genie/libs/robot/__init__.py index bd67c4603..3d1e88780 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__ = '23.9' +__version__ = '23.10' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/sdk-pkg/changelog/2023/october.rst b/pkgs/sdk-pkg/changelog/2023/october.rst new file mode 100644 index 000000000..365e35b02 --- /dev/null +++ b/pkgs/sdk-pkg/changelog/2023/october.rst @@ -0,0 +1,172 @@ +-------------------------------------------------------------------------------- + New +-------------------------------------------------------------------------------- + +* iosxe + * Added API configure_paramter_map + * API for configuring the parameter map with all the sub-commands included + * Added API unconfigure_paramter_map + * API for unconfiguring the parameter map + * Added __init__.py for vdsl folder + * Added __init__.py for vdsl folder + * Added added_api_rep_admin_vlan_configure API + * API to configure rep admin vlan + * Added configure_ospfv3_network_type + * New API to configure ospfv3 network type + * Added configure_ospfv3_interface + * New API to configure ospfv3 interface + * Added clear_ip_dhcp_snooping_binding_on_interface + * API for clear ip dhcp snooping binding on interface + * Added configure_device_policy_tracking + * API for configure device policy tracking + * Added configure_source_tracking_on_interface + * API for configure source tracking on interface + * Added configure_interface_range_dhcp_channel_group_mode + * New API to configure interface range channel-group 1 mode desirable + * Added unconfigure_interface_range_dhcp_channel_group_mode + * New API to unconfigure interface range channel-group 1 mode desirable + * Added configure_ip_sftp_password + * API to configure ip sftp password + * Added unconfigure_ip_sftp_password + * API to unconfigure ip sftp password + * Added configure_ip_scp_password + * API to configure ip scp password + * Added unconfigure_ip_scp_password + * API to unconfigure ip scp password + * Added config_interface_prpchannel + * added api to config_interface_prpchannel + * Added unconfig_interface_prpchannel + * added api to unconfig_interface_prpchannel + * Added `configure_management_ntp` API + * Added format_directory + * API to format {directory} + * Added configure_vtp_pruning + * API to vtp pruning + * Added unconfigure_vtp_pruning + * API to no vtp pruning + * Added configure_switchport_trunk_pruning_vlan + * API to configure switchport trunk pruning vlan + * Added unconfigure_switchport_trunk_pruning_vlan + * API to configure no switchport trunk pruning vlan + * Added configure_periodic_time_range + * API to configure periodic time range + * Added unconfigure_periodic_time_range + * API to unconfigure periodic time range + * Added configure_absolute_time_range + * API to configure absolute time range + * Added unconfigure_absolute_time_range + * API to unconfigure absolute time range + * Added configure_hw_module_slot_logging_onboard_voltage API + * Added API for hw-module slot {slot} logging onboard voltage + * Added unconfigure_hw_module_slot_logging_onboard_voltage API + * Added API for no hw-module slot {slot} logging onboard voltage + * Added configure_hw_module_slot_logging_onboard_temperature API + * Added API for hw-module slot {slot} logging onboard temperature + * Added unconfigure_hw_module_slot_logging_onboard_temperature API + * Added API for no hw-module slot {slot} logging onboard temperature + * Added configure_hw_module_slot_logging_onboard_environment API + * Added API for hw-module slot {slot} logging onboard environment + * Added unconfigure_hw_module_slot_logging_onboard_environment API + * Added API for no hw-module slot {slot} logging onboard environment + * Added configure_clear_logging_onboard_slot_temperature API + * Added API for clear logging onboard slot {slot} temperature + * Added configure_clear_logging_onboard_slot_voltage API + * Added API for clear logging onboard slot {slot} voltage + * Added configure_clear_logging_onboard_slot_environment API + * Added API for clear logging onboard slot {slot} Environment + * Added configure_ip_sftp_username + * API to configure ip sftp username + * Added unconfigure_ip_sftp_username + * API to unconfigure ip sftp username + * Added configure_ip_scp_username + * API to configure ip scp username + * Added unconfigure_ip_scp_username + * API to unconfigure ip scp username + * Added configure_snmp_mib_bulkstat_transfer + * API to configure snmp mib bulkstat transfer + * Added copy_file_with_sftp + * API to copy file from device to sftp host + * Added copy_file_with_scp + * API to copy file from device to scp host + * Added api to execute more file + * API to execute more file on device and get the output + * Added execute_install_package_reloadfast + * API to execute install package reloadfast + * Added api to execute set platform hardware rom-monitor virtualization + * API to execute set platform hardware rom-monitor virtualization on device and get the output + * Added configure_interface_vlan_range_priority + * API to set vlan interface priority + * Added configure_interface_vlan_priority + * API to set vlan interface rnage priority + * Added unconfigure_ipv6_router_ospf + * New API for no ipv6 router ospf {ospf_process_id} + * Added api to configure service compress-config + * API to configure service compress-config on device + * Added api unconfigure service compress-config + * API to unconfigure service compress-config on device + * Added api configure_ip_igmp_querier_query_interval + * API to configure ip igmp querier query interval + * Added api configure_ip_igmp_querier_tcn_query_count + * API to configure ip igmp querier tcn query count + * Added configure_spanning_tree_etherchannel_misconfig + * added api to configure_spanning_tree_etherchannel_misconfig + * Added unconfigure_spanning_tree_etherchannel_misconfig + * added api to unconfigure_spanning_tree_etherchannel_misconfig + +* added configure_hw_module_logging_onboard api + * Added API for hw-module slot {slot} logging onboard + +* added unconfigure_hw_module_logging_onboard api + * Added API for no hw-module slot {slot} logging onboard + + +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- + +* iosxe + * Modified configure_bandwidth_remaining_policy_map + * Fixed the mandatory argument to optional "class_names=None,bandwidth_list=None" + * Modified enable_usb_ssd_verify_exists + * Fixed the time argument to timeout + * Fixed logic for get_mgmt_ip_and_mgmt_src_ip_addresses when passing IP address + * Modify configure_enable_nat_scale + * added boolean variables nat_aot and nat_scale + * Modify configure_disable_nat_scale + * added boolean variables nat_aot and nat_scale + * Modified change_configure_crypto_pki_server_eaptls + * Passing kwargs and condition to configure_crypto_pki_server + * Modified change_configure_crypto_pki_server_pki + * Passing kwargs and condition to configure_crypto_pki_server + * Removed + * Removed duplicate keyword configure_stack_power_stack and unconfigure_stack_power_stack + * Removed corresponding UT as well for those keywords. + +* nxos + * Modified + * Updated nxapi_method_nxapi_rest API to handle output of type RESPONSE + * Fixed logic for get_mgmt_ip_and_mgmt_src_ip_addresses when passing IP address + +* blitz + * Fix gnmi_util to enclose leaf-list entries within []. + * Fixed negative test handling for gnmi get + * Fixed decoding of proto encoding in Gnmi + * Added better logging for Gnmi + +* iosxr + * Fixed logic for get_mgmt_ip_and_mgmt_src_ip_addresses when passing IP address + +* genie.libs.sdk + * Fixed RPC Verifier regex substitution usage + * Added check for allowed fields for OptFields class, log warning for unknown fields + + +-------------------------------------------------------------------------------- + Modify +-------------------------------------------------------------------------------- + +* iosxe + * Modify configure_scale_vrf_via_tftp + * add both ipv4 and ipv6 address family + + diff --git a/pkgs/sdk-pkg/changelog/changelog_fix_iosxe_configure_snmp_server_user_20231012.rst b/pkgs/sdk-pkg/changelog/changelog_fix_iosxe_configure_snmp_server_user_20231012.rst new file mode 100644 index 000000000..64dd681c3 --- /dev/null +++ b/pkgs/sdk-pkg/changelog/changelog_fix_iosxe_configure_snmp_server_user_20231012.rst @@ -0,0 +1,5 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- +* IOSXE + * Updated configure_snmp_server_user diff --git a/pkgs/sdk-pkg/changelog/changelog_fix_iosxe_unconfigure_ipv6_flow_monitor_20230915170839.rst b/pkgs/sdk-pkg/changelog/changelog_fix_iosxe_unconfigure_ipv6_flow_monitor_20230915170839.rst new file mode 100644 index 000000000..ab42e7775 --- /dev/null +++ b/pkgs/sdk-pkg/changelog/changelog_fix_iosxe_unconfigure_ipv6_flow_monitor_20230915170839.rst @@ -0,0 +1,6 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- +* IOSXE + * Modified unconfigure_ipv6_flow_monitor: + * Added "no" in front of 'ipv6 flow monitor' command \ No newline at end of file diff --git a/pkgs/sdk-pkg/changelog/changelog_tahigash_get_outgoing_20231002091400.rst b/pkgs/sdk-pkg/changelog/changelog_tahigash_get_outgoing_20231002091400.rst new file mode 100644 index 000000000..6faad326f --- /dev/null +++ b/pkgs/sdk-pkg/changelog/changelog_tahigash_get_outgoing_20231002091400.rst @@ -0,0 +1,8 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- +* IOSXE + * Modified get_outgoing_interface_with_vrf API: + * updated logic to prevent recursive endless loop + * Modified get_next_hops_with_vrf API: + * Updated logic to find nexthop address even for binding label \ No newline at end of file diff --git a/pkgs/sdk-pkg/sdk_generator/output/github_apis.json b/pkgs/sdk-pkg/sdk_generator/output/github_apis.json index 687a3430f..e6cd8c236 100644 --- a/pkgs/sdk-pkg/sdk_generator/output/github_apis.json +++ b/pkgs/sdk-pkg/sdk_generator/output/github_apis.json @@ -5,7 +5,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "add_device_to_testbed_yaml_file", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/utils.py#L301" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/utils.py#L296" } }, "analyze_core_by_bingopy": { @@ -228,7 +228,7 @@ "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "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#L862" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L868" } }, "change_power_cycler_state": { @@ -246,7 +246,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "check_if_device_in_testbed_yaml", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/utils.py#L279" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/utils.py#L274" } }, "check_traffic_drop_count": { @@ -408,7 +408,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_counters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L753" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L757" } }, "clear_crypto_call_admission_stats": { @@ -534,7 +534,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_dlep_client", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1738" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1742" } }, "clear_dlep_neighbor": { @@ -543,7 +543,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_dlep_neighbor", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1760" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1764" } }, "clear_dmvpn": { @@ -692,7 +692,7 @@ }, "clear_iox": { "iosxe": { - "doc": " \n Execute clear iox\n Uses disable_iox\n Args:\n device ('obj') : Device object\n max_time ('int') : max time to wait\n interval ('int') : interval timer\n disable_iox_then_clear ('boolean') : Disable IOX then clear\n wait_timer ('int') : wait timer after disable IOX if disable_iox_then_clear\n timeout ('int'): timeout arg for Unicon execute for this CLI\n Returns:\n True\n False\n Raises:\n None \n ", + "doc": "\n Execute clear iox\n Uses disable_iox\n Args:\n device ('obj') : Device object\n max_time ('int') : max time to wait\n interval ('int') : interval timer\n disable_iox_then_clear ('boolean') : Disable IOX then clear\n wait_timer ('int') : wait timer after disable IOX if disable_iox_then_clear\n timeout ('int'): timeout arg for Unicon execute for this CLI\n Returns:\n True\n False\n Raises:\n None\n ", "module_name": "apphosting.configure", "package": "genie.libs.sdk.apis", "uid": "clear_iox", @@ -780,6 +780,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/execute.py#L28" } }, + "clear_ip_dhcp_snooping_binding_on_interface": { + "iosxe": { + "doc": " Clear ip dhcp snooping binding on interface\n Args:\n device (`obj`): Device object\n interface('str'): interface name\n Return:\n None\n Raise:\n SubCommandFailure\n ", + "module_name": "interface.clear", + "package": "genie.libs.sdk.apis", + "uid": "clear_ip_dhcp_snooping_binding_on_interface", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/clear.py#L33" + } + }, "clear_ip_eigrp_neighbor": { "iosxe": { "doc": "\n clear ip eigrp neighbor\n Args:\n device ('obj'): Device object\n Returns:\n None\n Raises:\n SubcommandFailure: Failed executing command\n ", @@ -795,7 +804,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "clear_ip_mfib_counters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1503" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1502" } }, "clear_ip_mroute_all": { @@ -804,7 +813,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_ip_mroute_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1421" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1425" } }, "clear_ip_mroute_vrf": { @@ -822,7 +831,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_ip_nat_translation_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1401" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1405" } }, "clear_ip_nhrp": { @@ -885,7 +894,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_ip_traffic", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1620" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1624" } }, "clear_ipv6_dhcp_binding": { @@ -1011,7 +1020,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_lne_ftpse_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1779" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1783" } }, "clear_logging": { @@ -1020,21 +1029,30 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_logging", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L774" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L778" }, "iosxr": { "doc": " clear logging\n Args:\n device ('obj'): Device object\n Returns:\n output ('str'): Output of execution\n Raises:\n SubCommandFailure\n ", "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_logging", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/utils.py#L362" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/utils.py#L361" }, "nxos": { "doc": " clear logging\n Args:\n device ('obj'): Device object\n Returns:\n output ('str'): Output of execution\n Raises:\n SubCommandFailure\n ", "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_logging", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/utils.py#L332" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/utils.py#L327" + } + }, + "clear_logging_onboard_rp_active_standby": { + "iosxe": { + "doc": " clears logging onboard rp active/standby\n Example: clear logging onboard rp active/standby\n Args:\n device ('obj'): Device object\n rp_active_standby('str'): Rp active/standby\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.utils", + "package": "genie.libs.sdk.apis", + "uid": "clear_logging_onboard_rp_active_standby", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/utils.py#L549" } }, "clear_logging_onboard_switch": { @@ -1221,7 +1239,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_pdm_steering_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1835" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1839" } }, "clear_platform_qos_dscp_cos_counters_interface": { @@ -1248,7 +1266,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_policy_map_counters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1677" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1681" } }, "clear_port_security": { @@ -1257,7 +1275,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_port_security", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1465" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1469" } }, "clear_ppp_all": { @@ -1266,7 +1284,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_ppp_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1796" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1800" } }, "clear_pppoe_all": { @@ -1275,7 +1293,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_pppoe_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1816" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1820" } }, "compare_archive_config_dicts": { @@ -1320,7 +1338,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "concurrent_ssh_sessions", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1252" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1256" } }, "confgiure_port_channel_min_link": { @@ -1575,6 +1593,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L701" } }, + "config_interface_prpchannel": { + "iosxe": { + "doc": " Configure prp-channel on an interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface to which prp channel is added\n prpchannel_num (`str`): Prp channel group number\n\n Returns:\n None\n Warning messages\n\n Raises:\n SubCommandFailure\n ", + "module_name": "interface.configure", + "package": "genie.libs.sdk.apis", + "uid": "config_interface_prpchannel", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9488" + } + }, "config_interface_ripng": { "iosxe": { "doc": "config RIPng on interface\n Args:\n device ('obj'): Device object\n interface ('str'): Interface name\n ripng_pid ('str'): ripng process id\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -1975,7 +2002,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "config_smart_authorisation_request", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1410" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1409" } }, "config_smart_save_license_usage": { @@ -1984,7 +2011,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "config_smart_save_license_usage", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1390" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1389" } }, "config_speed_nonego_on_interface": { @@ -2293,6 +2320,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py#L1272" } }, + "configure_absolute_time_range": { + "iosxe": { + "doc": "Configure absolute time range\n Args:\n device ('obj'): device object\n time_range_name ('str'): time range name\n action_type ('str') : start time/end time\n time ('str') : The start time/end time of the time range in the format HH:MM\n day ('int') : Day of the month (1-31)\n month ('str') : Month of the year (eg: Jan for January, Jun for June)\n year ('int') : Year (1993-2035)\n Return:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_absolute_time_range", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5019" + } + }, "configure_access_map_match_ip_address_action_forward": { "iosxe": { "doc": " Configuring access map match ip address action forward \n\n Args:\n device ('obj'): device to use\n vlan_access_name ('str'): name of vlan to access \n\n Returns:\n None\n\n Raises: \n SubCommandFailure\n ", @@ -2493,7 +2529,7 @@ }, "configure_app_hosting_appid_docker": { "iosxe": { - "doc": "\n Configure app-hosting appid resource docker\n Args:\n device ('obj'): Device object\n appid ('str'): app-hosting appid\n prepend_pkg_opts ('bool', optional): configure prepend-pkg-opts. Default is True\n run_opts ('list', optional): list of dictinaries.\n For ex:\n [\n {'index': 1, 'string': '-e TEAGENT_PROXY_LOCATION=proxy-wsa.esl.cisco.com:80'},\n {'index': 3, 'string': '-e TEAGENT_PROXY_TYPE=STATIC'},\n ] \n Returns:\n None\n Raises:\n SubCommandFailure\n \n ", + "doc": "\n Configure app-hosting appid resource docker\n Args:\n device ('obj'): Device object\n appid ('str'): app-hosting appid\n prepend_pkg_opts ('bool', optional): configure prepend-pkg-opts. Default is True\n run_opts ('list', optional): list of dictinaries.\n For ex:\n [\n {'index': 1, 'string': '-e TEAGENT_PROXY_LOCATION=proxy-wsa.esl.cisco.com:80'},\n {'index': 3, 'string': '-e TEAGENT_PROXY_TYPE=STATIC'},\n ]\n Returns:\n None\n Raises:\n SubCommandFailure\n\n ", "module_name": "apphosting.configure", "package": "genie.libs.sdk.apis", "uid": "configure_app_hosting_appid_docker", @@ -2502,7 +2538,7 @@ }, "configure_app_hosting_appid_iperf_from_vlan": { "iosxe": { - "doc": " configure_app_hosting_appid_iperf_from_vlan \n Args:\n device ('obj'): device to execute on\n port_id(int): port identifier\n vlan_id('str'): vlan identifier \n \n Return:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " configure_app_hosting_appid_iperf_from_vlan\n Args:\n device ('obj'): device to execute on\n port_id(int): port identifier\n vlan_id('str'): vlan identifier\n\n Return:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "apphosting.configure", "package": "genie.libs.sdk.apis", "uid": "configure_app_hosting_appid_iperf_from_vlan", @@ -2511,7 +2547,7 @@ }, "configure_app_hosting_appid_trunk_port": { "iosxe": { - "doc": "\n Configure app-hosting appid\n Args:\n device ('obj'): Device object\n appid ('str'): app-hosting appid\n app_vnic ('str'): app-hosting app-vnic type\n app_vnic_port ('int', optional): app-vnic port number of interface. Default is None\n app_vnic_port_mode ('str', optional): access or trunk port mode. Default is None\n app_vnic_guest_interface ('str', optional): guest-interface name. Default is None\n vlan_id ('str', optional): Vlan information App installation. Default is None\n app_ip ('str', optional): Public IP for Thousand Eye Application. Default is None\n app_netmask ('str', optional): Subnet mask for the Public IP. Default is None\n app_gateway_ip ('str', optional): gateway IP for Application. Default is None\n start ('bool', optional): True to start the Application. Default is False \n Returns:\n None\n Raises:\n SubCommandFailure\n \n ", + "doc": "\n Configure app-hosting appid\n Args:\n device ('obj'): Device object\n appid ('str'): app-hosting appid\n app_vnic ('str'): app-hosting app-vnic type\n app_vnic_port ('int', optional): app-vnic port number of interface. Default is None\n app_vnic_port_mode ('str', optional): access or trunk port mode. Default is None\n app_vnic_guest_interface ('str', optional): guest-interface name. Default is None\n vlan_id ('str', optional): Vlan information App installation. Default is None\n app_ip ('str', optional): Public IP for Thousand Eye Application. Default is None\n app_netmask ('str', optional): Subnet mask for the Public IP. Default is None\n app_gateway_ip ('str', optional): gateway IP for Application. Default is None\n start ('bool', optional): True to start the Application. Default is False\n Returns:\n None\n Raises:\n SubCommandFailure\n\n ", "module_name": "apphosting.configure", "package": "genie.libs.sdk.apis", "uid": "configure_app_hosting_appid_trunk_port", @@ -2520,7 +2556,7 @@ }, "configure_app_hosting_resource_profile": { "iosxe": { - "doc": "\n Configure app-hosting appid resource custom profile\n Args:\n device ('obj'): Device object\n appid ('str'): app-hosting appid\n profile_name ('srt'): app-resource profile name\n cpu ('int', optional): application CPU units/share quota. Default is None\n cpu_percent ('int', optional): application cpu percent. Default is None\n memory ('int', optional): memory reservation MB units. Default is None\n vcpu ('int', optional): application VCPU count. Default is None\n start ('bool', optional): True to start the Application. Default is False\n Returns:\n None\n Raises:\n SubCommandFailure\n \n ", + "doc": "\n Configure app-hosting appid resource custom profile\n Args:\n device ('obj'): Device object\n appid ('str'): app-hosting appid\n profile_name ('srt'): app-resource profile name\n cpu ('int', optional): application CPU units/share quota. Default is None\n cpu_percent ('int', optional): application cpu percent. Default is None\n memory ('int', optional): memory reservation MB units. Default is None\n vcpu ('int', optional): application VCPU count. Default is None\n start ('bool', optional): True to start the Application. Default is False\n Returns:\n None\n Raises:\n SubCommandFailure\n\n ", "module_name": "apphosting.configure", "package": "genie.libs.sdk.apis", "uid": "configure_app_hosting_resource_profile", @@ -2529,7 +2565,7 @@ }, "configure_app_management_networking": { "iosxe": { - "doc": " \n Args:\n device ('obj'): device to use\n app_name('str'): WORD no description\n auto_start('str'): Application start\n Returns:\n None\n Raises:\n SubCommandFailure \n ", + "doc": "\n Args:\n device ('obj'): device to use\n app_name('str'): WORD no description\n auto_start('str'): Application start\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "apphosting.configure", "package": "genie.libs.sdk.apis", "uid": "configure_app_management_networking", @@ -2810,11 +2846,11 @@ }, "configure_bandwidth_remaining_policy_map": { "iosxe": { - "doc": " Configures policy_map\n Args:\n device ('obj'): device to use\n policy_names('list) : list of policy-maps i.e. parent and grandparent\n class_names ('list') : list of classes inside policy-map i.e voice, video etc.\n bandwidth_list ('list) : list of bandwidth remainin for each class.\n shape_average ('str') : shaper percentage value for grandparent\n bandwidth_remaining ('bool') : If true, sets percentage of remaining bandwidth.\n Else, sets percentage of total bandwidth.\n Defaults to True.\n example:\n policy_names=['parent','grandparent']\n class_names = ['voice','data','video','class-default']\n bandwidth_list = [20,10,10,10,30]\n shape_average = 100\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Configures policy_map\n Args:\n device ('obj'): device to use\n policy_names('list) : list of policy-maps i.e. parent and grandparent\n shape_average ('str') : shaper percentage value for grandparent\n class_names ('list', optional) : list of classes inside policy-map i.e voice, video etc.\n bandwidth_list ('list, optional) : list of bandwidth remainin for each class.\n bandwidth_remaining ('bool') : If true, sets percentage of remaining bandwidth.\n Else, sets percentage of total bandwidth.\n Defaults to True.\n example:\n policy_names=['parent','grandparent']\n shape_average = '100'\n class_names = ['voice','data','video','class-default']\n bandwidth_list = [20,10,10,10,30]\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "configure_bandwidth_remaining_policy_map", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L201" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L226" } }, "configure_banner": { @@ -2841,7 +2877,7 @@ "module_name": "platform.configure", "package": "genie.libs.sdk.apis", "uid": "configure_bba_group_session_auto_cleanup", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4520" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4541" } }, "configure_bfd_neighbor_on_interface": { @@ -3266,7 +3302,7 @@ "module_name": "platform.configure", "package": "genie.libs.sdk.apis", "uid": "configure_bridge_domain", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4545" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4600" } }, "configure_broadband_aaa": { @@ -3695,6 +3731,33 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/multicast/configure.py#L1067" } }, + "configure_clear_logging_onboard_slot_environment": { + "iosxe": { + "doc": " unconfigures clear logging onboard slot Environment\n Args:\n device ('obj'): device to use\n slot ('int'): slot number to configure\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_clear_logging_onboard_slot_environment", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5296" + } + }, + "configure_clear_logging_onboard_slot_temperature": { + "iosxe": { + "doc": " unconfigures clear logging onboard slot temperature\n Args:\n device ('obj'): device to use\n slot ('int'): slot number to configure\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_clear_logging_onboard_slot_temperature", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5329" + } + }, + "configure_clear_logging_onboard_slot_voltage": { + "iosxe": { + "doc": " configures clear logging onboard slot voltage\n Args:\n device ('obj'): device to use\n slot ('int'): slot number to configure\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_clear_logging_onboard_slot_voltage", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5263" + } + }, "configure_clear_logging_onboard_switch_environment": { "iosxe": { "doc": " unconfigures clear logging onboard switch Environment\n Args:\n device ('obj'): device to use\n switch_number ('int'): switch number to configure\n ", @@ -3863,7 +3926,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_crypto_ikev2_NAT_keepalive", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L819" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L823" } }, "configure_crypto_ikev2_keyring": { @@ -4079,7 +4142,7 @@ "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_debug_snmp_packets", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L442" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L445" } }, "configure_default_gateway": { @@ -4160,7 +4223,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "configure_default_vtp_version", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L994" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1046" } }, "configure_default_vxlan": { @@ -4169,7 +4232,7 @@ "module_name": "vrf.configure", "package": "genie.libs.sdk.apis", "uid": "configure_default_vxlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L887" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L892" } }, "configure_device": { @@ -4199,6 +4262,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L3965" } }, + "configure_device_policy_tracking": { + "iosxe": { + "doc": "Configure device policy tracking \n Args:\n device (`obj`): Device object\n policy_name('str'): policy name\n tracking('boolean',optional): Flag to configure tracking enable (Default True)\n Return:\n None\n Raise:\n SubCommandFailure\n ", + "module_name": "device_tracking.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_device_policy_tracking", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/device_tracking/configure.py#L98" + } + }, "configure_device_sensor_filter_list": { "iosxe": { "doc": " Configure device sensor filter list\n Args:\n device ('obj'): device to use\n protocol ('str'): Protocol names like cdp, dhcp, lldp.\n list_name ('str'): Protocol list name.\n tlv_name ('str', optional): TLV type list name. Default is None.\n tlv_number ('int', optional): TLV type list number. Default is None.\n option_name ('str', optional): Option type list name. Default is None.\n option_number ('str', optional): Option type list name. Default is None.\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to configure device sensor filter list\n ", @@ -4435,11 +4507,11 @@ }, "configure_disable_nat_scale": { "iosxe": { - "doc": " Configure disable NAT scale\n Args:\n device (`obj`): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Configure disable NAT scale\n Args:\n device (`obj`): Device object\n nat_aot ('boolean', optional): Flag to disable nat aot\n nat_scale ('boolean', optional): Flag to disable nat scale\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_disable_nat_scale", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L997" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1001" } }, "configure_disable_sci_dot1q_clear": { @@ -4547,7 +4619,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_dynamic_nat_outside_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L949" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L953" } }, "configure_dynamic_nat_pool_overload_route_map_rule": { @@ -4574,7 +4646,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_dynamic_nat_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L557" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L561" } }, "configure_dynamic_path_in_tunnel": { @@ -4750,7 +4822,7 @@ }, "configure_enable_nat_scale": { "iosxe": { - "doc": " Configure enable NAT scale\n Args:\n device (`obj`): Device object\n timeout ('int', optional): Max time for enable nat scale.Defaults to 60\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Configure enable NAT scale\n Args:\n device (`obj`): Device object\n timeout ('int', optional): Max time for enable nat scale.Defaults to 60\n nat_aot ('boolean', optional): Flag to enable nat aot\n nat_scale ('boolean', optional): Flag to enable nat scale\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_enable_nat_scale", @@ -5285,7 +5357,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "configure_hqos_policer_map", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L572" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L599" } }, "configure_hsrp_interface": { @@ -5315,6 +5387,42 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/hardware/configure.py#L97" } }, + "configure_hw_module_logging_onboard": { + "iosxe": { + "doc": " Configures OBFL on the specified slot\n Example : hw-module slot logging onboard\n Args:\n device ('obj'): device to use\n slot ('int'): slot number to configure\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_hw_module_logging_onboard", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5089" + } + }, + "configure_hw_module_slot_logging_onboard_environment": { + "iosxe": { + "doc": " configures hw-module slot <#> logging onboard environment\n Args:\n device ('obj'): device to use\n slot ('int'): slot number to configure\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_hw_module_slot_logging_onboard_environment", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5171" + } + }, + "configure_hw_module_slot_logging_onboard_temperature": { + "iosxe": { + "doc": " configures hw-module slot <#> logging onboard temperature\n Args:\n device ('obj'): device to use\n slot ('int'): slot number to configure\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_hw_module_slot_logging_onboard_temperature", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5217" + } + }, + "configure_hw_module_slot_logging_onboard_voltage": { + "iosxe": { + "doc": " configures hw-module slot <#> logging onboard voltage\n Args:\n device ('obj'): device to use\n slot ('int'): slot number to configure\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_hw_module_slot_logging_onboard_voltage", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5125" + } + }, "configure_hw_module_slot_shutdown": { "iosxe": { "doc": " Shut hw-module slot {slot}\n Args:\n device (`obj`): Device object\n slot (`int`): slot\n\n Returns:\n Shutdown Status\n\n Raises:\n SubCommandFailure : Failed configuring device\n ", @@ -5704,7 +5812,7 @@ }, "configure_interface_ip_dhcp_relay_information_option_vpn_id": { "iosxe": { - "doc": " Configure ip dhcp relay information option vpn-id on the interface \n Args:\n device ('obj'): device to use\n interface ('str'): name of the interface to be configured # example \"interface vlan 100\" \"ip dhcp relay information option vpn-id\"\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to ip dhcp relay information option vpn-id\n ", + "doc": " Configure ip dhcp relay information option vpn-id on the interface\n Args:\n device ('obj'): device to use\n interface ('str'): name of the interface to be configured # example \"interface vlan 100\" \"ip dhcp relay information option vpn-id\"\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to ip dhcp relay information option vpn-id\n ", "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_interface_ip_dhcp_relay_information_option_vpn_id", @@ -5713,7 +5821,7 @@ }, "configure_interface_ip_dhcp_relay_source_interface_intf_id": { "iosxe": { - "doc": " Configure interface ip dhcp relay source interface intf_id \n Args:\n device ('obj'): device to use\n interface ('str'): name of the interface to be configured # example \"interface vlan 100\" \"ip dhcp relay source-interface Loopback1\"\n intf_id ('str'): Set source interface for relayed messages for interface ex: Loopback1 interface\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to configure ip dhcp relay source-interface intf_id\n ", + "doc": " Configure interface ip dhcp relay source interface intf_id\n Args:\n device ('obj'): device to use\n interface ('str'): name of the interface to be configured # example \"interface vlan 100\" \"ip dhcp relay source-interface Loopback1\"\n intf_id ('str'): Set source interface for relayed messages for interface ex: Loopback1 interface\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to configure ip dhcp relay source-interface intf_id\n ", "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_interface_ip_dhcp_relay_source_interface_intf_id", @@ -6089,13 +6197,22 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L4280" } }, + "configure_interface_range_dhcp_channel_group_mode": { + "iosxe": { + "doc": "Configures Ethernet port to an EtherChannel group\n Example: channel-group 10 mode desirable\n\n Args:\n device ('obj'): device object\n start_interface('str'): Starting Interface\n end_interface('str'): Ending Interface number\n group ('int'): Channel group number. The range is 1 to 128\n mode ('str'): EtherChannel mode (eg. active, passive, auto)\n\n Return:\n None\n\n Raises:\n SubCommandFailure\n ", + "module_name": "dhcp.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_interface_range_dhcp_channel_group_mode", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1464" + } + }, "configure_interface_range_no_switchport": { "iosxe": { - "doc": " Configure interface range no switchport \n Args:\n device ('obj'): device to use\n start_interface('str'): Starting Interface\n end_interface('str'): Ending Interface number\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Configure interface range no switchport\n Args:\n device ('obj'): device to use\n start_interface('str'): Starting Interface\n end_interface('str'): Ending Interface number\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "interface.configure", "package": "genie.libs.sdk.apis", "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#L9509" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9574" } }, "configure_interface_reg_segment": { @@ -6419,7 +6536,25 @@ "module_name": "interface.configure", "package": "genie.libs.sdk.apis", "uid": "configure_interface_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9487" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9552" + } + }, + "configure_interface_vlan_priority": { + "iosxe": { + "doc": "\n Args:\n device ('obj'): Device object\n vlan_id ('int') : <1-4094> Vlan interface id\n priority ('int') : <50-200> Vlan interface priority\n Returns:\n None\n Raises:\n SubcommandFailure: Failed executing command\n ", + "module_name": "vlan.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_interface_vlan_priority", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L917" + } + }, + "configure_interface_vlan_range_priority": { + "iosxe": { + "doc": "\n Args:\n device ('obj'): Device object\n vlan_id_from ('int') : <1-4094> Vlan interface vlan_id_from\n vlan_id_to ('int') : <1-4094> Vlan interface vlan_id_to\n stby_value ('int') : value after stanby (Ex. : 0)\n priority ('int') : <50-200> Vlan interface priority\n Returns:\n None\n Raises:\n SubcommandFailure: Failed executing command\n ", + "module_name": "vlan.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_interface_vlan_range_priority", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L942" } }, "configure_interface_vlan_standby_ip": { @@ -6533,7 +6668,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ip_access_group_in_out", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1726" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1733" } }, "configure_ip_acl": { @@ -6842,6 +6977,24 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/multicast/configure.py#L1182" } }, + "configure_ip_igmp_querier_query_interval": { + "iosxe": { + "doc": "\n Configure ip igmp snooping querier query-interval 100\n\n Args:\n device('obj'): Device object\n query_type('str'): query-interval IGMP querier query interval (sec)\n query_interval('int'): <1-18000> IGMP querier query interval (sec)\n \n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", + "module_name": "igmp_snooping.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_ip_igmp_querier_query_interval", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/igmp_snooping/configure.py#L327" + } + }, + "configure_ip_igmp_querier_tcn_query_count": { + "iosxe": { + "doc": "\n Configure ip igmp snooping querier tcn query count 10\n\n Args:\n device('obj'): Device object\n query_type('str'):tcn IGMP querier TCN related parameters\n action_type('str'): count IGMP querier TCN query count\n interval IGMP querier TCN query interval (sec)\n query_count('int'):<1-10> IGMP querier TCN query count\n \n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", + "module_name": "igmp_snooping.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_ip_igmp_querier_tcn_query_count", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/igmp_snooping/configure.py#L349" + } + }, "configure_ip_igmp_snooping": { "iosxe": { "doc": "UnConfigure IGMP snooping \n Example : ip igmp snooping \n\n Args:\n device('obj'): Device object\n \n Returns:\n None\n \n Raises:\n SubCommandFailure : Could not configure ip igmp snooping\n \n ", @@ -7193,6 +7346,42 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L494" } }, + "configure_ip_scp_password": { + "iosxe": { + "doc": " Configure password for scp\n Args:\n device ('obj'): Device object\n password ('str'): password\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_ip_scp_password", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4707" + } + }, + "configure_ip_scp_username": { + "iosxe": { + "doc": " Configure username for scp\n Args:\n device ('obj'): Device object\n username ('str'): username\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_ip_scp_username", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4675" + } + }, + "configure_ip_sftp_password": { + "iosxe": { + "doc": " Configure password for sftp\n Args:\n device ('obj'): Device object\n password ('str'): password\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_ip_sftp_password", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4739" + } + }, + "configure_ip_sftp_username": { + "iosxe": { + "doc": " Configure username for sftp\n Args:\n device ('obj'): Device object\n username ('str'): username\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_ip_sftp_username", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4642" + } + }, "configure_ip_source_binding": { "iosxe": { "doc": " Configure ip source binding\n Args:\n device ('obj'): device to use\n mac_address ('str'): binding MAC address\n vlan_id ('int'): binding VLAN number (1-4094)\n ip_address ('str'): binding IP address\n interface ('str'): interface name (eg: Gi1/0/13)\n Returns\n None\n Raises:\n SubCommandFailure\n ", @@ -7208,7 +7397,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "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#L894" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L908" } }, "configure_ip_subnet_to_sgt_mapping_vrf": { @@ -8444,11 +8633,11 @@ }, "configure_line_vty_needs_enhancement": { "iosxe": { - "doc": " configure_line_vty_needs_enhancement \n Args:\n device ('obj'): device to execute on\n firstline_id ('int') : firstline identifier\n lastline_id ('int') : lastline identifier \n min ('int') : timeout in minutes\n sec ('int') : timeout in seconds \n\n Return:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " configure_line_vty_needs_enhancement\n Args:\n device ('obj'): device to execute on\n firstline_id ('int') : firstline identifier\n lastline_id ('int') : lastline identifier\n min ('int') : timeout in minutes\n sec ('int') : timeout in seconds\n\n Return:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "management.configure", "package": "genie.libs.sdk.apis", "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#L930" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L946" } }, "configure_lineconsole_exectimeout": { @@ -8685,7 +8874,7 @@ "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_logging_snmp_trap", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L538" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L541" } }, "configure_login_log": { @@ -8847,7 +9036,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "configure_management", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L669" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L679" } }, "configure_management_credentials": { @@ -8865,7 +9054,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "configure_management_gateway", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L243" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L238" } }, "configure_management_gnmi": { @@ -8874,7 +9063,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "configure_management_gnmi", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L972" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L990" } }, "configure_management_http": { @@ -8883,7 +9072,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "configure_management_http", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L446" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L462" } }, "configure_management_ip": { @@ -8892,7 +9081,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "configure_management_ip", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L94" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L92" } }, "configure_management_netconf": { @@ -8901,7 +9090,16 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "configure_management_netconf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L593" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L606" + } + }, + "configure_management_ntp": { + "iosxe": { + "doc": "\n Configure device for time synchronization via ntp.\n\n Args:\n device ('obj'): device object\n server_name ('str'): name of the server in the testbed, default: 'ntp'\n source_interface ('str'): management interface (optional)\n\n Returns:\n None\n ", + "module_name": "management.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_management_ntp", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L432" } }, "configure_management_protocols": { @@ -8910,7 +9108,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "configure_management_protocols", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L621" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L634" } }, "configure_management_routes": { @@ -8919,7 +9117,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "configure_management_routes", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L341" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L333" } }, "configure_management_ssh": { @@ -8928,7 +9126,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "configure_management_ssh", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L476" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L489" } }, "configure_management_telnet": { @@ -8937,7 +9135,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "configure_management_telnet", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L517" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L530" } }, "configure_management_tftp": { @@ -8946,7 +9144,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "configure_management_tftp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L417" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L406" } }, "configure_management_vrf": { @@ -8955,7 +9153,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "configure_management_vrf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L45" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L46" } }, "configure_management_vty_lines": { @@ -8964,7 +9162,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "configure_management_vty_lines", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L541" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L554" } }, "configure_masked_unmasked_credentials": { @@ -9198,7 +9396,7 @@ "module_name": "vrf.configure", "package": "genie.libs.sdk.apis", "uid": "configure_mdt_auto_discovery_inter_as", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L984" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L989" } }, "configure_mdt_auto_discovery_inter_as_mdt_type": { @@ -9207,7 +9405,7 @@ "module_name": "vrf.configure", "package": "genie.libs.sdk.apis", "uid": "configure_mdt_auto_discovery_inter_as_mdt_type", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L1055" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L1060" } }, "configure_mdt_auto_discovery_mldp": { @@ -9225,7 +9423,7 @@ "module_name": "vrf.configure", "package": "genie.libs.sdk.apis", "uid": "configure_mdt_auto_discovery_vxlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L933" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L938" } }, "configure_mdt_data_mpls_mldp": { @@ -9252,7 +9450,7 @@ "module_name": "vrf.configure", "package": "genie.libs.sdk.apis", "uid": "configure_mdt_data_vxlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L765" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L770" } }, "configure_mdt_default": { @@ -9261,7 +9459,7 @@ "module_name": "vrf.configure", "package": "genie.libs.sdk.apis", "uid": "configure_mdt_default", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L1032" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L1037" } }, "configure_mdt_overlay_use_bgp": { @@ -9279,7 +9477,7 @@ "module_name": "vrf.configure", "package": "genie.libs.sdk.apis", "uid": "configure_mdt_overlay_use_bgp_spt_only", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L864" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L869" } }, "configure_mdt_partitioned_mldp_p2mp": { @@ -9583,11 +9781,11 @@ }, "configure_mtc": { "iosxe": { - "doc": " Configure parameters for mtc \n Args:\n device ('obj'): device object\n version ('str'): protocol version ipv4 or ipv6\n interface ('str') or ('list'): interfaces of mtc\n protocol ('str') or ('list'): protocols of mtc\n address ('str'): mtc ipv4 or ipv6 address\n \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Configure parameters for mtc\n Args:\n device ('obj'): device object\n version ('str'): protocol version ipv4 or ipv6\n interface ('str') or ('list'): interfaces of mtc\n protocol ('str') or ('list'): protocols of mtc\n address ('str'): mtc ipv4 or ipv6 address\n\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "configure_mtc", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L774" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L783" } }, "configure_multicast_routing_mvpn_vrf": { @@ -9605,7 +9803,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat64_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1119" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1126" } }, "configure_nat64_nd_ra_prefix": { @@ -9614,7 +9812,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat64_nd_ra_prefix", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1632" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1639" } }, "configure_nat64_prefix_stateful": { @@ -9623,7 +9821,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat64_prefix_stateful", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1161" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1168" } }, "configure_nat64_translation_timeout": { @@ -9632,7 +9830,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat64_translation_timeout", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1548" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1555" } }, "configure_nat64_v4_list_pool": { @@ -9641,7 +9839,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat64_v4_list_pool", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1393" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1400" } }, "configure_nat64_v4_list_pool_overload": { @@ -9650,7 +9848,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat64_v4_list_pool_overload", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1482" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1489" } }, "configure_nat64_v4_pool": { @@ -9659,7 +9857,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat64_v4_pool", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1343" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1350" } }, "configure_nat64_v6v4_static": { @@ -9668,7 +9866,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat64_v6v4_static", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1225" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1232" } }, "configure_nat64_v6v4_static_protocol_port": { @@ -9677,7 +9875,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat64_v6v4_static_protocol_port", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1285" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1292" } }, "configure_nat_extended_acl": { @@ -9686,7 +9884,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat_extended_acl", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L914" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L918" } }, "configure_nat_in_out": { @@ -9704,7 +9902,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat_ipv6_acl", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1601" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1608" } }, "configure_nat_overload_rule": { @@ -9731,7 +9929,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat_pool_overload_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1065" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1072" } }, "configure_nat_port_route_map_rule": { @@ -9749,7 +9947,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat_route_map", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L858" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L862" } }, "configure_nat_translation_max_entries": { @@ -9758,7 +9956,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat_translation_max_entries", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1910" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1917" } }, "configure_nat_translation_timeout": { @@ -9767,7 +9965,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_nat_translation_timeout", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1019" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1026" } }, "configure_neighbor_under_ospf": { @@ -9794,7 +9992,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "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#L864" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L876" } }, "configure_network_policy_profile_voice_vlan": { @@ -9928,11 +10126,11 @@ }, "configure_object_list_schema_transfer_for_bulkstat": { "iosxe": { - "doc": " Configure object list, schema and transfer for bulkstat\n Args:\n device ('obj'): device to use\n type_('str'): object-list Configure an Object List\n schema Configure Schema definition\n transfer Configure Transfer Parameters\n object_name('str', optional): WORD Name of object list, default value is None\n schema_name('str', optional): WORD Name of the schema, default value is None\n transfer_name('str', optional): WORD Name of bulk transfer, default value is None\n oid_value_list:('list', optional): WORD Object name or OID list, default value is None\n poll_interval('int', optional): Periodicity for the polling of objects in this schema in \n Minutes. (Default value is 5 Mins), default value is None\n snmp_interface('str', optional): Specify instance as ifDescr, default value is None\n format_('str', optional): An ASCII format containing schema definitions, default value is None\n transfer_interval('int', optional): Periodicity for the transfer of bulk data in Minutes, default value is None\n buffer_size('int', optional): Bulkstat data file maximum size(Default size is 2048 bytes), default value is None\n primary_url('str', optional): WORD URL of primary destination, default value is None\n enable('str', optional): Start Data Collection for this Configuration, default value is None \n logging_on('str', optional): Modify message logging facilities, default value is None \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Configure object list, schema and transfer for bulkstat\n Args:\n device ('obj'): device to use\n type_('str'): object-list Configure an Object List\n schema Configure Schema definition\n transfer Configure Transfer Parameters\n object_name('str', optional): WORD Name of object list, default value is None\n schema_name('str', optional): WORD Name of the schema, default value is None\n transfer_name('str', optional): WORD Name of bulk transfer, default value is None\n oid_value_list:('list', optional): WORD Object name or OID list, default value is None\n poll_interval('int', optional): Periodicity for the polling of objects in this schema in\n Minutes. (Default value is 5 Mins), default value is None\n snmp_interface('str', optional): Specify instance as ifDescr, default value is None\n format_('str', optional): An ASCII format containing schema definitions, default value is None\n transfer_interval('int', optional): Periodicity for the transfer of bulk data in Minutes, default value is None\n buffer_size('int', optional): Bulkstat data file maximum size(Default size is 2048 bytes), default value is None\n primary_url('str', optional): WORD URL of primary destination, default value is None\n enable('str', optional): Start Data Collection for this Configuration, default value is None\n logging_on('str', optional): Modify message logging facilities, default value is None\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_object_list_schema_transfer_for_bulkstat", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L668" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L671" } }, "configure_ospf_area_type": { @@ -10149,6 +10347,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L709" } }, + "configure_ospfv3_interface": { + "iosxe": { + "doc": "Configure OSPFv3 settings on the specified interface.\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name (e.g., 'GigabitEthernet1/0/24')\n process_id (`int`): OSPFv3 Process ID (1-65535)\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "ospf.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_ospfv3_interface", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2741" + } + }, "configure_ospfv3_ipsec_ah": { "iosxe": { "doc": "\n configure ospfv3 ipsec authentication\n Args:\n device (`obj`): Device object\n pid (`str`): ospfv3 process id\n areaid ('str'): Area id to use\n spi('str'): Security Policy Index id to use\n method('str'): authentication alogrightm md5|sh1\n ah_key('str'): Authentication key\n ah_key_type('`str`, optional): Authentication key type,default value is None\n Return:\n None\n Raises:\n SubCommandFailure\n ", @@ -10194,6 +10401,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2537" } }, + "configure_ospfv3_network_type": { + "iosxe": { + "doc": "Configure OSPFv3 network type on the specified interface\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name (e.g., 'GigabitEthernet1/0/24')\n network_type (`str`): OSPFv3 network type ('point-to-point', 'broadcast', 'non-broadcast', 'point-to-multipoint')\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "ospf.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_ospfv3_network_type", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2717" + } + }, "configure_ospfv3_on_interface": { "iosxe": { "doc": "confue_ospfv3_on_interface\n Args:\n device (`obj`): Device object\n interface ('str'): interface details\n pid (`str`): Ospfv3 process id\n area (int): Area to configure under.\n\n Return:\n None\n\n Raises:\n SubCommandFailure\n ", @@ -10230,6 +10446,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L6" } }, + "configure_parameter_map": { + "iosxe": { + "doc": " Configuring paramter-map webauth <>\n Args:\n device (`obj`): Device object\n parameter_map_name ('str'): parameter-map name (max 99 char)\n enable_global('bool'): To enable global mode\n banner_file_name('str'): Specify name of the banner-file\n banner_text('str'): c banner-text c, where 'c' is a delimiting character (maximum 200 characters)\n banner_title('str'): c banner-title-text c, where 'c' is a delimiting character (maximum 127 characters)\n captive_bypass_portal('bool'): Turn on captive bypass\n cisco_logo_disable('bool'): Disable Cisco logo on internal html pages\n consent_email('bool'): Turn-on Consent with Email\n custom_page('bool'): custom-page - login, expired, success or failure page\n device_failure_file_name('str') : Specify name of the HTML file\n login_device_name('str'): Specify file on local storage media,Specify name of the HTML file\n login_expired_device_name('str'): Expired authentication proxy,Specify name of the HTML file\n custom_page_success_name('str'):Successful authentication proxy\n logout_window_disabled('bool'): Webauth logout window disable\n max_http_conns('int'): Maximum number of HTTP connections per client\n redirect_command('str'): Specify the redirect command \n sleeping_client_timeout('int'): Sleep Timeout in Minute (10-43200)\n success_window_disable('bool'): Disable Success Window\n timeout_seconds('int'):timeout for the webauth session in Seconds\n type_name('str'): type - web-auth, consent or both\n http_port('int'): Set Webauth http server port (81-65535)\n intercept_https_enable('bool'): Enable intercept of https traffic\n secure_webauth_disable('bool'): Disable HTTP secure server for Webauth\n trustpoint_name('str') : Specify the trustpoint name\n virtual_ipv4('str'): Virtual IPv4 Address\n virtual_ipv6('str'): Virtual IPv6 Address\n watch_add_ipv4('str'): Watch List of webauth clients, IPv4 Watch List Entry\n watch_add_ipv6('str'): Watch List of webauth clients, IPv6 Watch List Entry\n dynamic_expiry_timeout('int'):Webauth watch-list expiry timeout in seconds\n enabled_watch_list('bool'): Enable Watchlist\n webauth_bypass_intercept_name('str'): Specify the webauth bypass ACL name\n webauth_http_enable('bool') : Enable HTTP server for Webauth\n\n Returns:\n None \n Raises: \n SubCommandFailure\n ", + "module_name": "dot1x.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_parameter_map", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L2214" + } + }, "configure_parameter_map_subscriber": { "iosxe": { "doc": "Configure parameter map subscriber\n Args:\n device ('obj'): device to use\n parameter_map_name (`str`): Parameter Map name to be configured\n map_num ('int'): Map number to be configured\n filter_type ('str'): Filter type to be configured\n parameter_type ('str'): parameter type to be configured\n parameter_name ('str'): Parameter name to be configured\n action_num ('int'): Action number to be configure\n template_type ('str'): Template type to be configured\n template_name ('str'): Template name to be configured\n\n Returns:\n None\n\n Raises:\n SubCommandFailure: Failed to configure parameter map subscriber\n ", @@ -10248,6 +10473,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pbr/configure.py#L85" } }, + "configure_periodic_time_range": { + "iosxe": { + "doc": "Configure periodic time range\n Args:\n device ('obj'): device object\n time_range_name ('str'): time range name\n periodicity ('str'): The periodicity for the time range ex: daily, weekdays, weekend, friday, monday\n start_time ('str') : The start time in the format HH:MM\n end_time ('str') : The end time in the format HH:MM\n Return:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_periodic_time_range", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4957" + } + }, "configure_pfs_enable_or_disable_under_gkm_group": { "iosxe": { "doc": " Configures Crypto Gdoi Gkm group\n Args:\n device ('obj'): Device object\n group_name ('str'): gkm group name\n server_local ('bool', optional): Configure server local. Default is False\n pfs ('str', optional): Enable/Disable the PFS feature on Key Server\n Returns: None \n Raises:\n SubCommandFailure\n ", @@ -10290,7 +10524,7 @@ "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "uid": "configure_pki_authenticate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L618" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L624" } }, "configure_pki_authenticate_certificate": { @@ -10308,7 +10542,7 @@ "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "uid": "configure_pki_enroll", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L548" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L554" } }, "configure_pki_enroll_certificate": { @@ -10326,7 +10560,7 @@ "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "uid": "configure_pki_export", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L778" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L784" } }, "configure_pki_export_pem": { @@ -10344,7 +10578,7 @@ "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "uid": "configure_pki_import", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L656" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L662" } }, "configure_pki_trustpoint": { @@ -10414,7 +10648,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "configure_policy_map_class_parameters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L674" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L701" } }, "configure_policy_map_class_precedence": { @@ -10423,7 +10657,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "configure_policy_map_class_precedence", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L910" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L937" } }, "configure_policy_map_control": { @@ -10441,7 +10675,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "configure_policy_map_on_device", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L539" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L566" } }, "configure_policy_map_type_service": { @@ -10450,7 +10684,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "configure_policy_map_type_service", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L274" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L301" } }, "configure_policy_map_with_dscp_police": { @@ -10459,7 +10693,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "configure_policy_map_with_dscp_police", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L467" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L494" } }, "configure_policy_map_with_dscp_table": { @@ -10468,7 +10702,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "configure_policy_map_with_dscp_table", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L414" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L441" } }, "configure_policy_map_with_no_set_dscp": { @@ -10477,7 +10711,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "configure_policy_map_with_no_set_dscp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L440" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L467" } }, "configure_policy_map_with_percent": { @@ -10486,7 +10720,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "configure_policy_map_with_percent", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L342" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L369" } }, "configure_policy_map_with_pps": { @@ -10495,7 +10729,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "configure_policy_map_with_pps", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L319" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L346" } }, "configure_port_channel_lacp_max_bundle": { @@ -10981,7 +11215,7 @@ "module_name": "vrf.configure", "package": "genie.libs.sdk.apis", "uid": "configure_rd_address_family_vrf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L1005" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L1010" } }, "configure_redestribute_ospf_metric_in_bgp": { @@ -11011,6 +11245,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/gkm/configure.py#L104" } }, + "configure_rep_admin_vlan": { + "iosxe": { + "doc": " configure rep admin vlan\n Args:\n device ('obj'): device to use\n segment ('str') : configure segment <1-1024> Between 1 and 1024\n vlanId ('str') : configure vlan ID\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_rep_admin_vlan", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4772" + } + }, "configure_replace": { "iosxe": { "doc": " Restore config from local file\n Args:\n device ('obj'): Device object\n path ('str'): directory\n file ('str'): file name\n config_replace_options ('str'): configure replace command suboption\n ex:)\n force Forcibly replace without prompting for user input\n ignorecase Ignore case\n list List the commands applied in each pass\n nolock Do not acquire config lock\n revert Options for reverting back to the original config\n time Time for which to wait for confirmation\n time ('int', optional): config_replace_options selected as time (default is 1 second)\n timeout ('int'): Timeout for applying config (default is 30 second)\n \n Returns:\n execution output\n Raises:\n SubCommandFailure\n ", @@ -11407,6 +11650,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/call_home/configure.py#L673" } }, + "configure_service_compress_config": { + "iosxe": { + "doc": " service compress-config\n Args:\n device ('obj'): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_service_compress_config", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4565" + } + }, "configure_service_dhcp": { "iosxe": { "doc": " Configure DHCP pool\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to configure service dhcp\n ", @@ -11467,7 +11719,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "configure_service_policy_with_queueing_name", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L515" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L542" } }, "configure_service_private_config_encryption": { @@ -11665,7 +11917,7 @@ "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_snmp_host_version", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L389" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L392" } }, "configure_snmp_if_index_on_ospfv3_process_id": { @@ -11686,6 +11938,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L851" } }, + "configure_snmp_mib_bulkstat_transfer": { + "iosxe": { + "doc": " configure snmp mib bulkstat transfer\n Args:\n device ('obj'): Device object\n transfer_name ('str'): Name of bulk transfer\n\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_snmp_mib_bulkstat_transfer", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4520" + } + }, "configure_snmp_server_contact": { "iosxe": { "doc": " Configures contact for snmp-server\n Example : snmp-server contact Testname\n\n Args:\n device ('obj'): device to use\n name ('str'): identification of the contact person\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", @@ -11697,11 +11958,11 @@ }, "configure_snmp_server_enable_traps_power_ethernet_group": { "iosxe": { - "doc": " Configure snmp-server enable traps power-ethernet group\n Args:\n device ('obj'): Device object\n number ('str'): The group number \n ip ('str') : ip address\n snmp_v ('str'): snmpv1/v2c community string or snmpv3 user name\n name ('str'): snmp community string\n rw ('str'): read-write/read-only\n\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Configure snmp-server enable traps power-ethernet group\n Args:\n device ('obj'): Device object\n number ('str'): The group number\n ip ('str') : ip address\n snmp_v ('str'): snmpv1/v2c community string or snmpv3 user name\n name ('str'): snmp community string\n rw ('str'): read-write/read-only\n\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_snmp_server_enable_traps_power_ethernet_group", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L478" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L481" } }, "configure_snmp_server_group": { @@ -11719,7 +11980,7 @@ "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_snmp_server_host_trap", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L624" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L627" } }, "configure_snmp_server_location": { @@ -11760,7 +12021,7 @@ }, "configure_snmp_server_view": { "iosxe": { - "doc": " Configures the snmp server view on device\n Args:\n device ('obj'): device to use\n mib_view ('str'): Name of the view\n family_name ('str'): MIB view family name\n state ('str'): mib family excluded|included \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Configures the snmp server view on device\n Args:\n device ('obj'): device to use\n mib_view ('str'): Name of the view\n family_name ('str'): MIB view family name\n state ('str'): mib family excluded|included\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_snmp_server_view", @@ -11785,6 +12046,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L1648" } }, + "configure_source_tracking_on_interface": { + "iosxe": { + "doc": "Configure source tracking on interface\n Args:\n device (`obj`): Device object\n interface ('str'): interface name\n value ('str'): provide the values details\n Return:\n None\n Raise:\n SubCommandFailure\n ", + "module_name": "device_tracking.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_source_tracking_on_interface", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/device_tracking/configure.py#L121" + } + }, "configure_span_monitor_session": { "iosxe": { "doc": " Configure span monitor session\n Args:\n device ('obj'): Device object\n session_number ('int'): session number\n source_int ('str') : source interface name\n source_option ('str'): name of the source option\n destination_int ('str'): name of the destination interface\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -11839,6 +12109,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py#L563" } }, + "configure_spanning_tree_etherchannel_misconfig": { + "iosxe": { + "doc": "configures spanning tree etherchannel misconfig\n Args:\n device ('obj') : Device object\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to configure spanning tree etherchannel misconfig\n ", + "module_name": "spanning_tree.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_spanning_tree_etherchannel_misconfig", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py#L803" + } + }, "configure_spanning_tree_guard_loop": { "iosxe": { "doc": " Enable spanning-tree guard loop over interface \n Args:\n device ('obj'): device to use\n interface ('str'): enable spanning-tree guard loop on this interface\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -12142,7 +12421,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_static_nat_network_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L605" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L609" } }, "configure_static_nat_outside_rule": { @@ -12151,7 +12430,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_static_nat_outside_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L738" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L742" } }, "configure_static_nat_route_map_no_alias_rule": { @@ -12160,7 +12439,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_static_nat_route_map_no_alias_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1860" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1867" } }, "configure_static_nat_route_map_rule": { @@ -12178,7 +12457,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_static_nat_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L655" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L659" } }, "configure_static_nat_source_list_rule": { @@ -12187,7 +12466,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "configure_static_nat_source_list_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1930" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1937" } }, "configure_subinterface": { @@ -12379,13 +12658,22 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L4568" } }, + "configure_switchport_trunk_pruning_vlan": { + "iosxe": { + "doc": " Configure switchport trunk pruning vlan\n Args:\n device ('obj'): device to use\n interface ('str'): interface name\n pruning_vlan ('str'): pruning vlan\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "vlan.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_switchport_trunk_pruning_vlan", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1148" + } + }, "configure_switchport_trunk_pruning_vlan_except": { "iosxe": { "doc": "Configure switchport trunk pruning vlan except\n Example: interface gigabitEthernet2/0/1\n switchport trunk pruning vlan except 1,9,1002-1005\n Args:\n device ('obj'): device to use\n interface ('str') : interface to add configs\n string ('str'): WORD VLAN IDs of disallowed VLANS when this port is in trunking mode\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "configure_switchport_trunk_pruning_vlan_except", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L917" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L969" } }, "configure_switchport_trunk_vlan": { @@ -12466,7 +12754,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "configure_table_map_on_device", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L882" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L909" } }, "configure_table_map_values": { @@ -12475,7 +12763,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "configure_table_map_values", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L391" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L418" } }, "configure_tacacs_group": { @@ -12611,7 +12899,7 @@ }, "configure_thousand_eyes_application": { "iosxe": { - "doc": "\n Configure Thousand Eye Application \n Args:\n device ('obj'): Device object\n vlan_id ('str'): Vlan information App installation \n app_ip ('str'): Public IP for Thousand Eye Application \n app_gateway_ip ('str'): gateway IP for Application\n app_netmask ('str'): Subnet mask for the Public IP used to configure Thousand Eye application \n thousand_eye_token ('str'): Thousand Eye Application Token\n app_proxy ('str'): Proxy details for application \n app_dns ('str'): Domain name server Ip address \n Returns:\n None\n Raises:\n SubCommandFailure\n \n ", + "doc": "\n Configure Thousand Eye Application\n Args:\n device ('obj'): Device object\n vlan_id ('str'): Vlan information App installation\n app_ip ('str'): Public IP for Thousand Eye Application\n app_gateway_ip ('str'): gateway IP for Application\n app_netmask ('str'): Subnet mask for the Public IP used to configure Thousand Eye application\n thousand_eye_token ('str'): Thousand Eye Application Token\n app_proxy ('str'): Proxy details for application\n app_dns ('str'): Domain name server Ip address\n Returns:\n None\n Raises:\n SubCommandFailure\n\n ", "module_name": "apphosting.configure", "package": "genie.libs.sdk.apis", "uid": "configure_thousand_eyes_application", @@ -12633,7 +12921,7 @@ "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "uid": "configure_trustpoint", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L216" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L222" } }, "configure_tunnel_auto_route": { @@ -12858,7 +13146,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "configure_vlan_group_list", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L959" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1011" } }, "configure_vlan_name": { @@ -12867,7 +13155,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "configure_vlan_name", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1009" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1061" } }, "configure_vlan_shutdown": { @@ -12975,7 +13263,7 @@ "module_name": "vrf.configure", "package": "genie.libs.sdk.apis", "uid": "configure_vrf_forwarding_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L816" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L821" } }, "configure_vrf_ipv6_eigrp_named_networks": { @@ -13068,13 +13356,22 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L882" } }, + "configure_vtp_pruning": { + "iosxe": { + "doc": " Configure vtp pruning\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "vlan.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_vtp_pruning", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1118" + } + }, "configure_vtp_trunk_interface": { "iosxe": { "doc": " Configures global VTP trunk interface\n Example: vtp trunk gig2/0/2\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": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "configure_vtp_trunk_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L940" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L992" } }, "configure_vtp_version": { @@ -13146,7 +13443,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "copy_file", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1644" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1648" } }, "copy_file_from_tftp_ftp": { @@ -13174,6 +13471,24 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/running_config/configure.py#L45" } }, + "copy_file_with_scp": { + "iosxe": { + "doc": " Copy files to sftp location\n\n Args:\n device ('obj'): Device object to modify configuration\n host ('str'): scp host ip address\n file('str'): file name\n username ('str',optional): sftp host VM username\n password ('str',optional): sftp host vm password\n path('str',optional): storage file path in the VM\n ex:)\n copy file scp://username:password@host/\n timeout('int', Optional): timeout in seconds for configuration file load to device(Default is 30 seconds)\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "copy_file_with_scp", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4883" + } + }, + "copy_file_with_sftp": { + "iosxe": { + "doc": " Copy files to sftp location\n\n Args:\n device ('obj'): Device object to modify configuration\n host ('str'): sftp host ip address\n file('str'): file name\n username ('str',optional): sftp host VM username\n password ('str',optional): sftp host vm password\n path('str',optional): storage file path in the VM\n ex:)\n copy file sftp://username:password@host/\n timeout('int', Optional): timeout in seconds for configuration file load to device(Default is 30 seconds)\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "copy_file_with_sftp", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4808" + } + }, "copy_from_device": { "apic": { "doc": "\n Copy a file from the device to the server or local system (where the script is running).\n Local system copy uses HTTP and is only supported via SSH sessions.\n\n Args:\n device (Device): device object\n local_path (str): local path from the device (path including filename)\n remote_path (str): Path on the server (default: .)\n server (str): Server to copy file to (optional)\n protocol (str): Protocol to use to copy (default: http)\n vrf (str): VRF to use for copying (default: None)\n timeout('int'): timeout value in seconds, default 300\n timestamp (bool): include timestamp in filename (default: False)\n http_auth (bool): Use http authentication (default: True)\n\n Returns:\n (boolean): True if successful, False if not\n\n If the server is not specified, below logic applies.\n\n If no filename is specified, the filename will be based on the device hostname\n and slugified name of the file determined from the local_path.\n\n The local IP adddress will be determined from the spawned telnet or ssh session.\n A temporary http server will be created and the show tech file will be sent\n to the host where the script is running.\n\n If the device is connected via proxy (unix jump host) and the proxy has\n 'socat' installed, the upload will be done via the proxy automatically.\n\n Note: if the file already exists, it will be overwritten.\n ", @@ -13336,7 +13651,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "create_dir_file_system", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L846" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L845" } }, "create_ip_vrf": { @@ -13381,7 +13696,7 @@ "module_name": "eaptls.configure", "package": "genie.libs.sdk.apis", "uid": "crypto_pki_import", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L409" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L414" } }, "crypto_pki_server_request": { @@ -13390,7 +13705,7 @@ "module_name": "eaptls.configure", "package": "genie.libs.sdk.apis", "uid": "crypto_pki_server_request", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L324" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L329" } }, "cts_refresh_environment_data": { @@ -13471,7 +13786,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "decrypt_tacacs_pcap", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L847" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L851" } }, "default_interface": { @@ -13514,7 +13829,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "delete_directory", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1912" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1916" } }, "delete_file_on_device": { @@ -13623,7 +13938,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "delete_unprotected_files", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L305" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L304" }, "nxos": { "doc": " Delete all files not matching regex in the protected list\n Args:\n device ('obj'): Device object\n directory ('str'): working directory to perform the operation\n protected ('list'): list of file patterns that won't be deleted. If it begins\n and ends with (), it will be considered as a regex\n files_to_delete('list') list of files that should be deleted unless they are not protected\n dir_output ('str'): output of dir command, if not provided execute the cmd on device to get the output\n allow_failure (bool, optional): Allow the deletion of a file to silently fail. Defaults to False.\n destination ('str') : Destination directory. default to None. i.e bootflash:/\n Returns:\n None\n ", @@ -13945,12 +14260,12 @@ "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "disable_ietf_standard_snmp_link_traps", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L608" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L611" } }, "disable_iox": { "iosxe": { - "doc": " \n Configure no iox \n Args:\n device ('obj') : Device object\n Returns:\n None\n ", + "doc": "\n Configure no iox\n Args:\n device ('obj') : Device object\n Returns:\n None\n ", "module_name": "apphosting.configure", "package": "genie.libs.sdk.apis", "uid": "disable_iox", @@ -14058,7 +14373,7 @@ }, "disable_usb_ssd": { "iosxe": { - "doc": " \n Configure - platform usb disable\n Disables connected SSDs on c9300\n Args:\n device ('obj') : Device object\n timeout ('int'): timeout arg for Unicon configure for this CLI\n Returns:\n None\n ", + "doc": "\n Configure - platform usb disable\n Disables connected SSDs on c9300\n Args:\n device ('obj') : Device object\n timeout ('int'): timeout arg for Unicon configure for this CLI\n Returns:\n None\n ", "module_name": "apphosting.configure", "package": "genie.libs.sdk.apis", "uid": "disable_usb_ssd", @@ -14327,12 +14642,12 @@ "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "enable_ietf_standard_snmp_link_traps", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L591" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L594" } }, "enable_iox": { "iosxe": { - "doc": " \n Configure iox \n Args:\n device ('obj') : Device object\n Returns:\n None\n ", + "doc": "\n Configure iox\n Args:\n device ('obj') : Device object\n Returns:\n None\n ", "module_name": "apphosting.configure", "package": "genie.libs.sdk.apis", "uid": "enable_iox", @@ -14512,7 +14827,7 @@ }, "enable_usb_ssd": { "iosxe": { - "doc": " \n Configure - no platform usb disable\n Enables connected SSDs on c9300\n Args:\n device ('obj') : Device object\n timeout ('int'): timeout arg for Unicon configure for this CLI\n Returns:\n None\n ", + "doc": "\n Configure - no platform usb disable\n Enables connected SSDs on c9300\n Args:\n device ('obj') : Device object\n timeout ('int'): timeout arg for Unicon configure for this CLI\n Returns:\n None\n ", "module_name": "apphosting.configure", "package": "genie.libs.sdk.apis", "uid": "enable_usb_ssd", @@ -14521,7 +14836,7 @@ }, "enable_usb_ssd_verify_exists": { "iosxe": { - "doc": " configure app-hosting appid\n Args:\n device ('obj'): device to use\n storage_name('str'): storage name eg:flash or bootflash\n time('int'): time\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " configure app-hosting appid\n Args:\n device ('obj'): device to use\n storage_name('str'): storage name eg:flash or bootflash\n timeout('int'): time\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "apphosting.configure", "package": "genie.libs.sdk.apis", "uid": "enable_usb_ssd_verify_exists", @@ -14615,16 +14930,16 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_archive_config", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1177" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1176" } }, "execute_archive_tar": { "iosxe": { - "doc": " Execute archive tar \n Example: archive tar /create usb0:usb_files.tar bootflash:/tracelogs\n archive tar /xtract usb0:usb_files.tar usb0:new-tar-files\n Args:\n device ('obj'): Device object\n dest_filesystem ('str'): specifying filesystems such as bootflash:,usb:, tftp:\n tar_filename('str'): tar filename \n operation_type('str'): Option can be xtract, table, create\n src_filesystem ('str'): specifying filesystems such as bootflash:,usb:, tftp:\n src_filepath ('str',optional): specifying files path which need to be archived,Default is None\n dest_filepath ('str',optional): specifying destination path of tar file,Default is None\n timeout ('int',optional): Max time for completion of cli execution,Default is 120 seconds\n Returns:\n output\n Raises:\n SubCommandFailure\n ", + "doc": " Execute archive tar\n Example: archive tar /create usb0:usb_files.tar bootflash:/tracelogs\n archive tar /xtract usb0:usb_files.tar usb0:new-tar-files\n Args:\n device ('obj'): Device object\n dest_filesystem ('str'): specifying filesystems such as bootflash:,usb:, tftp:\n tar_filename('str'): tar filename\n operation_type('str'): Option can be xtract, table, create\n src_filesystem ('str'): specifying filesystems such as bootflash:,usb:, tftp:\n src_filepath ('str',optional): specifying files path which need to be archived,Default is None\n dest_filepath ('str',optional): specifying destination path of tar file,Default is None\n timeout ('int',optional): Max time for completion of cli execution,Default is 120 seconds\n Returns:\n output\n Raises:\n SubCommandFailure\n ", "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_archive_tar", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1459" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1458" } }, "execute_by_jinja2": { @@ -14649,7 +14964,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_card_OIR", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L389" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L388" } }, "execute_card_OIR_insert": { @@ -14658,7 +14973,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_card_OIR_insert", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L466" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L465" } }, "execute_card_OIR_remove": { @@ -14667,7 +14982,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_card_OIR_remove", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L427" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L426" } }, "execute_change_boot_variable": { @@ -14741,7 +15056,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_install_label", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L607" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L611" } }, "execute_clear_install_state": { @@ -14750,16 +15065,16 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_install_state", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L533" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L537" } }, "execute_clear_ip_igmp_group": { "iosxe": { - "doc": " clear ipv6 mld group\n Args:\n device (`obj`) : Device object\n interface('str',optional): Interface name \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " clear ipv6 mld group\n Args:\n device (`obj`) : Device object\n interface('str',optional): Interface name\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_ip_igmp_group", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1597" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1596" } }, "execute_clear_ip_nat_translation": { @@ -14777,16 +15092,16 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_ipdhcp_snooping_database_statistics", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L623" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L622" } }, "execute_clear_ipv6_mld_group": { "iosxe": { - "doc": " clear ipv6 mld group\n Args:\n device (`obj`) : Device object\n interface('str',optional): Interface name \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " clear ipv6 mld group\n Args:\n device (`obj`) : Device object\n interface('str',optional): Interface name\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_ipv6_mld_group", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1574" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1573" } }, "execute_clear_line": { @@ -14894,7 +15209,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_parser_statistics", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L789" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L788" } }, "execute_clear_platform_hardware_fed_active_qos_statistics_interface": { @@ -14903,7 +15218,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_platform_hardware_fed_active_qos_statistics_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L691" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L690" } }, "execute_clear_platform_software_fed_active_acl_counters_hardware": { @@ -14912,7 +15227,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_platform_software_fed_active_acl_counters_hardware", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L504" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L503" } }, "execute_clear_platform_software_fed_active_cpu_interface": { @@ -14921,7 +15236,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_platform_software_fed_active_cpu_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L676" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L675" } }, "execute_clear_platform_software_fed_switch_acl_counters_hardware": { @@ -14930,7 +15245,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_platform_software_fed_switch_acl_counters_hardware", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L519" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L518" } }, "execute_clear_platform_software_fed_switch_active_cpu_interface": { @@ -14939,7 +15254,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_platform_software_fed_switch_active_cpu_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L592" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L591" } }, "execute_clear_platform_software_fed_switch_mode_acl_stats": { @@ -14948,7 +15263,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_platform_software_fed_switch_mode_acl_stats", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L607" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L606" } }, "execute_clear_platform_software_product_analytics_report": { @@ -14966,7 +15281,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_redundancy_history", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1323" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1322" } }, "execute_config_confirm": { @@ -14975,7 +15290,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_config_confirm", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1138" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1137" } }, "execute_copy_run_to_start": { @@ -15011,7 +15326,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_create_rollback_description", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L507" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L511" } }, "execute_create_rollback_label": { @@ -15020,7 +15335,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_create_rollback_label", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L481" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L485" } }, "execute_deactivate_pie": { @@ -15054,7 +15369,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_delete_boot_variable", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L27" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L26" }, "nxos": { "mds": { @@ -15109,7 +15424,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_device_dir_path", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1156" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1155" } }, "execute_diagnostic_start_module_test": { @@ -15118,7 +15433,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_diagnostic_start_module_test", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L731" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L730" } }, "execute_diagnostic_start_switch_module_test": { @@ -15127,7 +15442,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_diagnostic_start_switch_module_test", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L708" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L707" } }, "execute_diagnostic_start_switch_test": { @@ -15136,7 +15451,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_diagnostic_start_switch_test", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1086" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1085" } }, "execute_dir_file_system": { @@ -15145,7 +15460,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_dir_file_system", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1433" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1432" } }, "execute_erase_ap": { @@ -15163,7 +15478,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_format", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L804" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L803" } }, "execute_guestshell_enable": { @@ -15181,7 +15496,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_abort", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L661" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L665" } }, "execute_install_activate": { @@ -15190,7 +15505,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_activate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L72" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L76" } }, "execute_install_add": { @@ -15199,7 +15514,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_add", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L331" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L335" } }, "execute_install_application_bootflash": { @@ -15217,7 +15532,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_auto_abort_timer_stop", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L583" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L587" } }, "execute_install_commit": { @@ -15226,7 +15541,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_commit", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L432" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L436" } }, "execute_install_controller_group_firmware": { @@ -15244,7 +15559,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_deactivate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L725" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L729" } }, "execute_install_label": { @@ -15253,7 +15568,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_label", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1113" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1112" } }, "execute_install_one_shot": { @@ -15262,7 +15577,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_one_shot", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L256" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L260" } }, "execute_install_package": { @@ -15271,7 +15586,16 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_package", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L177" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L176" + } + }, + "execute_install_package_reload_fast": { + "iosxe": { + "doc": "\n Install package reloadfast\n Args:\n device (\"obj\"): Device object\n image_dir (\"str\"): Directory where the image is located\n image (\"str\"): Image filename\n reload_fast (\"bool\"): Whether to use reloadfast. Default is True.\n timeout (\"int\", optional): Timeout value. Default is 1600 seconds.\n connect_timeout (\"int\", optional): Time to wait before sending the prompt\n (when pattern \"Press RETURN to get started\" matches)\n Returns:\n True if install succeeded else False\n Raises:\n SubCommandFailure\n ", + "module_name": "install.execute", + "package": "genie.libs.sdk.apis", + "uid": "execute_install_package_reload_fast", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L914" } }, "execute_install_pie": { @@ -15289,7 +15613,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_remove", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L190" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L194" } }, "execute_install_remove_version": { @@ -15298,7 +15622,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_remove_version", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L11" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L15" } }, "execute_install_rollback": { @@ -15307,7 +15631,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_rollback", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L819" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L823" } }, "execute_install_switch_group_firmware": { @@ -15325,7 +15649,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_three_step_issu_package", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L986" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L985" } }, "execute_issu_install_package": { @@ -15334,7 +15658,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_issu_install_package", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L534" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L533" } }, "execute_license_smart_save_usage_all_file": { @@ -15382,6 +15706,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform_licensing/execute.py#L151" } }, + "execute_more_file": { + "iosxe": { + "doc": " Executes more file | inc \n Example : more bootflash:test.txt | inc ucode\n Args:\n device ('obj'): device to use\n filepath ('str'): path to the file, including the filename (eg. bootflash:test.txt)\n regex ('str',optional): regular expression for the inc (eg. ucode)\n Returns:\n output\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.execute", + "package": "genie.libs.sdk.apis", + "uid": "execute_more_file", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1617" + } + }, "execute_more_file_count": { "iosxe": { "doc": " Executes more file | count \n Example : more bootflash:test.txt | count Ready\n Args:\n device ('obj'): device to use\n filepath ('str'): path to the file, including the filename (eg. bootflash:test.txt)\n regex ('str'): regular expression for the count (eg. Ready)\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -15400,6 +15733,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/execute.py#L31" } }, + "execute_platform_virtualization": { + "iosxe": { + "doc": " Executes set platform hardware rom-monitor virtualization \n Example : set platform hardware rom-monitor virtualization rp active\n Args:\n device ('obj'): device to use\n slot_type ('str'): slot type options F0,F1,FP,R0,R1,RP\n slot_status ('str', optional): options can be active,standby. Applicable only for slot types RP and FP.\n Returns:\n output\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.execute", + "package": "genie.libs.sdk.apis", + "uid": "execute_platform_virtualization", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1642" + } + }, "execute_power_cycle_device": { "com": { "doc": " Powercycle a device\n\n Args:\n device ('obj'): Device object\n\n delay (int, optional): Time in seconds to sleep between turning the\n device off and then back on. Defaults to 30.\n\n Raises:\n Exception if powercycling fails.\n\n Returns:\n None\n ", @@ -15469,7 +15811,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_reload_fast", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1370" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1369" } }, "execute_remove_inactive_pies": { @@ -15487,7 +15829,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_request_platform_software_package_install_switch_rollback_auto_copy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1274" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1273" } }, "execute_self_signed_certificate_command": { @@ -15514,7 +15856,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_set_boot_variable", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L53" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L52" } }, "execute_set_config_register": { @@ -15530,7 +15872,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_set_config_register", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L71" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L70" }, "iosxr": { "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 Default 60 seconds (Optional)\n ", @@ -15573,7 +15915,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_set_platform_hardware_fed_qos", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1340" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1339" } }, "execute_show_license_boot_level_config": { @@ -15609,7 +15951,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_stack_power", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1064" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1063" } }, "execute_switch_card_OIR": { @@ -15618,7 +15960,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_switch_card_OIR", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L640" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L639" } }, "execute_switch_card_OIR_power_force": { @@ -15627,7 +15969,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_switch_card_OIR_power_force", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1523" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1522" } }, "execute_switch_clear_stack_mode": { @@ -15636,7 +15978,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_switch_clear_stack_mode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1194" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1193" } }, "execute_switch_priority": { @@ -15663,7 +16005,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_switch_role", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1223" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1222" } }, "execute_test_crash": { @@ -15789,7 +16131,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_uninstall_package", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L278" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L277" } }, "execute_vtp_primary": { @@ -15814,7 +16156,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_write_erase", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L126" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L125" }, "nxos": { "doc": " Execute write erase on the device\n Args:\n device ('obj'): Device object\n ", @@ -15846,7 +16188,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_write_memory", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L148" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L147" } }, "export_packet_capture": { @@ -15887,7 +16229,16 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "force_unconfigure_static_nat_route_map_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1088" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1095" + } + }, + "format_directory": { + "iosxe": { + "doc": " format directory\n Args:\n device ('obj'): Device object\n directory('str'): Directory name ex:crashinfo: \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "utils", + "package": "genie.libs.sdk.apis", + "uid": "format_directory", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1941" } }, "fp_switchover": { @@ -15975,7 +16326,7 @@ "module_name": "routing.get", "package": "genie.libs.sdk.apis", "uid": "get_RIPng_routes", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L764" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L782" } }, "get_aaa_member": { @@ -17345,7 +17696,7 @@ "module_name": "eaptls.configure", "package": "genie.libs.sdk.apis", "uid": "get_grant_certificate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L386" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L391" } }, "get_grant_id_pki_server": { @@ -17354,7 +17705,7 @@ "module_name": "eaptls.configure", "package": "genie.libs.sdk.apis", "uid": "get_grant_id_pki_server", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L367" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L372" } }, "get_hardware_all_fans_speed": { @@ -18174,7 +18525,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_ip_packet_scapy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1372" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1376" } }, "get_ip_prefer_mode": { @@ -18201,7 +18552,7 @@ "module_name": "routing.get", "package": "genie.libs.sdk.apis", "uid": "get_ipv6_connected_routes", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L692" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L710" } }, "get_ipv6_interface_ip_address": { @@ -18233,7 +18584,7 @@ "module_name": "routing.get", "package": "genie.libs.sdk.apis", "uid": "get_ipv6_interface_ip_and_mask", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L814" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L832" } }, "get_ipv6_interface_link_local_address": { @@ -18251,7 +18602,7 @@ "module_name": "routing.get", "package": "genie.libs.sdk.apis", "uid": "get_ipv6_intf_autocfg_address", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L738" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L756" } }, "get_ipv6_intf_tentative_address": { @@ -18260,7 +18611,7 @@ "module_name": "routing.get", "package": "genie.libs.sdk.apis", "uid": "get_ipv6_intf_tentative_address", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L635" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L653" } }, "get_ipv6_intf_valid_ip_addresses": { @@ -18269,7 +18620,7 @@ "module_name": "routing.get", "package": "genie.libs.sdk.apis", "uid": "get_ipv6_intf_valid_ip_addresses", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L568" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L586" } }, "get_ipv6_linklocal_addr_from_ipv4": { @@ -18278,7 +18629,7 @@ "module_name": "routing.get", "package": "genie.libs.sdk.apis", "uid": "get_ipv6_linklocal_addr_from_ipv4", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L591" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L609" } }, "get_ipv6_local_routes": { @@ -18287,7 +18638,7 @@ "module_name": "routing.get", "package": "genie.libs.sdk.apis", "uid": "get_ipv6_local_routes", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L669" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L687" } }, "get_ipv6_nd_raguard_policy_configurations": { @@ -18314,7 +18665,7 @@ "module_name": "routing.get", "package": "genie.libs.sdk.apis", "uid": "get_ipv6_routes", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L548" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L566" } }, "get_ipv6_source_guard_policy_configurations": { @@ -18332,7 +18683,7 @@ "module_name": "routing.get", "package": "genie.libs.sdk.apis", "uid": "get_ipv6_static_routes", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L715" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L733" } }, "get_isis_interface_metric": { @@ -18675,21 +19026,21 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_mgmt_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L702" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L706" }, "iosxr": { "doc": " Get the name of the management interface.\n\n if the mgmt_ip is provided, will use that for the lookup. If not, will\n call the get_mgmt_ip API to get the IP.\n\n Args:\n mgmt_ip: (str) IP address of the management interface (optional)\n\n Returns:\n String with interface name\n ", "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_mgmt_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/utils.py#L344" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/utils.py#L343" }, "nxos": { "doc": " Get the management interface name.\n ", "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_mgmt_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/utils.py#L273" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/utils.py#L268" } }, "get_mgmt_ip": { @@ -18718,20 +19069,20 @@ }, "iosxr": { "c8000": { - "doc": " Get the management IP address and management source addresses.\n \n if the mgmt_src_ip is provided, will use that for the lookup. If not, will\n select the 1st matching IP.\n Args:\n mgmt_src_ip: (str) local IP address (optional)\n Returns:\n Tuple of mgmt_ip and list of IP address (mgmt_ip, [mgmt_src_addrs]) or None\n ", + "doc": " Get the management IP address and management source addresses.\n\n if the mgmt_src_ip is provided, will use that for the lookup. If not, will\n select the 1st matching IP.\n Args:\n mgmt_src_ip: (str) local IP address (optional)\n Returns:\n Tuple of mgmt_ip and list of IP address (mgmt_ip, [mgmt_src_addrs]) or None\n ", "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_mgmt_ip_and_mgmt_src_ip_addresses", "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/c8000/utils.py#L25" }, - "doc": " Get the management IP address and management source addresses.\n \n if the mgmt_src_ip is provided, will use that for the lookup. If not, will\n select the 1st matching IP.\n Args:\n mgmt_src_ip: (str) local IP address (optional)\n Returns:\n Tuple of mgmt_ip and list of IP address (mgmt_ip, [mgmt_src_addrs]) or None\n ", + "doc": " Get the management IP address and management source addresses.\n\n if the mgmt_src_ip is provided, will use that for the lookup. If not, will\n select the 1st matching IP.\n Args:\n mgmt_src_ip: (str) local IP address (optional)\n Returns:\n Tuple of mgmt_ip and list of IP address (mgmt_ip, [mgmt_src_addrs]) or None\n ", "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_mgmt_ip_and_mgmt_src_ip_addresses", "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/utils.py#L305" }, "nxos": { - "doc": " Get the management IP and source IP addresses connected via SSH to the device.\n \n if the mgmt_src_ip is provided, will use that for the lookup. If not, will\n select the 1st matching IP.\n Args:\n mgmt_src_ip: (str) local IP address (optional)\n Returns:\n List of IP addresses or []\n ", + "doc": " Get the management IP and source IP addresses connected via SSH to the device.\n\n if the mgmt_src_ip is provided, will use that for the lookup. If not, will\n select the 1st matching IP.\n Args:\n mgmt_src_ip: (str) local IP address (optional)\n Returns:\n List of IP addresses or []\n ", "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_mgmt_ip_and_mgmt_src_ip_addresses", @@ -19384,7 +19735,7 @@ "module_name": "routing.get", "package": "genie.libs.sdk.apis", "uid": "get_outgoing_interface_with_vrf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L517" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L528" } }, "get_packet_attributes_scapy": { @@ -19393,7 +19744,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_packet_attributes_scapy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1307" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1311" } }, "get_packet_info_field": { @@ -19402,7 +19753,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_packet_info_field", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1360" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1364" } }, "get_packet_ip_tos_field": { @@ -19411,7 +19762,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_packet_ip_tos_field", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1389" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1393" } }, "get_peer_bgp_address": { @@ -19846,7 +20197,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_radius_packets", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1284" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1288" } }, "get_redundancy_operational_state": { @@ -19911,7 +20262,7 @@ "module_name": "routing.get", "package": "genie.libs.sdk.apis", "uid": "get_route_metric", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L787" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py#L805" } }, "get_route_mpls_labels": { @@ -20549,7 +20900,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_show_output_exclude", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L821" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L825" } }, "get_show_output_include": { @@ -20558,7 +20909,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_show_output_include", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L795" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L799" } }, "get_show_output_line_count": { @@ -20567,7 +20918,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_show_output_line_count", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L721" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L725" }, "junos": { "doc": " Count number of line from show command output\n\n Args:\n device (`obj`): Device object\n command (`str`): show command\n output (`str`): output of show command. Default to None\n \n Returns:\n line_count (`int`): number of lines based on show command output\n \n Raises:\n N/A\n ", @@ -20583,7 +20934,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_show_output_section", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1441" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1445" } }, "get_show_run_bgp_dict": { @@ -21377,7 +21728,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "hardware_qfp_active_ipsec_data_drop_clear", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L770" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L769" } }, "hardware_qfp_active_statistics_drop_clear": { @@ -21386,7 +21737,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "hardware_qfp_active_statistics_drop_clear", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L752" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L751" } }, "has_configuration": { @@ -22177,7 +22528,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "license_smart_sync_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L933" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L932" } }, "load_dict_from_json_file": { @@ -22267,7 +22618,7 @@ "module_name": "nxapi.rest", "package": "genie.libs.sdk.apis", "uid": "nxapi_method_nxapi_cli", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/nxapi/rest.py#L148" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/nxapi/rest.py#L151" } }, "nxapi_method_nxapi_rest": { @@ -22285,7 +22636,7 @@ "module_name": "nxapi.rest", "package": "genie.libs.sdk.apis", "uid": "nxapi_method_restconf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/nxapi/rest.py#L239" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/nxapi/rest.py#L242" } }, "parse_tacacs_packet": { @@ -22294,7 +22645,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "parse_tacacs_packet", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L882" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L886" } }, "perform_issu": { @@ -22312,7 +22663,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "perform_ssh", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1137" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1141" } }, "perform_telnet": { @@ -22321,7 +22672,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "perform_telnet", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1489" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1493" } }, "ping": { @@ -23050,7 +23401,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "rename_dir_file_system", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L878" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L877" } }, "repeat_command_save_output": { @@ -23086,7 +23437,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "request_platform_software_cflow_copy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L968" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L967" } }, "request_platform_software_package_clean": { @@ -23100,11 +23451,11 @@ }, "request_platform_software_package_expand": { "iosxe": { - "doc": " Perform request platform software package expand file {file_system}/{sub_directory}/{test_image}\n Perform request platform software package expand file {file_system}/{test_image}\n Args:\n device ('obj'): Device object\n file_system ('str'): bootflash: , harddisk: , usb0:\n test_image ('str'): image_name\n sub_directory ('str',optional): subdirectory inside the filesystem where the test image is present,Default is None\n timeout ('int'): Max time \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Perform request platform software package expand file {file_system}/{sub_directory}/{test_image}\n Perform request platform software package expand file {file_system}/{test_image}\n Args:\n device ('obj'): Device object\n file_system ('str'): bootflash: , harddisk: , usb0:\n test_image ('str'): image_name\n sub_directory ('str',optional): subdirectory inside the filesystem where the test image is present,Default is None\n timeout ('int'): Max time\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "request_platform_software_package_expand", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1546" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1545" } }, "request_platform_software_process_core": { @@ -23113,7 +23464,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "request_platform_software_process_core", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1293" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1292" } }, "request_routing_engine_login_other_routing_engine": { @@ -23131,7 +23482,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "request_system_shell", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1695" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1699" } }, "reset_interface": { @@ -23209,6 +23560,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/wsim/execute.py#L89" } }, + "sanitize": { + "com": { + "doc": "\n\n Wipes out all the whitespace\n\n ", + "module_name": "utils", + "package": "genie.libs.sdk.apis", + "uid": "sanitize", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4403" + } + }, "save_dict_to_json_file": { "com": { "doc": " merge a list of Python dictionaries into one dictionary\n and save the dictionary to a JSON file\n If same key exists in data(dicts) which will be merged,\n the key will be overridden.\n\n Args:\n data (`list`): list of dictionaries\n filename (`string`): filename to save\n Raise:\n Exception\n Returns:\n output (`dict`): Python dictionary\n\n Example:\n\n >>> dev.api.save_dict_to_file(data=[dict1, dict2], 'merged_dict')\n {\n 'a': { # came from `dict1`\n 'b': 1,\n },\n 'c': { # came from `dict2`\n 'd': 2,\n }\n }\n\n ", @@ -23426,7 +23786,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "show_switch_redirect", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L910" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L909" } }, "shut_interface": { @@ -23672,7 +24032,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "terminal_no_monitor", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L949" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L948" } }, "tftp_config": { @@ -24001,6 +24361,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L755" } }, + "unconfig_interface_prpchannel": { + "iosxe": { + "doc": " UnConfigure prp-channel on an interface\n\n Args:\n device (`obj`): Device object\n prpchannel_num (`str`): Prp channel group number\n\n Returns:\n None\n Warning messages\n\n Raises:\n SubCommandFailure\n ", + "module_name": "interface.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfig_interface_prpchannel", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9521" + } + }, "unconfig_interface_ripng": { "iosxe": { "doc": "unconfig RIPng on interface\n Args:\n device ('obj'): Device object\n interface ('str'): Interface name\n ripng_pid ('str'): ripng process id\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -24406,6 +24775,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py#L1294" } }, + "unconfigure_absolute_time_range": { + "iosxe": { + "doc": "Unconfigure absolute time range\n Args:\n device ('obj'): device object\n time_range_name ('str'): time range name\n action_type ('str') : start time/end time\n time ('str') : The start time/end time of the time range in the format HH:MM\n day ('int') : Day of the month (1-31)\n month ('str') : Month of the year (eg: Jan for January, Jun for June)\n year ('int') : Year (1993-2035)\n Return:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_absolute_time_range", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5054" + } + }, "unconfigure_access_map_match_ip_address_action_forward": { "iosxe": { "doc": " unconfiguring access map match ip address action forward \n Args:\n device ('obj'): device to use\n vlan_access_name ('str'): name of vlan to access \n Returns:\n None\n Raises: \n SubCommandFailure\n ", @@ -24754,7 +25132,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_bandwidth_remaining_policy_map", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L248" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L275" } }, "unconfigure_bba_group": { @@ -24900,7 +25278,7 @@ "module_name": "platform.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_bridge_domain", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4567" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4621" } }, "unconfigure_broadband_aaa": { @@ -25110,7 +25488,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_crypto_ikev2_NAT_keepalive", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L839" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L843" } }, "unconfigure_crypto_ikev2_keyring": { @@ -25155,7 +25533,7 @@ "module_name": "eaptls.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_crypto_key", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L303" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L308" } }, "unconfigure_crypto_logging_ikev2": { @@ -25191,7 +25569,7 @@ "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "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#L487" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L493" } }, "unconfigure_crypto_transform_set": { @@ -25299,7 +25677,7 @@ "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_debug_snmp_packets", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L460" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L463" } }, "unconfigure_default_switchport_trunk_vlan": { @@ -25317,7 +25695,7 @@ "module_name": "vrf.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_default_vxlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L910" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L915" } }, "unconfigure_device_classifier": { @@ -25596,7 +25974,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_dynamic_nat_outside_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L973" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L977" } }, "unconfigure_dynamic_nat_pool_overload_route_map_rule": { @@ -25623,7 +26001,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_dynamic_nat_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L581" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L585" } }, "unconfigure_dynamic_path_in_tunnel": { @@ -26085,6 +26463,42 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/hardware/configure.py#L142" } }, + "unconfigure_hw_module_logging_onboard": { + "iosxe": { + "doc": " Unconfigures OBFL on the specified slot\n Example : no hw-module slot logging onboard\n Args:\n device ('obj'): device to use\n slot ('int'): slot number to configure\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_hw_module_logging_onboard", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5107" + } + }, + "unconfigure_hw_module_slot_logging_onboard_environment": { + "iosxe": { + "doc": " unconfigures hw-module slot <#> logging onboard environment\n Args:\n device ('obj'): device to use\n slot ('int'): slot number to configure\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_hw_module_slot_logging_onboard_environment", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5194" + } + }, + "unconfigure_hw_module_slot_logging_onboard_temperature": { + "iosxe": { + "doc": " unconfigures hw-module slot <#> logging onboard temperature\n Args:\n device ('obj'): device to use\n slot ('int'): slot number to configure\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_hw_module_slot_logging_onboard_temperature", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5240" + } + }, + "unconfigure_hw_module_slot_logging_onboard_voltage": { + "iosxe": { + "doc": " unconfigures hw-module slot <#> logging onboard voltage\n Args:\n device ('obj'): device to use\n slot ('int'): slot number to configure\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_hw_module_slot_logging_onboard_voltage", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5148" + } + }, "unconfigure_hw_module_slot_shutdown": { "iosxe": { "doc": " Unshut hw-module slot {slot}\n Args:\n device (`obj`): Device object\n slot (`int`): slot\n\n Returns:\n Shutdown Status\n\n Raises:\n SubCommandFailure : Failed configuring device\n ", @@ -26429,7 +26843,7 @@ }, "unconfigure_interface_ip_dhcp_relay_source_interface_intf_id": { "iosxe": { - "doc": " UnConfigure interface ip dhcp relay source interface intf_id \n Args:\n device ('obj'): device to use\n interface ('str'): name of the interface to be configured # example \"interface vlan 100\" \"no ip dhcp relay source-interface Loopback1\"\n intf_id ('str'): Set source interface for relayed messages for interface ex: Loopback1 interface\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to unconfigure ip dhcp relay source-interface intf_id\n ", + "doc": " UnConfigure interface ip dhcp relay source interface intf_id\n Args:\n device ('obj'): device to use\n interface ('str'): name of the interface to be configured # example \"interface vlan 100\" \"no ip dhcp relay source-interface Loopback1\"\n intf_id ('str'): Set source interface for relayed messages for interface ex: Loopback1 interface\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to unconfigure ip dhcp relay source-interface intf_id\n ", "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_interface_ip_dhcp_relay_source_interface_intf_id", @@ -26625,6 +27039,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L8902" } }, + "unconfigure_interface_range_dhcp_channel_group_mode": { + "iosxe": { + "doc": "Unconfigures Ethernet port to an EtherChannel group\n Example: no channel-group 120 mode active\n\n Args:\n device ('obj'): device object\n start_interface('str'): Starting Interface\n end_interface('str'): Ending Interface number\n group ('int'): Channel group number. The range is 1 to 128\n mode ('str'): EtherChannel mode (eg. active, passive, auto)\n\n Return:\n None\n\n Raises:\n SubCommandFailure\n ", + "module_name": "dhcp.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_interface_range_dhcp_channel_group_mode", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1493" + } + }, "unconfigure_interface_reg_segment": { "iosxe": { "doc": " Unconfig Reg segment on interface\n Args:\n device ('obj'): Device object\n interface ('str'): Interface name\n segment_no ('int'): rep segment number\n edge('bool'): edge preferred. Default is False\n preferred ('bool'): neighbor preferred. Default is False\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -26892,7 +27315,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ip_access_group_in_out", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1755" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1762" } }, "unconfigure_ip_arp_inspection_filter": { @@ -27417,6 +27840,42 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L1869" } }, + "unconfigure_ip_scp_password": { + "iosxe": { + "doc": " Unconfigure password for scp\n Args:\n device ('obj'): Device object\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_ip_scp_password", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4724" + } + }, + "unconfigure_ip_scp_username": { + "iosxe": { + "doc": " Unconfigure username for scp\n Args:\n device ('obj'): Device object\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_ip_scp_username", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4692" + } + }, + "unconfigure_ip_sftp_password": { + "iosxe": { + "doc": " Unconfigure password for sftp\n Args:\n device ('obj'): Device object\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_ip_sftp_password", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4756" + } + }, + "unconfigure_ip_sftp_username": { + "iosxe": { + "doc": " Unconfigure username for sftp\n Args:\n device ('obj'): Device object\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_ip_sftp_username", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4659" + } + }, "unconfigure_ip_source_binding": { "iosxe": { "doc": " unconfigure ip source binding\n Args:\n device ('obj'): device to use\n mac_address ('str'): binding MAC address\n vlan_id ('int'): binding VLAN number (1-4094)\n ip_address ('str'): binding IP address\n interface ('str'): interface name (eg: Gi1/0/13)\n Returns\n None\n Raises:\n SubCommandFailure\n ", @@ -27432,7 +27891,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "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#L912" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L927" } }, "unconfigure_ip_subnet_to_sgt_mapping_vrf": { @@ -28038,6 +28497,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/configure.py#L1065" } }, + "unconfigure_ipv6_router_ospf": { + "iosxe": { + "doc": "Remove ipv6 ospf on device\n Args:\n device (`obj`): Device object\n ospf_process_id (`int`): OSPF process id\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "ospf.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_ipv6_router_ospf", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2701" + } + }, "unconfigure_ipv6_static_route": { "iosxe": { "doc": " Configure static ip route on device\n Args:\n device ('obj'): Device obj\n route ('str'): ip address for route\n mask (str): mask the ip address\n interface ('str', optional): interface name to configure. Default is False\n destination_address('str', optional): destination address to configure. Default is False\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -28515,7 +28983,7 @@ "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_logging_snmp_trap", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L556" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L559" } }, "unconfigure_mac_access_group_mac_acl_in_out": { @@ -28659,7 +29127,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_management_netconf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L955" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L972" } }, "unconfigure_match_service_type_mdns_controller_service_list": { @@ -28821,7 +29289,7 @@ "module_name": "vrf.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_mdt_auto_discovery_vxlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L960" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L965" } }, "unconfigure_mdt_config_on_vrf": { @@ -28848,7 +29316,7 @@ "module_name": "vrf.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_mdt_data_vxlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L791" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L796" } }, "unconfigure_mdt_overlay_use_bgp": { @@ -28988,20 +29456,20 @@ }, "unconfigure_mtc": { "iosxe": { - "doc": " Unconfigure mtc \n Args:\n device ('obj'): device object\n version ('str'): protocol version ipv4 or ipv6\n \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Unconfigure mtc\n Args:\n device ('obj'): device object\n version ('str'): protocol version ipv4 or ipv6\n\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_mtc", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L846" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L857" } }, "unconfigure_mtc_parameters": { "iosxe": { - "doc": " Unconfigure parameters for mtc \n Args:\n device ('obj'): device object\n version ('str'): protocol version ipv4 or ipv6\n interface ('str') or ('list'): interface under mtc\n protocol ('str') or ('list'): protocols of mtc\n \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " Unconfigure parameters for mtc\n Args:\n device ('obj'): device object\n version ('str'): protocol version ipv4 or ipv6\n interface ('str') or ('list'): interface under mtc\n protocol ('str') or ('list'): protocols of mtc\n\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "management.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_mtc_parameters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L812" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L822" } }, "unconfigure_nat64_interface": { @@ -29010,7 +29478,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_nat64_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1140" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1147" } }, "unconfigure_nat64_nd_ra_prefix": { @@ -29019,7 +29487,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_nat64_nd_ra_prefix", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1681" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1688" } }, "unconfigure_nat64_prefix_stateful": { @@ -29028,7 +29496,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_nat64_prefix_stateful", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1192" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1199" } }, "unconfigure_nat64_translation_timeout": { @@ -29037,7 +29505,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_nat64_translation_timeout", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1572" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1579" } }, "unconfigure_nat64_v4_list_pool": { @@ -29046,7 +29514,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_nat64_v4_list_pool", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1449" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1456" } }, "unconfigure_nat64_v4_list_pool_overload": { @@ -29055,7 +29523,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_nat64_v4_list_pool_overload", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1515" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1522" } }, "unconfigure_nat64_v4_pool": { @@ -29064,7 +29532,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_nat64_v4_pool", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1368" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1375" } }, "unconfigure_nat64_v6v4_static": { @@ -29073,7 +29541,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_nat64_v6v4_static", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1252" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1259" } }, "unconfigure_nat64_v6v4_static_protocol_port": { @@ -29082,7 +29550,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_nat64_v6v4_static_protocol_port", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1314" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1321" } }, "unconfigure_nat_in_out": { @@ -29118,7 +29586,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_nat_pool_address", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1828" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1835" } }, "unconfigure_nat_pool_overload_rule": { @@ -29127,7 +29595,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_nat_pool_overload_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1426" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1433" } }, "unconfigure_nat_port_route_map_rule": { @@ -29145,7 +29613,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_nat_route_map", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L889" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L893" } }, "unconfigure_nat_translation_max_entries": { @@ -29154,7 +29622,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_nat_translation_max_entries", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1970" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1977" } }, "unconfigure_nat_translation_timeout": { @@ -29163,7 +29631,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_nat_translation_timeout", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1043" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1050" } }, "unconfigure_neighbor_under_ospf": { @@ -29190,7 +29658,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "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#L879" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L892" } }, "unconfigure_netconf_yang_polling": { @@ -29199,7 +29667,7 @@ "module_name": "management.configure", "package": "genie.libs.sdk.apis", "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#L759" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/management/configure.py#L767" } }, "unconfigure_network_policy_profile_number": { @@ -29361,7 +29829,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_outside_static_nat_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1785" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1792" } }, "unconfigure_pae": { @@ -29373,6 +29841,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L23" } }, + "unconfigure_parameter_map": { + "iosxe": { + "doc": " unconfigure paramter map\n Args:\n device ('obj'): device to use\n parameter_map_name ('str'): parameter-map name (max 99 char)\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to unconfigure interface-template sticky timer\n ", + "module_name": "dot1x.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_parameter_map", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L2364" + } + }, "unconfigure_pbr_route_map": { "iosxe": { "doc": " Unconfigure route-map\n\n Args:\n device (`obj`): Device object\n route_map_name (`str`): Route-map to be configured on interface\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n\n ", @@ -29382,6 +29859,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pbr/configure.py#L199" } }, + "unconfigure_periodic_time_range": { + "iosxe": { + "doc": "Unconfigure periodic time range\n Args:\n device ('obj'): device object\n time_range_name ('str'): time range name\n periodicity ('str'): The periodicity for the time range ex: daily, weekdays, weekend, friday, monday\n start_time ('str') : The start time in the format HH:MM\n end_time ('str') : The end time in the format HH:MM\n Return:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_periodic_time_range", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4988" + } + }, "unconfigure_pim_register_source": { "iosxe": { "doc": " Unconfigure pim register-source interface\n\n Args:\n device ('obj'): Device object\n interface ('str'): Name of interface being used as source\n vrf_name ('str',optional): Name of vrf for which we are setting pim source.\n is_ipv6 ('bool',optional): (True | False) 'True' for ipv6 pim configuration. Default is False.\n Returns:\n None\n\n Raises:\n SubCommandFailure\n\n ", @@ -29442,7 +29928,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_policy_map_class", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L860" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L887" } }, "unconfigure_policy_map_class_parameters": { @@ -29451,7 +29937,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_policy_map_class_parameters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L767" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L794" } }, "unconfigure_policy_map_on_interface": { @@ -29469,7 +29955,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_policy_map_type_service", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L298" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L325" } }, "unconfigure_policy_map_with_type_queue": { @@ -29478,7 +29964,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_policy_map_with_type_queue", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L494" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L521" } }, "unconfigure_port_channel_ip": { @@ -29591,7 +30077,7 @@ }, "unconfigure_propagate_sgt": { "iosxe": { - "doc": " UnConfigure propagate sgt\n Args:\n device ('obj'): device object\n interface ('str'): interface to configure (eg. Gig1/0/1, Te1/0/10)\n type ('str'): manual Supply local configuration for CTS parameters\n role-based Role-based Access Control per-port config commands\n cts_type ('str'): policy CTS policy for manual mode\n propagate CTS SGT Propagation configuration for manual mode\n sap CTS SAP configuration for manual mode \n Return:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " UnConfigure propagate sgt\n Args:\n device ('obj'): device object\n interface ('str'): interface to configure (eg. Gig1/0/1, Te1/0/10)\n type ('str'): manual Supply local configuration for CTS parameters\n role-based Role-based Access Control per-port config commands\n cts_type ('str'): policy CTS policy for manual mode\n propagate CTS SGT Propagation configuration for manual mode\n sap CTS SAP configuration for manual mode\n Return:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_propagate_sgt", @@ -29703,7 +30189,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_pvlan_primary", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1026" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1078" } }, "unconfigure_pvlan_type": { @@ -29712,7 +30198,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_pvlan_type", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1048" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1100" } }, "unconfigure_qos_policy": { @@ -29814,6 +30300,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L1644" } }, + "unconfigure_rep_admin_vlan": { + "iosxe": { + "doc": " unconfigure rep admin vlan\n Args:\n device ('obj'): device to use\n segment ('str') : unconfigure segment <1-1024> Between 1 and 1024\n vlanId ('str') : configure vlan ID\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_rep_admin_vlan", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4790" + } + }, "unconfigure_rip": { "iosxe": { "doc": "unconfigure rip\n Args:\n device ('obj'): Device object\n Return:\n None\n Raises:\n SubCommandFailure\n ", @@ -29985,6 +30480,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/call_home/configure.py#L684" } }, + "unconfigure_service_compress_config": { + "iosxe": { + "doc": " service compress-config\n Args:\n device ('obj'): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_service_compress_config", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4582" + } + }, "unconfigure_service_dhcp": { "iosxe": { "doc": " Unconfigure DHCP pool\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to unconfigure service dhcp\n ", @@ -30045,7 +30549,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_service_policy_with_queueing_name", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L651" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L678" } }, "unconfigure_service_private_config_encryption": { @@ -30117,7 +30621,7 @@ "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_snmp_host_version", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L416" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L419" } }, "unconfigure_snmp_mib_bulkstat": { @@ -30140,11 +30644,11 @@ }, "unconfigure_snmp_server_enable_traps_power_ethernet_group": { "iosxe": { - "doc": "unconfigure snmp server enable traps power ethernet group\n Args:\n device ('obj'): device object\n action_type_1 ('str'): logging or traps\n action_type_2 ('str'): group or police\n group_number ('int') : The group number (1-9)\n \n Return:\n None\n Raises:\n SubCommandFailure\n ", + "doc": "unconfigure snmp server enable traps power ethernet group\n Args:\n device ('obj'): device object\n action_type_1 ('str'): logging or traps\n action_type_2 ('str'): group or police\n group_number ('int') : The group number (1-9)\n\n Return:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_snmp_server_enable_traps_power_ethernet_group", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L642" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L645" } }, "unconfigure_snmp_server_engineid": { @@ -30153,7 +30657,7 @@ "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_snmp_server_engineid", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L573" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L576" } }, "unconfigure_snmp_server_group": { @@ -30180,7 +30684,7 @@ "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_snmp_server_manager", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L521" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L524" } }, "unconfigure_snmp_server_trap": { @@ -30198,7 +30702,7 @@ "module_name": "snmp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_snmp_server_user", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L332" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py#L335" } }, "unconfigure_snmp_server_view": { @@ -30273,6 +30777,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py#L421" } }, + "unconfigure_spanning_tree_etherchannel_misconfig": { + "iosxe": { + "doc": "Unconfigures spanning tree etherchannel misconfig\n Args:\n device ('obj') : Device object\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to unconfigure spanning tree etherchannel misconfig\n ", + "module_name": "spanning_tree.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_spanning_tree_etherchannel_misconfig", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py#L788" + } + }, "unconfigure_spanning_tree_guard_loop": { "iosxe": { "doc": " Disable spanning-tree guard loop over interface \n Args:\n device ('obj'): device to use\n interface ('str'): disable spanning-tree guard loop over this interface\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -30504,7 +31017,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_static_nat_network_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L630" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L634" } }, "unconfigure_static_nat_outside_rule": { @@ -30513,7 +31026,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_static_nat_outside_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L779" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L783" } }, "unconfigure_static_nat_route_map_no_alias_rule": { @@ -30522,7 +31035,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_static_nat_route_map_no_alias_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1885" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1892" } }, "unconfigure_static_nat_route_map_rule": { @@ -30540,7 +31053,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_static_nat_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L696" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L700" } }, "unconfigure_static_nat_source_list_rule": { @@ -30549,7 +31062,7 @@ "module_name": "nat.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_static_nat_source_list_rule", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1990" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py#L1997" } }, "unconfigure_subinterface": { @@ -30633,6 +31146,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9270" } }, + "unconfigure_switchport_trunk_pruning_vlan": { + "iosxe": { + "doc": " Unconfigure switchport trunk pruning vlan\n Args:\n device ('obj'): device to use\n interface ('str'): interface name\n pruning_vlan ('str'): pruning vlan \n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "vlan.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_switchport_trunk_pruning_vlan", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1165" + } + }, "unconfigure_switchport_vlan_mapping": { "iosxe": { "doc": "Unconfigure switchport vlan mapping \n Example : no switchport vlan mapping 5\n\n Args:\n device('obj'): Device object\n interface('str'): Device interface\n vlan('str'): Device Vlan to Map\n translation('str',optional): translation vlan to map\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -30684,7 +31206,7 @@ "module_name": "policy_map.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_table_map_values", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L367" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py#L394" } }, "unconfigure_tacacs_group": { @@ -30747,7 +31269,7 @@ "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_trustpoint", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L516" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L522" } }, "unconfigure_trustpoint_switch": { @@ -30756,7 +31278,7 @@ "module_name": "eaptls.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_trustpoint_switch", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L271" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L276" } }, "unconfigure_tunnel_auto_route": { @@ -30909,7 +31431,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_vlan_group_list", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L977" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1029" } }, "unconfigure_vlan_interface": { @@ -30999,7 +31521,7 @@ "module_name": "vrf.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_vrf_forwarding_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L840" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py#L845" } }, "unconfigure_vrf_select_source": { @@ -31020,6 +31542,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/hsrp/configure.py#L235" } }, + "unconfigure_vtp_mode": { + "iosxe": { + "doc": " Unconfigures global VTP mode\n Args:\n device ('obj'): device to use\n mode ('str'): VTP mode (i.e transparent, client, server)\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "vlan.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_vtp_mode", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1182" + } + }, "unconfigure_vtp_password": { "iosxe": { "doc": "unconfigure vtp password on the device\n\n Args:\n device ('obj'): device to use\n vtp_password('str'): vtp password\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to unconfigure VTP password\n ", @@ -31029,6 +31560,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L899" } }, + "unconfigure_vtp_pruning": { + "iosxe": { + "doc": " Unconfigure vtp pruning\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "vlan.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_vtp_pruning", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1133" + } + }, "unconfigure_vtp_version": { "iosxe": { "doc": "Unconfigure vtp version on the device\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to unconfigure VTP version\n ", @@ -31062,7 +31602,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "uninstall_appliance_package", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1254" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1253" } }, "unit_convert": { @@ -31123,7 +31663,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "upgrade_hw_module_subslot_sfp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1854" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1858" } }, "upgrade_hw_programmable": { @@ -34863,7 +35403,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_ospf_icmp_ping", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1575" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1579" } }, "verify_ospf_in_state": { @@ -36638,7 +37178,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_tacacs_packet", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1089" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1093" } }, "verify_task_replication": { diff --git a/pkgs/sdk-pkg/sdk_generator/output/github_triggers.json b/pkgs/sdk-pkg/sdk_generator/output/github_triggers.json index 26567ff17..da602fe78 100644 --- a/pkgs/sdk-pkg/sdk_generator/output/github_triggers.json +++ b/pkgs/sdk-pkg/sdk_generator/output/github_triggers.json @@ -11760,7 +11760,6 @@ "TriggerModifyHsrpIpv6StateActiveToStandby", "TriggerUnconfigConfigVlan", "TriggerUnconfigConfigVlanVnsegment", - "TriggerModifyVlanVnsegment", "TriggerShutNoShutVlan", "TriggerDisableEnablePim", "TriggerDisableEnablePim6", @@ -11941,6 +11940,7 @@ "TriggerUnconfigConfigNveVniAssociateVrf", "TriggerUnconfigConfigBgpAfL2vpnEvpnRewriteEvpnRtAsn", "TriggerModifyNveMultisiteBgwInterface", + "TriggerModifyVlanVnsegment", "TriggerModifyEvpnMsiteBgwDelayRestoreTime", "TriggerModifyNveVniMcastGroup", "TriggerModifyNveSourceInterfaceLoopback", diff --git a/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json b/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json index 10f7af8eb..e9fc5c326 100644 --- a/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json +++ b/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json @@ -2511,7 +2511,7 @@ "attempt": 12, "interval": 10 }, - "schema": "{'vrf': {Any (str) *: {Optional (str) neighbor: {Any (str) *: {'address_family': {Any (str) *: {'neighbor_table_version': , 'as': , 'msg_rcvd': , 'msg_sent': , 'tbl_ver': , 'inq': , 'outq': , 'up_down': , 'state_pfxrcd': , 'state': , Optional (str) prefix_received: , Optional (str) route_identifier: , Optional (str) local_as: , Optional (str) bgp_table_version: , Optional (str) config_peers: , Optional (str) capable_peers: , Optional (str) prefixes: {'total_entries': , 'memory_usage': }, Optional (str) path: {'total_entries': , 'memory_usage': }, Optional (str) attribute_entries: , Optional (str) as_path_entries: , Optional (str) community_entries: , Optional (str) clusterlist_entries: , Optional (str) dampening: , Optional (str) history_paths: , Optional (str) dampened_paths: , Optional (str) soft_reconfig_recvd_paths: , Optional (str) soft_reconfig_identical_paths: , Optional (str) soft_reconfig_combo_paths: , Optional (str) soft_reconfig_filtered_recvd: , Optional (str) soft_reconfig_bytes: }}}}}}}", + "schema": "{'vrf': {Any (str) *: {Optional (str) neighbor: {Any (str) *: {'address_family': {Any (str) *: {'neighbor_table_version': , 'as': Or (, ), 'msg_rcvd': , 'msg_sent': , 'tbl_ver': , 'inq': , 'outq': , 'up_down': , 'state_pfxrcd': , 'state': , Optional (str) prefix_received: , Optional (str) route_identifier: , Optional (str) local_as: , Optional (str) bgp_table_version: , Optional (str) config_peers: , Optional (str) capable_peers: , Optional (str) prefixes: {'total_entries': , 'memory_usage': }, Optional (str) path: {'total_entries': , 'memory_usage': }, Optional (str) attribute_entries: , Optional (str) as_path_entries: , Optional (str) community_entries: , Optional (str) clusterlist_entries: , Optional (str) dampening: , Optional (str) history_paths: , Optional (str) dampened_paths: , Optional (str) soft_reconfig_recvd_paths: , Optional (str) soft_reconfig_identical_paths: , Optional (str) soft_reconfig_combo_paths: , Optional (str) soft_reconfig_filtered_recvd: , Optional (str) soft_reconfig_bytes: }}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -2526,7 +2526,7 @@ "doc": "Parser for show bgp vrf all summary", "exclude": [], "groups": [], - "schema": "{'vrf': {Any (str) *: {Optional (str) neighbor: {Any (str) *: {'address_family': {Any (str) *: {'neighbor_table_version': , 'as': , 'msg_rcvd': , 'msg_sent': , 'tbl_ver': , 'inq': , 'outq': , 'up_down': , 'state_pfxrcd': , 'state': , Optional (str) prefix_received: , Optional (str) route_identifier: , Optional (str) local_as: , Optional (str) bgp_table_version: , Optional (str) config_peers: , Optional (str) capable_peers: , Optional (str) prefixes: {'total_entries': , 'memory_usage': }, Optional (str) path: {'total_entries': , 'memory_usage': }, Optional (str) attribute_entries: , Optional (str) as_path_entries: , Optional (str) community_entries: , Optional (str) clusterlist_entries: , Optional (str) dampening: , Optional (str) history_paths: , Optional (str) dampened_paths: , Optional (str) soft_reconfig_recvd_paths: , Optional (str) soft_reconfig_identical_paths: , Optional (str) soft_reconfig_combo_paths: , Optional (str) soft_reconfig_filtered_recvd: , Optional (str) soft_reconfig_bytes: }}}}}}}", + "schema": "{'vrf': {Any (str) *: {Optional (str) neighbor: {Any (str) *: {'address_family': {Any (str) *: {'neighbor_table_version': , 'as': Or (, ), 'msg_rcvd': , 'msg_sent': , 'tbl_ver': , 'inq': , 'outq': , 'up_down': , 'state_pfxrcd': , 'state': , Optional (str) prefix_received: , Optional (str) route_identifier: , Optional (str) local_as: , Optional (str) bgp_table_version: , Optional (str) config_peers: , Optional (str) capable_peers: , Optional (str) prefixes: {'total_entries': , 'memory_usage': }, Optional (str) path: {'total_entries': , 'memory_usage': }, Optional (str) attribute_entries: , Optional (str) as_path_entries: , Optional (str) community_entries: , Optional (str) clusterlist_entries: , Optional (str) dampening: , Optional (str) history_paths: , Optional (str) dampened_paths: , Optional (str) soft_reconfig_recvd_paths: , Optional (str) soft_reconfig_identical_paths: , Optional (str) soft_reconfig_combo_paths: , Optional (str) soft_reconfig_filtered_recvd: , Optional (str) soft_reconfig_bytes: }}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -2990,7 +2990,7 @@ "doc": "Parser for show environment all'\n ", "exclude": [], "groups": [], - "schema": "{'switch': {Any (str) *: {Optional (str) fan: {Any (str) *: {'state': , Optional (str) direction: }}, Optional (str) power_supply: {Any (str) *: {Optional (str) state: , Optional (str) pid: , Optional (str) serial_number: , Optional (str) status: , Optional (str) system_power: , Optional (str) poe_power: , Optional (str) watts: , Optional (str) temperature: , Optional (str) power_source: , Optional (str) type: , Optional (str) mode: }}, Optional (str) system_temperature_state: , Optional (str) inlet_temperature: {'value': Or (, ), 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) hotspot_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) asic_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) outlet_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) system_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) redundant_power_system: {: {'status': , Optional (str) serial_num: , Optional (str) port_num: }}}}}", + "schema": "{'switch': {Any (str) *: {Optional (str) fan: {Any (str) *: {Optional (str) speed: , Optional (str) direction: , Optional (str) state: }}, Optional (str) power_supply: {Any (str) *: {Optional (str) state: , Optional (str) pid: , Optional (str) serial_number: , Optional (str) status: , Optional (str) system_power: , Optional (str) poe_power: , Optional (str) watts: , Optional (str) temperature: , Optional (str) power_source: , Optional (str) type: , Optional (str) mode: }}, Optional (str) sensors_details: {Any (str) *: {Optional (str) location: , Optional (str) state: , Optional (str) reading: , Optional (str) unit: , Optional (str) range: }}, Optional (str) system_temperature_state: , Optional (str) inlet_temperature: {'value': Or (, ), 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) hotspot_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) asic_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) outlet_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) system_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) redundant_power_system: {: {'status': , Optional (str) serial_num: , Optional (str) port_num: }}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -7243,7 +7243,7 @@ "ios": { "doc": "Parser for \"show lisp all instance-id dabatase\"", "groups": [], - "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': }}}}}}}}}}", + "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) service_insertion_id: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': , Optional (str) affinity_id_x: , Optional (str) affinity_id_y: }}}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -7261,7 +7261,7 @@ "instance_id": "*", "service": "ethernet" }, - "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': }}}}}}}}}}", + "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) service_insertion_id: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': , Optional (str) affinity_id_x: , Optional (str) affinity_id_y: }}}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -7272,7 +7272,7 @@ "ios": { "doc": "Parser for \"show lisp all instance-id dabatase\"", "groups": [], - "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': }}}}}}}}}}", + "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) service_insertion_id: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': , Optional (str) affinity_id_x: , Optional (str) affinity_id_y: }}}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -7290,7 +7290,7 @@ "instance_id": "*", "service": "ipv4" }, - "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': }}}}}}}}}}", + "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) service_insertion_id: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': , Optional (str) affinity_id_x: , Optional (str) affinity_id_y: }}}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -7301,7 +7301,7 @@ "ios": { "doc": "Parser for \"show lisp all instance-id dabatase\"", "groups": [], - "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': }}}}}}}}}}", + "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) service_insertion_id: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': , Optional (str) affinity_id_x: , Optional (str) affinity_id_y: }}}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -7319,7 +7319,7 @@ "instance_id": "*", "service": "ipv6" }, - "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': }}}}}}}}}}", + "schema": "{'lisp_id': {Any (str) *: {'instance_id': {: {'eid_table': , 'lsb': , 'entries': {'total': , 'no_route': , 'inactive': , Optional (str) do_not_register: , 'eids': {: {'eid': , 'mask': , Optional (str) do_not_register: , Optional (str) dynamic_eid: , Optional (str) locator_set: , Optional (str) no_route_to_prefix: , Optional (str) proxy: , Optional (str) sgt: , Optional (str) domain_id: , Optional (str) service_insertion: , Optional (str) service_insertion_id: , Optional (str) auto_discover_rlocs: , Optional (str) uptime: , Optional (str) last_change: , Optional (str) locators: {: {'priority': , 'weight': , 'source': , 'location': , 'state': , Optional (str) affinity_id_x: , Optional (str) affinity_id_y: }}}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -9358,7 +9358,7 @@ "doc": null, "exclude": [], "groups": [], - "schema": "{'vrf': {Any (str) *: {'address_family': {Any (str) *: {Optional (str) routes: {Any (str) *: {'route': , 'active': , Optional (str) ip: , Optional (str) mask: , Optional (str) route_preference: , Optional (str) metric: , Optional (str) behaviour: , Optional (str) source_protocol: , Optional (str) source_protocol_codes: , Optional (str) known_via: , Optional (str) distance: , Optional (str) type: , Optional (str) tag: , Optional (str) installed: {'date': , 'for': }, Optional (str) redist_advertisers: {Any (str) *: {'protoid': , 'clientid': }}, Optional (str) next_hop: {Optional (str) outgoing_interface: {Any (str) *: {'outgoing_interface': , Optional (str) updated: , Optional (str) metric: }}, Optional (str) next_hop_list: {: {'index': , Optional (str) next_hop: , Optional (str) outgoing_interface: , Optional (str) updated: , Optional (str) metric: , Optional (str) from: , Optional (str) table: , Optional (str) address_family: , Optional (str) table_id: , Optional (str) nexthop_in_vrf: }}}}}}}, Optional (str) last_resort: {Optional (str) gateway: , Optional (str) to_network: }}}}", + "schema": "{'vrf': {Any (str) *: {'address_family': {Any (str) *: {Optional (str) routes: {Any (str) *: {'route': , 'active': , Optional (str) ip: , Optional (str) mask: , Optional (str) route_preference: , Optional (str) metric: , Optional (str) behaviour: , Optional (str) source_protocol: , Optional (str) source_protocol_codes: , Optional (str) known_via: , Optional (str) distance: , Optional (str) type: , Optional (str) tag: , Optional (str) installed: {'date': , 'for': }, Optional (str) redist_advertisers: {Any (str) *: {'protoid': , 'clientid': }}, Optional (str) next_hop: {Optional (str) outgoing_interface: {Any (str) *: {Optional (str) outgoing_interface: , Optional (str) updated: , Optional (str) metric: }}, Optional (str) next_hop_list: {: {'index': , Optional (str) next_hop: , Optional (str) outgoing_interface: , Optional (str) updated: , Optional (str) metric: , Optional (str) from: , Optional (str) table: , Optional (str) address_family: , Optional (str) table_id: , Optional (str) nexthop_in_vrf: , Optional (str) label: , Optional (str) tunnel_id: , Optional (str) binding_label: , Optional (str) extended_communites_count: , Optional (str) nhid: , Optional (str) path_grouping_id: , Optional (str) srv6_headend: , Optional (str) sid_list: }}}}}}}, Optional (str) last_resort: {Optional (str) gateway: , Optional (str) to_network: }}}}", "source": { "class": "genie.harness.base.Template" }, @@ -9373,7 +9373,7 @@ "doc": "Parser for :\n show route ipv6\n show route vrf ipv6", "exclude": [], "groups": [], - "schema": "{'vrf': {Any (str) *: {'address_family': {Any (str) *: {Optional (str) routes: {Any (str) *: {'route': , 'active': , Optional (str) ip: , Optional (str) mask: , Optional (str) route_preference: , Optional (str) metric: , Optional (str) behaviour: , Optional (str) source_protocol: , Optional (str) source_protocol_codes: , Optional (str) known_via: , Optional (str) distance: , Optional (str) type: , Optional (str) tag: , Optional (str) installed: {'date': , 'for': }, Optional (str) redist_advertisers: {Any (str) *: {'protoid': , 'clientid': }}, Optional (str) next_hop: {Optional (str) outgoing_interface: {Any (str) *: {'outgoing_interface': , Optional (str) updated: , Optional (str) metric: }}, Optional (str) next_hop_list: {: {'index': , Optional (str) next_hop: , Optional (str) outgoing_interface: , Optional (str) updated: , Optional (str) metric: , Optional (str) from: , Optional (str) table: , Optional (str) address_family: , Optional (str) table_id: , Optional (str) nexthop_in_vrf: }}}}}}}, Optional (str) last_resort: {Optional (str) gateway: , Optional (str) to_network: }}}}", + "schema": "{'vrf': {Any (str) *: {'address_family': {Any (str) *: {Optional (str) routes: {Any (str) *: {'route': , 'active': , Optional (str) ip: , Optional (str) mask: , Optional (str) route_preference: , Optional (str) metric: , Optional (str) behaviour: , Optional (str) source_protocol: , Optional (str) source_protocol_codes: , Optional (str) known_via: , Optional (str) distance: , Optional (str) type: , Optional (str) tag: , Optional (str) installed: {'date': , 'for': }, Optional (str) redist_advertisers: {Any (str) *: {'protoid': , 'clientid': }}, Optional (str) next_hop: {Optional (str) outgoing_interface: {Any (str) *: {Optional (str) outgoing_interface: , Optional (str) updated: , Optional (str) metric: }}, Optional (str) next_hop_list: {: {'index': , Optional (str) next_hop: , Optional (str) outgoing_interface: , Optional (str) updated: , Optional (str) metric: , Optional (str) from: , Optional (str) table: , Optional (str) address_family: , Optional (str) table_id: , Optional (str) nexthop_in_vrf: , Optional (str) label: , Optional (str) tunnel_id: , Optional (str) binding_label: , Optional (str) extended_communites_count: , Optional (str) nhid: , Optional (str) path_grouping_id: , Optional (str) srv6_headend: , Optional (str) sid_list: }}}}}}}, Optional (str) last_resort: {Optional (str) gateway: , Optional (str) to_network: }}}}", "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 afeeb7b88..5bdc5bd7b 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__ = '23.9' +__version__ = '23.10' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2020, Cisco Systems Inc.' diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/apphosting/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/apphosting/configure.py index 6d8fa225d..a278a8fc5 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/apphosting/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/apphosting/configure.py @@ -15,7 +15,7 @@ def enable_usb_ssd(device, timeout=30): - ''' + ''' Configure - no platform usb disable Enables connected SSDs on c9300 Args: @@ -24,17 +24,17 @@ def enable_usb_ssd(device, timeout=30): Returns: None ''' - + try: output = device.configure("no platform usb disable" , timeout=timeout) - + except SubCommandFailure as e: raise SubCommandFailure( "Could not enable USB SSD - Error:\n{error}".format(error=e) ) - + def disable_usb_ssd(device, timeout=30): - ''' + ''' Configure - platform usb disable Disables connected SSDs on c9300 Args: @@ -43,17 +43,17 @@ def disable_usb_ssd(device, timeout=30): Returns: None ''' - + try: output = device.configure("platform usb disable" , timeout=timeout) - + except SubCommandFailure as e: raise SubCommandFailure( "Could not disable USB SSD - Error:\n{error}".format(error=e) ) def clear_iox(device, max_time=120, interval=10, disable_iox_then_clear=False,wait_timer=30,timeout=30): - ''' + ''' Execute clear iox Uses disable_iox Args: @@ -67,21 +67,21 @@ def clear_iox(device, max_time=120, interval=10, disable_iox_then_clear=False,wa True False Raises: - None + None ''' - + time_out = Timeout(max_time=max_time, interval=interval) while time_out.iterate(): try: output = device.execute("clear iox" , timeout=timeout) if 'IOX cleanup successfully completed' in output: - return True + return True elif 'IOX is configured/UP. IOX must be disabled before invoking this command' in output: - if disable_iox_then_clear: + if disable_iox_then_clear: log.info("User requested unconfigure IOX then clear IOX") device.api.disable_iox() log.info('Wait %s seconds after Disable IOX' % wait_timer) - time.sleep(wait_timer) + time.sleep(wait_timer) except SubCommandFailure as e: raise SubCommandFailure( "Could not clear IOX - Error:\n{error}".format(error=e) @@ -89,8 +89,8 @@ def clear_iox(device, max_time=120, interval=10, disable_iox_then_clear=False,wa return False def enable_iox(device): - ''' - Configure iox + ''' + Configure iox Args: device ('obj') : Device object Returns: @@ -102,10 +102,10 @@ def enable_iox(device): raise SubCommandFailure( "Could not enable IOX - Error:\n{error}".format(error=e) ) - + def disable_iox(device): - ''' - Configure no iox + ''' + Configure no iox Args: device ('obj') : Device object Returns: @@ -119,24 +119,24 @@ def disable_iox(device): ) -def configure_thousand_eyes_application(device, vlan_id, app_ip, app_gateway_ip, +def configure_thousand_eyes_application(device, vlan_id, app_ip, app_gateway_ip, app_netmask, thousand_eye_token, app_proxy, app_dns): ''' - Configure Thousand Eye Application + Configure Thousand Eye Application Args: device ('obj'): Device object - vlan_id ('str'): Vlan information App installation - app_ip ('str'): Public IP for Thousand Eye Application + vlan_id ('str'): Vlan information App installation + app_ip ('str'): Public IP for Thousand Eye Application app_gateway_ip ('str'): gateway IP for Application - app_netmask ('str'): Subnet mask for the Public IP used to configure Thousand Eye application + app_netmask ('str'): Subnet mask for the Public IP used to configure Thousand Eye application thousand_eye_token ('str'): Thousand Eye Application Token - app_proxy ('str'): Proxy details for application - app_dns ('str'): Domain name server Ip address + app_proxy ('str'): Proxy details for application + app_dns ('str'): Domain name server Ip address Returns: None Raises: SubCommandFailure - + ''' log.info("User requested Configure Thousand Eye Application") @@ -161,16 +161,16 @@ def configure_thousand_eyes_application(device, vlan_id, app_ip, app_gateway_ip, except SubCommandFailure as e: raise SubCommandFailure( "Configure Thousand Eye Application Config. Error {e}".format(e=e) - ) + ) def configure_app_hosting_appid_iperf_from_vlan(device,port_id,vlan_id): - """ configure_app_hosting_appid_iperf_from_vlan + """ configure_app_hosting_appid_iperf_from_vlan Args: device ('obj'): device to execute on port_id(int): port identifier - vlan_id('str'): vlan identifier - + vlan_id('str'): vlan identifier + Return: None Raises: @@ -179,16 +179,16 @@ def configure_app_hosting_appid_iperf_from_vlan(device,port_id,vlan_id): cmd = ["app-hosting appid iperf", "app-vnic AppGigabitEthernet port {port_id} trunk".format(port_id=port_id), "Vlan {vlan_id} guest-interface 0".format(vlan_id=vlan_id), - "start"] + "start"] try: device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure( - "Failed to configure_app_hosting_appid_iperf_from_vlan Error {e}".format(e=e)) + "Failed to configure_app_hosting_appid_iperf_from_vlan Error {e}".format(e=e)) -def configure_app_hosting_appid_trunk_port(device, appid, app_vnic, app_vnic_port=None, - app_vnic_port_mode=None, app_vnic_guest_interface=None, vlan_id=None, +def configure_app_hosting_appid_trunk_port(device, appid, app_vnic, app_vnic_port=None, + app_vnic_port_mode=None, app_vnic_guest_interface=None, vlan_id=None, app_ip=None, app_netmask=None, app_gateway_ip=None, start=False): """ Configure app-hosting appid @@ -203,12 +203,12 @@ def configure_app_hosting_appid_trunk_port(device, appid, app_vnic, app_vnic_por app_ip ('str', optional): Public IP for Thousand Eye Application. Default is None app_netmask ('str', optional): Subnet mask for the Public IP. Default is None app_gateway_ip ('str', optional): gateway IP for Application. Default is None - start ('bool', optional): True to start the Application. Default is False + start ('bool', optional): True to start the Application. Default is False Returns: None Raises: SubCommandFailure - + """ config = [f'app-hosting appid {appid}', f'app-vnic {app_vnic}'] @@ -227,7 +227,7 @@ def configure_app_hosting_appid_trunk_port(device, appid, app_vnic, app_vnic_por config.append(f'app-default-gateway {app_gateway_ip} guest-interface 0') if start: config.append('start') - + try: device.configure(config) except SubCommandFailure as e: @@ -246,22 +246,22 @@ def configure_app_hosting_appid_docker(device, appid, prepend_pkg_opts=True, run [ {'index': 1, 'string': '-e TEAGENT_PROXY_LOCATION=proxy-wsa.esl.cisco.com:80'}, {'index': 3, 'string': '-e TEAGENT_PROXY_TYPE=STATIC'}, - ] + ] Returns: None Raises: SubCommandFailure - + """ config = [f'app-hosting appid {appid}', 'app-resource docker'] if prepend_pkg_opts: config.append('prepend-pkg-opts') - + for run_opt in run_opts: config.append(f'run-opts {run_opt["index"]} "{run_opt["string"]}"') - + try: device.configure(config) except SubCommandFailure as e: @@ -285,7 +285,7 @@ def configure_app_hosting_resource_profile(device, appid, profile_name, cpu=None None Raises: SubCommandFailure - + """ config = [f'app-hosting appid {appid}', f'app-resource profile {profile_name}'] @@ -300,7 +300,7 @@ def configure_app_hosting_resource_profile(device, appid, profile_name, cpu=None config.append(f'vcpu {vcpu}') if start: config.append(f'start') - + try: device.configure(config) except SubCommandFailure as e: @@ -331,28 +331,28 @@ def confirm_iox_enabled_requested_storage_media(uut, storage='ssd'): None Raises: SubCommandFailure - """ + """ log.debug("Entering " + inspect.currentframe().f_code.co_name) - local_args = locals() + local_args = locals() log.debug("Passed in arguments are") log.debug(local_args) - log.debug("Called by function name " + inspect.currentframe().f_back.f_code.co_name) - + log.debug("Called by function name " + inspect.currentframe().f_back.f_code.co_name) + other_storage = "" - + if storage == "ssd": req_storage_string = "/vol/usb1" other_storage = "/mnt/sd3" elif storage == "alt_hdd": - req_storage_string = "/mnt/sd3" + req_storage_string = "/mnt/sd3" other_storage = "/vol/usb1" else: log.error("Passed in value of storage not supported!") return False - + result = False - + output = [] for attempt in range(1, 10): try: @@ -366,12 +366,12 @@ def confirm_iox_enabled_requested_storage_media(uut, storage='ssd'): except: log.error("Problem with parsing show app-hosting infra CLI") return False - + if not output: log.error("Failed to parse show app-hosting infra!") return False internal_storage = output['internal_working_directory'] - + if req_storage_string in internal_storage: log.info('IOX brought up on Requested Storage %s \n with location %s successfully!' % (storage, req_storage_string)) return True @@ -381,13 +381,13 @@ def confirm_iox_enabled_requested_storage_media(uut, storage='ssd'): else: log.error('IOX not brought up properly! - Error!') return False - -def enable_usb_ssd_verify_exists(device, storage_name="usbflash1:.",time=30): + +def enable_usb_ssd_verify_exists(device, storage_name="usbflash1:.",timeout=30): """ configure app-hosting appid Args: device ('obj'): device to use storage_name('str'): storage name eg:flash or bootflash - time('int'): time + timeout('int'): time Returns: None Raises: @@ -399,7 +399,7 @@ def enable_usb_ssd_verify_exists(device, storage_name="usbflash1:.",time=30): filter='platform usb disable') if not out[0]: # if we got False device.api.enable_usb_ssd() - time.sleep(time) + time.sleep(timeout) output = device.parse("show version") try: @@ -415,10 +415,10 @@ def enable_usb_ssd_verify_exists(device, storage_name="usbflash1:.",time=30): except SubCommandFailure as e: log.error(f"Problem with parsing show version CLI. Error:\n{e}") return False - - + + def configure_app_management_networking(device, app_name="guestshell", auto_start=None): - ''' + ''' Args: device ('obj'): device to use app_name('str'): WORD no description @@ -426,7 +426,7 @@ def configure_app_management_networking(device, app_name="guestshell", auto_star Returns: None Raises: - SubCommandFailure + SubCommandFailure ''' log.info("Configuring APP %s with basic Mgmt Interface config - app-vnic management guest-interface 0" % app_name) @@ -438,4 +438,4 @@ def configure_app_management_networking(device, app_name="guestshell", auto_star try: device.configure(config) except SubCommandFailure as e: - raise SubCommandFailure(f"Could not configure app_management networking. Error:\n{e}") + raise SubCommandFailure(f"Could not configure app_management networking. Error:\n{e}") diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/device_tracking/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/device_tracking/configure.py index 13a2782dc..a7292b779 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/device_tracking/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/device_tracking/configure.py @@ -94,3 +94,48 @@ def configure_device_tracking_policy( else: log.debug('Invalid protocol') + +def configure_device_policy_tracking(device, policy_name, tracking=True): + """Configure device policy tracking + Args: + device (`obj`): Device object + policy_name('str'): policy name + tracking('boolean',optional): Flag to configure tracking enable (Default True) + Return: + None + Raise: + SubCommandFailure + """ + cmd = [f'device-tracking policy {policy_name}'] + if tracking: + cmd.append("tracking enable") + else: + cmd.append("tracking disable") + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure device policy tracking on {device}. Error:\n{e}" + ) + +def configure_source_tracking_on_interface(device, interface, value): + """Configure source tracking on interface + Args: + device (`obj`): Device object + interface ('str'): interface name + value ('str'): provide the values details + Return: + None + Raise: + SubCommandFailure + """ + cmd = [ + f'interface {interface}', + f'ip verify source {value}' + ] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure source tracking on {interface}. Error:\n{e}" + ) \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py index ae20912f6..adcc41873 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py @@ -938,7 +938,7 @@ def configure_cts_manual(device, interface, policy=None, sgt=None, trusted=None, config= [ f'interface {interface}', f'cts manual'] - + if policy: if trusted: config.append(f'policy static sgt {sgt} trusted') @@ -1145,7 +1145,7 @@ def configure_ip_dhcp_snooping_limit(device, interface, rate_limit): ) def configure_interface_ip_dhcp_relay_information_option_vpn_id(device, interface): - """ Configure ip dhcp relay information option vpn-id on the interface + """ Configure ip dhcp relay information option vpn-id on the interface Args: device ('obj'): device to use interface ('str'): name of the interface to be configured # example "interface vlan 100" "ip dhcp relay information option vpn-id" @@ -1185,7 +1185,7 @@ def unconfigure_interface_ip_dhcp_relay_information_option_vpn_id(device, interf ) def configure_interface_ip_dhcp_relay_source_interface_intf_id(device, interface, intf_id): - """ Configure interface ip dhcp relay source interface intf_id + """ Configure interface ip dhcp relay source interface intf_id Args: device ('obj'): device to use interface ('str'): name of the interface to be configured # example "interface vlan 100" "ip dhcp relay source-interface Loopback1" @@ -1207,7 +1207,7 @@ def configure_interface_ip_dhcp_relay_source_interface_intf_id(device, interface ) def unconfigure_interface_ip_dhcp_relay_source_interface_intf_id(device, interface, intf_id): - """ UnConfigure interface ip dhcp relay source interface intf_id + """ UnConfigure interface ip dhcp relay source interface intf_id Args: device ('obj'): device to use interface ('str'): name of the interface to be configured # example "interface vlan 100" "no ip dhcp relay source-interface Loopback1" @@ -1257,7 +1257,7 @@ def configure_dhcp_pool(device, pool_name, router_id=None, network=None, mask=No device.configure(config) except SubCommandFailure as e: raise SubCommandFailure(f'Could not configure dhcp pool. Error: {e}') - + def unconfigure_dhcp_pool(device, pool_name, router_id=None, network=None, mask=None, vrf=None, dns_server=None): """ Unconfigure DHCP pool Args: @@ -1383,7 +1383,7 @@ def unconfigure_propagate_sgt(device, interface, type, cts_type): role-based Role-based Access Control per-port config commands cts_type ('str'): policy CTS policy for manual mode propagate CTS SGT Propagation configuration for manual mode - sap CTS SAP configuration for manual mode + sap CTS SAP configuration for manual mode Return: None Raises: @@ -1400,7 +1400,7 @@ def unconfigure_propagate_sgt(device, interface, type, cts_type): except SubCommandFailure as e: raise SubCommandFailure( f'Failed to unconfigure propagate sgt {interface} on {device.name}\n{e}' - ) + ) def unconfigure_cts_role_based_sgt_map_vlan_list(device, Vlan_id, Tag_value): """UnConfigure cts role-based sgt-map vlan-list 300 sgt 300 @@ -1422,7 +1422,7 @@ def unconfigure_cts_role_based_sgt_map_vlan_list(device, Vlan_id, Tag_value): except SubCommandFailure as e: raise SubCommandFailure( f'Failed to unconfigure cts role-based sgt-map vlan-list 300 sgt 300 on {device.name}\n{e}' - ) + ) def configure_ip_dhcp_snooping_information_option_allow_untrusted_global(device): @@ -1459,4 +1459,62 @@ def unconfigure_ip_dhcp_snooping_information_option_allow_untrusted_global(devic except SubCommandFailure as e: raise SubCommandFailure( "Could not unconfigure dhcp snooping information option allow-untrusted. Error:\n{e}" - ) \ No newline at end of file + ) + +def configure_interface_range_dhcp_channel_group_mode(device, start_interface, end_interface, group, mode): + """Configures Ethernet port to an EtherChannel group + Example: channel-group 10 mode desirable + + Args: + device ('obj'): device object + start_interface('str'): Starting Interface + end_interface('str'): Ending Interface number + group ('int'): Channel group number. The range is 1 to 128 + mode ('str'): EtherChannel mode (eg. active, passive, auto) + + Return: + None + + Raises: + SubCommandFailure + """ + log.debug(f"Configuring DHCP EtherChannel group mode {mode}") + config= [ + f'interface range {start_interface} - {end_interface}', + f'channel-group {group} mode {mode}' + ] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f'Failed to configure DHCP channel-group mode {mode} \n{e}' + ) + +def unconfigure_interface_range_dhcp_channel_group_mode(device, start_interface, end_interface, group, mode): + """Unconfigures Ethernet port to an EtherChannel group + Example: no channel-group 120 mode active + + Args: + device ('obj'): device object + start_interface('str'): Starting Interface + end_interface('str'): Ending Interface number + group ('int'): Channel group number. The range is 1 to 128 + mode ('str'): EtherChannel mode (eg. active, passive, auto) + + Return: + None + + Raises: + SubCommandFailure + """ + log.debug(f"Unconfiguring DHCP EtherChannel group mode {mode}") + config= [ + f'interface range {start_interface} - {end_interface}', + f'no channel-group {group} mode {mode}' + ] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f'Failed to unconfigure DHCP channel-group mode {mode}\n{e}' + ) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py index 7e5b12c1b..6a92f4a36 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py @@ -2210,3 +2210,172 @@ def unconfigure_access_session_mac_move(device, access_type, deny_type): except SubCommandFailure as e: raise SubCommandFailure( f"Failed to unconfigure access-session mac-move. Error:\n{e}") + +def configure_parameter_map(device, + parameter_map_name=False, + enable_global=False, + banner_file_name=None, + banner_text=None, + banner_title=None, + captive_bypass_portal=False, + cisco_logo_disable=False, + consent_email=False, + custom_page=False, + device_failure_file_name=None, + login_device_name=None, + login_expired_device_name=None, + custom_page_success_name=None, + logout_window_disabled=False, + max_http_conns=None, + redirect_command=None, + sleeping_client_timeout=None, + success_window_disable=False, + timeout_seconds=None, + type_name=None, + http_port=None, + intercept_https_enable=False, + secure_webauth_disable=False, + trustpoint_name=None, + virtual_ipv4=None, + virtual_ipv6=None, + watch_add_ipv4=None, + watch_add_ipv6=None, + dynamic_expiry_timeout=None, + enabled_watch_list=False, + webauth_bypass_intercept_name=None, + webauth_bypass_intercept=None, + webauth_http_enable=False + ): + + """ Configuring paramter-map webauth <> + Args: + device (`obj`): Device object + parameter_map_name ('str'): parameter-map name (max 99 char) + enable_global('bool'): To enable global mode + banner_file_name('str'): Specify name of the banner-file + banner_text('str'): c banner-text c, where 'c' is a delimiting character (maximum 200 characters) + banner_title('str'): c banner-title-text c, where 'c' is a delimiting character (maximum 127 characters) + captive_bypass_portal('bool'): Turn on captive bypass + cisco_logo_disable('bool'): Disable Cisco logo on internal html pages + consent_email('bool'): Turn-on Consent with Email + custom_page('bool'): custom-page - login, expired, success or failure page + device_failure_file_name('str') : Specify name of the HTML file + login_device_name('str'): Specify file on local storage media,Specify name of the HTML file + login_expired_device_name('str'): Expired authentication proxy,Specify name of the HTML file + custom_page_success_name('str'):Successful authentication proxy + logout_window_disabled('bool'): Webauth logout window disable + max_http_conns('int'): Maximum number of HTTP connections per client + redirect_command('str'): Specify the redirect command + sleeping_client_timeout('int'): Sleep Timeout in Minute (10-43200) + success_window_disable('bool'): Disable Success Window + timeout_seconds('int'):timeout for the webauth session in Seconds + type_name('str'): type - web-auth, consent or both + http_port('int'): Set Webauth http server port (81-65535) + intercept_https_enable('bool'): Enable intercept of https traffic + secure_webauth_disable('bool'): Disable HTTP secure server for Webauth + trustpoint_name('str') : Specify the trustpoint name + virtual_ipv4('str'): Virtual IPv4 Address + virtual_ipv6('str'): Virtual IPv6 Address + watch_add_ipv4('str'): Watch List of webauth clients, IPv4 Watch List Entry + watch_add_ipv6('str'): Watch List of webauth clients, IPv6 Watch List Entry + dynamic_expiry_timeout('int'):Webauth watch-list expiry timeout in seconds + enabled_watch_list('bool'): Enable Watchlist + webauth_bypass_intercept_name('str'): Specify the webauth bypass ACL name + webauth_http_enable('bool') : Enable HTTP server for Webauth + + Returns: + None + Raises: + SubCommandFailure + """ + log.debug(f"Configuring parameter-map type webauth {parameter_map_name}") + cmd = [] + if parameter_map_name: + cmd.append("parameter-map type webauth {parameter_map_name}".format(parameter_map_name=parameter_map_name)) + if enable_global: + cmd.append("parameter-map type webauth global") + if http_port: + cmd.append("http port {http_port}".format(http_port=http_port)) + if intercept_https_enable: + cmd.append("intercept-https-enable") + if secure_webauth_disable: + cmd.append("secure-webauth-disable") + if trustpoint_name: + cmd.append("trustpoint {trustpoint_name}".format(trustpoint_name=trustpoint_name)) + if virtual_ipv4: + cmd.append("virtual-ip ipv4 {virtual_ipv4}".format(virtual_ipv4=virtual_ipv4)) + if virtual_ipv6: + cmd.append("virtual-ip ipv6 {virtual_ipv6}".format(virtual_ipv6=virtual_ipv6)) + if watch_add_ipv4: + cmd.append("watch-list add-item ipv4 {watch_add_ipv4}".format(watch_add_ipv4=watch_add_ipv4)) + if watch_add_ipv6: + cmd.append("watch-list add-item ipv6 {watch_add_ipv6}".format(watch_add_ipv6=watch_add_ipv6)) + if dynamic_expiry_timeout: + cmd.append("watch-list dynamic-expiry-timeout {dynamic_expiry_timeout}".format(dynamic_expiry_timeout=dynamic_expiry_timeout)) + if enabled_watch_list: + cmd.append("watch-list enabled") + if webauth_bypass_intercept_name: + cmd.append("webauth-bypass-intercept {webauth_bypass_intercept}".format(webauth_bypass_intercept=webauth_bypass_intercept)) + if webauth_http_enable: + cmd.append("webauth-http-enable") + if banner_file_name: + cmd.append("banner file {banner_file_name}".format(banner_file_name=banner_file_name)) + if banner_text: + cmd.append("banner text {banner_text}".format(banner_text=banner_text)) + if banner_title: + cmd.append("banner title {banner_title}".format(banner_title=banner_title)) + if captive_bypass_portal: + cmd.append("captive-bypass-portal") + if cisco_logo_disable: + cmd.append("cisco-logo-disable") + if consent_email: + cmd.append("consent email") + if custom_page: + if device_failure_file_name: + cmd.append("custom-page failure device {device_failure_file_name}".format(device_failure_file_name=device_failure_file_name)) + if login_device_name: + cmd.append("custom-page login device {login_device_name}".format(login_device_name=login_device_name)) + if login_expired_device_name: + cmd.append("custom-page login expired device {login_expired_device_name}".format(login_expired_device_name=login_expired_device_name)) + if custom_page_success_name: + cmd.append("custom-page failure device {custom_page_success_name}".format(custom_page_success_name=custom_page_success_name)) + if logout_window_disabled: + cmd.append("logout-window-disabled") + if max_http_conns: + cmd.append("max-http-conns {max_http_conns}".format(max_http_conns=max_http_conns)) + if redirect_command: + cmd.append("redirect {redirect_command}".format(redirect_command=redirect_command)) + if sleeping_client_timeout: + cmd.append("sleeping-client timeout {sleeping_client_timeout}".format(sleeping_client_timeout=sleeping_client_timeout)) + if success_window_disable: + cmd.append("success-window-disable") + if timeout_seconds: + cmd.append("timeout init-state sec {timeout_seconds}".format(timeout_seconds=timeout_seconds)) + if type_name: + cmd.append("type {type_name}".format(type_name=type_name)) + + try: + device.configure(cmd) + except SubCommandFailure as error: + raise SubCommandFailure( + f"Could not configure class-map on device. Error:\n{error}" + ) + +def unconfigure_parameter_map(device, parameter_map_name): + """ unconfigure paramter map + Args: + device ('obj'): device to use + parameter_map_name ('str'): parameter-map name (max 99 char) + Returns: + None + Raises: + SubCommandFailure: Failed to unconfigure interface-template sticky timer + """ + cmd = f'no parameter-map type webauth {parameter_map_name}' + log.debug("Unconfigure Parameter map") + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to unconfigure parameter map {parameter_map_name}.Error:\n{e}" + ) \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py index 9a6bd15bb..22a4aec42 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py @@ -158,13 +158,14 @@ def unconfigure_crypto_pki_server(device, server_name): def configure_crypto_pki_server( device, - domain_name, - database_level, - issuer_name, - hash, - modulus_size, - password, - server_name, + domain_name=None, + database_level=None, + issuer_name=None, + hash=None, + modulus_size=None, + password=None, + server_name=None, + **kwargs ): """Configures crypto pki server on device @@ -185,6 +186,10 @@ def configure_crypto_pki_server( SubCommandFailure: Failed to configure crypto pki server on device """ + if kwargs: + from genie.libs.sdk.apis.iosxe.pki.configure import configure_crypto_pki_server as pki_configure_crypto_pki_server + return pki_configure_crypto_pki_server(device=device, server_name=server_name, database_level=database_level, issuer_name=issuer_name, password=password, **kwargs) + def send_password(spawn, password): spawn.sendline(password) 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 43c3bd03f..9ac388420 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 @@ -1246,7 +1246,7 @@ def unconfigure_ipv6_flow_monitor(device, interface, monitor_name,direction): SubCommandFailure """ cmd = [f"interface {interface}".format(interface=interface), - f"ipv6 flow monitor {monitor_name} {direction}".format(monitor_name=monitor_name,direction=direction)] + f"no ipv6 flow monitor {monitor_name} {direction}".format(monitor_name=monitor_name,direction=direction)] try: device.configure(cmd) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/igmp_snooping/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/igmp_snooping/configure.py index 3714695c3..07b6a29f7 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/igmp_snooping/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/igmp_snooping/configure.py @@ -324,3 +324,48 @@ def unconfigure_ip_igmp_snooping_vlan_static(device, vlan_id, group_ip, interfac log.error(e) raise SubCommandFailure(f"Could not unconfigure ip igmp snooping vlan id static interface. Error:\n{e}") +def configure_ip_igmp_querier_query_interval(device, query_type, query_interval): + """ + Configure ip igmp snooping querier query-interval 100 + + Args: + device('obj'): Device object + query_type('str'): query-interval IGMP querier query interval (sec) + query_interval('int'): <1-18000> IGMP querier query interval (sec) + + Returns: + None + + Raises: + SubCommandFailure + """ + cmd = f"ip igmp snooping querier {query_type} {query_interval}" + try: + device.configure(cmd) + except SubCommandFailure as e: + log.error(e) + raise SubCommandFailure(f"Could not configure ip igmp snooping querier query-interval. Error:\n{e}") + +def configure_ip_igmp_querier_tcn_query_count(device, query_type, action_type, query_count): + """ + Configure ip igmp snooping querier tcn query count 10 + + Args: + device('obj'): Device object + query_type('str'):tcn IGMP querier TCN related parameters + action_type('str'): count IGMP querier TCN query count + interval IGMP querier TCN query interval (sec) + query_count('int'):<1-10> IGMP querier TCN query count + + Returns: + None + + Raises: + SubCommandFailure + """ + cmd = f"ip igmp snooping querier {query_type} query {action_type} {query_count}" + try: + device.configure(cmd) + except SubCommandFailure as e: + log.error(e) + raise SubCommandFailure(f"Could not configure ip igmp snooping querier tcn query count 10. Error:\n{e}") \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py index dc98c9f06..3039355f2 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py @@ -3,8 +3,12 @@ import re import time +# Genie +from genie.utils.timeout import Timeout + # Unicon from unicon.eal.dialogs import Statement, Dialog +from unicon.core.errors import SubCommandFailure log = logging.getLogger(__name__) @@ -907,3 +911,77 @@ def slow_sendline(spawn): log.info(f"install rollback operation got {result} on {device.name}") return output if not match else match +def execute_install_package_reload_fast(device, image_dir, image, reload_fast=True, timeout=1600, connect_timeout=300): + """ + Install package reloadfast + Args: + device ("obj"): Device object + image_dir ("str"): Directory where the image is located + image ("str"): Image filename + reload_fast ("bool"): Whether to use reloadfast. Default is True. + timeout ("int", optional): Timeout value. Default is 1600 seconds. + connect_timeout ("int", optional): Time to wait before sending the prompt + (when pattern "Press RETURN to get started" matches) + Returns: + True if install succeeded else False + Raises: + SubCommandFailure + """ + + def slow_sendline(spawn): + time.sleep(connect_timeout) + spawn.sendline('') + + dialog = Dialog([ + Statement(pattern=r".*\[y/n\]", + action="sendline(y)", + args=None, + loop_continue=True, + continue_timer=False), + Statement(pattern=r".*Please confirm you have changed boot config to .*\/packages\.conf \[y/n\]", + action="sendline(y)", + args=None, + loop_continue=True, + continue_timer=False), + Statement(pattern=r".*you may save configuration and re-enter the command\. \[y/n/q\]", + action="sendline(y)", + args=None, + loop_continue=True, + continue_timer=False), + Statement(pattern=r"%s.*# " % device.name, + action=None, + args=None, + loop_continue=True, + continue_timer=False), + Statement(pattern=r".*Press RETURN to get started.*", + action=slow_sendline, + args=None, + loop_continue=False, + continue_timer=False), + Statement(pattern = r".*SUCCESS: install_add_activate_commit.*", + action = None, + args = None, + loop_continue = False, + continue_timer = False), + ]) + + cmd = "install add file {image_dir}{image} activate".format(image_dir=image_dir, image=image) + if reload_fast: + cmd += " reloadfast" + + cmd += " commit" + + log.info(f"Perform install reloadfast {device.name}") + + try: + device.api.execute_write_memory() + output = device.execute(cmd, reply=dialog, timeout=timeout) + log.info(f"{cmd} is successful on {device.name}") + except Exception as e: + log.error(f"Error while executing {cmd} on {device.name}: {e}") + return False + + match = re.search(r".*SUCCESS: install_add_activate_commit.*", output) + result = 'successful' if match else 'failed' + log.info(f"install reloadfast {result} on {device.name}") + return output if match else match \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/clear.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/clear.py index 48a62f592..27f9ee7d1 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/clear.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/clear.py @@ -28,4 +28,23 @@ def clear_interface_range(device, interface, interface_range): except SubCommandFailure as e: raise SubCommandFailure( f"Could not clear interface range on {interface}. Error:\n{e}" + ) + +def clear_ip_dhcp_snooping_binding_on_interface(device, interface): + """ Clear ip dhcp snooping binding on interface + Args: + device (`obj`): Device object + interface('str'): interface name + Return: + None + Raise: + SubCommandFailure + """ + log.debug("Executing clear_ip_dhcp_snooping_binding_on_interface API") + cmd = [f'clear ip dhcp snooping binding interface {interface}'] + try: + device.execute(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f'Failed to clear DHCPv4 server statistics on {interface} \n{e}' ) \ 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 2c60747da..4fe848dd5 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 @@ -9484,6 +9484,71 @@ def unconfigure_interface_ip_nbar(device,interface): raise SubCommandFailure( f"Could not unconfigure ip nbar Error:\n{e}") + +def config_interface_prpchannel( + device, + interface, + prpchannel_num): + + """ Configure prp-channel on an interface + + Args: + device (`obj`): Device object + interface (`str`): Interface to which prp channel is added + prpchannel_num (`str`): Prp channel group number + + Returns: + None + Warning messages + + Raises: + SubCommandFailure + """ + + log.debug(f"Configuring PRP channel on interface {interface}") + + cmd = [] + cmd.append(f"interface {interface}") + cmd.append(f"prp-channel-group {prpchannel_num}") + + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure prp channel on interace Error:\n{e}") + + +def unconfig_interface_prpchannel( + device, + prpchannel_num): + + """ UnConfigure prp-channel on an interface + + Args: + device (`obj`): Device object + prpchannel_num (`str`): Prp channel group number + + Returns: + None + Warning messages + + Raises: + SubCommandFailure + """ + + log.debug(f"UnConfiguring PRP channel") + + cmd = [] + cmd.append(f"no interface prp-channel {prpchannel_num}") + + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not unconfigure prp channel on interace Error:\n{e}") + + + def configure_interface_vlan(device, vlan_id): """ Configures interface vlan id Example : interface vlan 1 @@ -9507,7 +9572,7 @@ def configure_interface_vlan(device, vlan_id): def configure_interface_range_no_switchport(device, start_interface, end_interface): - """ Configure interface range no switchport + """ Configure interface range no switchport Args: device ('obj'): device to use start_interface('str'): Starting Interface 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 d6b7e7c13..6530c1fe0 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 @@ -35,7 +35,8 @@ def configure_management_credentials(device, credentials='default', username=Non 'aaa new-model', 'aaa authentication login default local', 'aaa authorization exec default local', - f'username {username} password {password}' + f'username {username} password 0 {password}', + f'username {username} privilege 15' ]) if config: @@ -58,10 +59,7 @@ def configure_management_vrf(device, vrf=None, protocols=None): ''' - try: - management = device.management - except AttributeError: - management = {} + management = getattr(device, 'management', {}) vrf = vrf or management.get('vrf') @@ -155,10 +153,7 @@ def configure_management_ip(device, device.api.configure_management_ip() ''' - try: - management = device.management - except AttributeError: - management = {} + management = getattr(device, 'management', {}) address_dict = address or management.get('address') address = [] @@ -276,10 +271,7 @@ def configure_management_gateway(device, device.api.configure_management_gateway(gateway={'ipv4': '1.1.1.254'}) ''' - try: - management = device.management - except AttributeError: - management = {} + management = getattr(device, 'management', {}) gateway_dict = gateway or management.get('gateway') gateway = [] @@ -372,10 +364,7 @@ def configure_management_routes(device, }) ''' - try: - management = device.management - except AttributeError: - management = {} + management = getattr(device, 'management', {}) routes_dict = routes or management.get('routes') if routes_dict is None: @@ -427,10 +416,7 @@ def configure_management_tftp(device, None ''' - try: - management = device.management - except AttributeError: - management = {} + management = getattr(device, 'management', {}) source_interface = source_interface or management.get('interface') @@ -443,6 +429,36 @@ def configure_management_tftp(device, device.configure(tftp_config) +def configure_management_ntp(device, server_name=None, source_interface=None): + ''' + Configure device for time synchronization via ntp. + + Args: + device ('obj'): device object + server_name ('str'): name of the server in the testbed, default: 'ntp' + source_interface ('str'): management interface (optional) + + Returns: + None + ''' + server_name = server_name or 'ntp' + ntp_server = device.testbed.servers.get(server_name, {}) + ntp_address = ntp_server.get('address') + if not ntp_address: + log.warning('No NTP server address found, skipping NTP configuration.') + return + + ntp_config = [f'ntp server {ntp_address}'] + + management = getattr(device, 'management', {}) + + source_interface = source_interface or management.get('interface') + if source_interface: + ntp_config.append(f'ntp source {source_interface}') + + return device.configure(ntp_config) + + def configure_management_http(device, source_interface=None): @@ -457,10 +473,7 @@ def configure_management_http(device, None ''' - try: - management = device.management - except AttributeError: - management = {} + management = getattr(device, 'management', {}) source_interface = source_interface or management.get('interface') @@ -642,10 +655,7 @@ def configure_management_protocols(device, ''' - try: - management = device.management - except AttributeError: - management = {} + management = getattr(device, 'management', {}) protocols = protocols or management.get('protocols', []) @@ -722,10 +732,7 @@ def configure_management(device, protocols ('list', optional): [list of protocols] set_hostname (bool): Configure hostname on the device (default: False) ''' - try: - management = device.management - except AttributeError: - management = {} + management = getattr(device, 'management', {}) address = address or management.get('address') gateway = gateway or management.get('gateway') @@ -756,6 +763,7 @@ def configure_management(device, protocols=protocols ) + def unconfigure_netconf_yang_polling(device): """ configure unconfigure netconf_yang cisco-odm parameters polling enable Args: @@ -770,16 +778,17 @@ def unconfigure_netconf_yang_polling(device): device.configure(config) except SubCommandFailure as e: raise SubCommandFailure(f"Failed to configure unconfigure netconf_yang cisco-odm parameters polling enable. Error:\n{e}") - + + def configure_mtc(device, version, interface=None, protocol=None, address=None): - """ Configure parameters for mtc + """ Configure parameters for mtc Args: device ('obj'): device object version ('str'): protocol version ipv4 or ipv6 interface ('str') or ('list'): interfaces of mtc protocol ('str') or ('list'): protocols of mtc address ('str'): mtc ipv4 or ipv6 address - + Returns: None Raises: @@ -808,15 +817,16 @@ def configure_mtc(device, version, interface=None, protocol=None, address=None): device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f'Could not configure the parameter under mtc. Error:\n{e}') - + + def unconfigure_mtc_parameters(device, version, interface=None, protocol=None): - """ Unconfigure parameters for mtc + """ Unconfigure parameters for mtc Args: device ('obj'): device object version ('str'): protocol version ipv4 or ipv6 interface ('str') or ('list'): interface under mtc protocol ('str') or ('list'): protocols of mtc - + Returns: None Raises: @@ -842,13 +852,14 @@ def unconfigure_mtc_parameters(device, version, interface=None, protocol=None): device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f'Could not unconfigure the parameter under mtc. Error:\n{e}') - + + def unconfigure_mtc(device, version): - """ Unconfigure mtc + """ Unconfigure mtc Args: device ('obj'): device object version ('str'): protocol version ipv4 or ipv6 - + Returns: None Raises: @@ -860,7 +871,8 @@ def unconfigure_mtc(device, version): device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f'Could not unconfigure mtc. Error:\n{e}') - + + def configure_netconf_yang_intelligent_sync(device): """ Configure netconf-yang cisco-ia intelligent-sync Args: @@ -876,6 +888,7 @@ def configure_netconf_yang_intelligent_sync(device): except SubCommandFailure as e: raise SubCommandFailure(f"Failed to configure netconf-yang cisco-ia intelligent-sync. Error:\n{e}") + def unconfigure_netconf_yang_intelligent_sync(device): """ Unconfigure netconf-yang cisco-ia intelligent-sync Args: @@ -891,8 +904,9 @@ def unconfigure_netconf_yang_intelligent_sync(device): except SubCommandFailure as e: raise SubCommandFailure(f"Failed to unconfigure netconf-yang cisco-ia intelligent-sync. Error:\n{e}") + def configure_ip_ssh_version(device, version): - + """ Configure ip ssh version Args: device ('obj'): Device object @@ -909,8 +923,9 @@ def configure_ip_ssh_version(device, version): except SubCommandFailure as e: raise SubCommandFailure(f"Failed to configure ip ssh version on device {device}. Error:\n{e}") + def unconfigure_ip_ssh_version(device, version): - + """ Unconfigure ip ssh version Args: device ('obj'): Device object @@ -927,14 +942,15 @@ def unconfigure_ip_ssh_version(device, version): except SubCommandFailure as e: raise SubCommandFailure(f"Failed to unconfigure ip ssh version on device {device}. Error:\n{e}") + def configure_line_vty_needs_enhancement(device,firstline_id,lastline_id,min,sec): - """ configure_line_vty_needs_enhancement + """ configure_line_vty_needs_enhancement Args: device ('obj'): device to execute on firstline_id ('int') : firstline identifier - lastline_id ('int') : lastline identifier + lastline_id ('int') : lastline identifier min ('int') : timeout in minutes - sec ('int') : timeout in seconds + sec ('int') : timeout in seconds Return: None @@ -945,13 +961,14 @@ def configure_line_vty_needs_enhancement(device,firstline_id,lastline_id,min,sec "transport preferred ssh", "exec-timeout {min} {sec}".format(min=min,sec=sec), "transport input all", - "transport output all"] + "transport output all"] try: device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure( "Failed to configure_line_vty_needs_enhancement Error {e}".format(e=e)) - + + def unconfigure_management_netconf(device): ''' Unonfigure device for management via netconf. @@ -967,8 +984,9 @@ def unconfigure_management_netconf(device): try: device.configure(netconf_config) except SubCommandFailure as e: - raise SubCommandFailure(f"Failed to unconfigure netconf-yang on device {device}. Error:\n{e}") - + raise SubCommandFailure(f"Failed to unconfigure netconf-yang on device {device}. Error:\n{e}") + + def configure_management_gnmi(device, enable=True, server=True, port=None, **kwargs): ''' Configure device for management via gnmi. @@ -990,6 +1008,4 @@ def configure_management_gnmi(device, enable=True, server=True, port=None, **kwa port=port ) except SubCommandFailure as e: - raise SubCommandFailure(f"Failed to configure gnmi on device {device}. Error:\n{e}") - - + raise SubCommandFailure(f"Failed to configure gnmi on device {device}. Error:\n{e}") diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py index be9f4d5df..0b30c2f80 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nat/configure.py @@ -521,12 +521,14 @@ def unconfigure_standard_access_list( log.error(e) raise SubCommandFailure("Could not UnConfigure standard access-list") -def configure_enable_nat_scale(device, timeout=60): +def configure_enable_nat_scale(device, timeout=60, nat_aot=True, nat_scale=True): """ Configure enable NAT scale Args: device (`obj`): Device object timeout ('int', optional): Max time for enable nat scale.Defaults to 60 + nat_aot ('boolean', optional): Flag to enable nat aot + nat_scale ('boolean', optional): Flag to enable nat scale Returns: None Raises: @@ -539,10 +541,12 @@ def configure_enable_nat_scale(device, timeout=60): action='sendline(yes)', loop_continue=False, continue_timer=False)]) - - command = [ "no ip nat create flow-entries", - "nat scale"] - + command = [] + if nat_aot: + command.append("no ip nat create flow-entries") + if nat_scale: + command.append("nat scale") + try: device.configure( command, @@ -994,24 +998,27 @@ def unconfigure_dynamic_nat_outside_rule( log.error(e) raise SubCommandFailure("Could not UnConfigure dynamic NAT outside rule") -def configure_disable_nat_scale(device): +def configure_disable_nat_scale(device, nat_aot=True, nat_scale=True): """ Configure disable NAT scale Args: device (`obj`): Device object + nat_aot ('boolean', optional): Flag to disable nat aot + nat_scale ('boolean', optional): Flag to disable nat scale Returns: None Raises: SubCommandFailure """ + command = [] + if nat_aot: + command.append("ip nat create flow-entries") + if nat_scale: + command.append("no nat scale") + try: - device.configure( - [ - "ip nat create flow-entries", - "no nat scale" - ] - ) + device.configure(command) except SubCommandFailure as e: log.error(e) raise SubCommandFailure("Could not configure disable NAT scale") diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py index 0c70c0529..4349ee4f4 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py @@ -2697,3 +2697,64 @@ def redistribute_bgp_on_ospfv3(device, pid, type, as_num): except SubCommandFailure as e: raise SubCommandFailure(f"Failed to redistribute bgp on ospfv3 {device}, Error: {e}" ) + +def unconfigure_ipv6_router_ospf(device, ospf_process_id): + + """Remove ipv6 ospf on device + Args: + device (`obj`): Device object + ospf_process_id (`int`): OSPF process id + Returns: + None + Raises: + SubCommandFailure + """ + try: + device.configure(f"no ipv6 router ospf {ospf_process_id}") + except SubCommandFailure as e: + raise SubCommandFailure("Failed in configuring, Please verify") from e + +def configure_ospfv3_network_type(device, interface, network_type): + """Configure OSPFv3 network type on the specified interface + Args: + device (`obj`): Device object + interface (`str`): Interface name (e.g., 'GigabitEthernet1/0/24') + network_type (`str`): OSPFv3 network type ('point-to-point', 'broadcast', 'non-broadcast', 'point-to-multipoint') + Returns: + None + Raises: + SubCommandFailure + """ + try: + cmd = [ + f"interface {interface}", + f"ospfv3 network {network_type}" + ] + + device.configure(cmd) + + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to configure OSPFv3 network type as '{network_type}' on interface {interface}. Error:\n{e}" + ) + +def configure_ospfv3_interface(device, interface, process_id): + """Configure OSPFv3 settings on the specified interface. + Args: + device (`obj`): Device object + interface (`str`): Interface name (e.g., 'GigabitEthernet1/0/24') + process_id (`int`): OSPFv3 Process ID (1-65535) + Returns: + None + Raises: + SubCommandFailure + """ + try: + cmd = [f"interface {interface}", + f"ospfv3 {process_id}"] + device.configure(cmd) + + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to configure OSPFv3 on interface {interface}. Error:\n{e}" + ) \ No newline at end of file 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 d11e11dd0..d17e537c2 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 @@ -11,7 +11,7 @@ from genie.metaparser.util.exceptions import SchemaEmptyParserError def configure_crypto_pki_server(device, - server_name, + server_name=None, password=None, auto_rollover_time=None, cdp_url_type=None, @@ -42,7 +42,8 @@ def configure_crypto_pki_server(device, enrollment_path=None, revoke_chk=None, key_len=None, - port=80): + port=80, + **kwargs): ''' Configure crypto pki server @@ -84,6 +85,11 @@ def configure_crypto_pki_server(device, True/False ''' + if kwargs: + from genie.libs.sdk.apis.iosxe.eaptls.configure import configure_crypto_pki_server as eaptls_configure_crypto_pki_server + return eaptls_configure_crypto_pki_server(device=device, server_name=server_name, issuer_name=issuer_name, + password=password, **kwargs) + dialog = Dialog([ Statement(pattern=r'.*Password:', action=f'sendline({password})', 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 db131100b..85367d6f0 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 @@ -4517,6 +4517,27 @@ def hw_module_beacon_RP_active_standby(device, supervisor, operation): raise SubCommandFailure(f'Failed to turn {operation} the {supervisor} beacon slot. Error:\n{e}') +def configure_snmp_mib_bulkstat_transfer(device, transfer_name): + """ configure snmp mib bulkstat transfer + Args: + device ('obj'): Device object + transfer_name ('str'): Name of bulk transfer + + Returns: + None + Raises: + SubCommandFailure + """ + cmd = [ + f"snmp mib bulkstat transfer {transfer_name}", + "no enable" + ] + + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to configure snmp mib bulkstat transfer on this device. Error:\n{e}") + def configure_bba_group_session_auto_cleanup(device,name,session_auto_cleanup): """ bba-group Args: @@ -4541,6 +4562,40 @@ def configure_bba_group_session_auto_cleanup(device,name,session_auto_cleanup): .format(device=device, error=e) ) +def configure_service_compress_config(device): + """ service compress-config + Args: + device ('obj'): Device object + Returns: + None + Raises: + SubCommandFailure + """ + try: + device.configure('service compress-config') + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure dservice compress-config {device}. Error:\n{e}" + + ) + +def unconfigure_service_compress_config(device): + """ service compress-config + Args: + device ('obj'): Device object + Returns: + None + Raises: + SubCommandFailure + """ + try: + device.configure('no service compress-config') + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not unconfigure dservice compress-config {device}. Error:\n{e}" + + ) + def configure_bridge_domain(device,domain_number): """ bridge-domain @@ -4563,7 +4618,6 @@ def configure_bridge_domain(device,domain_number): .format(device=device, error=e) ) - def unconfigure_bridge_domain(device,domain_number): """ bridge-domain Args: @@ -4584,3 +4638,724 @@ def unconfigure_bridge_domain(device,domain_number): "Could not unconfig bridge-domain on {device}. Error:\n{error}" .format(device=device, error=e) ) + +def configure_ip_sftp_username(device, username): + """ Configure username for sftp + Args: + device ('obj'): Device object + username ('str'): username + Raises: + SubCommandFailure + """ + + cmd = f'ip sftp username {username}' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to configure ip sftp username on device {device}. Error:\n{e}" + ) + +def unconfigure_ip_sftp_username(device): + """ Unconfigure username for sftp + Args: + device ('obj'): Device object + Raises: + SubCommandFailure + """ + + cmd = f'no ip sftp username' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to unconfigure ip sftp username on device {device}. Error:\n{e}" + ) + +def configure_ip_scp_username(device, username): + """ Configure username for scp + Args: + device ('obj'): Device object + username ('str'): username + Raises: + SubCommandFailure + """ + + cmd = f'ip scp username {username}' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to configure ip scp username on device {device}. Error:\n{e}" + ) + +def unconfigure_ip_scp_username(device): + """ Unconfigure username for scp + Args: + device ('obj'): Device object + Raises: + SubCommandFailure + """ + + cmd = f'no ip scp username' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to unconfigure ip scp username on device {device}. Error:\n{e}" + ) +def configure_ip_scp_password(device, password): + """ Configure password for scp + Args: + device ('obj'): Device object + password ('str'): password + Raises: + SubCommandFailure + """ + + cmd = f'ip scp password {password}' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to configure ip scp password on device {device}. Error:\n{e}" + ) + +def unconfigure_ip_scp_password(device): + """ Unconfigure password for scp + Args: + device ('obj'): Device object + Raises: + SubCommandFailure + """ + + cmd = f'no ip scp password' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to unconfigure ip scp password on device {device}. Error:\n{e}" + ) +def configure_ip_sftp_password(device, password): + """ Configure password for sftp + Args: + device ('obj'): Device object + password ('str'): password + Raises: + SubCommandFailure + """ + + cmd = f'ip sftp password {password}' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to configure ip sftp password on device {device}. Error:\n{e}" + ) + +def unconfigure_ip_sftp_password(device): + """ Unconfigure password for sftp + Args: + device ('obj'): Device object + Raises: + SubCommandFailure + """ + + cmd = f'no ip sftp password' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to unconfigure ip sftp password on device {device}. Error:\n{e}" + ) + +def configure_rep_admin_vlan(device, vlanId, segment_number): + """ configure rep admin vlan + Args: + device ('obj'): device to use + segment ('str') : configure segment <1-1024> Between 1 and 1024 + vlanId ('str') : configure vlan ID + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f"rep admin vlan {vlanId} segment {segment_number}" + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to config admin vlan. Error:\n{e}") + +def unconfigure_rep_admin_vlan(device, vlanId, segment_number): + """ unconfigure rep admin vlan + Args: + device ('obj'): device to use + segment ('str') : unconfigure segment <1-1024> Between 1 and 1024 + vlanId ('str') : configure vlan ID + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f"no rep admin vlan {vlanId} segment {segment_number}" + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to config admin vlan. Error:\n{e}") + +def copy_file_with_sftp(device, host, file, username=None, password=None, path=None, timeout=30): + """ Copy files to sftp location + + Args: + device ('obj'): Device object to modify configuration + host ('str'): sftp host ip address + file('str'): file name + username ('str',optional): sftp host VM username + password ('str',optional): sftp host vm password + path('str',optional): storage file path in the VM + ex:) + copy file sftp://username:password@host/ + timeout('int', Optional): timeout in seconds for configuration file load to device(Default is 30 seconds) + Returns: + None + Raises: + SubCommandFailure + """ + + log.debug(f"copy files from dut to sftp server on {host}") + + if (username and password): + dialog = Dialog([ + Statement(pattern=r'.*Address or name of remote host.*', + action='sendline()', + loop_continue=True, + continue_timer=False), + Statement(pattern=r'.*Destination filename.*', + action='sendline()', + loop_continue=True, + continue_timer=False) + ]) + + cmd = f"copy {file} sftp://{username}:{password}@{host}/{file}" + + elif (username == None) and password: + dialog = Dialog([ + Statement(pattern=r'.*Address or name of remote host.*', + action='sendline()', + loop_continue=True, + continue_timer=False), + Statement(pattern=r'.*Destination filename.*', + action='sendline()', + loop_continue=True, + continue_timer=False), + Statement(pattern=r'.*Password:', + action=f'sendline({password})', + loop_continue=True, + continue_timer=False), + ]) + + cmd = f"copy {file} sftp://{host}/{file}" + + else: + dialog = Dialog([ + Statement(pattern=r'.*Address or name of remote host.*', + action='sendline()', + loop_continue=True, + continue_timer=False), + Statement(pattern=r'.*Destination filename.*', + action='sendline()', + loop_continue=True, + continue_timer=False) + ]) + + cmd = f"copy {file} sftp://{host}/{file}" + + try: + out = device.execute(cmd,reply=dialog, timeout=timeout) + + except SubCommandFailure as e: + raise SubCommandFailure(f"Could not copy running configuration on sftp. Error:\n{e}") + + return out + +def copy_file_with_scp(device, host, file, username=None, password=None, path=None, timeout=30): + """ Copy files to sftp location + + Args: + device ('obj'): Device object to modify configuration + host ('str'): scp host ip address + file('str'): file name + username ('str',optional): sftp host VM username + password ('str',optional): sftp host vm password + path('str',optional): storage file path in the VM + ex:) + copy file scp://username:password@host/ + timeout('int', Optional): timeout in seconds for configuration file load to device(Default is 30 seconds) + Returns: + None + Raises: + SubCommandFailure + """ + log.debug(f"copy files from dut to scp server on {host}") + + if (username and password): + dialog = Dialog([ + Statement(pattern=r'.*Address or name of remote host.*', + action='sendline()', + loop_continue=True, + continue_timer=False), + Statement(pattern=r'.*Destination filename.*', + action='sendline()', + loop_continue=True, + continue_timer=False) + ]) + + cmd = f"copy {file} scp://{username}:{password}@{host}/{file}" + + elif (username == None) and password: + dialog = Dialog([ + Statement(pattern=r'.*Address or name of remote host.*', + action='sendline()', + loop_continue=True, + continue_timer=False), + Statement(pattern=r'.*Destination filename.*', + action='sendline()', + loop_continue=True, + continue_timer=False), + Statement(pattern=r'.*Password:', + action=f'sendline({password})', + loop_continue=True, + continue_timer=False), + ]) + + cmd = f"copy {file} scp://{host}/{file}" + + else: + dialog = Dialog([ + Statement(pattern=r'.*Address or name of remote host.*', + action='sendline()', + loop_continue=True, + continue_timer=False), + Statement(pattern=r'.*Destination filename.*', + action='sendline()', + loop_continue=True, + continue_timer=False) + ]) + + cmd = f"copy {file} scp://{host}/{file}" + + try: + out = device.execute(cmd,reply=dialog, timeout=timeout) + + except SubCommandFailure as e: + raise SubCommandFailure(f"Could not copy running configuration on scp. Error:\n{e}") + + return out + +def configure_periodic_time_range( + device, + time_range_name, + periodicity, + start_time, + end_time, +): + """Configure periodic time range + Args: + device ('obj'): device object + time_range_name ('str'): time range name + periodicity ('str'): The periodicity for the time range ex: daily, weekdays, weekend, friday, monday + start_time ('str') : The start time in the format HH:MM + end_time ('str') : The end time in the format HH:MM + Return: + None + Raises: + SubCommandFailure + """ + config = [ + f'time-range {time_range_name}', + f'periodic {periodicity} {start_time} to {end_time}', + ] + + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f'Failed to configure periodic time range on {device.name}\n{e}' + ) + +def unconfigure_periodic_time_range( + device, + time_range_name, + periodicity, + start_time, + end_time, +): + """Unconfigure periodic time range + Args: + device ('obj'): device object + time_range_name ('str'): time range name + periodicity ('str'): The periodicity for the time range ex: daily, weekdays, weekend, friday, monday + start_time ('str') : The start time in the format HH:MM + end_time ('str') : The end time in the format HH:MM + Return: + None + Raises: + SubCommandFailure + """ + config = [ + f'time-range {time_range_name}', + f'no periodic {periodicity} {start_time} to {end_time}', + ] + + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f'Failed to unconfigure periodic time range on {device.name}\n{e}' + ) + +def configure_absolute_time_range( + device, + time_range_name, + action_type, + time, + day, + month, + year, +): + """Configure absolute time range + Args: + device ('obj'): device object + time_range_name ('str'): time range name + action_type ('str') : start time/end time + time ('str') : The start time/end time of the time range in the format HH:MM + day ('int') : Day of the month (1-31) + month ('str') : Month of the year (eg: Jan for January, Jun for June) + year ('int') : Year (1993-2035) + Return: + None + Raises: + SubCommandFailure + """ + config = [ + f'time-range {time_range_name}', + f'absolute {action_type} {time} {day} {month} {year}', + ] + + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f'Failed to configure absolute time range on {device.name}\n{e}' + ) + +def unconfigure_absolute_time_range( + device, + time_range_name, + action_type, + time, + day, + month, + year, +): + """Unconfigure absolute time range + Args: + device ('obj'): device object + time_range_name ('str'): time range name + action_type ('str') : start time/end time + time ('str') : The start time/end time of the time range in the format HH:MM + day ('int') : Day of the month (1-31) + month ('str') : Month of the year (eg: Jan for January, Jun for June) + year ('int') : Year (1993-2035) + Return: + None + Raises: + SubCommandFailure + """ + config = [ + f'time-range {time_range_name}', + f'no absolute {action_type} {time} {day} {month} {year}', + ] + + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f'Failed to unconfigure absolute time range on {device.name}\n{e}' + ) + +def configure_hw_module_logging_onboard(device, slot): + """ Configures OBFL on the specified slot + Example : hw-module slot logging onboard + Args: + device ('obj'): device to use + slot ('int'): slot number to configure + Returns: + None + Raises: + SubCommandFailure + """ + log.info(f"Configuring OBFL on module {slot} on {device.name}") + config = f"hw-module slot {slot} logging onboard" + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to configure OBFL on module {slot} on device {device.name}. Error:\n{e}") + +def unconfigure_hw_module_logging_onboard(device, slot): + """ Unconfigures OBFL on the specified slot + Example : no hw-module slot logging onboard + Args: + device ('obj'): device to use + slot ('int'): slot number to configure + Returns: + None + Raises: + SubCommandFailure + """ + log.info(f"Unconfiguring OBFL on module {slot} on {device.name}") + config = f"no hw-module slot {slot} logging onboard" + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to unconfigure OBFL on module {slot} on device {device.name}. Error:\n{e}") + +def configure_hw_module_slot_logging_onboard_voltage(device, slot): + """ configures hw-module slot <#> logging onboard voltage + Args: + device ('obj'): device to use + slot ('int'): slot number to configure + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f"hw-module slot {slot} logging onboard voltage" + + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + "Failed to configure hw-module slot {slot} logging onboard voltage on the device {dev}. Error:\n{error}".format( + dev=device.name, + slot=slot, + error=e, + ) + ) + +def unconfigure_hw_module_slot_logging_onboard_voltage(device, slot): + """ unconfigures hw-module slot <#> logging onboard voltage + Args: + device ('obj'): device to use + slot ('int'): slot number to configure + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f"no hw-module slot {slot} logging onboard voltage" + + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + "Failed to unconfigure hw-module slot {slot} logging onboard voltage on the device {dev}. Error:\n{error}".format( + dev=device.name, + slot=slot, + error=e, + ) + ) + +def configure_hw_module_slot_logging_onboard_environment(device, slot): + """ configures hw-module slot <#> logging onboard environment + Args: + device ('obj'): device to use + slot ('int'): slot number to configure + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f"hw-module slot {slot} logging onboard environment" + + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + "Failed to configure hw-module slot {slot} logging onboard environment on the device {dev}. Error:\n{error}".format( + dev=device.name, + slot=slot, + error=e, + ) + ) + +def unconfigure_hw_module_slot_logging_onboard_environment(device, slot): + """ unconfigures hw-module slot <#> logging onboard environment + Args: + device ('obj'): device to use + slot ('int'): slot number to configure + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f"no hw-module slot {slot} logging onboard environment" + + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + "Failed to unconfigure hw-module slot {slot} logging onboard environment on the device {dev}. Error:\n{error}".format( + dev=device.name, + slot=slot, + error=e, + ) + ) + +def configure_hw_module_slot_logging_onboard_temperature(device, slot): + """ configures hw-module slot <#> logging onboard temperature + Args: + device ('obj'): device to use + slot ('int'): slot number to configure + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f"hw-module slot {slot} logging onboard temperature" + + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + "Failed to configure hw-module slot {slot} logging onboard temperature on the device {dev}. Error:\n{error}".format( + dev=device.name, + slot=slot, + error=e, + ) + ) + +def unconfigure_hw_module_slot_logging_onboard_temperature(device, slot): + """ unconfigures hw-module slot <#> logging onboard temperature + Args: + device ('obj'): device to use + slot ('int'): slot number to configure + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f"no hw-module slot {slot} logging onboard temperature" + + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + "Failed to unconfigure hw-module slot {slot} logging onboard temperature on the device {dev}. Error:\n{error}".format( + dev=device.name, + slot=slot, + error=e, + ) + ) + +def configure_clear_logging_onboard_slot_voltage(device, slot): + """ configures clear logging onboard slot voltage + Args: + device ('obj'): device to use + slot ('int'): slot number to configure + Returns: + None + Raises: + SubCommandFailure + """ + dialog = Dialog( + [ + Statement( + pattern=r".*Clear logging.*", + action="sendline(y)", + loop_continue=False, + continue_timer=False, + ) + ] + ) + cmd = "clear logging onboard slot {slot} voltage".format(slot=slot) + try: + device.execute(cmd, reply=dialog) + + except SubCommandFailure as e: + raise SubCommandFailure( + "Failed to configure clear logging onboard slot {slot} voltage on the device {dev}. Error:\n{error}".format( + dev=device.name, + slot=slot, + error=e, + ) + ) + +def configure_clear_logging_onboard_slot_environment(device, slot): + """ unconfigures clear logging onboard slot Environment + Args: + device ('obj'): device to use + slot ('int'): slot number to configure + Returns: + None + Raises: + SubCommandFailure + """ + dialog = Dialog( + [ + Statement( + pattern=r".*Clear logging.*", + action="sendline(y)", + loop_continue=False, + continue_timer=False, + ) + ] + ) + cmd = "clear logging onboard slot {slot} environment".format(slot=slot) + try: + device.execute(cmd, reply=dialog) + + except SubCommandFailure as e: + raise SubCommandFailure( + "Failed to configure clear logging onboard slot {slot} environment on the device {dev}. Error:\n{error}".format( + dev=device.name, + slot=slot, + error=e, + ) + ) + +def configure_clear_logging_onboard_slot_temperature(device, slot): + """ unconfigures clear logging onboard slot temperature + Args: + device ('obj'): device to use + slot ('int'): slot number to configure + Returns: + None + Raises: + SubCommandFailure + """ + dialog = Dialog( + [ + Statement( + pattern=r".*Clear logging.*", + action="sendline(y)", + loop_continue=False, + continue_timer=False, + ) + ] + ) + cmd = "clear logging onboard slot {slot} temperature".format(slot=slot) + try: + device.execute(cmd, reply=dialog) + + except SubCommandFailure as e: + raise SubCommandFailure( + "Failed to configure clear logging onboard slot {slot} temperature on the device {dev}. Error:\n{error}".format( + dev=device.name, + slot=slot, + error=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 fb0fb24c7..f6e419098 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 @@ -19,7 +19,6 @@ from unicon.eal.dialogs import Statement, Dialog from unicon.core.errors import StateMachineError,SubCommandFailure - # Logger log = logging.getLogger(__name__) @@ -1457,13 +1456,13 @@ def execute_dir_file_system(device, file_system, sub_directory=None, timeout=120 def execute_archive_tar(device, tar_filename, operation_type, src_filesystem, src_filepath=None, dest_filesystem=None, dest_filepath=None, timeout=120): - """ Execute archive tar + """ Execute archive tar Example: archive tar /create usb0:usb_files.tar bootflash:/tracelogs archive tar /xtract usb0:usb_files.tar usb0:new-tar-files Args: device ('obj'): Device object dest_filesystem ('str'): specifying filesystems such as bootflash:,usb:, tftp: - tar_filename('str'): tar filename + tar_filename('str'): tar filename operation_type('str'): Option can be xtract, table, create src_filesystem ('str'): specifying filesystems such as bootflash:,usb:, tftp: src_filepath ('str',optional): specifying files path which need to be archived,Default is None @@ -1473,7 +1472,7 @@ def execute_archive_tar(device, tar_filename, operation_type, src_filesystem, sr output Raises: SubCommandFailure - """ + """ if operation_type not in ('create', 'xtract', 'table') : raise ValueError('Operation type must be "xtract", "table" or "create"') @@ -1540,7 +1539,7 @@ def execute_switch_card_OIR_power_force(device, card_slot, subslot): except SubCommandFailure as e: - raise SubCommandFailure(f"Could not execute hw-module subslot {card_slot}/{subslot} oir power force. Error:\n{e}") + raise SubCommandFailure(f"Could not execute hw-module subslot {card_slot}/{subslot} oir power force. Error:\n{e}") def request_platform_software_package_expand(device, file_system, test_image, sub_directory=None,timeout=240): @@ -1551,20 +1550,20 @@ def request_platform_software_package_expand(device, file_system, test_image, su file_system ('str'): bootflash: , harddisk: , usb0: test_image ('str'): image_name sub_directory ('str',optional): subdirectory inside the filesystem where the test image is present,Default is None - timeout ('int'): Max time + timeout ('int'): Max time Returns: None Raises: SubCommandFailure """ - + try: if sub_directory: cmd = f'request platform software package expand file {file_system}/{sub_directory}/{test_image}' - + else : cmd = f'request platform software package expand file {file_system}/{test_image}' - + device.execute(cmd,timeout=timeout) except SubCommandFailure as e: @@ -1575,7 +1574,7 @@ def execute_clear_ipv6_mld_group(device, interface=None): """ clear ipv6 mld group Args: device (`obj`) : Device object - interface('str',optional): Interface name + interface('str',optional): Interface name Returns: None Raises: @@ -1583,7 +1582,7 @@ def execute_clear_ipv6_mld_group(device, interface=None): """ log.debug(f"Clear ipv6 mld group on {device}") - + cmd = "clear ipv6 mld group" if interface: cmd += f" {interface}" @@ -1598,7 +1597,7 @@ def execute_clear_ip_igmp_group(device, interface=None): """ clear ipv6 mld group Args: device (`obj`) : Device object - interface('str',optional): Interface name + interface('str',optional): Interface name Returns: None Raises: @@ -1615,3 +1614,55 @@ def execute_clear_ip_igmp_group(device, interface=None): except SubCommandFailure as e: raise SubCommandFailure(f"Could not clear ip igmp group on {device}. Error:\n{e}") +def execute_more_file(device, filepath, regex): + """ Executes more file | inc + Example : more bootflash:test.txt | inc ucode + Args: + device ('obj'): device to use + filepath ('str'): path to the file, including the filename (eg. bootflash:test.txt) + regex ('str',optional): regular expression for the inc (eg. ucode) + Returns: + output + Raises: + SubCommandFailure + """ + log.debug(f'Executing more {filepath} | i {regex} on {device.name}') + cmd = f'more {filepath}' + if regex: + cmd += f' | i {regex}' + try: + output = device.execute(cmd) + return output + + except SubCommandFailure as e: + raise SubCommandFailure( + f'Failed to execute more {filepath} | count {regex} on device {device.name}. Error:\n{e}' + ) + +def execute_platform_virtualization(device, slot_type, slot_status): + """ Executes set platform hardware rom-monitor virtualization + Example : set platform hardware rom-monitor virtualization rp active + Args: + device ('obj'): device to use + slot_type ('str'): slot type options F0,F1,FP,R0,R1,RP + slot_status ('str', optional): options can be active,standby. Applicable only for slot types RP and FP. + Returns: + output + Raises: + SubCommandFailure + """ + log.debug(f'Executing set platform hardware rom-monitor virtualization {slot_type} {slot_status} on {device.name}') + cmd = f'set platform hardware rom-monitor virtualization {slot_type}' + + if slot_status: + cmd += f' {slot_status}' + + try: + output = device.execute(cmd) + return output + except SubCommandFailure as e: + raise SubCommandFailure( + f'Failed to execute set platform hardware rom-monitor virtualization {slot_type} {slot_status} on device {device.name}. Error:\n{e}' + ) + + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/utils.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/utils.py index 00e301cfc..59a935b4a 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/utils.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/utils.py @@ -546,3 +546,27 @@ def erase_startup_config(device): raise SubCommandFailure( f'could not erase startup config on {device}. Error:\n{e}') +def clear_logging_onboard_rp_active_standby(device, rp_active_standby): + """ clears logging onboard rp active/standby + Example: clear logging onboard rp active/standby + Args: + device ('obj'): Device object + rp_active_standby('str'): Rp active/standby + Returns: + None + Raises: + SubCommandFailure + """ + dialog = Dialog([ + Statement( + pattern=r'.*Clear logging onboard buffer\[y\/n\]', + action='sendline(y)', + loop_continue=False + ) + ]) + config = f"clear logging onboard rp {rp_active_standby}" + try: + device.execute(config, reply=dialog) + except SubCommandFailure as e: + raise SubCommandFailure(f"Could not clear logging onboard rp {rp_active_standby} on {device.name}. Error:\n{e}") + \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py index f5469e0b1..3ce9f0632 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_map/configure.py @@ -198,24 +198,50 @@ def configure_shape_map(device, queue_name=None, class_map_list=[], ) ) -def configure_bandwidth_remaining_policy_map(device,policy_names, - class_names,bandwidth_list,shape_average,bandwidth_remaining=True): +def configure_policy_map_on_device(device, policy_map_name, class_map_name, target_bit_rate): + """ Configure policy-map type on Device + Args: + device (`obj`): Device object + policy_map_name ('str'): policy-map name to configure + class_map_name ('str'): class map name to configure + target_bit_rate ('str'): target bit rate to configure (in bits/sec) + Return: + None + Raise: + SubCommandFailure: Failed configuring policy-map on device + """ + log.debug("Configuring policy-map on device") + + try: + device.configure( + [ + f"policy-map {policy_map_name}", + f"class {class_map_name}", + f"shape average {target_bit_rate}", + ] + ) + except SubCommandFailure: + raise SubCommandFailure("Could not configure policy-map on device") + +def configure_bandwidth_remaining_policy_map(device, policy_names, shape_average, + class_names=None, bandwidth_list=None, + bandwidth_remaining=True): """ Configures policy_map Args: device ('obj'): device to use policy_names('list) : list of policy-maps i.e. parent and grandparent - class_names ('list') : list of classes inside policy-map i.e voice, video etc. - bandwidth_list ('list) : list of bandwidth remainin for each class. shape_average ('str') : shaper percentage value for grandparent + class_names ('list', optional) : list of classes inside policy-map i.e voice, video etc. + bandwidth_list ('list, optional) : list of bandwidth remainin for each class. bandwidth_remaining ('bool') : If true, sets percentage of remaining bandwidth. Else, sets percentage of total bandwidth. Defaults to True. example: policy_names=['parent','grandparent'] + shape_average = '100' class_names = ['voice','data','video','class-default'] bandwidth_list = [20,10,10,10,30] - shape_average = 100 Returns: None Raises: @@ -225,18 +251,19 @@ def configure_bandwidth_remaining_policy_map(device,policy_names, counter = 0 cli = [f"policy-map {policy_names[0]}"] - for class_val in class_names: - cli.append(f"class {class_val}") - if bandwidth_remaining: - cli.append(f"bandwidth remaining percent {bandwidth_list[counter]}") - else: - cli.append(f"bandwidth percent {bandwidth_list[counter]}") - counter += 1 + if (class_names) and (bandwidth_list): + for class_val in class_names: + cli.append(f"class {class_val}") + if bandwidth_remaining: + cli.append(f"bandwidth remaining percent {bandwidth_list[counter]}") + else: + cli.append(f"bandwidth percent {bandwidth_list[counter]}") + counter += 1 - cli.append(f"policy-map {policy_names[1]}") + cli.append(f"policy-map {policy_names[0]}") cli.append(f"class class-default") cli.append(f"shape average percent {shape_average}") - cli.append(f"service-policy {policy_names[0]}") + cli.append(f"service-policy {policy_names[1]}") try: device.configure(cli) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py index c22f978ec..470eadefd 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/get.py @@ -496,22 +496,33 @@ def get_next_hops_with_vrf(device, route, output=None, vrf='default'): 'next_hop_list'] source_protocol_codes = route_dict[masked_route]['source_protocol_codes'] for index in next_hop_list: - next_hop = next_hop_list[index]['next_hop'] if 'vrf' in next_hop_list[index]: vrf = next_hop_list[index]['vrf'].split(':')[0] else: vrf = 'default' + if 'next_hop' in next_hop_list[index]: + next_hop = next_hop_list[index]['next_hop'] + else: + if 'binding_label' in next_hop_list[index]: + binding_label = next_hop_list[index]['binding_label'] + out = device.parse(f'show ip cef label-table {binding_label} internal') + next_hop = out.q.get_values('outgoing_address') + out_intf = out.q.get_values('outgoing_interface') + for nh, oi in list(set(zip(next_hop, out_intf))): + route_next_hops.append([nh, vrf, oi, source_protocol_codes]) + continue + else: + raise Exception('No next hop or binding label found') if 'outgoing_interface' in next_hop_list[index]: out_intf = next_hop_list[index]['outgoing_interface'] else: out_intf = None route_next_hops.append([next_hop, vrf, out_intf, source_protocol_codes]) - return route_next_hops or [] except Exception as e: - log.error(f"An exception has occurred.\n{e}") + log.exception(f"An exception has occurred.\n{e}") return None def get_outgoing_interface_with_vrf(device, route, vrf='default'): @@ -532,15 +543,22 @@ def _get_outgoing_interface(route, vrf): prefix = device.api.get_routes(route=route, vrf=vrf) return device.api.get_next_hops_with_vrf(route=prefix[0], vrf=vrf) + # recursively loop until outgoing interface is found while not interfaces: nexthops = _get_outgoing_interface(route, vrf) - for each_nh in nexthops: - if each_nh[2] is not None: - # append outgoing interface - interfaces.append(each_nh) - else: - route = each_nh[0] - vrf = each_nh[1] + if nexthops: + for each_nh in nexthops: + if each_nh[2] is not None: + # append outgoing interface + interfaces.append(each_nh) + else: + # prevent recursive endless loop + if route == each_nh[0] and vrf == each_nh[1]: + log.error('Something went wrong.') + return [] + else: + route = each_nh[0] + vrf = each_nh[1] return interfaces diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py index a1b0a1298..4decf96e3 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/snmp/configure.py @@ -49,7 +49,7 @@ def configure_snmp_server_view(device, mib_view, family_name, state = 'excluded' device ('obj'): device to use mib_view ('str'): Name of the view family_name ('str'): MIB view family name - state ('str'): mib family excluded|included + state ('str'): mib family excluded|included Returns: None Raises: @@ -221,7 +221,7 @@ def configure_snmp_server_trap(device, intf=None, host_name=None, trap_type=None elif trap_type: cli = f"snmp-server enable traps {trap_type}" else: - cli = f"snmp-server enable traps" + cli = f"snmp-server enable traps" try: device.configure(cli) @@ -255,7 +255,7 @@ def unconfigure_snmp_server_trap(device, intf=None, host_name=None, trap_type=N elif trap_type: cli = f"no snmp-server enable traps {trap_type}" else: - cli = f"no snmp-server enable traps" + cli = f"no snmp-server enable traps" try: device.configure(cli) @@ -264,7 +264,7 @@ def unconfigure_snmp_server_trap(device, intf=None, host_name=None, trap_type=N on snmp-server. Error:\n{str(error)}") def configure_snmp_server_user(device, - user_name, + user_name, group_name, version, auth_type = None, @@ -304,8 +304,11 @@ def configure_snmp_server_user(device, cli = f"snmp-server user {user_name} {group_name} {version}" - if auth_type is not None and auth_password is not None: - cli = f"{cli} auth {auth_type} {auth_password}" + if auth_type and auth_password: + cli += f" auth {auth_type}" + if auth_algorithm: + cli += f" {auth_algorithm}" + cli += f" {auth_password}" if priv_method is not None: if(priv_method == 'aes'): @@ -330,7 +333,7 @@ def configure_snmp_server_user(device, def unconfigure_snmp_server_user(device, - user_name, + user_name, group_name, version, auth_type = None, @@ -401,17 +404,17 @@ def configure_snmp_host_version(device,host_name,vrf_id,version_id,community_str SubCommandFailure """ log.debug("Configuring snmp host version on device {device}".format(device=device)) - + if udp_port == 0: cmd = f"snmp-server host {host_name} vrf {vrf_id} version {version_id} {community_string}" else: cmd = f"snmp-server host {host_name} vrf {vrf_id} version {version_id} {community_string} udp-port {udp_port}" - try: - device.configure(cmd) + try: + device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure("Could not configure snmp host version. Error:\n{error}".format(error=e)) - + def unconfigure_snmp_host_version(device,host_name,vrf_id,version_id,community_string, udp_port = 0): """ UnConfigures the snmp-server host 172.21.226.240 vrf Mgmt-vrf version 2c public on device @@ -428,17 +431,17 @@ def unconfigure_snmp_host_version(device,host_name,vrf_id,version_id,community_s SubCommandFailure """ log.debug("Configuring snmp host version on device {device}".format(device=device)) - + if udp_port == 0: cmd = f"no snmp-server host {host_name} vrf {vrf_id} version {version_id} {community_string}" else: cmd = f"no snmp-server host {host_name} vrf {vrf_id} version {version_id} {community_string} udp-port {udp_port}" try: - device.configure(cmd) + device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure("Could not configure snmp host version. Error:\n{error}".format(error=e)) - + def configure_debug_snmp_packets(device): """ enable snmp debugs on device Args: @@ -479,7 +482,7 @@ def configure_snmp_server_enable_traps_power_ethernet_group(device, number, ip, """ Configure snmp-server enable traps power-ethernet group Args: device ('obj'): Device object - number ('str'): The group number + number ('str'): The group number ip ('str') : ip address snmp_v ('str'): snmpv1/v2c community string or snmpv3 user name name ('str'): snmp community string @@ -587,7 +590,7 @@ def unconfigure_snmp_server_engineid(device): except SubCommandFailure as e: raise SubCommandFailure(f"Could not un configure snmp server engineID . Error:\n{e}") - + def enable_ietf_standard_snmp_link_traps(device): """ Enable ietf standard snmp link traps @@ -632,14 +635,14 @@ def configure_snmp_server_host_trap(device, host_name=None, trap_type=None): None Raises: SubCommandFailure - """ + """ try: device.configure(f"snmp-server host {host_name} traps public {trap_type}") except SubCommandFailure as error: raise SubCommandFailure(f"Could not configure host on snmp-server. Error:\n{str(error)}") - -def unconfigure_snmp_server_enable_traps_power_ethernet_group(device, action_type_1, action_type_2, group_number): + +def unconfigure_snmp_server_enable_traps_power_ethernet_group(device, action_type_1, action_type_2, group_number): """unconfigure snmp server enable traps power ethernet group Args: @@ -647,7 +650,7 @@ def unconfigure_snmp_server_enable_traps_power_ethernet_group(device, action_typ action_type_1 ('str'): logging or traps action_type_2 ('str'): group or police group_number ('int') : The group number (1-9) - + Return: None Raises: @@ -679,15 +682,15 @@ def configure_object_list_schema_transfer_for_bulkstat(device, type_, object_nam schema_name('str', optional): WORD Name of the schema, default value is None transfer_name('str', optional): WORD Name of bulk transfer, default value is None oid_value_list:('list', optional): WORD Object name or OID list, default value is None - poll_interval('int', optional): Periodicity for the polling of objects in this schema in + poll_interval('int', optional): Periodicity for the polling of objects in this schema in Minutes. (Default value is 5 Mins), default value is None snmp_interface('str', optional): Specify instance as ifDescr, default value is None format_('str', optional): An ASCII format containing schema definitions, default value is None transfer_interval('int', optional): Periodicity for the transfer of bulk data in Minutes, default value is None buffer_size('int', optional): Bulkstat data file maximum size(Default size is 2048 bytes), default value is None primary_url('str', optional): WORD URL of primary destination, default value is None - enable('str', optional): Start Data Collection for this Configuration, default value is None - logging_on('str', optional): Modify message logging facilities, default value is None + enable('str', optional): Start Data Collection for this Configuration, default value is None + logging_on('str', optional): Modify message logging facilities, default value is None Returns: None Raises: 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 df8d2da34..d7bc2f34e 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 @@ -784,3 +784,33 @@ def configure_spanning_tree_portfast_on_interface(device, interface, option=None raise SubCommandFailure( f'Could not configure spanning-tree portfast - Error:\n{error}' ) + +def unconfigure_spanning_tree_etherchannel_misconfig(device): + '''Unconfigures spanning tree etherchannel misconfig + Args: + device ('obj') : Device object + Returns: + None + Raises: + SubCommandFailure: Failed to unconfigure spanning tree etherchannel misconfig + ''' + config = 'no spanning-tree etherchannel guard misconfig' + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure("Failed to unconfigure spanning tree etherchannel misconfig.Error:\n{e}") + +def configure_spanning_tree_etherchannel_misconfig(device): + '''configures spanning tree etherchannel misconfig + Args: + device ('obj') : Device object + Returns: + None + Raises: + SubCommandFailure: Failed to configure spanning tree etherchannel misconfig + ''' + config = 'spanning-tree etherchannel guard misconfig' + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure("Failed to configure spanning tree etherchannel misconfig.Error:\n{e}") diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py index ec531c832..19bc4cff7 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py @@ -676,17 +676,21 @@ def get_mgmt_ip_and_mgmt_src_ip_addresses(device, mgmt_src_ip=None): tcp_output = device.execute('show tcp brief | inc .22 |.23 ') # 0160C06C 5.25.26.9.22 5.25.24.1.51363 ESTAB - mgmt_src_ip_addresses = set(re.findall(r'\w+ +\S+\.(?:22|23) +(\S+)\.\d+ +ESTAB', tcp_output)) - if not mgmt_src_ip_addresses: + mgmt_addresses = list(set(re.findall(r'\w+ +(\S+)\.(?:22|23) +(\S+)\.\d+ +ESTAB', tcp_output))) + if not mgmt_addresses: log.error('Unable to find management session, cannot determine management IP addresses') - if mgmt_src_ip: - m = re.search(rf'\w+ +(\S+)\.(22|23) +{mgmt_src_ip}\.\d+ +ESTAB', tcp_output) - else: - m = re.search(r'\w+ +(\S+)\.(22|23) +\S+\.\d+ +ESTAB', tcp_output) - if m: - mgmt_ip = m.group(1) + mgmt_src_ip_addresses = set([ip[1] for ip in mgmt_addresses if ip[1]]) + mgmt_ip_addresses = list(set([ip[0] for ip in mgmt_addresses if ip[0]])) + + for ip_pair in mgmt_addresses: + if mgmt_src_ip == ip_pair[1]: + mgmt_ip = ip_pair[0] + break else: + mgmt_ip = mgmt_ip_addresses[0] + + if not mgmt_ip: log.error('Unable to find management session, cannot determine IP address') mgmt_ip = None @@ -1933,3 +1937,24 @@ def delete_directory(device, file_system, directory): device.execute(f"rmdir {file_system}{directory}", reply=dialog) except SubCommandFailure as e: raise SubCommandFailure(f"Could not delete directory {directory} from device ") + +def format_directory(device, directory, timeout=200): + """ format directory + Args: + device ('obj'): Device object + directory('str'): Directory name ex:crashinfo: + Returns: + None + Raises: + SubCommandFailure + """ + log.info("format directory on {device}".format(device=device)) + + dialog = Dialog([Statement(pattern=r".* Continue\? \[confirm\]", action='sendline(\r)', + loop_continue=True,continue_timer=False)]) + + cmd = f"format {directory}" + try: + device.execute(cmd, timeout=timeout, reply=dialog) + except SubCommandFailure as e: + raise SubCommandFailure(f'Could not format directory on {device}. Error:\n{e}') \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vdsl/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vdsl/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py index b6c744a93..89e49a18d 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py @@ -914,6 +914,58 @@ def unconfigure_vtp_password(device, vtp_password): raise SubCommandFailure( f"Failed to unconfigure vtp password on device {device}. Error:\n{e}") +def configure_interface_vlan_priority(device, vlan_id, priority): + """ + Args: + device ('obj'): Device object + vlan_id ('int') : <1-4094> Vlan interface id + priority ('int') : <50-200> Vlan interface priority + Returns: + None + Raises: + SubcommandFailure: Failed executing command + """ + + log.debug("interface vlan {vlan_id}".format(vlan_id=vlan_id)) + configs = [] + configs.append("interface vlan {vlan_id}".format(vlan_id=vlan_id)) + configs.append("standby {vlan_id} priority {priority}".format(vlan_id=vlan_id, priority=priority)) + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not set the vlan {vlan_id} priority {priority} on {device}. Error:\n{error}".format( + vlan_id=vlan_id, priority=priority, device=device, error=e + ) + ) + +def configure_interface_vlan_range_priority(device, vlan_id_from, vlan_id_to, stby_value, priority): + """ + Args: + device ('obj'): Device object + vlan_id_from ('int') : <1-4094> Vlan interface vlan_id_from + vlan_id_to ('int') : <1-4094> Vlan interface vlan_id_to + stby_value ('int') : value after stanby (Ex. : 0) + priority ('int') : <50-200> Vlan interface priority + Returns: + None + Raises: + SubcommandFailure: Failed executing command + """ + + log.debug("interface range vlan {vlan_id_from}-{vlan_id_to}".format(vlan_id_from=vlan_id_from,vlan_id_to=vlan_id_to)) + configs = [] + configs.append("interface range vlan {vlan_id_from}-{vlan_id_to}".format(vlan_id_from=vlan_id_from, vlan_id_to=vlan_id_to)) + configs.append("standby {stby_value} priority {priority}".format(stby_value=stby_value, priority=priority)) + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not set the vlan range {vlan_id_from}-{vlan_id_to} priority {priority} on {device}. Error:\n{error}".format( + vlan_id_from=vlan_id_from, vlan_id_to=vlan_id_to, priority=priority, device=device, error=e + ) + ) + def configure_switchport_trunk_pruning_vlan_except(device, interface, string): """Configure switchport trunk pruning vlan except Example: interface gigabitEthernet2/0/1 @@ -1062,3 +1114,83 @@ def unconfigure_pvlan_type(device, vlan, pvlan_type): device.configure(config) except SubCommandFailure as e: raise SubCommandFailure(f'Could not unconfigure private-vlan. Error:\n{e}') + +def configure_vtp_pruning(device): + """ Configure vtp pruning + Args: + device ('obj'): device to use + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f'vtp pruning' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f'Could not configure vtp pruning. Error:\n{e}') + +def unconfigure_vtp_pruning(device): + """ Unconfigure vtp pruning + Args: + device ('obj'): device to use + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f'no vtp pruning' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f'Could not configure no vtp pruning. Error:\n{e}') + +def configure_switchport_trunk_pruning_vlan(device, interface, pruning_vlan): + """ Configure switchport trunk pruning vlan + Args: + device ('obj'): device to use + interface ('str'): interface name + pruning_vlan ('str'): pruning vlan + Returns: + None + Raises: + SubCommandFailure + """ + cmd = [f'interface {interface}',f'switchport trunk pruning vlan {pruning_vlan}'] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f'Could not configure switchport trunk pruning vlan. Error:\n{e}') + +def unconfigure_switchport_trunk_pruning_vlan(device, interface, pruning_vlan): + """ Unconfigure switchport trunk pruning vlan + Args: + device ('obj'): device to use + interface ('str'): interface name + pruning_vlan ('str'): pruning vlan + Returns: + None + Raises: + SubCommandFailure + """ + cmd = [f'interface {interface}',f'no switchport trunk pruning vlan {pruning_vlan}'] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f'Could not configure no switchport trunk pruning vlan. Error:\n{e}') + +def unconfigure_vtp_mode(device, mode): + """ Unconfigures global VTP mode + Args: + device ('obj'): device to use + mode ('str'): VTP mode (i.e transparent, client, server) + Returns: + None + Raises: + SubCommandFailure + """ + cmd = f'no vtp mode {mode}' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f'Could not configure no vtp mode. Error:\n{e}') diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py index 09488f5c0..f0d2cfc7c 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vrf/configure.py @@ -746,9 +746,14 @@ def configure_scale_vrf_via_tftp( for count in range(vrf_count): cmds += ''' vrf definition {vrf} + rd {vrf}:{vrf} + ! address-family ipv4 + exit-address-family + ! address-family ipv6 - exit + exit-address-family + ! '''.format(vrf=vrf_name) vrf_name += vrf_name_step diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/c8000/utils.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/c8000/utils.py index 513314a2e..ecb79900c 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/c8000/utils.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/c8000/utils.py @@ -24,7 +24,7 @@ def get_mgmt_src_ip_addresses(device): def get_mgmt_ip_and_mgmt_src_ip_addresses(device, mgmt_src_ip=None): """ Get the management IP address and management source addresses. - + if the mgmt_src_ip is provided, will use that for the lookup. If not, will select the 1st matching IP. Args: @@ -37,23 +37,23 @@ def get_mgmt_ip_and_mgmt_src_ip_addresses(device, mgmt_src_ip=None): # tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 32230/sshd # tcp 0 0 1.1.1.161:22 1.1.1.26:60718 ESTABLISHED 24543/sshd: admin [ mgmt_addresses = re.findall(r'\w+ +(\S+):(?:22|23) +(\S+):\d+ +ESTAB', tcp_output) - - if mgmt_src_ip: - # tcp 0 0 1.1.1.161:22 1.1.1.26:60718 ESTABLISHED 24543/sshd: admin [ - m = re.search(rf'\w+ +(\S+):(?:22|23) +{mgmt_src_ip}:\d+ +ESTAB', tcp_output) - else: - # tcp 0 0 1.1.1.161:22 1.1.1.26:60718 ESTABLISHED 24543/sshd: admin [ - m = re.search(r'\w+ +(\S+):(?:22|23) +(\S+):\d+ +ESTAB', tcp_output) - if m: - mgmt_ip = m.group(1) + + mgmt_src_ip_addresses = set([ip[1] for ip in mgmt_addresses if ip[1]]) + mgmt_ip_addresses = list(set([ip[0] for ip in mgmt_addresses if ip[0]])) + + for ip_pair in mgmt_addresses: + if mgmt_src_ip == ip_pair[1]: + mgmt_ip = ip_pair[0] + break else: + mgmt_ip = mgmt_ip_addresses[0] + + if not mgmt_ip: log.error('Unable to find management session, cannot determine IP address') mgmt_ip = None - if mgmt_addresses: - mgmt_src_ip_addresses = set([m[1] for m in mgmt_addresses]) - else: - log.error('Unable to find management session, cannot determine management IP addresses') - return [] + + if not mgmt_ip or not mgmt_src_ip_addresses: + return None log.info('Device management IP: {}'.format(mgmt_ip)) log.info('Device management source IP addresses: {}'.format(mgmt_src_ip_addresses)) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/utils.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/utils.py index c79495558..ed8a79ae3 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/utils.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/utils.py @@ -304,7 +304,7 @@ def get_mgmt_src_ip_addresses(device): def get_mgmt_ip_and_mgmt_src_ip_addresses(device, mgmt_src_ip=None): """ Get the management IP address and management source addresses. - + if the mgmt_src_ip is provided, will use that for the lookup. If not, will select the 1st matching IP. Args: @@ -316,24 +316,23 @@ def get_mgmt_ip_and_mgmt_src_ip_addresses(device, mgmt_src_ip=None): # 0x00007f2fbc01b4b8 0x60000000 0 32 127.1.1.2:23 127.1.1.1:54860 ESTAB mgmt_addresses = re.findall(r'\w+ +(\S+):(?:22|23) +(\S+):\d+ +ESTAB', tcp_output) - - if mgmt_src_ip: - # 0x00007f2fbc01b4b8 0x60000000 0 32 127.1.1.2:23 127.1.1.1:54860 ESTAB - m = re.search(rf'\w+ +(\S+):(?:22|23) +{mgmt_src_ip}:\d+ +ESTAB', tcp_output) - else: - # 0x00007f2fbc01b4b8 0x60000000 0 32 127.1.1.2:23 127.1.1.1:54860 ESTAB - m = re.search(r'\w+ +(\S+):(?:22|23) +(\S+):\d+ +ESTAB', tcp_output) - if m: - mgmt_ip = m.group(1) + + mgmt_src_ip_addresses = set([ip[1] for ip in mgmt_addresses if ip[1]]) + mgmt_ip_addresses = list(set([ip[0] for ip in mgmt_addresses if ip[0]])) + + for ip_pair in mgmt_addresses: + if mgmt_src_ip == ip_pair[1]: + mgmt_ip = ip_pair[0] + break else: + mgmt_ip = mgmt_ip_addresses[0] + + if not mgmt_ip: log.error('Unable to find management session, cannot determine IP address') mgmt_ip = None - - if mgmt_addresses: - mgmt_src_ip_addresses = set([m[1] for m in mgmt_addresses]) - else: - log.error('Unable to find management session, cannot determine management IP addresses') - return [] + + if not mgmt_ip or not mgmt_src_ip_addresses: + return None log.info('Device management IP: {}'.format(mgmt_ip)) log.info('Device management source IP addresses: {}'.format(mgmt_src_ip_addresses)) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/nxapi/rest.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/nxapi/rest.py index 9e12f0cd0..d4c7debb5 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/nxapi/rest.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/nxapi/rest.py @@ -133,7 +133,10 @@ def nxapi_method_nxapi_rest(device, action, commands='', input_type='cli', if isinstance(output, list): output = output[-1] - output = output.get('result', {}).get('msg') + if isinstance(output, dict): + output = output.get('result', {}).get('msg') + else: + output = list(output.json())[-1].get("result", {}).get("msg") # The nxapi returns this at the end of the message. # But the GUI strips it - So it gets stripped here too @@ -458,4 +461,4 @@ def _nxapi_payload_builder( sid=sid, input=command) - return payload \ No newline at end of file + return payload diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/utils.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/utils.py index ec4732b72..4e08c7d2c 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/utils.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/utils.py @@ -227,7 +227,7 @@ def get_mgmt_src_ip_addresses(device): def get_mgmt_ip_and_mgmt_src_ip_addresses(device, mgmt_src_ip=None): """ Get the management IP and source IP addresses connected via SSH to the device. - + if the mgmt_src_ip is provided, will use that for the lookup. If not, will select the 1st matching IP. Args: @@ -241,28 +241,23 @@ def get_mgmt_ip_and_mgmt_src_ip_addresses(device, mgmt_src_ip=None): mgmt_addresses = re.findall( r'tcp\s+ESTABLISHED\s+0\s+(\S+)\((?:22|23)\).+management +\d+ +(\S+)\(\d+\)', show_sockets_output, re.S) - - if mgmt_src_ip: - # tcp ESTABLISHED 0 5.25.25.5(23) - m = re.search( - rf'tcp\s+ESTABLISHED\s+0\s+(\S+)\((?:22|23)\).+management +\d+ +({mgmt_src_ip})\(\d+\)', - show_sockets_output, re.S) - else: - # tcp ESTABLISHED 0 5.25.25.5(23) - m = re.search( - r'tcp\s+ESTABLISHED\s+0\s+(\S+)\((?:22|23)\).+management +\d+ +(\S+)\(\d+\)', - show_sockets_output, re.S) - if m: - mgmt_ip = m.groups(0) + + mgmt_src_ip_addresses = set([ip[1] for ip in mgmt_addresses if ip[1]]) + mgmt_ip_addresses = list(set([ip[0] for ip in mgmt_addresses if ip[0]])) + + for ip_pair in mgmt_addresses: + if mgmt_src_ip == ip_pair[1]: + mgmt_ip = ip_pair[0] + break else: + mgmt_ip = mgmt_ip_addresses[0] + + if not mgmt_ip: log.error('Unable to find management session, cannot determine IP address') mgmt_ip = None - if mgmt_addresses: - mgmt_src_ip_addresses = set([m[1] for m in mgmt_addresses]) - else: - log.error('Unable to find management session, cannot determine management IP addresses') - return [] + if not mgmt_ip or not mgmt_src_ip_addresses: + return None log.info('Device management IP: {}'.format(mgmt_ip)) log.info('Device management source IP addresses: {}'.format(mgmt_src_ip_addresses)) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/execute/power_cycler_apis/test_api_power_cycler_apis.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/execute/power_cycler_apis/test_api_power_cycler_apis.py index 9a8a98ecc..9218a0950 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/execute/power_cycler_apis/test_api_power_cycler_apis.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/execute/power_cycler_apis/test_api_power_cycler_apis.py @@ -150,7 +150,7 @@ def setUpClass(self): peripherals: power_cycler: - type: generic-cli - host: sjc-ads-5555 + host: localhost connection_type: ssh outlets: [6] commands: @@ -161,11 +161,11 @@ def setUpClass(self): platform: c9800 type: c9800 - sjc-ads-5555: + localhost: os: linux connections: a: - ip: sjc-ads-5555 + ip: localhost protocol: ssh credentials: default: @@ -175,7 +175,7 @@ def setUpClass(self): """ self.testbed = loader.load(testbed) self.device = self.testbed.devices["FW-9800-7"] - self.server = self.testbed.devices["sjc-ads-5555"] + self.server = self.testbed.devices["localhost"] def test_execute_power_on_device(self): @@ -215,7 +215,7 @@ def setUpClass(self): peripherals: power_cycler: - type: generic-cli - host: sjc-ads-5555 + host: localhost connection_type: ssh commands: power_on: "power-tool %{self} on" @@ -225,11 +225,11 @@ def setUpClass(self): platform: c9800 type: c9800 - sjc-ads-5555: + localhost: os: linux connections: a: - ip: sjc-ads-5555 + ip: localhost protocol: ssh credentials: default: @@ -239,7 +239,7 @@ def setUpClass(self): """ self.testbed = loader.load(testbed) self.device = self.testbed.devices["FW-9800-7"] - self.server = self.testbed.devices["sjc-ads-5555"] + self.server = self.testbed.devices["localhost"] def test_execute_power_on_device(self): @@ -278,7 +278,7 @@ def setUpClass(self): peripherals: power_cycler: - type: Raritan - host: sjc-ads-5555 + host: localhost connection_type: telnet outlets: [7] @@ -286,11 +286,11 @@ def setUpClass(self): platform: c9800 type: c9800 - sjc-ads-5555: + localhost: os: linux connections: a: - ip: sjc-ads-5555 + ip: localhost protocol: telnet credentials: default: @@ -300,7 +300,7 @@ def setUpClass(self): """ self.testbed = loader.load(testbed) self.device = self.testbed.devices["FW-9800-7"] - self.server = self.testbed.devices["sjc-ads-5555"] + self.server = self.testbed.devices["localhost"] def test_execute_power_on_device(self): @@ -322,4 +322,4 @@ def test_execute_power_off_device(self): expected_calls = [ call('power outlets 7 off', reply=ANY), ] - self.assertEqual(self.server.execute.call_args_list, expected_calls) \ No newline at end of file + self.assertEqual(self.server.execute.call_args_list, expected_calls) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/apphosting/configure/enable_usb_ssd_verify_exists/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/apphosting/configure/enable_usb_ssd_verify_exists/mock_data/iosxe/mock_data.yaml index 53577620c..5fa34fbb7 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/apphosting/configure/enable_usb_ssd_verify_exists/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/apphosting/configure/enable_usb_ssd_verify_exists/mock_data/iosxe/mock_data.yaml @@ -5,13 +5,14 @@ configure: line console 0: new_state: configure_line no logging console: '' - prompt: T1-9300-SP1(config)# + no platform usb disable: "no platform usb disable\r\njavelin-morph-mini1a(config)#" + prompt: javelin-morph-mini1a-c9300-stack(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: T1-9300-SP1(config-line)# + prompt: javelin-morph-mini1a-c9300-stack(config-line)# connect: commands: ? '' @@ -30,15 +31,15 @@ execute: new_state: configure show running-config | include platform usb disable | include platform usb disable: response: - - $ include platform usb disable | include platform usb disable + - '' response_type: circular show version: response: - - "Cisco IOS XE Software, Version BLD_V179_THROTTLE_MONIT_LATEST_20230630_102418\r\ - \nCisco IOS Software [Cupertino], Catalyst L3 Switch Software (CAT9K_IOSXE),\ - \ Experimental Version 17.9.20230630:111447 [BLD_V179_THROTTLE_MONIT_LATEST_20230630_102418:/nobackup/mcpre/s2c-build-ws\ - \ 101]\r\nCopyright (c) 1986-2023 by Cisco Systems, Inc.\r\nCompiled Fri 30-Jun-23\ - \ 04:14 by mcpre\r\n\r\n\r\nCisco IOS-XE software, Copyright (c) 2005-2023\ + - "Cisco IOS XE Software, Version BLD_POLARIS_DEV_LATEST_20221121_153510\r\n\ + Cisco IOS Software [Dublin], Catalyst L3 Switch Software (CAT9K_IOSXE), Experimental\ + \ Version 17.11.20221121:160300 [BLD_POLARIS_DEV_LATEST_20221121_153510:/nobackup/mcpre/s2c-build-ws\ + \ 101]\r\nCopyright (c) 1986-2022 by Cisco Systems, Inc.\r\nCompiled Mon 21-Nov-22\ + \ 08:03 by mcpre\r\n\r\n\r\nCisco IOS-XE software, Copyright (c) 2005-2022\ \ by cisco Systems, Inc.\r\nAll rights reserved. Certain components of Cisco\ \ IOS-XE software are\r\nlicensed under the GNU General Public License (\"\ GPL\") Version 2.0. The\r\nsoftware code licensed under GPL Version 2.0 is\ @@ -47,16 +48,15 @@ execute: \ more details, see the\r\ndocumentation or \"License Notice\" file accompanying\ \ the IOS-XE software,\r\nor the applicable URL provided on the flyer accompanying\ \ the IOS-XE\r\nsoftware.\r\n\r\n\r\nROM: IOS-XE ROMMON\r\nBOOTLDR: System\ - \ Bootstrap, Version 17.12.0.1r, DEVELOPMENT SOFTWARE\r\n\r\nT1-9300-SP1 uptime\ - \ is 3 weeks, 5 days, 19 hours, 46 minutes\r\nUptime for this control processor\ - \ is 3 weeks, 5 days, 19 hours, 48 minutes\r\nSystem returned to ROM by Reload\ - \ Command\r\nSystem restarted at 20:21:23 IST Wed Jul 5 2023\r\nSystem image\ - \ file is \"flash:cat9k_iosxe.BLD_V179_THROTTLE_MONIT_LATEST_20230630_102418.SSA.bin\"\ - \r\nLast reload reason: Reload Command\r\n\r\n\r\n\r\nThis product contains\ - \ cryptographic features and is subject to United\r\nStates and local country\ - \ laws governing import, export, transfer and\r\nuse. Delivery of Cisco cryptographic\ - \ products does not imply\r\nthird-party authority to import, export, distribute\ - \ or use encryption.\r\nImporters, exporters, distributors and users are responsible\ + \ Bootstrap, Version 17.12.1r, RELEASE SOFTWARE (P)\r\n\r\njavelin-morph-mini1a-c9300-stack\ + \ uptime is 1 day, 14 hours, 22 minutes\r\nUptime for this control processor\ + \ is 1 day, 14 hours, 24 minutes\r\nSystem returned to ROM by Admin reload\ + \ CLI\r\nSystem image file is \"flash:packages.conf\"\r\nLast reload reason:\ + \ Admin reload CLI\r\n\r\n\r\n\r\nThis product contains cryptographic features\ + \ and is subject to United\r\nStates and local country laws governing import,\ + \ export, transfer and\r\nuse. Delivery of Cisco cryptographic products does\ + \ not imply\r\nthird-party authority to import, export, distribute or use\ + \ encryption.\r\nImporters, exporters, distributors and users are responsible\ \ for\r\ncompliance with U.S. and local country laws. By using this product\ \ you\r\nagree to comply with applicable laws and regulations. If you are\ \ unable\r\nto comply with U.S. and local laws, return this product immediately.\r\ @@ -68,37 +68,50 @@ execute: \nTechnology-package Technology-package\r\ \nCurrent Type Next reboot \r\ \n------------------------------------------------------------------------------\r\ - \nnetwork-advantage \tSmart License \t network-advantage\ - \ \r\ndna-advantage \tSubscription Smart License \t dna-advantage\ - \ \r\nAIR License Level: AIR DNA Advantage\r\nNext reload\ + \nnetwork-essentials \tSmart License \t network-essentials\ + \ \r\nNone \tSubscription Smart License \t None \ + \ \r\nAIR License Level: AIR DNA Advantage\r\nNext reload\ \ AIR license Level: AIR DNA Advantage\r\n\r\n\r\nSmart Licensing Status:\ - \ Smart Licensing Using Policy\r\n\r\ncisco C9300-24P (X86) processor with\ - \ 1310597K/6147K bytes of memory.\r\nProcessor board ID FCW2124L0XE\r\n11\ - \ Virtual Ethernet interfaces\r\n56 Gigabit Ethernet interfaces\r\n16 Ten\ - \ Gigabit Ethernet interfaces\r\n4 TwentyFive Gigabit Ethernet interfaces\r\ - \n4 Forty Gigabit Ethernet interfaces\r\n2048K bytes of non-volatile configuration\ - \ memory.\r\n8388608K bytes of physical memory.\r\n1638400K bytes of Crash\ - \ Files at crashinfo:.\r\n1638400K bytes of Crash Files at crashinfo-1:.\r\ - \n11264000K bytes of Flash at flash:.\r\n11264000K bytes of Flash at flash-1:.\r\ - \n\r\nBase Ethernet MAC Address : a0:f8:49:0f:3b:80\r\nMotherboard\ - \ Assembly Number : 73-17953-06\r\nMotherboard Serial Number \ - \ : FOC21230KCQ\r\nModel Revision Number : A0\r\nMotherboard\ - \ Revision Number : A0\r\nModel Number : C9300-24P\r\ - \nSystem Serial Number : FCW2124L0XE\r\nCLEI Code Number \ - \ : INM2T10ARA\r\n\r\n\r\nSwitch Ports Model SW\ + \ Smart Licensing Using Policy\r\n\r\ncisco C9300-48UXM (X86) processor with\ + \ 1311315K/6147K bytes of memory.\r\nProcessor board ID FHH2335P005\r\n1 Virtual\ + \ Ethernet interface\r\n12 Gigabit Ethernet interfaces\r\n72 2.5 Gigabit Ethernet\ + \ interfaces\r\n72 Ten Gigabit Ethernet interfaces\r\n6 TwentyFive Gigabit\ + \ Ethernet interfaces\r\n6 Forty Gigabit Ethernet interfaces\r\n2048K bytes\ + \ of non-volatile configuration memory.\r\n8388608K bytes of physical memory.\r\ + \n1638400K bytes of Crash Files at crashinfo:.\r\n1638400K bytes of Crash\ + \ Files at crashinfo-2:.\r\n1638400K bytes of Crash Files at crashinfo-3:.\r\ + \n11264000K bytes of Flash at flash:.\r\n11264000K bytes of Flash at flash-2:.\r\ + \n11264000K bytes of Flash at flash-3:.\r\n117219783K bytes of USB Flash at\ + \ usbflash1:.\r\n16789568K bytes of USB Flash at usbflash0:.\r\n117219783K\ + \ bytes of USB Flash at usbflash1-2:.\r\n16789568K bytes of USB Flash at usbflash0-2:.\r\ + \n16789568K bytes of USB Flash at usbflash0-3:.\r\n117219783K bytes of USB\ + \ Flash at usbflash1-3:.\r\n\r\nBase Ethernet MAC Address : fc:58:9a:00:d5:00\r\ + \nMotherboard Assembly Number : 73-19920-01\r\nMotherboard Serial Number\ + \ : FHH23350005\r\nModel Revision Number : 01\r\nMotherboard\ + \ Revision Number : 01\r\nModel Number : C9300-48UXM\r\ + \nSystem Serial Number : FHH2335P005\r\nCLEI Code Number \ + \ : 0123456789\r\n\r\n\r\nSwitch Ports Model SW\ \ Version SW Image Mode \r\n------ ----- ----- \ - \ ---------- ---------- ---- \r\n 1 41 \ - \ C9300-24P 17.09.04 CAT9K_IOSXE BUNDLE \r\n*\ - \ 2 41 C9300-24P 17.09.04 CAT9K_IOSXE BUNDLE\ - \ \r\n\r\n\r\nSwitch 01\r\n---------\r\nSwitch uptime \ - \ : 3 weeks, 5 days, 19 hours, 47 minutes \r\n\r\nBase Ethernet MAC Address\ - \ : a0:f8:49:10:b3:80\r\nMotherboard Assembly Number : 73-17953-06\r\ - \nMotherboard Serial Number : FOC21230KDW\r\nModel Revision Number\ - \ : A0\r\nMotherboard Revision Number : A0\r\nModel Number\ - \ : C9300-24P\r\nSystem Serial Number \ - \ : FCW2125G011\r\nLast reload reason : Reload Command\r\n\ - CLEI Code Number : INM2T10ARA" + \ ---------- ---------- ---- \r\n* 1 65 \ + \ C9300-48UXM 17.11.01 CAT9K_IOSXE INSTALL\r\n \ + \ 2 65 C9300-48UXM 17.11.01 CAT9K_IOSXE INSTALL\r\ + \n 3 41 C9300-24UX 17.11.01 CAT9K_IOSXE \ + \ INSTALL\r\n\r\n\r\nSwitch 02\r\n---------\r\nSwitch uptime \ + \ : 1 day, 14 hours, 24 minutes \r\n\r\nBase Ethernet MAC Address\ + \ : 70:6b:b9:28:e7:00\r\nMotherboard Assembly Number : 73-17959-06\r\ + \nMotherboard Serial Number : FOC21260XVP\r\nModel Revision Number\ + \ : 46\r\nMotherboard Revision Number : 05\r\nModel Number\ + \ : C9300-48UXM\r\nSystem Serial Number \ + \ : FCW2128L03N\r\nLast reload reason : Admin reload CLI\r\ + \nCLEI Code Number : ABCDEFGHIJ\r\n\r\nSwitch 03\r\n---------\r\ + \nSwitch uptime : 1 day, 14 hours, 24 minutes \r\n\r\n\ + Base Ethernet MAC Address : dc:f7:19:01:b2:00\r\nMotherboard Assembly\ + \ Number : 73-17958-06\r\nMotherboard Serial Number : FOC222502CV\r\ + \nModel Revision Number : E0\r\nMotherboard Revision Number \ + \ : B0\r\nModel Number : C9300-24UX\r\nSystem\ + \ Serial Number : FCW2226G0QW\r\nLast reload reason \ + \ : Admin reload CLI\r\nCLEI Code Number : INM3Y10BRA" response_type: circular term length 0: '' term width 0: '' - prompt: T1-9300-SP1# + prompt: javelin-morph-mini1a-c9300-stack# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/apphosting/configure/enable_usb_ssd_verify_exists/test_api_enable_usb_ssd_verify_exists.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/apphosting/configure/enable_usb_ssd_verify_exists/test_api_enable_usb_ssd_verify_exists.py index 7fc4dffbc..090d06b82 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/apphosting/configure/enable_usb_ssd_verify_exists/test_api_enable_usb_ssd_verify_exists.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/apphosting/configure/enable_usb_ssd_verify_exists/test_api_enable_usb_ssd_verify_exists.py @@ -10,7 +10,7 @@ class TestEnableUsbSsdVerifyExists(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - T1-9300-SP1: + javelin-morph-mini1a-c9300-stack: connections: defaults: class: unicon.Unicon @@ -18,11 +18,11 @@ def setUpClass(self): command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: c9300 - type: c9500 + platform: cat9k + type: c9600 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['T1-9300-SP1'] + self.device = self.testbed.devices['javelin-morph-mini1a-c9300-stack'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -30,6 +30,6 @@ def setUpClass(self): ) def test_enable_usb_ssd_verify_exists(self): - result = enable_usb_ssd_verify_exists(self.device, 'flash-1:.', 30) + result = enable_usb_ssd_verify_exists(self.device, 'usbflash1:.', 30) expected_output = True self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_policy_tracking/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_policy_tracking/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_policy_tracking/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_policy_tracking/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..bf6cbff7b --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_policy_tracking/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + device-tracking policy SISF_1: "device-tracking policy SISF_1\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + tracking enable: "tracking enable\r\n" + prompt: 9404_SVL_UUT2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404_SVL_UUT2(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: '' + prompt: 9404_SVL_UUT2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_policy_tracking/test_api_configure_device_policy_tracking.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_policy_tracking/test_api_configure_device_policy_tracking.py new file mode 100644 index 000000000..4a1386378 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_policy_tracking/test_api_configure_device_policy_tracking.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.device_tracking.configure import configure_device_policy_tracking + + +class TestConfigureDevicePolicyTracking(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404_SVL_UUT2: + 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['9404_SVL_UUT2'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_device_policy_tracking(self): + result = configure_device_policy_tracking(self.device, 'SISF_1', True) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_source_tracking_on_interface/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_source_tracking_on_interface/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_source_tracking_on_interface/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_source_tracking_on_interface/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..dcdb88921 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_source_tracking_on_interface/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/4/0/14: "interface GigabitEthernet1/4/0/14\r\n" + ip verify source tracking: "ip verify source tracking\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9404_SVL_UUT2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404_SVL_UUT2(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: '' + prompt: 9404_SVL_UUT2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_source_tracking_on_interface/test_api_configure_source_tracking_on_interface.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_source_tracking_on_interface/test_api_configure_source_tracking_on_interface.py new file mode 100644 index 000000000..e83bdcf4a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_source_tracking_on_interface/test_api_configure_source_tracking_on_interface.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.device_tracking.configure import configure_source_tracking_on_interface + + +class TestConfigureSourceTrackingOnInterface(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404_SVL_UUT2: + 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['9404_SVL_UUT2'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_source_tracking_on_interface(self): + result = configure_source_tracking_on_interface(self.device, 'GigabitEthernet1/4/0/14', 'tracking') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_interface_range_dhcp_channel_group_mode/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_interface_range_dhcp_channel_group_mode/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_interface_range_dhcp_channel_group_mode/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_interface_range_dhcp_channel_group_mode/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..12d81ad3c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_interface_range_dhcp_channel_group_mode/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + channel-group 200 mode desirable: "channel-group 200 mode desirable\r\n" + end: + new_state: execute + interface range Gi1/0/39 - 41: "interface range Gi1/0/39 - 41\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9404-Access(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404-Access(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: '' + prompt: 9404-Access# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_interface_range_dhcp_channel_group_mode/test_api_configure_interface_range_dhcp_channel_group_mode.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_interface_range_dhcp_channel_group_mode/test_api_configure_interface_range_dhcp_channel_group_mode.py new file mode 100644 index 000000000..161ed87ed --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_interface_range_dhcp_channel_group_mode/test_api_configure_interface_range_dhcp_channel_group_mode.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.dhcp.configure import configure_interface_range_dhcp_channel_group_mode + + +class TestConfigureInterfaceRangeDhcpChannelGroupMode(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404-Access: + 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['9404-Access'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_interface_range_dhcp_channel_group_mode(self): + result = configure_interface_range_dhcp_channel_group_mode(self.device, 'Gi1/0/39', '41', '200', 'desirable') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_interface_range_dhcp_channel_group_mode/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_interface_range_dhcp_channel_group_mode/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_interface_range_dhcp_channel_group_mode/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_interface_range_dhcp_channel_group_mode/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..82580ff54 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_interface_range_dhcp_channel_group_mode/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + interface range Gi1/0/39 - 41: "interface range Gi1/0/39 - 41\r\n" + line console 0: + new_state: configure_line + no channel-group 200 mode desirable: "no channel-group 200 mode desirable\r\n" + no logging console: '' + prompt: 9404-Access(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404-Access(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: '' + prompt: 9404-Access# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_interface_range_dhcp_channel_group_mode/test_api_unconfigure_interface_range_dhcp_channel_group_mode.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_interface_range_dhcp_channel_group_mode/test_api_unconfigure_interface_range_dhcp_channel_group_mode.py new file mode 100644 index 000000000..2d646d38f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_interface_range_dhcp_channel_group_mode/test_api_unconfigure_interface_range_dhcp_channel_group_mode.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.dhcp.configure import unconfigure_interface_range_dhcp_channel_group_mode + + +class TestUnconfigureInterfaceRangeDhcpChannelGroupMode(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404-Access: + 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['9404-Access'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_interface_range_dhcp_channel_group_mode(self): + result = unconfigure_interface_range_dhcp_channel_group_mode(self.device, 'Gi1/0/39', '41', '200', 'desirable') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/configure_parameter_map/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/configure_parameter_map/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/configure_parameter_map/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/configure_parameter_map/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..39249bbf3 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/configure_parameter_map/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,65 @@ +configure: + commands: + banner file banner: "banner file banner\r\n" + banner text c banner-text c: "%Could not get the drive type for the given file\r\ + \n" + banner title c banner-title c: "\r\n" + captive-bypass-portal: "banner text c banner-text c\r\n" + cisco-logo-disable: "banner title c banner-title c\r\n" + consent email: "captive-bypass-portal\r\n" + custom-page failure device html: "cisco-logo-disable\r\n" + custom-page failure device success: "custom-page failure device html\r\n" + custom-page login device logindevice: "consent email\r\n" + end: + new_state: execute + http port 85: "http port 85\r\n" + intercept-https-enable: "intercept-https-enable\r\n" + line console 0: + new_state: configure_line + logout-window-disabled: "%Could not get the drive type for the given file\r\n" + max-http-conns 10: "\r\n" + no logging console: '' + parameter-map type webauth global: "parameter-map type webauth global\r\n" + redirect append client-mac tag vis: "custom-page login device logindevice\r\n" + secure-webauth-disable: "secure-webauth-disable\r\n" + sleeping-client timeout 11: "%Could not get the drive type for the given file\r\ + \n" + success-window-disable: "\r\n" + timeout init-state sec 60: "custom-page failure device success\r\n" + trustpoint vis: "trustpoint vis\r\n" + type consent: "%Could not get the drive type for the given file\r\n" + virtual-ip ipv4 10.10.10.10: "virtual-ip ipv4 10.10.10.10\r\n" + virtual-ip ipv6 10:10:10::1: "virtual-ip ipv6 10:10:10::1\r\n" + watch-list add-item ipv4 1.1.1.1: "watch-list add-item ipv4 1.1.1.1\r\n" + watch-list add-item ipv6 20:20:20::1: "watch-list add-item ipv6 20:20:20::1\r\n" + watch-list dynamic-expiry-timeout 10: "watch-list dynamic-expiry-timeout 10\r\n" + watch-list enabled: "watch-list enabled\r\n" + webauth-bypass-intercept None: "webauth-bypass-intercept None\r\n" + webauth-http-enable: "webauth-http-enable\r\n" + prompt: PE1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: PE1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: PE1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/configure_parameter_map/test_api_configure_parameter_map.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/configure_parameter_map/test_api_configure_parameter_map.py new file mode 100644 index 000000000..b9dd79985 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/configure_parameter_map/test_api_configure_parameter_map.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.dot1x.configure import configure_parameter_map + + +class TestConfigureParameterMap(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + PE1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: None + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['PE1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_parameter_map(self): + result = configure_parameter_map(self.device, False, True, 'banner', 'c banner-text c', 'c banner-title c', True, True, True, True, 'html', 'logindevice', None, 'success', True, 10, 'append client-mac tag vis', 11, True, 60, 'consent', 85, True, True, 'vis', '10.10.10.10', '10:10:10::1', '1.1.1.1', '20:20:20::1', 10, True, 'vis', None, True) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/unconfigure_parameter_map/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/unconfigure_parameter_map/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/unconfigure_parameter_map/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/unconfigure_parameter_map/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..db2c3efc9 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/unconfigure_parameter_map/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + no parameter-map type webauth global: "no parameter-map type webauth global\r\n" + prompt: PE1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: PE1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: PE1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/unconfigure_parameter_map/test_api_unconfigure_parameter_map.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/unconfigure_parameter_map/test_api_unconfigure_parameter_map.py new file mode 100644 index 000000000..06676c443 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dot1x/configure/unconfigure_parameter_map/test_api_unconfigure_parameter_map.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.dot1x.configure import unconfigure_parameter_map + + +class TestUnconfigureParameterMap(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + PE1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: None + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['PE1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_parameter_map(self): + result = unconfigure_parameter_map(self.device, 'global') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/unconfigure_ipv6_flow_monitor/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/unconfigure_ipv6_flow_monitor/mock_data/iosxe/mock_data.yaml index b679583b5..e890a8862 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/unconfigure_ipv6_flow_monitor/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/unconfigure_ipv6_flow_monitor/mock_data/iosxe/mock_data.yaml @@ -2,18 +2,18 @@ configure: commands: end: new_state: execute - interface GigabitEthernet1/0/1: "interface GigabitEthernet1/0/1\r\n" - ipv6 flow monitor m6in1 input: "ipv6 flow monitor m6in1 input\r\n" + interface GigabitEthernet1/7: "interface GigabitEthernet1/7\r\n" line console 0: new_state: configure_line + no ipv6 flow monitor hr1m input: "no ipv6 flow monitor hr1m input\r\n" no logging console: '' - prompt: SC_9200-2(config)# + prompt: l2sec_petra_2010(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: SC_9200-2(config-line)# + prompt: l2sec_petra_2010(config-line)# connect: commands: ? '' @@ -33,4 +33,4 @@ execute: show version: '' term length 0: '' term width 0: '' - prompt: SC_9200-2# + prompt: l2sec_petra_2010# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/unconfigure_ipv6_flow_monitor/test_api_unconfigure_ipv6_flow_monitor.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/unconfigure_ipv6_flow_monitor/test_api_unconfigure_ipv6_flow_monitor.py index 3f0cb8884..bb66566ad 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/unconfigure_ipv6_flow_monitor/test_api_unconfigure_ipv6_flow_monitor.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/flow/configure/unconfigure_ipv6_flow_monitor/test_api_unconfigure_ipv6_flow_monitor.py @@ -10,7 +10,7 @@ class TestUnconfigureIpv6FlowMonitor(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - SC_9200-2: + l2sec_petra_2010: 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: c9200 - type: c9200 + platform: switch + type: switch """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['SC_9200-2'] + self.device = self.testbed.devices['l2sec_petra_2010'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -30,6 +30,6 @@ def setUpClass(self): ) def test_unconfigure_ipv6_flow_monitor(self): - result = unconfigure_ipv6_flow_monitor(self.device, 'GigabitEthernet1/0/1', 'm6in1', 'input') + result = unconfigure_ipv6_flow_monitor(self.device, 'GigabitEthernet1/7', 'hr1m', 'input') expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_query_interval/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_query_interval/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_query_interval/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_query_interval/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..0582bca8e --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_query_interval/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + ip igmp snooping querier query-interval 100: "ip igmp snooping querier query-interval\ + \ 100\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: Switch(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Switch(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: '' + prompt: Switch# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_query_interval/test_api_configure_ip_igmp_querier_query_interval.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_query_interval/test_api_configure_ip_igmp_querier_query_interval.py new file mode 100644 index 000000000..2921b45ab --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_query_interval/test_api_configure_ip_igmp_querier_query_interval.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.igmp_snooping.configure import configure_ip_igmp_querier_query_interval + + +class TestConfigureIpIgmpQuerierQueryInterval(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Switch: + 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: c9500L + type: c9500L + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Switch'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ip_igmp_querier_query_interval(self): + result = configure_ip_igmp_querier_query_interval(self.device, 'query-interval', 100) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_tcn_query_count/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_tcn_query_count/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_tcn_query_count/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_tcn_query_count/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..3bf5ef54b --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_tcn_query_count/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + ip igmp snooping querier tcn query count 10: "ip igmp snooping querier tcn query\ + \ count 10\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: Switch(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Switch(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: '' + prompt: Switch# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_tcn_query_count/test_api_configure_ip_igmp_querier_tcn_query_count.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_tcn_query_count/test_api_configure_ip_igmp_querier_tcn_query_count.py new file mode 100644 index 000000000..c8a06217c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/igmp_snooping/configure/configure_ip_igmp_querier_tcn_query_count/test_api_configure_ip_igmp_querier_tcn_query_count.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.igmp_snooping.configure import configure_ip_igmp_querier_tcn_query_count + + +class TestConfigureIpIgmpQuerierTcnQueryCount(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Switch: + 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: c9500L + type: c9500L + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Switch'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ip_igmp_querier_tcn_query_count(self): + result = configure_ip_igmp_querier_tcn_query_count(self.device, 'tcn', 'count', 10) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_package_reload_fast/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_package_reload_fast/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_package_reload_fast/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_package_reload_fast/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..02eec300d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_package_reload_fast/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,141 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9300-24UX-1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9300-24UX-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 + install add file flash:cat9k_iosxe.17.12.01.SPA.bin activate reloadfast commit: + response: + - "y\r\n\r\n--- Starting Activate ---\r\nPerforming Activate on all members\r\ + \n [1] Activate package(s) on switch 1\r\n --- Starting list of software\ + \ package changes ---\r\n Old files list:\r\n Modified cat9k-cc_srdriver.17.09.03.SPA.pkg\r\ + \n Modified cat9k-espbase.17.09.03.SPA.pkg\r\n Modified cat9k-guestshell.17.09.03.SPA.pkg\r\ + \n Modified cat9k-lni.17.09.03.SPA.pkg\r\n Modified cat9k-rpbase.17.09.03.SPA.pkg\r\ + \n Modified cat9k-rpboot.17.09.03.SPA.pkg\r\n Modified cat9k-sipbase.17.09.03.SPA.pkg\r\ + \n Modified cat9k-sipspa.17.09.03.SPA.pkg\r\n Modified cat9k-srdriver.17.09.03.SPA.pkg\r\ + \n Modified cat9k-webui.17.09.03.SPA.pkg\r\n Modified cat9k-wlc.17.09.03.SPA.pkg\r\ + \n New files list:\r\n Added cat9k-cc_srdriver.17.12.01.SPA.pkg\r\n\ + \ Added cat9k-espbase.17.12.01.SPA.pkg\r\n Added cat9k-guestshell.17.12.01.SPA.pkg\r\ + \n Added cat9k-lni.17.12.01.SPA.pkg\r\n Added cat9k-rpbase.17.12.01.SPA.pkg\r\ + \n Added cat9k-rpboot.17.12.01.SPA.pkg\r\n Added cat9k-sipbase.17.12.01.SPA.pkg\r\ + \n Added cat9k-sipspa.17.12.01.SPA.pkg\r\n Added cat9k-srdriver.17.12.01.SPA.pkg\r\ + \n Added cat9k-webui.17.12.01.SPA.pkg\r\n Added cat9k-wlc.17.12.01.SPA.pkg\r\ + \n Finished list of software package changes\r\n [1] Finished Activate\ + \ on switch 1\r\nChecking status of Activate on [1]\r\nActivate: Passed on\ + \ [1]\r\nFinished Activate\r\n\r\n--- Starting Commit ---\r\nPerforming Commit\ + \ on all members\r\n [1] Commit package(s) on switch 1\r\n [1] Finished\ + \ Commit on switch 1\r\nChecking status of Commit on [1]\r\nCommit: Passed\ + \ on [1]\r\nFinished Commit\r\n\r\nSend model notification for install_add_activate_commit\ + \ before reload\r\nCheck xFSU support and verification on switch\r\n[1]: xFSU-Verify-Package\ + \ package(s) on switch 1\r\nFinished preverifying before xFSU\r\nSUCCESS to\ + \ verify packages\r\nSUCCESS to verify before xFSU\r\n[1]: Finished xFSU-Verify-Package\ + \ successful on switch 1\r\n (-2) SUCCESS: Finished xFSU-Verify-Package:\ + \ Success on [1]\r\n[1]: Performing Upgrade_Service\r\n300+0 records in\r\n\ + 300+0 records out\r\n307200 bytes (307 kB, 300 KiB) copied, 0.196372 s, 1.6\ + \ MB/s\r\nMM [1] MCU version 228 sw ver 225\nMM [2] MCU version 228 sw ver\ + \ 225\n\n\nMCU UPGRADE IN PROGRESS... PLEASE DO NOT POWER CYCLE!!\n\nFront-end\ + \ Microcode IMG MGR: found 4 microcode images for 1 device.\nImage for front-end\ + \ 0: /tmp/microcode_update/front_end/fe_type_6_0 update needed: no\nImage\ + \ for front-end 0: /tmp/microcode_update/front_end/fe_type_6_1 update needed:\ + \ yes\nImage for front-end 0: /tmp/microcode_update/front_end/fe_type_6_2\ + \ update needed: yes\nImage for front-end 0: /tmp/microcode_update/front_end/fe_type_6_3\ + \ update needed: no\n\nFront-end Microcode IMG MGR: Preparing to program device\ + \ microcode...\nFront-end Microcode IMG MGR: Preparing to program device[0],\ + \ index=0 ...594412 bytes.... Skipped[0].\nFront-end Microcode IMG MGR: Preparing\ + \ to program device[0], index=1 ...579456 bytes.\nFront-end Microcode IMG\ + \ MGR: Programming device 0...r-ww-Rrrrrrrw..0%...........................................................................................................10%............................................................................................................20%..........................................................................................................30%.............................................................................................................40%..........................................................................................................50%............................................................................................................60%.............................................................................................................70%..........................................................................................................80%............................................................................................................90%...........................................................................................................100%\n\ + Front-end Microcode IMG MGR: Preparing to program device[0], index=2 ...24506\ + \ bytes.\nFront-end Microcode IMG MGR: Programming device 0...rrrrrrw..0%....10%....20%......30%...40%....50%......60%....70%.....80%....90%....100%w\n\ + Wating for MCU to come up .....Rr!\nFront-end Microcode IMG MGR: Microcode\ + \ programming complete for device 0.\nFront-end Microcode IMG MGR: Preparing\ + \ to program device[0], index=3 ...90974 bytes.... Skipped[3].\nFront-end\ + \ Microcode IMG MGR: Microcode programming complete in 374 seconds\n\n\nMCU\ + \ UPGRADE COMPLETED!!... SUCCESS: Upgrade_Service finished\r\n PID TTY \ + \ TIME CMD\r\nStarting GR:#\r\ncat: /: Is a directory\r\nWait for\ + \ ifm backup: Ifm backup is completeSep 20 06:35:21.646: %PMAN-3-RELOAD_SYSTEM:\ + \ R0/0: pvp: Reloading: Peer switch is not standby ready. System will be reloaded\r\ + \nSep 20 06:35:22.587: %PMAN-5-EXITACTION: F0/0: pvp: Process manager is exiting:\ + \ reload fp action requested\r\nSep 20 06:35:28.630: %PMAN-5-EXITACTION: R0/0:\ + \ pvp: Process manager is exiting: rp processes exit with reload switch code\r\ + \n\n\r\n\r\nInitializing Hardware......\r\nReload Fast Detected\r\n\0\0\0\0\ + \r\nSystem Bootstrap, Version 17.12.1r, RELEASE SOFTWARE (P)\r\nCompiled Mon\ + \ 04/24/2023 22:21:00.36 by rel\r\n\r\nCurrent ROMMON image : Primary\r\n\ + Last reset cause : SoftwareReload\r\nC9300-24UX platform with 8388608\ + \ Kbytes of main memory\r\n\r\nPreparing to autoboot. [Press Ctrl-C to interrupt]\ + \ 0 \r\nboot: attempting to boot from [flash:packages.conf]\r\nboot:\ + \ reading file packages.conf\r\n#\r\n############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################\r\ + \n\r\n\r\n\r\n\r\nBoth links down, not waiting for other switches\r\nSwitch\ + \ number is 1\r\n\r\n Restricted Rights Legend\r\n\r\nUse, duplication,\ + \ or disclosure by the Government is\r\nsubject to restrictions as set forth\ + \ in subparagraph\r\n(c) of the Commercial Computer Software - Restricted\r\ + \nRights clause at FAR sec. 52.227-19 and subparagraph\r\n(c) (1) (ii) of\ + \ the Rights in Technical Data and Computer\r\nSoftware clause at DFARS sec.\ + \ 252.227-7013.\r\n\r\n Cisco Systems, Inc.\r\n 170 West\ + \ Tasman Drive\r\n San Jose, California 95134-1706\r\n\r\n\r\n\r\ + \nCisco IOS Software [Dublin], Catalyst L3 Switch Software (CAT9K_IOSXE),\ + \ Version 17.12.1, RELEASE SOFTWARE (fc1)\r\nTechnical Support: http://www.cisco.com/techsupport\r\ + \nCopyright (c) 1986-2023 by Cisco Systems, Inc.\r\nCompiled Fri 21-Jul-23\ + \ 19:50 by mcpre\r\n\r\n\r\nThis software version supports only Smart Licensing\ + \ as the software licensing mechanism.\r\n\r\n\r\nPLEASE READ THE FOLLOWING\ + \ TERMS CAREFULLY. INSTALLING THE LICENSE OR\r\nLICENSE KEY PROVIDED FOR ANY\ + \ CISCO SOFTWARE PRODUCT, PRODUCT FEATURE,\r\nAND/OR SUBSEQUENTLY PROVIDED\ + \ SOFTWARE FEATURES (COLLECTIVELY, THE\r\n\"SOFTWARE\"), AND/OR USING SUCH\ + \ SOFTWARE CONSTITUTES YOUR FULL\r\nACCEPTANCE OF THE FOLLOWING TERMS. YOU\ + \ MUST NOT PROCEED FURTHER IF YOU\r\nARE NOT WILLING TO BE BOUND BY ALL THE\ + \ TERMS SET FORTH HEREIN.\r\n\r\nYour use of the Software is subject to the\ + \ Cisco End User License Agreement\r\n(EULA) and any relevant supplemental\ + \ terms (SEULA) found at\r\nhttp://www.cisco.com/c/en/us/about/legal/cloud-and-software/software-terms.html.\r\ + \n\r\nYou hereby acknowledge and agree that certain Software and/or features\ + \ are\r\nlicensed for a particular term, that the license to such Software\ + \ and/or\r\nfeatures is valid only for the applicable term and that such Software\ + \ and/or\r\nfeatures may be shut down or otherwise terminated by Cisco after\ + \ expiration\r\nof the applicable license term (e.g., 90-day trial period).\ + \ Cisco reserves\r\nthe right to terminate any such Software feature electronically\ + \ or by any\r\nother means available. While Cisco may provide alerts, it is\ + \ your sole\r\nresponsibility to monitor your usage of any such term Software\ + \ feature to\r\nensure that your systems and networks are prepared for a shutdown\ + \ of the\r\nSoftware feature.\r\n\r\n\r\n\r\nFIPS: Flash Key Check : Key Not\ + \ Found, FIPS Mode Not Enabled\r\ncisco C9300-24UX (X86) processor with 1302216K/6147K\ + \ bytes of memory.\r\nProcessor board ID FOC2434L2RA\r\n2048K bytes of non-volatile\ + \ configuration memory.\r\n8388608K bytes of physical memory.\r\n1638400K\ + \ bytes of Crash Files at crashinfo:.\r\n11264000K bytes of Flash at flash:.\r\ + \n\r\nBase Ethernet MAC Address : f8:6b:d9:67:35:80\r\nMotherboard\ + \ Assembly Number : 73-20290-01\r\nMotherboard Serial Number \ + \ : FOC24311H14\r\nModel Revision Number : 06\r\nMotherboard\ + \ Revision Number : 05\r\nModel Number : C9300-24UX\r\ + \nSystem Serial Number : FOC2434L2RA\r\nCLEI Code Number \ + \ : INM3Y10BRB\r\n\r\n\r\nCompliance shield is not available\ + \ for this platform\a\r\n\r\n\r\nPress RETURN to get started!" + response_type: circular + show version: '' + term length 0: '' + term width 0: '' + write memory: + response: + - "Building configuration...\r\n[OK]" + response_type: circular + prompt: 9300-24UX-1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_package_reload_fast/test_api_execute_install_package_reload_fast.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_package_reload_fast/test_api_execute_install_package_reload_fast.py new file mode 100644 index 000000000..e9828a478 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_package_reload_fast/test_api_execute_install_package_reload_fast.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.install.execute import execute_install_package_reload_fast + + +class TestExecuteInstallPackageReloadFast(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9300-24UX-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: c9300 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9300-24UX-1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_execute_install_package_reload_fast(self): + result = execute_install_package_reload_fast(self.device, 'flash:', 'cat9k_iosxe.17.12.01.SPA.bin', True, 1600, 300) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/clear/clear_ip_dhcp_snooping_binding_on_interface/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/clear/clear_ip_dhcp_snooping_binding_on_interface/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/clear/clear_ip_dhcp_snooping_binding_on_interface/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/clear/clear_ip_dhcp_snooping_binding_on_interface/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..25e692964 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/clear/clear_ip_dhcp_snooping_binding_on_interface/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9404_SVL_UUT2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404_SVL_UUT2(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + clear ip dhcp snooping binding interface GigabitEthernet1/4/0/14: + response: + - '' + response_type: circular + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: 9404_SVL_UUT2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/clear/clear_ip_dhcp_snooping_binding_on_interface/test_api_clear_ip_dhcp_snooping_binding_on_interface.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/clear/clear_ip_dhcp_snooping_binding_on_interface/test_api_clear_ip_dhcp_snooping_binding_on_interface.py new file mode 100644 index 000000000..9f8e9adff --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/clear/clear_ip_dhcp_snooping_binding_on_interface/test_api_clear_ip_dhcp_snooping_binding_on_interface.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.clear import clear_ip_dhcp_snooping_binding_on_interface + + +class TestClearIpDhcpSnoopingBindingOnInterface(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404_SVL_UUT2: + 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['9404_SVL_UUT2'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_clear_ip_dhcp_snooping_binding_on_interface(self): + result = clear_ip_dhcp_snooping_binding_on_interface(self.device, 'GigabitEthernet1/4/0/14') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/config_interface_prpchannel/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/config_interface_prpchannel/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/config_interface_prpchannel/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/config_interface_prpchannel/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..669276470 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/config_interface_prpchannel/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/0/21: "interface GigabitEthernet1/0/21\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prp-channel-group 1: "prp-channel-group 1\r\n" + prompt: l2sec_clarke_2006(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: l2sec_clarke_2006(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: '' + prompt: l2sec_clarke_2006# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/config_interface_prpchannel/test_api_config_interface_prpchannel.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/config_interface_prpchannel/test_api_config_interface_prpchannel.py new file mode 100644 index 000000000..35f5b7553 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/config_interface_prpchannel/test_api_config_interface_prpchannel.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import config_interface_prpchannel + + +class TestConfigInterfacePrpchannel(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + l2sec_clarke_2006: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['l2sec_clarke_2006'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_config_interface_prpchannel(self): + result = config_interface_prpchannel(self.device, 'GigabitEthernet1/0/21', 1) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfig_interface_prpchannel/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfig_interface_prpchannel/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfig_interface_prpchannel/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfig_interface_prpchannel/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..1167daa16 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfig_interface_prpchannel/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no interface prp-channel 1: "no interface prp-channel 1\r\n" + no logging console: '' + prompt: l2sec_clarke_2006(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: l2sec_clarke_2006(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: '' + prompt: l2sec_clarke_2006# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfig_interface_prpchannel/test_api_unconfig_interface_prpchannel.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfig_interface_prpchannel/test_api_unconfig_interface_prpchannel.py new file mode 100644 index 000000000..6239ac04e --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfig_interface_prpchannel/test_api_unconfig_interface_prpchannel.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import unconfig_interface_prpchannel + + +class TestUnconfigInterfacePrpchannel(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + l2sec_clarke_2006: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['l2sec_clarke_2006'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfig_interface_prpchannel(self): + result = unconfig_interface_prpchannel(self.device, 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/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management/mock_data/iosxe/mock_data.yaml index 9ae06d64a..fc9b0fe48 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management/mock_data/iosxe/mock_data.yaml @@ -16,7 +16,7 @@ configure: no logging console: '' no shutdown: "Bad mask /32 for address 10.29.30.167\r\n" transport input ssh telnet: "transport input ssh telnet\r\n" - username admin password admin: "username admin password admin\r\n" + username admin password 0 admin: "username admin password 0 admin\r\n" vrf forwarding Mgmt-intf: "vrf forwarding Mgmt-intf\r\n" prompt: vmtb-isr4451(config)# configure_line: diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_netconf/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_netconf/mock_data/iosxe/mock_data.yaml index 1259d00f7..4cded2902 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_netconf/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_netconf/mock_data/iosxe/mock_data.yaml @@ -15,7 +15,8 @@ configure: netconf-yang: "netconf-yang\r\n" no logging console: '' transport input ssh: "transport input ssh\r\n" - username admin password admin: "username admin password admin\r\n" + username admin password 0 admin: "username admin password 0 admin\r\n" + username admin privilege 15: "username admin privilege 15\r\n" prompt: vmtb-isr4451(config)# configure_line: commands: diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_ntp/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_ntp/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_ntp/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_ntp/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..d9d0e802a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_ntp/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + ip tftp source-interface GigabitEthernet0: "ip tftp source-interface GigabitEthernet0\r\ + \n" + line console 0: + new_state: configure_line + no logging console: '' + ntp server 127.0.0.1: "" + prompt: vmtb-isr4451(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: vmtb-isr4451(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: '' + prompt: vmtb-isr4451# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_ntp/test_api_configure_management_ntp.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_ntp/test_api_configure_management_ntp.py new file mode 100644 index 000000000..01069b6a9 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_ntp/test_api_configure_management_ntp.py @@ -0,0 +1,39 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.management.configure import configure_management_ntp + + +class TestConfigureManagementNtp(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + testbed: + servers: + ntp: + address: 127.0.0.1 + devices: + vmtb-isr4451: + 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: iosxe + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['vmtb-isr4451'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_management_ntp(self): + result = configure_management_ntp(self.device) + expected_output = 'ntp server 127.0.0.1\r\n' + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_protocols/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_protocols/mock_data/iosxe/mock_data.yaml index d6ddeae80..230476988 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_protocols/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_protocols/mock_data/iosxe/mock_data.yaml @@ -16,9 +16,10 @@ configure: login authentication default: "login authentication default\r\n" netconf-yang: "netconf-yang\r\n" no logging console: '' - transport input telnet ssh: "transport input telnet ssh\r\n" - username admin password lab: "username admin password lab\r\n" - prompt: ott-c9300-67(config)# + transport input ssh telnet: "transport input ssh telnet\r\n" + transport input telnet ssh: "transport input telnet ssh\r'n" + username admin password 0 admin: "username admin password 0 admin\r\n" + prompt: vmtb-isr4451(config)# configure_line: commands: end: diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_ssh/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_ssh/mock_data/iosxe/mock_data.yaml index f9508394b..a3caed1fc 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_ssh/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_ssh/mock_data/iosxe/mock_data.yaml @@ -14,7 +14,7 @@ configure: login authentication default: "login authentication default\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" + username admin password 0 admin: "username admin password 0 admin\r\n" prompt: vmtb-isr4451(config)# configure_line: commands: diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_telnet/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_telnet/mock_data/iosxe/mock_data.yaml index f91f3cacc..2445a7c56 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_telnet/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/management/configure/configure_management_telnet/mock_data/iosxe/mock_data.yaml @@ -12,7 +12,7 @@ configure: login authentication default: "login authentication default\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" + username admin password 0 admin: "username admin password 0 admin\r\n" prompt: vmtb-isr4451(config)# configure_line: commands: diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_disable_nat_scale/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_disable_nat_scale/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_disable_nat_scale/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_disable_nat_scale/mock_data/iosxe/mock_data.yaml index e7b317e1f..5d0e96fe9 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_disable_nat_scale/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_disable_nat_scale/mock_data/iosxe/mock_data.yaml @@ -6,14 +6,13 @@ configure: line console 0: new_state: configure_line no logging console: '' - no nat scale: "no nat scale\r\n" - prompt: Stargazer(config)# + prompt: C9500h-2-DUT(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: Stargazer(config-line)# + prompt: C9500h-2-DUT(config-line)# connect: commands: ? '' @@ -33,4 +32,4 @@ execute: show version: '' term length 0: '' term width 0: '' - prompt: Stargazer# + prompt: C9500h-2-DUT# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_disable_nat_scale/test_api_configure_disable_nat_scale.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_disable_nat_scale/test_api_configure_disable_nat_scale.py index b7bdfa6e5..2a756d669 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_disable_nat_scale/test_api_configure_disable_nat_scale.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_disable_nat_scale/test_api_configure_disable_nat_scale.py @@ -1,3 +1,4 @@ +import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.nat.configure import configure_disable_nat_scale @@ -7,21 +8,21 @@ class TestConfigureDisableNatScale(unittest.TestCase): @classmethod def setUpClass(self): - testbed = """ + testbed = f""" devices: - Stargazer: + C9500h-2-DUT: 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: c9600 - type: c9600 + platform: c9500 + type: c9500 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['Stargazer'] + self.device = self.testbed.devices['C9500h-2-DUT'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -29,6 +30,6 @@ def setUpClass(self): ) def test_configure_disable_nat_scale(self): - result = configure_disable_nat_scale(self.device) + result = configure_disable_nat_scale(self.device, True, False) expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_enable_nat_scale/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_enable_nat_scale/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_enable_nat_scale/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_enable_nat_scale/mock_data/iosxe/mock_data.yaml index 65c178b60..e0c06f595 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_enable_nat_scale/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_enable_nat_scale/mock_data/iosxe/mock_data.yaml @@ -4,16 +4,15 @@ configure: new_state: execute line console 0: new_state: configure_line - nat scale: "nat scale\r\n" no ip nat create flow-entries: "no ip nat create flow-entries\r\n" no logging console: '' - prompt: Stargazer(config)# + prompt: C9500h-2-DUT(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: Stargazer(config-line)# + prompt: C9500h-2-DUT(config-line)# connect: commands: ? '' @@ -33,4 +32,4 @@ execute: show version: '' term length 0: '' term width 0: '' - prompt: Stargazer# + prompt: C9500h-2-DUT# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_enable_nat_scale/test_api_configure_enable_nat_scale.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_enable_nat_scale/test_api_configure_enable_nat_scale.py index ec93472bd..103ca243d 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_enable_nat_scale/test_api_configure_enable_nat_scale.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/nat/configure/configure_enable_nat_scale/test_api_configure_enable_nat_scale.py @@ -1,3 +1,4 @@ +import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.nat.configure import configure_enable_nat_scale @@ -7,21 +8,21 @@ class TestConfigureEnableNatScale(unittest.TestCase): @classmethod def setUpClass(self): - testbed = """ + testbed = f""" devices: - Stargazer: + C9500h-2-DUT: 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: c9600 - type: c9600 + platform: c9500 + type: c9500 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['Stargazer'] + self.device = self.testbed.devices['C9500h-2-DUT'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -29,6 +30,6 @@ def setUpClass(self): ) def test_configure_enable_nat_scale(self): - result = configure_enable_nat_scale(self.device) + result = configure_enable_nat_scale(self.device, 60, True, False) expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_interface/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_interface/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_interface/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_interface/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..2fcb29034 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_interface/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/0/24: "interface GigabitEthernet1/0/24\r\n" + line console 0: + new_state: configure_line + no logging console: '' + ospfv3 mtu-ignore: "ospfv3 mtu-ignore\r\n" + prompt: Switch(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Switch(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: '' + prompt: Switch# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_interface/test_api_configure_ospfv3_interface.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_interface/test_api_configure_ospfv3_interface.py new file mode 100644 index 000000000..1699b8098 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_interface/test_api_configure_ospfv3_interface.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.ospf.configure import configure_ospfv3_interface + + +class TestConfigureOspfv3Interface(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Switch: + 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: c9500L + type: c9500L + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Switch'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ospfv3_interface(self): + result = configure_ospfv3_interface(self.device, 'GigabitEthernet1/0/24', 'mtu-ignore') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_network_type/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_network_type/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_network_type/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_network_type/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..e9cc5e422 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_network_type/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/0/24: "interface GigabitEthernet1/0/24\r\n" + line console 0: + new_state: configure_line + no logging console: '' + ospfv3 network point-to-point: "ospfv3 network point-to-point\r\n" + prompt: Switch(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Switch(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: '' + prompt: Switch# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_network_type/test_api_configure_ospfv3_network_type.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_network_type/test_api_configure_ospfv3_network_type.py new file mode 100644 index 000000000..e31058377 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospfv3_network_type/test_api_configure_ospfv3_network_type.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.ospf.configure import configure_ospfv3_network_type + + +class TestConfigureOspfv3NetworkType(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Switch: + 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: c9500L + type: c9500L + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Switch'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ospfv3_network_type(self): + result = configure_ospfv3_network_type(self.device, 'GigabitEthernet1/0/24', 'point-to-point') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/unconfigure_ipv6_router_ospf/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/unconfigure_ipv6_router_ospf/__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_stack/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/unconfigure_ipv6_router_ospf/mock_data/iosxe/mock_data.yaml similarity index 81% rename from pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_stack_power_stack/mock_data/iosxe/mock_data.yaml rename to pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/unconfigure_ipv6_router_ospf/mock_data/iosxe/mock_data.yaml index 6750d9756..5b531fd5e 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_stack_power_stack/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/unconfigure_ipv6_router_ospf/mock_data/iosxe/mock_data.yaml @@ -4,15 +4,15 @@ configure: new_state: execute line console 0: new_state: configure_line + no ipv6 router ospf 10: "no ipv6 router ospf 10\r\n" no logging console: '' - stack-power stack test: "stack-power stack test\r\n" - prompt: n10SVL(config)# + prompt: A1(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: n10SVL(config-line)# + prompt: A1(config-line)# connect: commands: ? '' @@ -32,4 +32,4 @@ execute: show version: '' term length 0: '' term width 0: '' - prompt: n10SVL# + prompt: A1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/unconfigure_ipv6_router_ospf/test_api_unconfigure_ipv6_router_ospf.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/unconfigure_ipv6_router_ospf/test_api_unconfigure_ipv6_router_ospf.py new file mode 100644 index 000000000..668575e45 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/unconfigure_ipv6_router_ospf/test_api_unconfigure_ipv6_router_ospf.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.ospf.configure import unconfigure_ipv6_router_ospf + + +class TestUnconfigureIpv6RouterOspf(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + A1: + 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: single_rp + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['A1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_ipv6_router_ospf(self): + result = unconfigure_ipv6_router_ospf(self.device, 10) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_absolute_time_range/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_absolute_time_range/__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_absolute_time_range/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_absolute_time_range/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..2a6b04c84 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_absolute_time_range/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + absolute start 22:40 7 Jan 2000: "absolute start 22:40 7 Jan 2000\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + time-range time1: "time-range time1\r\n" + prompt: T2-9500-RA_SDG(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T2-9500-RA_SDG(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: '' + prompt: T2-9500-RA_SDG# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_absolute_time_range/test_api_configure_absolute_time_range.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_absolute_time_range/test_api_configure_absolute_time_range.py new file mode 100644 index 000000000..0dd89af40 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_absolute_time_range/test_api_configure_absolute_time_range.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_absolute_time_range + + +class TestConfigureAbsoluteTimeRange(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + T2-9500-RA_SDG: + 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: c9500 + type: c9500 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['T2-9500-RA_SDG'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_absolute_time_range(self): + result = configure_absolute_time_range(self.device, 'time1', 'start', '22:40', '7', 'Jan', '2000') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_environment/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_environment/__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_clear_logging_onboard_slot_environment/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_environment/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..9e74d67dd --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_environment/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9404R-dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404R-dut1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + clear logging onboard slot 2 environment: + response: + - Done clearing Environment data + response_type: circular + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: 9404R-dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_environment/test_api_configure_clear_logging_onboard_slot_environment.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_environment/test_api_configure_clear_logging_onboard_slot_environment.py new file mode 100644 index 000000000..533a64c48 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_environment/test_api_configure_clear_logging_onboard_slot_environment.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_clear_logging_onboard_slot_environment + + +class TestConfigureClearLoggingOnboardSlotEnvironment(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404R-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: cat9400 + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9404R-dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_clear_logging_onboard_slot_environment(self): + result = configure_clear_logging_onboard_slot_environment(self.device, 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_clear_logging_onboard_slot_temperature/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_temperature/__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_clear_logging_onboard_slot_temperature/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_temperature/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..9759aa47d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_temperature/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9404R-dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404R-dut1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + clear logging onboard slot 2 temperature: + response: + - Done clearing Temperature data + response_type: circular + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: 9404R-dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_temperature/test_api_configure_clear_logging_onboard_slot_temperature.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_temperature/test_api_configure_clear_logging_onboard_slot_temperature.py new file mode 100644 index 000000000..25f93796a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_temperature/test_api_configure_clear_logging_onboard_slot_temperature.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_clear_logging_onboard_slot_temperature + + +class TestConfigureClearLoggingOnboardSlotTemperature(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404R-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: cat9400 + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9404R-dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_clear_logging_onboard_slot_temperature(self): + result = configure_clear_logging_onboard_slot_temperature(self.device, 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_clear_logging_onboard_slot_voltage/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_voltage/__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_clear_logging_onboard_slot_voltage/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_voltage/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..3b367b119 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_voltage/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9404R-dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404R-dut1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + clear logging onboard slot 2 voltage: + response: + - Done clearing Voltage data + response_type: circular + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: 9404R-dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_voltage/test_api_configure_clear_logging_onboard_slot_voltage.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_voltage/test_api_configure_clear_logging_onboard_slot_voltage.py new file mode 100644 index 000000000..3e03a5e8c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_clear_logging_onboard_slot_voltage/test_api_configure_clear_logging_onboard_slot_voltage.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_clear_logging_onboard_slot_voltage + + +class TestConfigureClearLoggingOnboardSlotVoltage(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404R-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: cat9400 + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9404R-dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_clear_logging_onboard_slot_voltage(self): + result = configure_clear_logging_onboard_slot_voltage(self.device, 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_logging_onboard/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_logging_onboard/__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_logging_onboard/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_logging_onboard/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..d3fdb99b3 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_logging_onboard/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + hw-module slot 2 logging onboard: "hw-module slot 2 logging onboard\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9404R-dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404R-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: '' + term length 0: '' + term width 0: '' + prompt: 9404R-dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_logging_onboard/test_api_configure_hw_module_logging_onboard.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_logging_onboard/test_api_configure_hw_module_logging_onboard.py new file mode 100644 index 000000000..b0b587804 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_logging_onboard/test_api_configure_hw_module_logging_onboard.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_logging_onboard + + +class TestConfigureHwModuleLoggingOnboard(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404R-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: cat9400 + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9404R-dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_hw_module_logging_onboard(self): + result = configure_hw_module_logging_onboard(self.device, 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_slot_logging_onboard_environment/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_environment/__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_slot_logging_onboard_environment/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_environment/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..eb743a9d9 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_environment/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + hw-module slot 2 logging onboard environment: "hw-module slot 2 logging onboard\ + \ environment\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9404R-dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404R-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: '' + term length 0: '' + term width 0: '' + prompt: 9404R-dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_environment/test_api_configure_hw_module_slot_logging_onboard_environment.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_environment/test_api_configure_hw_module_slot_logging_onboard_environment.py new file mode 100644 index 000000000..d1c01b930 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_environment/test_api_configure_hw_module_slot_logging_onboard_environment.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_slot_logging_onboard_environment + + +class TestConfigureHwModuleSlotLoggingOnboardEnvironment(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404R-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: cat9400 + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9404R-dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_hw_module_slot_logging_onboard_environment(self): + result = configure_hw_module_slot_logging_onboard_environment(self.device, 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_slot_logging_onboard_temperature/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_temperature/__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_slot_logging_onboard_temperature/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_temperature/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..a122648f5 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_temperature/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + hw-module slot 2 logging onboard temperature: "hw-module slot 2 logging onboard\ + \ temperature\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9404R-dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404R-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: '' + term length 0: '' + term width 0: '' + prompt: 9404R-dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_temperature/test_api_configure_hw_module_slot_logging_onboard_temperature.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_temperature/test_api_configure_hw_module_slot_logging_onboard_temperature.py new file mode 100644 index 000000000..141c8c356 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_temperature/test_api_configure_hw_module_slot_logging_onboard_temperature.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_slot_logging_onboard_temperature + + +class TestConfigureHwModuleSlotLoggingOnboardTemperature(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404R-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: cat9400 + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9404R-dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_hw_module_slot_logging_onboard_temperature(self): + result = configure_hw_module_slot_logging_onboard_temperature(self.device, 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_slot_logging_onboard_voltage/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_voltage/__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_slot_logging_onboard_voltage/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_voltage/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..379157182 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_voltage/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + hw-module slot 2 logging onboard voltage: "hw-module slot 2 logging onboard voltage\r\ + \n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9404R-dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404R-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: '' + term length 0: '' + term width 0: '' + prompt: 9404R-dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_voltage/test_api_configure_hw_module_slot_logging_onboard_voltage.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_voltage/test_api_configure_hw_module_slot_logging_onboard_voltage.py new file mode 100644 index 000000000..6e4c26c5f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_hw_module_slot_logging_onboard_voltage/test_api_configure_hw_module_slot_logging_onboard_voltage.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_slot_logging_onboard_voltage + + +class TestConfigureHwModuleSlotLoggingOnboardVoltage(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404R-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: cat9400 + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9404R-dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_hw_module_slot_logging_onboard_voltage(self): + result = configure_hw_module_slot_logging_onboard_voltage(self.device, 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_ip_scp_password/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_password/__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_ip_scp_password/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_password/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..e26011b58 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_password/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + ip scp password cisco: "ip scp password cisco\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: T13-C9407-Dual-SUP2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T13-C9407-Dual-SUP2(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: '' + prompt: T13-C9407-Dual-SUP2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_password/test_api_configure_ip_scp_password.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_password/test_api_configure_ip_scp_password.py new file mode 100644 index 000000000..5062d682f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_password/test_api_configure_ip_scp_password.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_ip_scp_password + + +class TestConfigureIpScpPassword(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + VCR: + 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['VCR'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ip_scp_password(self): + result = configure_ip_scp_password(self.device, 'cisco') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_username/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_username/__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_ip_scp_username/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_username/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..12f350dfd --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_username/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + ip scp username root: "ip scp username root\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: T13-C9407-Dual-SUP2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T13-C9407-Dual-SUP2(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: '' + prompt: T13-C9407-Dual-SUP2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_username/test_api_configure_ip_scp_username.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_username/test_api_configure_ip_scp_username.py new file mode 100644 index 000000000..aa15e7546 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_username/test_api_configure_ip_scp_username.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_ip_scp_username + + +class TestConfigureIpScpUsername(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + VCR: + 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['VCR'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ip_scp_username(self): + result = configure_ip_scp_username(self.device, 'root') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_sftp_password/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_sftp_password/__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_ip_sftp_password/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_sftp_password/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..1e088f8c6 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_sftp_password/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + ip sftp password cisco: "ip sftp password cisco\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: T13-C9407-Dual-SUP2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T13-C9407-Dual-SUP2(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: '' + prompt: T13-C9407-Dual-SUP2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_sftp_password/test_api_configure_ip_sftp_password.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_sftp_password/test_api_configure_ip_sftp_password.py new file mode 100644 index 000000000..4db6fd4f9 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_sftp_password/test_api_configure_ip_sftp_password.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_ip_sftp_password + + +class TestConfigureIpSftpPassword(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + VCR: + 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['VCR'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ip_sftp_password(self): + result = configure_ip_sftp_password(self.device, 'cisco') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_sftp_username/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_sftp_username/__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_ip_sftp_username/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_sftp_username/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..09e0eb44e --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_sftp_username/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + ip sftp username root: "ip sftp username root\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: T13-C9407-Dual-SUP2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T13-C9407-Dual-SUP2(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: '' + prompt: T13-C9407-Dual-SUP2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_sftp_username/test_api_configure_ip_sftp_username.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_sftp_username/test_api_configure_ip_sftp_username.py new file mode 100644 index 000000000..082bb3fdb --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_sftp_username/test_api_configure_ip_sftp_username.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_ip_sftp_username + + +class TestConfigureIpSftpUsername(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + VCR: + 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['VCR'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ip_sftp_username(self): + result = configure_ip_sftp_username(self.device, 'root') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_periodic_time_range/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_periodic_time_range/__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_periodic_time_range/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_periodic_time_range/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ad2c96525 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_periodic_time_range/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: '' + periodic daily 22:40 to 22:41: "periodic daily 22:40 to 22:41\r\n" + time-range time1: "time-range time1\r\n" + prompt: T2-9500-RA_SDG(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T2-9500-RA_SDG(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: '' + prompt: T2-9500-RA_SDG# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_stack_power_stack/test_api_configure_stack_power_stack.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_periodic_time_range/test_api_configure_periodic_time_range.py similarity index 72% rename from pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_stack_power_stack/test_api_configure_stack_power_stack.py rename to pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_periodic_time_range/test_api_configure_periodic_time_range.py index f66d098db..070786cf5 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_stack_power_stack/test_api_configure_stack_power_stack.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_periodic_time_range/test_api_configure_periodic_time_range.py @@ -1,16 +1,16 @@ import os import unittest from pyats.topology import loader -from genie.libs.sdk.apis.iosxe.platform.configure import configure_stack_power_stack +from genie.libs.sdk.apis.iosxe.platform.configure import configure_periodic_time_range -class TestConfigureStackPowerStack(unittest.TestCase): +class TestConfigurePeriodicTimeRange(unittest.TestCase): @classmethod def setUpClass(self): testbed = f""" devices: - n10SVL: + T2-9500-RA_SDG: connections: defaults: class: unicon.Unicon @@ -22,14 +22,14 @@ def setUpClass(self): type: c9500 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['n10SVL'] + self.device = self.testbed.devices['T2-9500-RA_SDG'] self.device.connect( learn_hostname=True, init_config_commands=[], init_exec_commands=[] ) - def test_configure_stack_power_stack(self): - result = configure_stack_power_stack(self.device, 'test') + def test_configure_periodic_time_range(self): + result = configure_periodic_time_range(self.device, 'time1', 'daily', '22:40', '22:41') expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_rep_admin_vlan/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_rep_admin_vlan/__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_rep_admin_vlan/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_rep_admin_vlan/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ce7b15952 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_rep_admin_vlan/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + rep admin vlan 2 segment 1: "rep admin vlan 2 segment 1\r\n" + prompt: Clarke_2008(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Clarke_2008(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: '' + prompt: Clarke_2008# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_rep_admin_vlan/test_api_configure_rep_admin_vlan.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_rep_admin_vlan/test_api_configure_rep_admin_vlan.py new file mode 100644 index 000000000..75a9189d0 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_rep_admin_vlan/test_api_configure_rep_admin_vlan.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_rep_admin_vlan + + +class TestConfigureRepAdminVlan(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Clarke_2008: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Clarke_2008'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_rep_admin_vlan(self): + result = configure_rep_admin_vlan(self.device, '2', '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_service_compress_config/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_service_compress_config/__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_service_compress_config/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_service_compress_config/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..0ba06a31f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_service_compress_config/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + service compress-config: "service compress-config\r\n" + prompt: Kahuna-Sanity(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Kahuna-Sanity(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: '' + prompt: Kahuna-Sanity# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_service_compress_config/test_api_configure_service_compress_config.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_service_compress_config/test_api_configure_service_compress_config.py new file mode 100644 index 000000000..bcc837a2d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_service_compress_config/test_api_configure_service_compress_config.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_service_compress_config + + +class TestConfigureServiceCompressConfig(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Kahuna-Sanity: + 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: iosxe + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Kahuna-Sanity'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_service_compress_config(self): + result = configure_service_compress_config(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_snmp_mib_bulkstat_transfer/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_snmp_mib_bulkstat_transfer/__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_snmp_mib_bulkstat_transfer/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_snmp_mib_bulkstat_transfer/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..dda1a9a29 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_snmp_mib_bulkstat_transfer/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no enable: "no enable\r\n" + no logging console: '' + snmp mib bulkstat transfer myTransfer1: "snmp mib bulkstat transfer myTransfer1\r\ + \n" + prompt: T2-9500-RA_SDG(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T2-9500-RA_SDG(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: '' + prompt: T2-9500-RA_SDG# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_snmp_mib_bulkstat_transfer/test_api_configure_snmp_mib_bulkstat_transfer.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_snmp_mib_bulkstat_transfer/test_api_configure_snmp_mib_bulkstat_transfer.py new file mode 100644 index 000000000..36785f6f7 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_snmp_mib_bulkstat_transfer/test_api_configure_snmp_mib_bulkstat_transfer.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_snmp_mib_bulkstat_transfer + + +class TestConfigureSnmpMibBulkstatTransfer(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + T2-9500-RA_SDG#: + 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: c9500 + type: c9500 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['T2-9500-RA_SDG#'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_snmp_mib_bulkstat_transfer(self): + result = configure_snmp_mib_bulkstat_transfer(self.device, 'myTransfer1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_scp/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_scp/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_scp/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_scp/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..d541558f8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_scp/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,40 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: T13-C9300-24T(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T13-C9300-24T(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 + copy sh_switch_sftp.txt scp://root:cisco@172.163.128.3/sh_switch_sftp.txt: + response: + - "Address or name of remote host [172.163.128.3]? \r\nDestination filename\ + \ [sh_switch_sftp.txt]? \r\nWriting sh_switch_sftp.txt Sink: C0644 397 sh_switch_sftp.txt\r\ + \n!\r\n397 bytes copied in 0.200 secs (1985 bytes/sec)" + response_type: circular + show version: '' + term length 0: '' + term width 0: '' + prompt: T13-C9300-24T# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_scp/test_api_copy_file_with_scp.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_scp/test_api_copy_file_with_scp.py new file mode 100644 index 000000000..76ec2a35b --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_scp/test_api_copy_file_with_scp.py @@ -0,0 +1,42 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import copy_file_with_scp + + +class TestCopyFileWithScp(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + VCR: + 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['VCR'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_copy_file_with_scp(self): + result = copy_file_with_scp(self.device, '172.163.128.3', 'sh_switch_sftp.txt', 'root', 'cisco', None, 30) + expected_output = ('Address or name of remote host [172.163.128.3]? \r\n' + 'Destination filename [sh_switch_sftp.txt]? \r\n' + 'Writing sh_switch_sftp.txt Sink: C0644 397 sh_switch_sftp.txt\r\n' + '!\r\n' + '397 bytes copied in 0.200 secs (1985 bytes/sec)') + # Device output inconsistently includes device prompt + if result.endswith('#'): + expected_output += '\r\nT13-C9300-24T#' + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_sftp/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_sftp/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_sftp/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_sftp/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..1c87f70af --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_sftp/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,40 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: T13-C9300-24T(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T13-C9300-24T(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 + copy sh_switch_sftp.txt sftp://root:cisco@172.163.128.3/sh_switch_sftp.txt: + response: + - "Address or name of remote host [172.163.128.3]? \r\nDestination filename\ + \ [sh_switch_sftp.txt]? \r\nSFTP send: Writing to /root/sh_switch_sftp.txt\ + \ size 397\r\n!\r\n397 bytes copied in 0.204 secs (1946 bytes/sec)" + response_type: circular + show version: '' + term length 0: '' + term width 0: '' + prompt: T13-C9300-24T# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_sftp/test_api_copy_file_with_sftp.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_sftp/test_api_copy_file_with_sftp.py new file mode 100644 index 000000000..67333b249 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_sftp/test_api_copy_file_with_sftp.py @@ -0,0 +1,41 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import copy_file_with_sftp + + +class TestCopyFileWithSftp(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + VCR: + 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['VCR'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_copy_file_with_sftp(self): + result = copy_file_with_sftp(self.device, '172.163.128.3', 'sh_switch_sftp.txt', 'root', 'cisco', None, 30) + expected_output = ('Address or name of remote host [172.163.128.3]? \r\n' + 'Destination filename [sh_switch_sftp.txt]? \r\n' + 'SFTP send: Writing to /root/sh_switch_sftp.txt size 397\r\n' + '!\r\n' + '397 bytes copied in 0.204 secs (1946 bytes/sec)') + # '\r\nT13-C9300-24T#') + # Running UT on Mac drops the prompt from the device output. + self.assertTrue(result.startswith(expected_output)) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_absolute_time_range/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_absolute_time_range/__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_absolute_time_range/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_absolute_time_range/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..b52dadc67 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_absolute_time_range/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no absolute start 22:40 7 Jan 2000: "no absolute start 22:40 7 Jan 2000\r\n" + no logging console: '' + time-range time1: "time-range time1\r\n" + prompt: T2-9500-RA_SDG(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T2-9500-RA_SDG(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: '' + prompt: T2-9500-RA_SDG# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_absolute_time_range/test_api_unconfigure_absolute_time_range.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_absolute_time_range/test_api_unconfigure_absolute_time_range.py new file mode 100644 index 000000000..b3d04d0d3 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_absolute_time_range/test_api_unconfigure_absolute_time_range.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_absolute_time_range + + +class TestUnconfigureAbsoluteTimeRange(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + T2-9500-RA_SDG: + 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: c9500 + type: c9500 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['T2-9500-RA_SDG'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_absolute_time_range(self): + result = unconfigure_absolute_time_range(self.device, 'time1', 'start', '22:40', '7', 'Jan', '2000') + 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_logging_onboard/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_logging_onboard/__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_logging_onboard/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_logging_onboard/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ab5f35900 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_logging_onboard/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no hw-module slot 2 logging onboard: "no hw-module slot 2 logging onboard\r\n" + no logging console: '' + prompt: 9404R-dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404R-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: '' + term length 0: '' + term width 0: '' + prompt: 9404R-dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_logging_onboard/test_api_unconfigure_hw_module_logging_onboard.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_logging_onboard/test_api_unconfigure_hw_module_logging_onboard.py new file mode 100644 index 000000000..c12d77d93 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_logging_onboard/test_api_unconfigure_hw_module_logging_onboard.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_logging_onboard + + +class TestUnconfigureHwModuleLoggingOnboard(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404R-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: cat9400 + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9404R-dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_hw_module_logging_onboard(self): + result = unconfigure_hw_module_logging_onboard(self.device, 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_slot_logging_onboard_environment/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_environment/__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_slot_logging_onboard_environment/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_environment/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..e0f75519a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_environment/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 slot 2 logging onboard environment: "no hw-module slot 2 logging\ + \ onboard environment\r\n" + no logging console: '' + prompt: 9404R-dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404R-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: '' + term length 0: '' + term width 0: '' + prompt: 9404R-dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_environment/test_api_unconfigure_hw_module_slot_logging_onboard_environment.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_environment/test_api_unconfigure_hw_module_slot_logging_onboard_environment.py new file mode 100644 index 000000000..9e9dc7229 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_environment/test_api_unconfigure_hw_module_slot_logging_onboard_environment.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_slot_logging_onboard_environment + + +class TestUnconfigureHwModuleSlotLoggingOnboardEnvironment(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404R-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: cat9400 + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9404R-dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_hw_module_slot_logging_onboard_environment(self): + result = unconfigure_hw_module_slot_logging_onboard_environment(self.device, 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_slot_logging_onboard_temperature/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_temperature/__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_slot_logging_onboard_temperature/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_temperature/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ebb1e80d8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_temperature/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 slot 2 logging onboard temperature: "no hw-module slot 2 logging\ + \ onboard temperature\r\n" + no logging console: '' + prompt: 9404R-dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404R-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: '' + term length 0: '' + term width 0: '' + prompt: 9404R-dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_temperature/test_api_unconfigure_hw_module_slot_logging_onboard_temperature.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_temperature/test_api_unconfigure_hw_module_slot_logging_onboard_temperature.py new file mode 100644 index 000000000..cff2e8ce3 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_temperature/test_api_unconfigure_hw_module_slot_logging_onboard_temperature.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_slot_logging_onboard_temperature + + +class TestUnconfigureHwModuleSlotLoggingOnboardTemperature(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404R-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: cat9400 + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9404R-dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_hw_module_slot_logging_onboard_temperature(self): + result = unconfigure_hw_module_slot_logging_onboard_temperature(self.device, 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_slot_logging_onboard_voltage/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_voltage/__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_slot_logging_onboard_voltage/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_voltage/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..4fce0958b --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_voltage/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 slot 2 logging onboard voltage: "no hw-module slot 2 logging onboard\ + \ voltage\r\n" + no logging console: '' + prompt: 9404R-dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404R-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: '' + term length 0: '' + term width 0: '' + prompt: 9404R-dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_voltage/test_api_unconfigure_hw_module_slot_logging_onboard_voltage.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_voltage/test_api_unconfigure_hw_module_slot_logging_onboard_voltage.py new file mode 100644 index 000000000..c0338ae5e --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_hw_module_slot_logging_onboard_voltage/test_api_unconfigure_hw_module_slot_logging_onboard_voltage.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_slot_logging_onboard_voltage + + +class TestUnconfigureHwModuleSlotLoggingOnboardVoltage(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404R-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: cat9400 + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9404R-dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_hw_module_slot_logging_onboard_voltage(self): + result = unconfigure_hw_module_slot_logging_onboard_voltage(self.device, 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_ip_scp_password/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_password/__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_ip_scp_password/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_password/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..bd7cd2e8c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_password/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no ip scp password: "no ip scp password\r\n" + no logging console: '' + prompt: T13-C9407-Dual-SUP2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T13-C9407-Dual-SUP2(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: '' + prompt: T13-C9407-Dual-SUP2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_password/test_api_unconfigure_ip_scp_password.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_password/test_api_unconfigure_ip_scp_password.py new file mode 100644 index 000000000..faea7cc31 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_password/test_api_unconfigure_ip_scp_password.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_ip_scp_password + + +class TestUnconfigureIpScpPassword(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + VCR: + 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['VCR'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_ip_scp_password(self): + result = unconfigure_ip_scp_password(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_username/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_username/__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_ip_scp_username/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_username/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..a551420ed --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_username/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no ip scp username: "no ip scp username\r\n" + no logging console: '' + prompt: T13-C9407-Dual-SUP2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T13-C9407-Dual-SUP2(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: '' + prompt: T13-C9407-Dual-SUP2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_username/test_api_unconfigure_ip_scp_username.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_username/test_api_unconfigure_ip_scp_username.py new file mode 100644 index 000000000..fbbc10723 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_username/test_api_unconfigure_ip_scp_username.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_ip_scp_username + + +class TestUnconfigureIpScpUsername(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + VCR: + 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['VCR'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_ip_scp_username(self): + result = unconfigure_ip_scp_username(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_sftp_password/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_sftp_password/__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_ip_sftp_password/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_sftp_password/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..a375da8e8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_sftp_password/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no ip sftp password: "no ip sftp password\r\n" + no logging console: '' + prompt: T13-C9407-Dual-SUP2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T13-C9407-Dual-SUP2(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: '' + prompt: T13-C9407-Dual-SUP2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_sftp_password/test_api_unconfigure_ip_sftp_password.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_sftp_password/test_api_unconfigure_ip_sftp_password.py new file mode 100644 index 000000000..539cbff7b --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_sftp_password/test_api_unconfigure_ip_sftp_password.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_ip_sftp_password + + +class TestUnconfigureIpSftpPassword(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + VCR: + 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['VCR'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_ip_sftp_password(self): + result = unconfigure_ip_sftp_password(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_sftp_username/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_sftp_username/__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_ip_sftp_username/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_sftp_username/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..afe859d14 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_sftp_username/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no ip sftp username: "no ip sftp username\r\n" + no logging console: '' + prompt: T13-C9407-Dual-SUP2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T13-C9407-Dual-SUP2(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: '' + prompt: T13-C9407-Dual-SUP2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_sftp_username/test_api_unconfigure_ip_sftp_username.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_sftp_username/test_api_unconfigure_ip_sftp_username.py new file mode 100644 index 000000000..abf92256f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_sftp_username/test_api_unconfigure_ip_sftp_username.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_ip_sftp_username + + +class TestUnconfigureIpSftpUsername(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + VCR: + 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['VCR'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_ip_sftp_username(self): + result = unconfigure_ip_sftp_username(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_periodic_time_range/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_periodic_time_range/__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_periodic_time_range/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_periodic_time_range/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..e4b4cd5e9 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_periodic_time_range/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 periodic daily 22:40 to 22:41: "no periodic daily 22:40 to 22:41\r\n" + time-range time1: "time-range time1\r\n" + prompt: T2-9500-RA_SDG(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T2-9500-RA_SDG(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: '' + prompt: T2-9500-RA_SDG# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_stack_power_stack/test_api_unconfigure_stack_power_stack.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_periodic_time_range/test_api_unconfigure_periodic_time_range.py similarity index 71% rename from pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_stack_power_stack/test_api_unconfigure_stack_power_stack.py rename to pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_periodic_time_range/test_api_unconfigure_periodic_time_range.py index 06eff7a21..8bba0890f 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_stack_power_stack/test_api_unconfigure_stack_power_stack.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_periodic_time_range/test_api_unconfigure_periodic_time_range.py @@ -1,16 +1,16 @@ import os import unittest from pyats.topology import loader -from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_stack_power_stack +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_periodic_time_range -class TestUnconfigureStackPowerStack(unittest.TestCase): +class TestUnconfigurePeriodicTimeRange(unittest.TestCase): @classmethod def setUpClass(self): testbed = f""" devices: - n10SVL: + T2-9500-RA_SDG: connections: defaults: class: unicon.Unicon @@ -22,14 +22,14 @@ def setUpClass(self): type: c9500 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['n10SVL'] + self.device = self.testbed.devices['T2-9500-RA_SDG'] self.device.connect( learn_hostname=True, init_config_commands=[], init_exec_commands=[] ) - def test_unconfigure_stack_power_stack(self): - result = unconfigure_stack_power_stack(self.device, 'test') + def test_unconfigure_periodic_time_range(self): + result = unconfigure_periodic_time_range(self.device, 'time1', 'daily', '22:40', '22:41') expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_rep_admin_vlan/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_rep_admin_vlan/__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_rep_admin_vlan/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_rep_admin_vlan/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..36e55882d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_rep_admin_vlan/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + no rep admin vlan 2 segment 1: "no rep admin vlan 2 segment 1\r\n" + prompt: Clarke_2008(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Clarke_2008(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: '' + prompt: Clarke_2008# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_rep_admin_vlan/test_api_unconfigure_rep_admin_vlan.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_rep_admin_vlan/test_api_unconfigure_rep_admin_vlan.py new file mode 100644 index 000000000..9e74ca322 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_rep_admin_vlan/test_api_unconfigure_rep_admin_vlan.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_rep_admin_vlan + + +class TestUnconfigureRepAdminVlan(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Clarke_2008: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Clarke_2008'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_rep_admin_vlan(self): + result = unconfigure_rep_admin_vlan(self.device, '2', '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_service_compress_config/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_service_compress_config/__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_service_compress_config/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_service_compress_config/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..548166f22 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_service_compress_config/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + no service compress-config: "no service compress-config\r\n" + prompt: Kahuna-Sanity(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Kahuna-Sanity(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: '' + prompt: Kahuna-Sanity# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_service_compress_config/test_api_unconfigure_service_compress_config.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_service_compress_config/test_api_unconfigure_service_compress_config.py new file mode 100644 index 000000000..0a7adba84 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_service_compress_config/test_api_unconfigure_service_compress_config.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_service_compress_config + + +class TestUnconfigureServiceCompressConfig(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Kahuna-Sanity: + 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: iosxe + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Kahuna-Sanity'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_service_compress_config(self): + result = unconfigure_service_compress_config(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_archive_tar/archive_1/test_api_execute_archive_tar.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_archive_tar/archive_1/test_api_execute_archive_tar.py index be901b76f..f7edc4689 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_archive_tar/archive_1/test_api_execute_archive_tar.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_archive_tar/archive_1/test_api_execute_archive_tar.py @@ -2,7 +2,7 @@ import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.platform.execute import execute_archive_tar - +from genie.libs.sdk.apis.utils import sanitize class TestExecuteArchiveTar(unittest.TestCase): @@ -612,4 +612,4 @@ def test_execute_archive_tar(self): 'extracting btman_rotate_immediate_R0-0.20245_0.20230914070151.bin.gz (9098 ' 'bytes)\r\n' 'extracting cyaninit_R0-0.6101_0.20230914070532.bin.gz (1888 bytes)') - self.assertEqual(result, expected_output) + self.assertEqual(sanitize(result), sanitize(expected_output)) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_archive_tar/archive_2/test_api_execute_archive_tar_option_create.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_archive_tar/archive_2/test_api_execute_archive_tar_option_create.py index 83e76ead7..96bee80b1 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_archive_tar/archive_2/test_api_execute_archive_tar_option_create.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_archive_tar/archive_2/test_api_execute_archive_tar_option_create.py @@ -2,7 +2,7 @@ import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.platform.execute import execute_archive_tar - +from genie.libs.sdk.apis.utils import sanitize class TestExecuteArchiveTar(unittest.TestCase): @@ -592,4 +592,4 @@ def test_execute_archive_tar(self): 'archiving btman_rotate_immediate_R0-0.20245_0.20230914070151.bin.gz (9098 ' 'bytes)\r\n' 'archiving cyaninit_R0-0.6101_0.20230914070532.bin.gz (1888 bytes)') - self.assertEqual(result, expected_output) + self.assertEqual(sanitize(result), sanitize(expected_output)) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_archive_tar/archive_3/test_api_execute_archive_tar_option_table.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_archive_tar/archive_3/test_api_execute_archive_tar_option_table.py index 9b4572349..0d128fd81 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_archive_tar/archive_3/test_api_execute_archive_tar_option_table.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_archive_tar/archive_3/test_api_execute_archive_tar_option_table.py @@ -2,7 +2,7 @@ import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.platform.execute import execute_archive_tar - +from genie.libs.sdk.apis.utils import sanitize class TestExecuteArchiveTar(unittest.TestCase): @@ -541,4 +541,4 @@ def test_execute_archive_tar(self): 'hman_pman_R0-0.6058_1.20230914070150.bin.gz (974 bytes)\r\n' 'btman_rotate_immediate_R0-0.20245_0.20230914070151.bin.gz (9098 bytes)\r\n' 'cyaninit_R0-0.6101_0.20230914070532.bin.gz (1888 bytes)') - self.assertEqual(result, expected_output) + self.assertEqual(sanitize(result), sanitize(expected_output)) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_more_file/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_more_file/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_more_file/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_more_file/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..00006f09a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_more_file/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: Sanity-ASR2X(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Sanity-ASR2X(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 + more bootflash:core/Sanity-ASR2X_RP_0-system-report_20230912-151005-UTC-info.txt | i ucode: + response: + - /harddisk/core/Sanity-ASR2X_RP_0_cpp-mcplo-ucode_20230912-150929-UTC.core.gz + response_type: circular + show version: '' + term length 0: '' + term width 0: '' + prompt: Sanity-ASR2X# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_more_file/test_api_execute_more_file.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_more_file/test_api_execute_more_file.py new file mode 100644 index 000000000..973789313 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_more_file/test_api_execute_more_file.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.execute import execute_more_file + + +class TestExecuteMoreFile(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Sanity-ASR2X: + 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: iosxe + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Sanity-ASR2X'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_execute_more_file(self): + result = execute_more_file(self.device, 'bootflash:core/Sanity-ASR2X_RP_0-system-report_20230912-151005-UTC-info.txt', 'ucode') + expected_output = '/harddisk/core/Sanity-ASR2X_RP_0_cpp-mcplo-ucode_20230912-150929-UTC.core.gz' + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_platform_virtualization/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_platform_virtualization/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..9ab31f802 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_platform_virtualization/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: Sanity-ASR9X(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Sanity-ASR9X(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 + set platform hardware rom-monitor virtualization RP active: + response: + - ' Rom-monitor variable ENABLE_VTX has already been set.' + response_type: circular + show version: '' + term length 0: '' + term width 0: '' + prompt: Sanity-ASR9X# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_platform_virtualization/test_api_execute_platform_virtualization.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_platform_virtualization/test_api_execute_platform_virtualization.py new file mode 100644 index 000000000..a01d22ca5 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_platform_virtualization/test_api_execute_platform_virtualization.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.execute import execute_platform_virtualization + + +class TestExecutePlatformVirtualization(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Sanity-ASR9X: + 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: iosxe + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Sanity-ASR9X'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_execute_platform_virtualization(self): + result = execute_platform_virtualization(self.device, 'RP', 'active') + expected_output = ' Rom-monitor variable ENABLE_VTX has already been set.' + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/utils/clear_logging_onboard_rp_active_standby/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/utils/clear_logging_onboard_rp_active_standby/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/utils/clear_logging_onboard_rp_active_standby/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/utils/clear_logging_onboard_rp_active_standby/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..625298680 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/utils/clear_logging_onboard_rp_active_standby/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,41 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9404R-dut1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404R-dut1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + clear logging onboard rp active: + response: + - "Done clearing Message data\r\nDone clearing Voltage data\r\n\r\n--------------------------------------------------------------------------------\r\ + \nNo POE sensor description data\r\n\r\n--------------------------------------------------------------------------------\r\ + \nDone clearing Temperature data\r\nDone clearing Environment data\r\nDone\ + \ clearing Counter data" + response_type: circular + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: 9404R-dut1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/utils/clear_logging_onboard_rp_active_standby/test_api_clear_logging_onboard_rp_active_standby.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/utils/clear_logging_onboard_rp_active_standby/test_api_clear_logging_onboard_rp_active_standby.py new file mode 100644 index 000000000..7f18f73a4 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/utils/clear_logging_onboard_rp_active_standby/test_api_clear_logging_onboard_rp_active_standby.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.utils import clear_logging_onboard_rp_active_standby + + +class TestClearLoggingOnboardRpActiveStandby(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404R-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: cat9400 + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9404R-dut1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_clear_logging_onboard_rp_active_standby(self): + result = clear_logging_onboard_rp_active_standby(self.device, 'active') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_map/configure/configure_bandwidth_remaining_policy_map/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_map/configure/configure_bandwidth_remaining_policy_map/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_map/configure/configure_bandwidth_remaining_policy_map/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_map/configure/configure_bandwidth_remaining_policy_map/mock_data/iosxe/mock_data.yaml index e9689280c..6b8c82128 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_map/configure/configure_bandwidth_remaining_policy_map/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_map/configure/configure_bandwidth_remaining_policy_map/mock_data/iosxe/mock_data.yaml @@ -1,29 +1,21 @@ configure: commands: - bandwidth remaining percent 10: "bandwidth remaining percent 10\r\n" - bandwidth remaining percent 20: "bandwidth remaining percent 20\r\n" - bandwidth percent 5: "bandwidth percent 5\r\n" - bandwidth percent 7: "bandwidth percent 7\r\n" class class-default: "class class-default\r\n" - class data: "class data\r\n" - class video: "class video\r\n" - class voice: "class voice\r\n" end: new_state: execute line console 0: new_state: configure_line no logging console: '' - policy-map grandparent: "policy-map grandparent\r\n" - policy-map parent: "policy-map parent\r\n" + policy-map PQ: "policy-map PQ\r\n" service-policy parent: "service-policy parent\r\n" - shape average percent 100: "shape average percent 100\r\n" - prompt: BB_2HX(config)# + shape average percent 4: "shape average percent 4\r\n" + prompt: A1(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: BB_2HX(config-line)# + prompt: A1(config-line)# connect: commands: ? '' @@ -43,4 +35,4 @@ execute: show version: '' term length 0: '' term width 0: '' - prompt: BB_2HX# + prompt: A1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_map/configure/configure_bandwidth_remaining_policy_map/test_api_configure_bandwidth_remaining_policy_map.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_map/configure/configure_bandwidth_remaining_policy_map/test_api_configure_bandwidth_remaining_policy_map.py index 0ad4aac7d..7dda5ddd5 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_map/configure/configure_bandwidth_remaining_policy_map/test_api_configure_bandwidth_remaining_policy_map.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/policy_map/configure/configure_bandwidth_remaining_policy_map/test_api_configure_bandwidth_remaining_policy_map.py @@ -1,3 +1,4 @@ +import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.policy_map.configure import configure_bandwidth_remaining_policy_map @@ -7,21 +8,21 @@ class TestConfigureBandwidthRemainingPolicyMap(unittest.TestCase): @classmethod def setUpClass(self): - testbed = """ + testbed = f""" devices: - BB_2HX: + A1: 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: iosxe - type: iosxe + platform: cat9k + type: single_rp """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['BB_2HX'] + self.device = self.testbed.devices['A1'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -29,11 +30,6 @@ def setUpClass(self): ) def test_configure_bandwidth_remaining_policy_map(self): - result = configure_bandwidth_remaining_policy_map(self.device, ['parent', 'grandparent'], ['voice', 'data', 'video', 'class-default'], [20, 10, 10, 10, 30], '100') - expected_output = None - self.assertEqual(result, expected_output) - - def test_configure_bandwidth_policy_map(self): - result = configure_bandwidth_remaining_policy_map(self.device, ['parent', 'grandparent'], ['voice', 'data', 'video', 'class-default'], [7, 5, 5, 5], '100', bandwidth_remaining=False) + result = configure_bandwidth_remaining_policy_map(self.device, ['PQ', 'parent'], '4', None, None, True) expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/redundancy/execute/execute_redundancy_reload/test_api_execute_redundancy_reload.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/redundancy/execute/execute_redundancy_reload/test_api_execute_redundancy_reload.py index fbcf42afd..0aafc69a5 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/redundancy/execute/execute_redundancy_reload/test_api_execute_redundancy_reload.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/redundancy/execute/execute_redundancy_reload/test_api_execute_redundancy_reload.py @@ -33,4 +33,7 @@ def test_execute_redundancy_reload(self): expected_output = ('Stack is in Half ring setup; Reloading a switch might cause stack split\r\n' 'Reload peer [confirm]\r\n' 'Preparing to reload peer') + # Device output inconsistently includes device prompt + if result.endswith('#'): + expected_output += '\r\nstartrek-1#' self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_user/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_user/mock_data/iosxe/mock_data.yaml index 56bdf124e..c2d240728 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_user/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_user/mock_data/iosxe/mock_data.yaml @@ -5,17 +5,16 @@ configure: line console 0: new_state: configure_line no logging console: '' - snmp-server user TestUsr2 TestGrp v3 auth md5 password1: "snmp-server user TestUsr2\ - \ TestGrp v3 auth md5 password\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$ user TestUsr2\ - \ TestGrp v3 auth md5 password1 \b\b\b\b\b\b\b\b\b\r\n" - prompt: T2-9500-RA_SDG(config)# + snmp-server user snmp_user snmp_group v3 auth sha-2 256 cisco123 priv aes 256 cisco123: "snmp-server\ + \ user snmp_user snmp_group v3 auth sha-2 256 cisco123 priv aes 256 cisco123\r\ + \n" + prompt: C1113-8P_pkumarmu(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: T2-9500-RA_SDG(config-line)# + prompt: C1113-8P_pkumarmu(config-line)# connect: commands: ? '' @@ -35,4 +34,4 @@ execute: show version: '' term length 0: '' term width 0: '' - prompt: T2-9500-RA_SDG# + prompt: C1113-8P_pkumarmu# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_user/test_api_configure_snmp_server_user.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_user/test_api_configure_snmp_server_user.py index af8342def..55628ea34 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_user/test_api_configure_snmp_server_user.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/snmp/configure/configure_snmp_server_user/test_api_configure_snmp_server_user.py @@ -10,7 +10,7 @@ class TestConfigureSnmpServerUser(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - Switch: + C1113-8P_pkumarmu: 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: c9500L - type: c9500L + platform: router + type: iosxe """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['Switch'] + self.device = self.testbed.devices['C1113-8P_pkumarmu'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -30,6 +30,6 @@ def setUpClass(self): ) def test_configure_snmp_server_user(self): - result = configure_snmp_server_user(self.device, 'TestUsr2', 'TestGrp', 'v3', 'md5', None, 'password1', 'des', None, None, None, 'password', None, None, None) + result = configure_snmp_server_user(self.device, 'snmp_user', 'snmp_group', 'v3', 'sha-2', '256', 'cisco123', 'aes', '256', 'cisco123', None, None, None, None, None) 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_etherchannel_misconfig/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_etherchannel_misconfig/__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_etherchannel_misconfig/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_etherchannel_misconfig/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..506413b46 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_etherchannel_misconfig/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 etherchannel guard misconfig: "spanning-tree etherchannel guard\ + \ misconfig\r\n" + prompt: l2sec_clarke_2006(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: l2sec_clarke_2006(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: '' + prompt: l2sec_clarke_2006# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_etherchannel_misconfig/test_api_configure_spanning_tree_etherchannel_misconfig.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_etherchannel_misconfig/test_api_configure_spanning_tree_etherchannel_misconfig.py new file mode 100644 index 000000000..7fddbd50c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_etherchannel_misconfig/test_api_configure_spanning_tree_etherchannel_misconfig.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_etherchannel_misconfig + + +class TestConfigureSpanningTreeEtherchannelMisconfig(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + l2sec_clarke_2006: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['l2sec_clarke_2006'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_spanning_tree_etherchannel_misconfig(self): + result = configure_spanning_tree_etherchannel_misconfig(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_etherchannel_misconfig/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_etherchannel_misconfig/__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_etherchannel_misconfig/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_etherchannel_misconfig/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..4d46cf85c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_etherchannel_misconfig/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 etherchannel guard misconfig: "no spanning-tree etherchannel\ + \ guard misconfig\r\n" + prompt: l2sec_clarke_2006(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: l2sec_clarke_2006(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: '' + prompt: l2sec_clarke_2006# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_etherchannel_misconfig/test_api_unconfigure_spanning_tree_etherchannel_misconfig.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_etherchannel_misconfig/test_api_unconfigure_spanning_tree_etherchannel_misconfig.py new file mode 100644 index 000000000..e55e7eed3 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/unconfigure_spanning_tree_etherchannel_misconfig/test_api_unconfigure_spanning_tree_etherchannel_misconfig.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_etherchannel_misconfig + + +class TestUnconfigureSpanningTreeEtherchannelMisconfig(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + l2sec_clarke_2006: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: switch + type: switch + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['l2sec_clarke_2006'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_spanning_tree_etherchannel_misconfig(self): + result = unconfigure_spanning_tree_etherchannel_misconfig(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/telemetry/execute/execute_test_telemetry_show_logging/test_api_execute_test_telemetry_show_logging.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/telemetry/execute/execute_test_telemetry_show_logging/test_api_execute_test_telemetry_show_logging.py index 78611358a..6d563054d 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/telemetry/execute/execute_test_telemetry_show_logging/test_api_execute_test_telemetry_show_logging.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/telemetry/execute/execute_test_telemetry_show_logging/test_api_execute_test_telemetry_show_logging.py @@ -2,7 +2,7 @@ import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.telemetry.execute import execute_test_telemetry_show_logging - +from genie.libs.sdk.apis.utils import sanitize class TestExecuteTestTelemetryShowLogging(unittest.TestCase): @@ -158,4 +158,4 @@ def test_execute_test_telemetry_show_logging(self): 'Created report id: 1668403011\r\n' '*Nov 13 22:17:28.120 PDT: %SYS-5-CONFIG_I: Configured from console by ' 'console') - self.assertEqual(result, expected_output) + self.assertEqual(sanitize(result), sanitize(expected_output)) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/format_directory/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/format_directory/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/format_directory/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/format_directory/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..e8db892ff --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/format_directory/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,40 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: Skyfox(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Skyfox(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 + 'format crashinfo:': + response: + - "Format operation may take a while. Continue? [confirm]\r\nFormat operation\ + \ will destroy all data in \"crashinfo:\". Continue? [confirm]\r\nFormat\ + \ of crashinfo: complete" + response_type: circular + show version: '' + term length 0: '' + term width 0: '' + prompt: Skyfox# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/format_directory/test_api_format_directory.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/format_directory/test_api_format_directory.py new file mode 100644 index 000000000..9d3ce5fcb --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/format_directory/test_api_format_directory.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.utils import format_directory + + +class TestFormatDirectory(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Skyfox: + 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: c9600 + type: c9600 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Skyfox'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_format_directory(self): + result = format_directory(self.device, 'crashinfo:', 200) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/get_mgmt_ip_and_mgmt_src_ip_addresses/test_api_get_mgmt_ip_and_mgmt_src_ip_addresses.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/get_mgmt_ip_and_mgmt_src_ip_addresses/test_api_get_mgmt_ip_and_mgmt_src_ip_addresses.py index 43573021f..c2aba87c5 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/get_mgmt_ip_and_mgmt_src_ip_addresses/test_api_get_mgmt_ip_and_mgmt_src_ip_addresses.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/get_mgmt_ip_and_mgmt_src_ip_addresses/test_api_get_mgmt_ip_and_mgmt_src_ip_addresses.py @@ -29,7 +29,12 @@ def setUpClass(self): init_exec_commands=[] ) - def test_get_mgmt_ip_and_mgmt_src_ip_addresses(self): + def test_get_mgmt_ip_and_mgmt_src_ip_addresses_with_source(self): result = get_mgmt_ip_and_mgmt_src_ip_addresses(self.device, '192.168.1.5') expected_output = ('192.168.1.6', {'192.168.1.5'}) self.assertEqual(result, expected_output) + + def test_get_mgmt_ip_and_mgmt_src_ip_addresses(self): + result = get_mgmt_ip_and_mgmt_src_ip_addresses(self.device) + expected_output = ('192.168.1.6', {'192.168.1.5'}) + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/config_vlan_tag_native/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/config_vlan_tag_native/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/config_vlan_tag_native/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/config_vlan_tag_native/mock_data/iosxe/mock_data.yaml index 06d2a0f1b..a8c6a1d85 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/config_vlan_tag_native/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/config_vlan_tag_native/mock_data/iosxe/mock_data.yaml @@ -2,21 +2,17 @@ configure: commands: end: new_state: execute - line console: - new_state: configure_line line console 0: new_state: configure_line no logging console: '' vlan dot1q tag native: "vlan dot1q tag native\r\n" - prompt: Switch(config)# + prompt: 9500-Core(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - line vty: '' - terminal width 511: '' - prompt: Switch(config-line)# + prompt: 9500-Core(config-line)# connect: commands: ? '' @@ -36,6 +32,4 @@ execute: show version: '' term length 0: '' term width 0: '' - term width 511: '' - terminal session-timeout 0: '' - prompt: Switch# + prompt: 9500-Core# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/config_vlan_tag_native/test_api_config_vlan_tag_native.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/config_vlan_tag_native/test_api_config_vlan_tag_native.py index 6b4782339..df7278585 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/config_vlan_tag_native/test_api_config_vlan_tag_native.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/config_vlan_tag_native/test_api_config_vlan_tag_native.py @@ -1,3 +1,4 @@ +import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.vlan.configure import config_vlan_tag_native @@ -7,21 +8,21 @@ class TestConfigVlanTagNative(unittest.TestCase): @classmethod def setUpClass(self): - testbed = """ + testbed = f""" devices: - Switch: + 9500-Core: connections: defaults: class: unicon.Unicon a: - command: mock_device_cli --os iosxe --mock_data_dir mock_data --state connect + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe platform: cat9k - type: c9300 + type: single_rp """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['Switch'] + self.device = self.testbed.devices['9500-Core'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -29,6 +30,6 @@ def setUpClass(self): ) def test_config_vlan_tag_native(self): - result = config_vlan_tag_native(device=self.device) + result = config_vlan_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/vlan/configure/configure_interface_vlan_priority/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_priority/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_priority/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_priority/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..2ecff194a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_priority/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + interface vlan 11: "\r\n" + line console 0: + new_state: configure_line + no logging console: '' + standby 11 priority 200: "*Feb 17 06:26:46.158: %SYS-5-CONFIG_I: Configured from\ + \ console by consoleinterface vlan 11\r\n" + prompt: 9500-Core(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9500-Core(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: '' + prompt: 9500-Core# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_priority/test_api_configure_interface_vlan_priority.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_priority/test_api_configure_interface_vlan_priority.py new file mode 100644 index 000000000..2f339523f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_priority/test_api_configure_interface_vlan_priority.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.vlan.configure import configure_interface_vlan_priority + + +class TestConfigureInterfaceVlanPriority(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9500-Core: + 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: single_rp + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9500-Core'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_interface_vlan_priority(self): + result = configure_interface_vlan_priority(self.device, 11, 200) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_range_priority/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_range_priority/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_range_priority/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_range_priority/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ac1489357 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_range_priority/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + interface range vlan 11-20: "interface range vlan 11-20\r\n" + line console 0: + new_state: configure_line + no logging console: '' + standby 0 priority 50: "standby 0 priority 50\r\n" + prompt: A1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: A1(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: '' + prompt: A1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_range_priority/test_api_configure_interface_vlan_range_priority.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_range_priority/test_api_configure_interface_vlan_range_priority.py new file mode 100644 index 000000000..67ed19318 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_interface_vlan_range_priority/test_api_configure_interface_vlan_range_priority.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.vlan.configure import configure_interface_vlan_range_priority + + +class TestConfigureInterfaceVlanRangePriority(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + A1: + 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: single_rp + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['A1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_interface_vlan_range_priority(self): + result = configure_interface_vlan_range_priority(self.device, 11, 20, 0, 50) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_switchport_trunk_pruning_vlan/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_switchport_trunk_pruning_vlan/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_switchport_trunk_pruning_vlan/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_switchport_trunk_pruning_vlan/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..8fb1e3e32 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_switchport_trunk_pruning_vlan/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + interface HundredGigE1/0/5: "interface HundredGigE1/0/5\r\n" + line console 0: + new_state: configure_line + no logging console: '' + switchport trunk pruning vlan 3: "switchport trunk pruning vlan 3\r\n" + prompt: Skyfox(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Skyfox(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: '' + prompt: Skyfox# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_switchport_trunk_pruning_vlan/test_api_configure_switchport_trunk_pruning_vlan.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_switchport_trunk_pruning_vlan/test_api_configure_switchport_trunk_pruning_vlan.py new file mode 100644 index 000000000..60ac65e88 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_switchport_trunk_pruning_vlan/test_api_configure_switchport_trunk_pruning_vlan.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.vlan.configure import configure_switchport_trunk_pruning_vlan + + +class TestConfigureSwitchportTrunkPruningVlan(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Skyfox: + 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: c9500 + type: c9500 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Skyfox'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_switchport_trunk_pruning_vlan(self): + result = configure_switchport_trunk_pruning_vlan(self.device, 'HundredGigE1/0/5', '3') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_vtp_pruning/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_vtp_pruning/__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_stack/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_vtp_pruning/mock_data/iosxe/mock_data.yaml similarity index 80% rename from pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_stack_power_stack/mock_data/iosxe/mock_data.yaml rename to pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_vtp_pruning/mock_data/iosxe/mock_data.yaml index f33a7e9f8..2f4091c7a 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_stack_power_stack/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_vtp_pruning/mock_data/iosxe/mock_data.yaml @@ -5,14 +5,14 @@ configure: line console 0: new_state: configure_line no logging console: '' - no stack-power stack test: "no stack-power stack test\r\n" - prompt: n10SVL(config)# + vtp pruning: "vtp pruning\r\nPruning switched on\r\n" + prompt: SC_9200-1(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: n10SVL(config-line)# + prompt: SC_9200-1(config-line)# connect: commands: ? '' @@ -32,4 +32,4 @@ execute: show version: '' term length 0: '' term width 0: '' - prompt: n10SVL# + prompt: SC_9200-1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_vtp_pruning/test_api_configure_vtp_pruning.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_vtp_pruning/test_api_configure_vtp_pruning.py new file mode 100644 index 000000000..b1e2dfe83 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_vtp_pruning/test_api_configure_vtp_pruning.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.vlan.configure import configure_vtp_pruning + + +class TestConfigureVtpPruning(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + SC_9200-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: c9300 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['SC_9200-1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_vtp_pruning(self): + result = configure_vtp_pruning(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfig_vlan_tag_native/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfig_vlan_tag_native/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfig_vlan_tag_native/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfig_vlan_tag_native/mock_data/iosxe/mock_data.yaml index a42545147..79b1cb102 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfig_vlan_tag_native/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfig_vlan_tag_native/mock_data/iosxe/mock_data.yaml @@ -2,21 +2,19 @@ configure: commands: end: new_state: execute - line console: - new_state: configure_line + interface range vlan 11-20: '% Invalid command at ''^'' marker.' line console 0: new_state: configure_line no logging console: '' no vlan dot1q tag native: "no vlan dot1q tag native\r\n" - prompt: VCR(config)# + standby 0 priority 50: '% Invalid command at ''^'' marker.' + prompt: 9500-Core(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - line vty: '' - terminal width 511: '' - prompt: VCR(config-line)# + prompt: 9500-Core(config-line)# connect: commands: ? '' @@ -36,6 +34,4 @@ execute: show version: '' term length 0: '' term width 0: '' - term width 511: '' - terminal session-timeout 0: '' - prompt: VCR# + prompt: 9500-Core# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfig_vlan_tag_native/test_api_unconfig_vlan_tag_native.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfig_vlan_tag_native/test_api_unconfig_vlan_tag_native.py index 23541115e..2f37e8817 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfig_vlan_tag_native/test_api_unconfig_vlan_tag_native.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfig_vlan_tag_native/test_api_unconfig_vlan_tag_native.py @@ -1,3 +1,4 @@ +import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.vlan.configure import unconfig_vlan_tag_native @@ -7,21 +8,21 @@ class TestUnconfigVlanTagNative(unittest.TestCase): @classmethod def setUpClass(self): - testbed = """ + testbed = f""" devices: - VCR: + 9500-Core: connections: defaults: class: unicon.Unicon a: - command: mock_device_cli --os iosxe --mock_data_dir mock_data --state connect + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe platform: cat9k - type: c9200 + type: single_rp """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['VCR'] + self.device = self.testbed.devices['9500-Core'] self.device.connect( learn_hostname=True, init_config_commands=[], diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_switchport_trunk_pruning_vlan/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_switchport_trunk_pruning_vlan/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_switchport_trunk_pruning_vlan/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_switchport_trunk_pruning_vlan/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ddbb4175d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_switchport_trunk_pruning_vlan/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + interface HundredGigE1/0/5: "interface HundredGigE1/0/5\r\n" + line console 0: + new_state: configure_line + no logging console: '' + no switchport trunk pruning vlan 3: "no switchport trunk pruning vlan 3\r\n" + prompt: Skyfox(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Skyfox(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: '' + prompt: Skyfox# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_switchport_trunk_pruning_vlan/test_api_unconfigure_switchport_trunk_pruning_vlan.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_switchport_trunk_pruning_vlan/test_api_unconfigure_switchport_trunk_pruning_vlan.py new file mode 100644 index 000000000..e0dd2c057 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_switchport_trunk_pruning_vlan/test_api_unconfigure_switchport_trunk_pruning_vlan.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.vlan.configure import unconfigure_switchport_trunk_pruning_vlan + + +class TestUnconfigureSwitchportTrunkPruningVlan(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Skyfox: + 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: c9500 + type: c9500 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Skyfox'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_switchport_trunk_pruning_vlan(self): + result = unconfigure_switchport_trunk_pruning_vlan(self.device, 'HundredGigE1/0/5', '3') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_mode/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_mode/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_mode/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_mode/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..3403378dc --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_mode/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 vtp mode transparent: "no vtp mode transparent\r\nDevice mode already VTP server\ + \ for VLAN feature\r\nResetting device to VTP SERVER mode.\r\n" + prompt: SC_9200-2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: SC_9200-2(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: '' + prompt: SC_9200-2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_mode/test_api_unconfigure_vtp_mode.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_mode/test_api_unconfigure_vtp_mode.py new file mode 100644 index 000000000..28e1f794d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_mode/test_api_unconfigure_vtp_mode.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.vlan.configure import unconfigure_vtp_mode + + +class TestUnconfigureVtpMode(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + SC_9200-2: + 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['SC_9200-2'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_vtp_mode(self): + result = unconfigure_vtp_mode(self.device, 'transparent') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_pruning/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_pruning/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_pruning/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_pruning/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..223da7b26 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_pruning/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + no vtp pruning: "no vtp pruning\r\nPruning switched off\r\n" + prompt: SC_9200-1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: SC_9200-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: '' + prompt: SC_9200-1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_pruning/test_api_unconfigure_vtp_pruning.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_pruning/test_api_unconfigure_vtp_pruning.py new file mode 100644 index 000000000..46dd24950 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_pruning/test_api_unconfigure_vtp_pruning.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.vlan.configure import unconfigure_vtp_pruning + + +class TestUnconfigureVtpPruning(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + SC_9200-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: c9300 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['SC_9200-1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_vtp_pruning(self): + result = unconfigure_vtp_pruning(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_version/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_version/mock_data/iosxe/mock_data.yaml index 83c724425..e312b7b52 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_version/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_version/mock_data/iosxe/mock_data.yaml @@ -5,14 +5,14 @@ configure: line console 0: new_state: configure_line no logging console: '' - no vtp version: "no vtp version\r\n" - prompt: 9300-24UX-2(config)# + no vtp version: "no vtp version\r\nVTP version is already in V1.\r\n" + prompt: 9500-Core(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: 9300-24UX-2(config-line)# + prompt: 9500-Core(config-line)# connect: commands: ? '' @@ -32,4 +32,4 @@ execute: show version: '' term length 0: '' term width 0: '' - prompt: 9300-24UX-2# + prompt: 9500-Core# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_version/test_api_unconfigure_vtp_version.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_version/test_api_unconfigure_vtp_version.py index ca8108276..d0c77ab7a 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_version/test_api_unconfigure_vtp_version.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/unconfigure_vtp_version/test_api_unconfigure_vtp_version.py @@ -10,7 +10,7 @@ class TestUnconfigureVtpVersion(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - 9300-24UX-2: + 9500-Core: connections: defaults: class: unicon.Unicon @@ -19,10 +19,10 @@ def setUpClass(self): protocol: unknown os: iosxe platform: cat9k - type: c9300 + type: single_rp """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['9300-24UX-2'] + self.device = self.testbed.devices['9500-Core'] self.device.connect( learn_hostname=True, init_config_commands=[], diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vrf/configure/configure_scale_vrf_via_tftp/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vrf/configure/configure_scale_vrf_via_tftp/mock_data/iosxe/mock_data.yaml index 46b3f7d29..87307cc34 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vrf/configure/configure_scale_vrf_via_tftp/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vrf/configure/configure_scale_vrf_via_tftp/mock_data/iosxe/mock_data.yaml @@ -5,13 +5,13 @@ configure: line console 0: new_state: configure_line no logging console: '' - prompt: Organ(config)# + prompt: Minuet(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: Organ(config-line)# + prompt: Minuet(config-line)# connect: commands: ? '' @@ -31,4 +31,4 @@ execute: show version: '' term length 0: '' term width 0: '' - prompt: Organ# + prompt: Minuet# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vrf/configure/configure_scale_vrf_via_tftp/test_api_configure_scale_vrf_via_tftp.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vrf/configure/configure_scale_vrf_via_tftp/test_api_configure_scale_vrf_via_tftp.py index e9bc94a80..41e2a4f77 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vrf/configure/configure_scale_vrf_via_tftp/test_api_configure_scale_vrf_via_tftp.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vrf/configure/configure_scale_vrf_via_tftp/test_api_configure_scale_vrf_via_tftp.py @@ -1,3 +1,4 @@ +import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.vrf.configure import configure_scale_vrf_via_tftp @@ -7,21 +8,21 @@ class TestConfigureScaleVrfViaTftp(unittest.TestCase): @classmethod def setUpClass(self): - testbed = """ + testbed = f""" devices: - Organ: + Minuet: 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: router type: router """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['Organ'] + self.device = self.testbed.devices['Minuet'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -29,58 +30,61 @@ def setUpClass(self): ) def test_configure_scale_vrf_via_tftp(self): - result = configure_scale_vrf_via_tftp(self.device, {'myftpserver': {'custom': {'scale_config_path': '/auto/tftp-sjc-users4/siwwu/'}, + result = configure_scale_vrf_via_tftp(self.device, {'myftpserver': {'address': None, + 'custom': {'scale_config_path': '/auto/tftp-sjc-users4/siwwu/'}, 'dynamic': True, - 'protocol': 'ftp'}}, 2, 1, 10, False, False) + 'path': '/', + 'protocol': 'ftp', + 'subnet': '171.70.0.0/16'}}, 1, 1, 5, False, False) expected_output = ('\n' + ' vrf definition 1\n' + ' rd 1:1\n' + ' !\n' + ' address-family ipv4\n' + ' exit-address-family\n' + ' !\n' + ' address-family ipv6\n' + ' exit-address-family\n' + ' !\n' + ' \n' ' vrf definition 2\n' + ' rd 2:2\n' + ' !\n' ' address-family ipv4\n' + ' exit-address-family\n' + ' !\n' ' address-family ipv6\n' - ' exit\n' + ' exit-address-family\n' + ' !\n' ' \n' ' vrf definition 3\n' + ' rd 3:3\n' + ' !\n' ' address-family ipv4\n' + ' exit-address-family\n' + ' !\n' ' address-family ipv6\n' - ' exit\n' + ' exit-address-family\n' + ' !\n' ' \n' ' vrf definition 4\n' + ' rd 4:4\n' + ' !\n' ' address-family ipv4\n' + ' exit-address-family\n' + ' !\n' ' address-family ipv6\n' - ' exit\n' + ' exit-address-family\n' + ' !\n' ' \n' ' vrf definition 5\n' + ' rd 5:5\n' + ' !\n' ' address-family ipv4\n' + ' exit-address-family\n' + ' !\n' ' address-family ipv6\n' - ' exit\n' - ' \n' - ' vrf definition 6\n' - ' address-family ipv4\n' - ' address-family ipv6\n' - ' exit\n' - ' \n' - ' vrf definition 7\n' - ' address-family ipv4\n' - ' address-family ipv6\n' - ' exit\n' - ' \n' - ' vrf definition 8\n' - ' address-family ipv4\n' - ' address-family ipv6\n' - ' exit\n' - ' \n' - ' vrf definition 9\n' - ' address-family ipv4\n' - ' address-family ipv6\n' - ' exit\n' - ' \n' - ' vrf definition 10\n' - ' address-family ipv4\n' - ' address-family ipv6\n' - ' exit\n' - ' \n' - ' vrf definition 11\n' - ' address-family ipv4\n' - ' address-family ipv6\n' - ' exit\n' + ' exit-address-family\n' + ' !\n' ' ') self.assertEqual(result, expected_output) 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 5c0ad8a8c..6d41fa21c 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py @@ -4399,3 +4399,15 @@ def device_recovery_boot(device, console_activity_pattern=None, console_breakboo raise Exception(f"Failed to boot the device {device.name}", from_exception=e) else: log.info(f"Successfully boot the device {device.name}") + +def sanitize(s): + """ + + Wipes out all the whitespace + + """ + + ansi_escape = re.compile(r'\x1B\[[0-?]*[ -/]*[@-~]') + s = ansi_escape.sub('', s) + + return s.translate(dict.fromkeys(range(32))).strip().replace(' ', '') diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/genie_yamls/trigger_datafile.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/genie_yamls/trigger_datafile.yaml index 2654f5986..ee28f64f8 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/genie_yamls/trigger_datafile.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/genie_yamls/trigger_datafile.yaml @@ -376,11 +376,6 @@ TriggerAddRemoveBgpAggregateAddressIpv6: pkg: genie.libs.sdk class: triggers.addremove.bgp.addremove.TriggerAddRemoveBgpAggregateAddressIpv6 -TriggerAddRemoveBgpNetworkIPv4: - source: - pkg: genie.libs.sdk - class: triggers.addremove.bgp.addremove.TriggerAddRemoveBgpNetworkIPv4 - TriggerAddRemoveBgpKeepaliveHoldtime: source: pkg: genie.libs.sdk @@ -627,15 +622,6 @@ TriggerUnconfigConfigVlanVnsegment: pkg: genie.libs.sdk class: triggers.unconfigconfig.vlan.unconfigconfig.TriggerUnconfigConfigVlanVnsegment -# ----------- -# MODIFY -# ----------- - -TriggerModifyVlanVnsegment: - source: - pkg: genie.libs.sdk - class: triggers.modify.vlan.modify.TriggerModifyVlanVnsegment - # ----------- # SHUT-NOSHUT # ----------- diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/gnmi_util.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/gnmi_util.py index 08601ca63..9b3dad1ca 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/gnmi_util.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/gnmi_util.py @@ -29,6 +29,20 @@ class GnmiMessageException(Exception): pass +class LeafListVal: + """Class to set a leaf list value""" + def __init__(self, val): + self.llvalue = val + + @property + def llvalue(self): + return self._llvalue + + @llvalue.setter + def llvalue(self, val): + self._llvalue = val + + class ForkedPdb(pdb.Pdb): """A pdb subclass for debugging GnmiNotification. @@ -152,7 +166,7 @@ def run_get(self, log.error(banner( f'Response time: {response_time} seconds exceeded transaction_time {transaction_time}', )) - return response, False + return None else: response = device.gnmi.service.Get(payload, metadata=self.metadata) log.info( @@ -161,15 +175,15 @@ def run_get(self, ) ) if isinstance(response, gnmi_pb2.GetResponse): - return response, True - return None, False + return response + return None except Exception as exc: log.error(traceback.format_exc()) if hasattr(exc, 'details'): log.error('ERROR: {0}'.format(exc.details())) else: log.error(str(exc)) - return None, False + return None @staticmethod def get_opfields(val, xpath_str, opfields=[], namespace={}): @@ -256,6 +270,8 @@ def decode_update_value(val): return bytes(value, encoding='utf8') elif 'leaflist' in datatype: return GnmiMessage.process_leaf_list_val(value) + else: + return value else: log.info('Update has no value') @@ -285,26 +301,9 @@ def process_update(update, prefix=None, namespace={}, opfields=[]): 'datatype': 'ascii', 'value': decoded_val, }) - elif val: - datatype = next(iter(val)) - value = val[datatype] - if 'int' in datatype: - value = int(value) - elif ('float' in datatype or - 'double' in datatype): - value = float(value) - elif 'decimal' in datatype: - value = float( - value['digits']) / (10 ** value['precision']) - elif 'bytes' in datatype: - value = bytes(value, encoding='utf8') - elif 'leaflist' in datatype: - value = GnmiMessage.process_leaf_list_val(value) - if isinstance(value, list): - for val in value: - opfields.append((decoded_val, xpath)) - else: - opfields.append((decoded_val, xpath)) + elif decoded_val and isinstance(decoded_val, list): + for d_val in decoded_val: + opfields.append((d_val, xpath)) else: opfields.append((decoded_val, xpath)) @@ -577,6 +576,13 @@ def _upd_rpl(upd_rpl, base64_encode): updates.append(gnmi_update) return updates + @classmethod + def split_value_namespaces(self, value: str) -> list: + try: + return value.split(':') + except Exception: + return [] + @classmethod def json_to_gnmi(self, action, payload, **kwargs): """Given a JSON payload, convert it to a gNMI message. @@ -879,7 +885,8 @@ def get_payload(self, update): if xp.endswith(']'): xp = xp + '/' if xp in processed_xp: - continue + if node['nodetype'] != 'leaf-list': + continue jval = json_val collect_key = False key_elem = None @@ -894,13 +901,31 @@ def get_payload(self, update): if len(tokenized) == i: # If a node has only one element if len(jval) == 0: - jval[elem] = node['value'] + if node.get('nodetype', '') == 'leaf-list': + if jval.get(elem) is None: + jval[elem] = [LeafListVal(node['value'][0])] + else: + jval[elem].append(LeafListVal(node['value'][0])) + else: + jval[elem] = node['value'] else: # Check if jval is pointing to a list or dict to assign values if isinstance(jval, list): - jval[ind][elem] = node['value'] + if node.get('nodetype', '') == 'leaf-list': + if jval[ind].get(elem) is None: + jval[ind][elem] = [LeafListVal(node['value'][0])] + else: + jval[ind][elem].append(LeafListVal(node['value'][0])) + else: + jval[ind][elem] = node['value'] else: - jval[elem] = node['value'] + if node.get('nodetype', '') == 'leaf-list': + if jval.get(elem) is None: + jval[elem] = [LeafListVal(node['value'][0])] + else: + jval[elem].append(LeafListVal(node['value'][0])) + else: + jval[elem] = node['value'] else: # Create a new list of dictionary / new key in dictionary if elem is not present if elem not in jval: @@ -965,12 +990,22 @@ def format_json_val(self,json_val): return for j in json_val: if isinstance(json_val[j],list) and len(json_val[j]) == 1: - json_val[j] = json_val[j][0] - self.format_json_val(json_val[j]) + if isinstance(json_val[j][0], LeafListVal): + # leaflist value need to enclosed within brackets + # extract the value from Leaflistval object + json_val[j][0] = json_val[j][0].llvalue + self.format_json_val(json_val[j]) + else: + json_val[j] = json_val[j][0] + self.format_json_val(json_val[j]) else: if isinstance(json_val[j],list): - for i in json_val[j]: - self.format_json_val(i) + for ind, i in enumerate(json_val[j]): + if isinstance(i, LeafListVal): + json_val[j][ind] = i.llvalue + self.format_json_val(i.llvalue) + else: + self.format_json_val(i) def _trim_nodes(self, nodes): # Prune list nodes if already in other nodes xpath @@ -1100,14 +1135,20 @@ def xml_xpath_to_gnmi_xpath(self): self.origin = 'rfc7951' elif 'openconfig' in module: self.origin = 'openconfig' - + value_namespaces = self.split_value_namespaces(value) + # For info about namespaces handling refer to + # https://datatracker.ietf.org/doc/html/rfc7951#page-5 for pfx, mod in self.namespace_modules.items(): - if isinstance(value, string_types) and pfx in value: - if mod != module and self.origin == 'rfc7951': + if isinstance(value, string_types) and pfx in value_namespaces: + if mod != module: value = value.replace(pfx + ":", mod + ':') - else: - value = value.replace(pfx + ":", '') - # gNMI prefixes require entire module name. + elif isinstance(value, list): + for ind, i in enumerate(value): + list_value_namespaces = self.split_value_namespaces(i) + if (pfx in list_value_namespaces) and (mod != module): + value[ind] = value[ind].replace(pfx + ":", mod + ":") + # rfc7951 origin requires entire module name in path. + # Module as origin requires entire module name in path. for i, seg in enumerate(xp): if pfx not in xpath: continue @@ -1129,7 +1170,10 @@ def xml_xpath_to_gnmi_xpath(self): node['name'] = '' node['xpath'] = '/'.join(xp) - node['value'] = value + if nodetype == 'leaf-list': + node['value'] = [value] + else: + node['value'] = value if self.msg_type == 'set': if not edit_op: @@ -1403,6 +1447,7 @@ def run(self): """Check for inbound notifications.""" self.log.info('Subscribe notification active') for response in self.responses: + self.subscribe_response = True if response.HasField('sync_response'): # Don't count sync_response as a response for transaction_time self.log.info("Initial updates received") diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/rpcverify.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/rpcverify.py index 2973cf6c9..fdbd002c7 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/rpcverify.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/rpcverify.py @@ -3,13 +3,13 @@ import logging from six import string_types from pyats.log.utils import banner +import dataclasses from dataclasses import dataclass, field from typing import Union, Callable, List, Tuple, Any, ClassVar import operator as o from copy import deepcopy log = logging.getLogger(__name__) -log.setLevel(logging.DEBUG) def range_op(range: str, value: Any, datatype: str = '') -> bool: @@ -90,9 +90,14 @@ class OptFields: } def __post_init__(self): - if 'decimal' in self.datatype: - self.value = float( - self.value['digits']) / (10 ** self.value['precision']) + if not isinstance(self.datatype, str): + log.warning(f'Datatype must be a string got: {type(self.datatype).__name__}') + elif 'decimal' in self.datatype: + try: + self.value = float( + self.value['digits']) / (10 ** self.value['precision']) + except TypeError: + self.value = float(self.value) class OperatorsException(Exception): pass @@ -105,6 +110,8 @@ def __eq__(self, other): super().__eq__(other) return self.xpath == other.xpath +OPTFIELD_ALLOWED_OPTIONS = [f.name for f in dataclasses.fields(OptFields)] + class OperationalFieldsNode: """Data class for opfields and metadata default value, edit operation.""" @@ -311,7 +318,24 @@ class RpcVerify(): """ NETCONF_NAMESPACE = "urn:ietf:params:xml:ns:netconf:base:1.0" + + # Pattern to detect keys in an xpath RE_FIND_KEYS = re.compile(r'\[.*?\]') + RE_FIND_PREFIXES = re.compile(r'/[-a-zA-Z0-9]+:') + + # pattern to detect prefix in the key name, prefix is optional + # e.g. + # /native/route-map[name="set-community-list"]/route-map-seq[ios-route-map:ordering-seq="10"] + # becomes (note `name` does not have a prefix, but `ordering-seq` has): + # /native/route-map[name="set-community-list"]/route-map-seq[ordering-seq="10"] + RE_FIND_KEY_PREFIX = r'\[(?P[-\w]+:)?(?P[-\w]+)' + + # Pattern to match value and ignore leading and trailing whitespace + # e.g. for whitespace: + # /native/router/bgp[id="6"]/neighbor[id=" 100.5.6.6 "]/remote-as + # becomes + # /native/router/bgp[id="6"]/neighbor[id="100.5.6.6"]/remote-as + RE_FIND_QUOTED_VALUE = r'[\'"]\s*(?P.*?)\s*[\'"]' def __init__(self, log=log, rpc_reply=None, rpc_verify=None, capabilities=[]): @@ -557,6 +581,8 @@ def check_opfield(self, value: Any, field: OptFields): eval_text = op_name datatype = field.datatype + log.debug(f'Checking xpath {xpath} value "{value}" {op_name} "{field.value}"') + if op_name == 'range': try: if not datatype: @@ -1525,24 +1551,6 @@ def verify_reply(self, response, expected, opfields: List[OptFields]): return result - # Pattern to detect keys in an xpath - RE_FIND_KEYS = re.compile(r'\[.*?\]') - RE_FIND_PREFIXES = re.compile(r'/[-a-zA-Z0-9]+:') - - # pattern to detect prefix in the key name, prefix is optional - # e.g. - # /native/route-map[name="set-community-list"]/route-map-seq[ios-route-map:ordering-seq="10"] - # becomes (note `name` does not have a prefix, but `ordering-seq` has): - # /native/route-map[name="set-community-list"]/route-map-seq[ordering-seq="10"] - RE_FIND_KEY_PREFIX = r'\[(?P[-\w]+:)?(?P[-\w]+)' - - # Pattern to remove leading and trailing whitespace in the key content - # e.g. - # /native/router/bgp[id="6"]/neighbor[id=" 100.5.6.6 "]/remote-as - # becomes - # /native/router/bgp[id="6"]/neighbor[id="100.5.6.6"]/remote-as - RE_STRIP_WHITESPACE = r'(\'|\")\s*(?P.*?)\s*(\'|\")' - def verify_rpc_data_reply(self, decoded_response: List[tuple], rpc_data: dict) -> bool: # TODO Move to verifiers.py when netconf is implemented """Construct a GET based off an edit message and verify results. @@ -1594,7 +1602,7 @@ def verify_rpc_data_reply(self, decoded_response: List[tuple], rpc_data: dict) - # /native/router/bgp[id="6"]/neighbor[id=" 100.5.6.6 "]/remote-ass # becomes # /native/router/bgp[id="6"]/neighbor[id="100.5.6.6"]/remote-as - xpath_original = re.sub(self.RE_STRIP_WHITESPACE, r'"\g"', xpath_original) + xpath_original = re.sub(self.RE_FIND_QUOTED_VALUE, r'"\g"', xpath_original) # xpath with keys and namespace prefix stripped. xpath = re.sub(self.RE_FIND_KEYS, '', node.get('xpath', '')) @@ -1694,21 +1702,20 @@ def add_key_nodes(self, xpath: str, nodes: List[OptFields]): xpath = re.sub(self.RE_FIND_PREFIXES, '/', xpath) # Loop through all the key/value in the xpath for key in self.RE_FIND_KEYS.findall(xpath): - # Remove the prefix from list key name, - # Ex: changes [ios:foo="val"] to foo="val"] - key_no_pfx = re.sub(self.RE_FIND_KEY_PREFIX, '', key) - # Split the key/value on "=", get the first entry, - # and strip the '[' if present. # Ex: for [foo="val"] the keyname will be 'foo' - keyname = key_no_pfx.split('=')[0].strip('[') - # Get the value field from [foo="val"] - # second entry after spliting on "=" will get the value - # strip the ending ']'. - # Ex: [foo="val"] will return '"val"' after stripping the ']' - keyval = key_no_pfx.split('=')[1].strip(']') - # To remove double quotes from the value - # Ex: Change '"val"' to 'val' - keyval = re.sub('"', '', keyval) + # Ex: for [prefix:foo="val"] the keyname will be 'foo' + m = re.search(self.RE_FIND_KEY_PREFIX, key) + if m: + keyname = m.groupdict().get('name') + else: + raise ValueError(f'Unable to find key name in xpath {xpath} for key {key}') + # Ex: [foo="val"] will return "val" + # Ex: [foo=" val "] will return "val" + m = re.search(self.RE_FIND_QUOTED_VALUE, key) + if m: + keyval = m.groupdict().get('value') + else: + raise ValueError(f'Unable to find value in xpath {xpath} for key {key}') # contruct xpath /xpath/list/foo by appending the key name. key_path = xpath.split(key)[0] + '/' + keyname # If there are multiple key/values in xpath, substitute other diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/device_mocks.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/device_mocks.py index 79a1459bc..4948a9724 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/device_mocks.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/device_mocks.py @@ -1,7 +1,6 @@ import time from yang.connector import proto - class Service: def __init__(self, response): self.response = response @@ -36,6 +35,7 @@ class Creds: class TestDevice: device = Creds() active_notifications = {} + name = 'test' def __init__(self, response): self.gnmi = Gnmi(response) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/scripts/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/scripts/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_verifier.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/scripts/verifiers.py similarity index 100% rename from pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_verifier.py rename to pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/scripts/verifiers.py diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_gnmibuilder.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_gnmibuilder.py index 6290eeb29..01b6c8dcc 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_gnmibuilder.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_gnmibuilder.py @@ -132,7 +132,7 @@ 'name': '100', 'config': { - 'identifier': 'OSPF', + 'identifier': 'openconfig-policy-types:OSPF', 'name': '100' }, 'bgp': @@ -255,7 +255,7 @@ 'name': '100', 'config': { - 'identifier': 'OSPF', + 'identifier': 'openconfig-policy-types:OSPF', 'name': '100' }, 'bgp': @@ -834,6 +834,128 @@ ] } +request_leaf_list = { + 'nodes': [ + { + 'datatype': 'identityref', + 'nodetype': 'leaf-list', + 'value': 'oc-types:IPV4', + 'xpath': '/oc-netinst:network-instances/\ + oc-netinst:network-instance[oc-netinst:name="test11"]/\ + oc-netinst:config/oc-netinst:enabled-address-families' + } + ], + 'namespace_modules': { + 'oc-netinst': 'openconfig-network-instance', + 'oc-types': 'openconfig-types' + }, + 'namespace': { + 'oc-netinst': 'http://openconfig.net/yang/network-instances', + 'oc-types': 'http://openconfig.net/yang/openconfig-types' + } +} + +set_container_leaf_list = { + 'nodes': [ + { + 'nodetype': 'container', + 'xpath': '/oc-netinst:network-instances/', + 'edit-op': 'create', + 'value': '' + }, + { + 'datatype': 'leafref', + 'default': '', + 'key': True, + 'leafref_path': '/oc-netinst:network-instances/oc-netinst:network-instance[oc-netinst:name="red11"]/oc-netinst:config/oc-netinst:name', # noqa + 'nodetype': 'leaf', + 'value': '', + 'xpath': '/oc-netinst:network-instances/oc-netinst:network-instance[oc-netinst:name="red11"]' # noqa + }, + { + 'nodetype': 'leaf', + 'datatype': 'string', + 'value': 'red11', + 'xpath': '/oc-netinst:network-instances/\ + oc-netinst:network-instance[oc-netinst:name="red11"]/\ + oc-netinst:config/oc-netinst:name', + }, + { + 'nodetype': 'leaf-list', + 'datatype': 'identityref', + 'value': 'oc-types:IPV4', + 'xpath': '/oc-netinst:network-instances/\ + oc-netinst:network-instance[oc-netinst:name="red11"]/\ + oc-netinst:config/oc-netinst:enabled-address-families', + }, + { + 'nodetype': 'leaf-list', + 'datatype': 'identityref', + 'value': 'oc-types:IPV6', + 'xpath': '/oc-netinst:network-instances/\ + oc-netinst:network-instance[oc-netinst:name="red11"]/\ + oc-netinst:config/oc-netinst:enabled-address-families', + } + ], + 'namespace_modules': { + 'oc-netinst': 'openconfig-network-instance', + 'oc-types': 'openconfig-types' + }, + 'namespace': { + 'oc-netinst': 'http://openconfig.net/yang/network-instances', + 'oc-types': 'http://openconfig.net/yang/openconfig-types' + } +} + +json_decoded_cont_leaf_list = { + "update": [ + { + "path": { + "origin": "openconfig", + "elem": [ + { + "name": "network-instances" + } + ] + } + } + ] +} + +json_decoded_leaf_list = { + "update": [ + { + "path": { + "origin": "openconfig", + "elem": [ + { + "name": "network-instances" + }, + { + "name": "network-instance", + "key": { + "name": "test11" + } + }, + { + "name": "config" + }, + { + "name": "enabled-address-families" + } + ] + } + } + ] +} + +json_ietf_val_leaf_list = ["openconfig-types:IPV4"] + +format8 = { + 'encoding': 'JSON_IETF', + 'origin': 'openconfig' +} + json_decoded_multiple_key = { 'update': [ @@ -940,9 +1062,9 @@ } -json_val_decoded_1 = 'ethernetCsmacd' +json_val_decoded_1 = 'iana-if-type:ethernetCsmacd' json_val_decoded_2 = 'test multiple' -json_val_decoded_3 = 'ethernetCsmacd' +json_val_decoded_3 = 'iana-if-type:ethernetCsmacd' json_val_decoded_4 = 'test multiple' format7 = { @@ -1160,7 +1282,7 @@ }, "protocols": { "protocol": { - "identifier": "openconfig-policy-types:OSPF", + "identifier": "OSPF", "name": "100", "config": { "identifier": "openconfig-policy-types:OSPF", @@ -1422,6 +1544,28 @@ def test_updates_only(self): x = json_format.MessageToDict(gmc.payload) self.assertTrue(x['subscribe']['updatesOnly']) + def test_set_leaf_list(self): + """Verify the leaf list entry in the SET request""" + r7 = deepcopy(request_leaf_list) + gmc = GnmiMessageConstructor('set', r7, **format8) + jdict = json_format.MessageToDict(gmc.payload) + jdict['update'][0].pop('val') + self.assertEqual(jdict, json_decoded_leaf_list) + self.assertEqual(gmc.json_val, json_ietf_val_leaf_list) + + def test_set_container_leaf_list(self): + """Verify the json val with leaf-list entries""" + r7 = deepcopy(set_container_leaf_list) + gmc = GnmiMessageConstructor('set', r7, **format8) + jdict = json_format.MessageToDict(gmc.payload) + jdict['update'][0].pop('val') + self.assertEqual(jdict, json_decoded_cont_leaf_list) + self.assertEqual( + gmc.json_val, {'network-instance': + {"name": "red11", "config": {"name": "red11", + "enabled-address-families": ["openconfig-types:IPV4", + "openconfig-types:IPV6"]}}}) + if __name__ == '__main__': unittest.main() diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_rpc.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_rpc.py index 94ccdf86b..c0adb559a 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_rpc.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_rpc.py @@ -9,7 +9,7 @@ from yang.connector import proto from genie.libs.sdk.triggers.blitz import yangexec from genie.libs.sdk.triggers.blitz import netconf_util -from genie.libs.sdk.triggers.blitz.rpcverify import RpcVerify +from genie.libs.sdk.triggers.blitz.rpcverify import RpcVerify, OptFields from genie.libs.sdk.triggers.blitz.gnmi_util import GnmiMessage from genie.libs.sdk.triggers.blitz.tests.device_mocks import TestDevice @@ -1306,6 +1306,138 @@ def test_operational_state_multiple_entries(self): result = self.rpcv.process_operational_state(resp, opfields) self.assertTrue(result) + def test_add_key_nodes_without_prefix(self): + """ Check if we can find the names of the key nodes properly without prefixes """ + xpath = '/network-instances/network-instance[name="DEFAULT"]/protocols/protocol[identifier="ISIS"][name="1"]/isis/levels/level[level-number="2"]/authentication/config/enabled' + nodes = [] + self.rpcv.add_key_nodes(xpath=xpath, nodes=nodes) + expected_nodes = [ + OptFields(name='name', + value='DEFAULT', + xpath='/network-instances/network-instance/name', + op='==', + default='', + selected=True, + id='', + datatype='', + sequence=0, + default_xpath='', + nodetype='', + key=False), + OptFields(name='identifier', + value='ISIS', + xpath='/network-instances/network-instance/protocols/protocol/identifier', + op='==', + default='', + selected=True, + id='', + datatype='', + sequence=0, + default_xpath='', + nodetype='', + key=False), + OptFields(name='name', + value='1', + xpath='/network-instances/network-instance/protocols/protocol/name', + op='==', + default='', + selected=True, + id='', + datatype='', + sequence=0, + default_xpath='', + nodetype='', + key=False), + OptFields(name='level-number', + value='2', + xpath='/network-instances/network-instance/protocols/protocol/isis/levels/level/level-number', + op='==', + default='', + selected=True, + id='', + datatype='', + sequence=0, + default_xpath='', + nodetype='', + key=False) + ] + self.assertEqual(nodes, expected_nodes) + + def test_add_key_nodes_with_prefix(self): + """ Check if we can find the names of the key nodes properly when prefixed """ + xpath = '/network-instances/network-instance[prefix1:name="DEFAULT"]/protocols/protocol[prefix2:identifier="ISIS"][prefix3:name="1"]/isis/levels/level[prefix4:level-number="2"]/authentication/config/enabled' + nodes = [] + self.rpcv.add_key_nodes(xpath=xpath, nodes=nodes) + expected_nodes = [ + OptFields(name='name', + value='DEFAULT', + xpath='/network-instances/network-instance/name', + op='==', + default='', + selected=True, + id='', + datatype='', + sequence=0, + default_xpath='', + nodetype='', + key=False), + OptFields(name='identifier', + value='ISIS', + xpath='/network-instances/network-instance/protocols/protocol/identifier', + op='==', + default='', + selected=True, + id='', + datatype='', + sequence=0, + default_xpath='', + nodetype='', + key=False), + OptFields(name='name', + value='1', + xpath='/network-instances/network-instance/protocols/protocol/name', + op='==', + default='', + selected=True, + id='', + datatype='', + sequence=0, + default_xpath='', + nodetype='', + key=False), + OptFields(name='level-number', + value='2', + xpath='/network-instances/network-instance/protocols/protocol/isis/levels/level/level-number', + op='==', + default='', + selected=True, + id='', + datatype='', + sequence=0, + default_xpath='', + nodetype='', + key=False) + ] + self.assertEqual(nodes, expected_nodes) + + def test_add_key_nodes_invalid_name(self): + """ Check if we catch invalid key names in xpath keys """ + xpath = '/network-instances/network-instance["DEFAULT"]' + nodes = [] + with self.assertRaisesRegex(ValueError, + r'Unable to find key name in xpath ' + r'/network-instances/network-instance\["DEFAULT"] for key \["DEFAULT"]'): + self.rpcv.add_key_nodes(xpath=xpath, nodes=nodes) + + def test_add_key_nodes_invalid_value(self): + """ Check if we catch invalid value from the xpath key """ + xpath = '/network-instances/network-instance[name=]' + nodes = [] + with self.assertRaisesRegex(ValueError, + r'Unable to find value in xpath ' + r'/network-instances/network-instance\[name=] for key \[name=]'): + self.rpcv.add_key_nodes(xpath=xpath, nodes=nodes) + def test_opfields_selected(self): """Check "selected" parameter True or False.""" opfields_in = [ @@ -1409,7 +1541,6 @@ def test_auto_validate_multiple_list_entries(self): result = self.rpcv.verify_rpc_data_reply(resp, rpc_data) self.assertTrue(result) - def test_auto_validate_delete_presence_with_children(self): """Edit-config of multiple list entries in one RPC.""" rpc_data = { @@ -1494,7 +1625,7 @@ def test_auto_validate_remove_leaf(self): resp = self.rpcv.process_rpc_reply(no_data_rpc_reply) result = self.rpcv.verify_rpc_data_reply(resp, rpc_data) self.assertTrue(result) - + def test_auto_validate_operation_remove_leaf(self): """Test a remove operation on a leaf node with data returned.""" rpc_data = { @@ -1579,7 +1710,6 @@ def test_auto_validate_without_key_prefix(self): result = self.rpcv.verify_rpc_data_reply(resp, rpc_data) self.assertTrue(result) - def test_auto_validate_with_key_prefix(self): rpc_data = { "namespace": { diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_verifiers.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_verifiers.py new file mode 100644 index 000000000..8dd48ace9 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_verifiers.py @@ -0,0 +1,121 @@ +import logging +import unittest +from unittest.mock import Mock + +log = logging.getLogger(__name__) + +from genie.libs.sdk.triggers.blitz.rpcverify import DecodedResponse, OptFields +from genie.libs.sdk.triggers.blitz.verifiers import GnmiDefaultVerifier + + +class TestGnmiDefaultVerifier(unittest.TestCase): + + @classmethod + def setUpClass(cls): + device = Mock() + returns = [] + cls.gdv = GnmiDefaultVerifier(device=device, returns=returns, log=log) + + def test__auto_validation(self): + decoded_response = DecodedResponse( + json_dicts=[True, 'openconfig-keychain-types:SIMPLE_KEY', 'openconfig-isis-types:TEXT', 'ISIS'], + updates=[('DEFAULT', '/network-instances/network-instance/name'), + ('ISIS', '/network-instances/network-instance/protocols/protocol/identifier'), + ('1', '/network-instances/network-instance/protocols/protocol/name'), + ('2', '/network-instances/network-instance/protocols/protocol/isis/levels/level/level-number'), + (True, '/network-instances/network-instance/protocols/protocol/isis/levels/level/authentication/config/enabled'), + (True, '/network-instances/network-instance/protocols/protocol/isis/levels/level/authentication/config/enabled'), + ('DEFAULT', '/network-instances/network-instance/name'), + ('ISIS', '/network-instances/network-instance/protocols/protocol/identifier'), + ('1', '/network-instances/network-instance/protocols/protocol/name'), + ('2', '/network-instances/network-instance/protocols/protocol/isis/levels/level/level-number'), + ('openconfig-keychain-types:SIMPLE_KEY', '/network-instances/network-instance/protocols/protocol/isis/levels/level/authentication/config/auth-type'), + ('openconfig-keychain-types:SIMPLE_KEY', '/network-instances/network-instance/protocols/protocol/isis/levels/level/authentication/config/auth-type'), + ('DEFAULT', '/network-instances/network-instance/name'), + ('ISIS', '/network-instances/network-instance/protocols/protocol/identifier'), + ('1', '/network-instances/network-instance/protocols/protocol/name'), + ('2', '/network-instances/network-instance/protocols/protocol/isis/levels/level/level-number'), + ('openconfig-isis-types:TEXT', '/network-instances/network-instance/protocols/protocol/isis/levels/level/authentication/config/auth-mode'), + ('openconfig-isis-types:TEXT', '/network-instances/network-instance/protocols/protocol/isis/levels/level/authentication/config/auth-mode'), + ('DEFAULT', '/network-instances/network-instance/name'), + ('ISIS', '/network-instances/network-instance/protocols/protocol/identifier'), + ('1', '/network-instances/network-instance/protocols/protocol/name'), + ('2', '/network-instances/network-instance/protocols/protocol/isis/levels/level/level-number'), + ('ISIS', '/network-instances/network-instance/protocols/protocol/isis/levels/level/authentication/config/auth-password'), + ('ISIS', '/network-instances/network-instance/protocols/protocol/isis/levels/level/authentication/config/auth-password')], + deletes=[], + errors=[]) + + self.gdv.rpc_data = { + 'namespace': { + 'oc-keychain-types': 'openconfig-oc-keychain-types', + 'oc-netinst': 'openconfig-network-instance', + 'oc-pol-types': 'openconfig-policy-types' + }, + 'nodes': [{ + 'nodetype': 'container', + 'xpath': '/oc-netinst:network-instances/oc-netinst:network-instance[oc-netinst:name="DEFAULT"]/oc-netinst:protocols/oc-netinst:protocol[oc-netinst:identifier="ISIS"][oc-netinst:name="1"]/oc-netinst:isis/oc-netinst:levels/oc-netinst:level[oc-netinst:level-number="2"]/oc-netinst:authentication/oc-netinst:config' + }, { + 'nodetype': 'leaf', + 'datatype': 'boolean', + 'value': 'true', + 'xpath': '/oc-netinst:network-instances/oc-netinst:network-instance[oc-netinst:name="DEFAULT"]/oc-netinst:protocols/oc-netinst:protocol[oc-netinst:identifier="ISIS"][oc-netinst:name="1"]/oc-netinst:isis/oc-netinst:levels/oc-netinst:level[oc-netinst:level-number="2"]/oc-netinst:authentication/oc-netinst:config/oc-netinst:enabled' + }, { + 'nodetype': 'leaf', + 'datatype': 'identityref', + 'value':'openconfig-keychain-types:SIMPLE_KEY', + 'xpath': '/oc-netinst:network-instances/oc-netinst:network-instance[oc-netinst:name="DEFAULT"]/oc-netinst:protocols/oc-netinst:protocol[oc-netinst:identifier="ISIS"][oc-netinst:name="1"]/oc-netinst:isis/oc-netinst:levels/oc-netinst:level[oc-netinst:level-number="2"]/oc-netinst:authentication/oc-netinst:config/oc-netinst:auth-type' + }, { + 'nodetype':'leaf', + 'datatype': 'identityref', + 'value': 'openconfig-isis-types:TEXT', + 'xpath': '/oc-netinst:network-instances/oc-netinst:network-instance[oc-netinst:name="DEFAULT"]/oc-netinst:protocols/oc-netinst:protocol[oc-netinst:identifier="ISIS"][oc-netinst:name="1"]/oc-netinst:isis/oc-netinst:levels/oc-netinst:level[oc-netinst:level-number="2"]/oc-netinst:authentication/oc-netinst:config/oc-netinst:auth-mode' + }, { + 'nodetype': 'leaf', + 'datatype': 'string', + 'value': 'ISIS', + 'xpath': '/oc-netinst:network-instances/oc-netinst:network-instance[oc-netinst:name="DEFAULT"]/oc-netinst:protocols/oc-netinst:protocol[oc-netinst:identifier="ISIS"][oc-netinst:name="1"]/oc-netinst:isis/oc-netinst:levels/oc-netinst:level[oc-netinst:level-number="2"]/oc-netinst:authentication/oc-netinst:config/oc-netinst:auth-password' + }], + 'namespace_modules': { + 'oc-keychain-types': 'openconfig-oc-keychain-types', + 'oc-netinst': 'openconfig-network-instance', + 'oc-pol-types': 'openconfig-policy-types' + } + } + + self.gdv.decode = Mock(return_value=decoded_response) + result = self.gdv._auto_validation(response={}, namespace_modules={}) + self.assertTrue(result) + + def test_returns_init(self): + returns = [{ + 'datatype': bool, + 'default': '', + 'format': '', + 'name': 'enabled', + 'nodetype': '', + 'op': '==', + 'selected': 'True', + 'value': 'true', + 'xpath': '/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/hello-authentication/state/enabled' + }] + gdv = GnmiDefaultVerifier(device=Mock(), returns=returns, log=log) + + expected_returns = [OptFields( + name='enabled', + value='true', + xpath='/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/hello-authentication/state/enabled', + op='==', + default='', + selected='True', + id='', + datatype=bool, + sequence=0, + default_xpath='', + nodetype='', + key=False)] + self.assertEqual(gdv.returns, expected_returns) + + +if __name__ == "__main__": + unittest.main() diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_yangexec.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_yangexec.py index 7eaf08f5c..096f87b4a 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_yangexec.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_yangexec.py @@ -9,6 +9,8 @@ from yang.connector import proto from google.protobuf import json_format from copy import deepcopy +from grpc._channel import _InactiveRpcError, _RPCState +from grpc import StatusCode # Genie Libs from genie.libs.sdk.triggers.blitz.yangexec import run_netconf, run_gnmi, run_restconf @@ -22,7 +24,7 @@ from genie.libs.sdk.triggers.blitz.rpcverify import RpcVerify, OptFields from genie.libs.sdk.triggers.blitz.verifiers import GnmiDefaultVerifier from genie.libs.sdk.triggers.blitz.tests.device_mocks import TestDevice, TestDeviceWithNtp - +from dataclasses import dataclass log = logging.getLogger(__name__) log.setLevel(logging.DEBUG) @@ -3042,8 +3044,7 @@ def test_subscribe_poll_transaction_time(self): ) subscribe_thread.start() subscribe_thread.join() - # TODO: passes local unittest but fails runALL. - #self.assertEqual(subscribe_thread.result, False) + self.assertEqual(subscribe_thread.result, False) request['transaction_time'] = 2 subscribe_thread = GnmiSubscriptionPoll( @@ -3064,8 +3065,7 @@ def test_subscribe_once_transaction_time(self): ) subscribe_thread.start() subscribe_thread.join() - # TODO: passes local unittest but fails runALL. - #self.assertEqual(subscribe_thread.result, False) + self.assertEqual(subscribe_thread.result, False) request['transaction_time'] = 5 subscribe_thread = GnmiSubscriptionOnce( @@ -3074,8 +3074,7 @@ def test_subscribe_once_transaction_time(self): ) subscribe_thread.start() subscribe_thread.join() - # TODO: passes local unittest but fails runALL. - #self.assertEqual(subscribe_thread.result, True) + self.assertEqual(subscribe_thread.result, True) def test_subscribe_stream_transaction_time(self): request = self.make_test_request() @@ -4018,7 +4017,7 @@ def test_custom_verifier(self): device = TestDevice( self.make_test_notification(proto.gnmi_pb2.GetResponse)) format['verifier'] = { - 'class': 'genie.libs.sdk.triggers.blitz.tests.test_verifier.CustomVerifier'} + 'class': 'genie.libs.sdk.triggers.blitz.tests.scripts.verifiers.CustomVerifier'} get_result = run_gnmi('get', device, '', '', rpc_data, returns, format=format) self.assertTrue(get_result) @@ -4036,7 +4035,7 @@ def test_custom_verifier_extra_args(self): device = TestDevice( self.make_test_notification(proto.gnmi_pb2.GetResponse)) format['verifier'] = { - 'class': 'genie.libs.sdk.triggers.blitz.tests.test_verifier.VerifierWithArgs', + 'class': 'genie.libs.sdk.triggers.blitz.tests.scripts.verifiers.VerifierWithArgs', 'my_arg1': 1, 'my_arg2': 'test' } @@ -4049,7 +4048,7 @@ def test_custom_decoder(self): device = TestDevice( self.make_test_notification(proto.gnmi_pb2.GetResponse)) format['verifier'] = { - 'class': 'genie.libs.sdk.triggers.blitz.tests.test_verifier.VerifierWithCustomDecoder'} + 'class': 'genie.libs.sdk.triggers.blitz.tests.scripts.verifiers.VerifierWithCustomDecoder'} get_result = run_gnmi('get', device, '', '', rpc_data, returns, format=format) self.assertTrue(get_result) @@ -4111,6 +4110,44 @@ def test_gnmi_autovalidate(self): rpc_data, returns, format=format) self.assertTrue(get_result) + def test_gnmi_negative_test_wrong_response(self): + rpc_data, returns, format = self.make_test_run_gnmi_data() + format['negative_test'] = True + device = TestDevice(self.gnmi_error_response) + get_result = run_gnmi('get-config', device, '', '', + rpc_data, returns, format=format) + self.assertTrue(get_result) + + def test_gnmi_negative_subscribe(self): + rpc_data, returns, format = self.make_test_run_gnmi_data() + returns[0]['xpath'] = '/not/found/xpath' + format['negative_test'] = True + format['request_mode'] = 'STREAM' + format['sub_mode'] = 'SAMPLE' + format['stream_max'] = 5 + + device = TestDevice( + self.make_test_notification(proto.gnmi_pb2.SubscribeResponse)) + subscribe_thread = run_gnmi('subscribe', device, '', '', + rpc_data, returns, format=format) + subscribe_thread.join() + self.assertTrue(subscribe_thread.result) + + rpc_data, returns, format = self.make_test_run_gnmi_data() + returns[0]['xpath'] = '/not/found/xpath' + format['negative_test'] = False + format['request_mode'] = 'STREAM' + format['sub_mode'] = 'SAMPLE' + format['stream_max'] = 5 + subscribe_thread = run_gnmi('subscribe', device, '', '', + rpc_data, returns, format=format) + subscribe_thread.join() + self.assertFalse(subscribe_thread.result) + + @property + def gnmi_error_response(self): + return _InactiveRpcError(_RPCState({}, {}, {},StatusCode.NOT_FOUND, "Requested element(s) not found: 'config'")) + def make_test_notification_with_delete(self, n: int = 0): path_elem1 = proto.gnmi_pb2.PathElem() path_elem1.name = "acl" diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/verifiers.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/verifiers.py index f3be4a841..626ccaf7b 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/verifiers.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/verifiers.py @@ -13,17 +13,21 @@ OperationalFieldsNode, DecodedResponse, DecodedField, - DeletedPath) + DeletedPath, + OPTFIELD_ALLOWED_OPTIONS) from .gnmi_util import GnmiMessage, GnmiMessageConstructor from .netconf_util import gen_ncclient_rpc, netconf_send from genie.conf.base.utils import QDict from pyats.log.utils import banner +from yang.connector import proto try: import lxml.etree as et except Exception: pass +log = logging.getLogger(__name__) + class BaseVerifier(ABC): def __init__(self, @@ -144,7 +148,15 @@ def returns(self) -> List[OptFields]: @returns.setter def returns(self, returns: Union[List[dict], List[OptFields]]): if returns and isinstance(returns[0], dict): - self._returns = [OptFields(**r) for r in returns] + self._returns = [] + for ret in returns: + data = {} + for opt_key, opt_value in ret.items(): + if opt_key in OPTFIELD_ALLOWED_OPTIONS: + data.update({opt_key: opt_value}) + else: + log.warning(f'{opt_key} not allowed as OptField, ignoring') + self._returns.append(OptFields(**data)) elif not returns: self._returns = [] else: @@ -187,11 +199,11 @@ class EmptyResponse(BaseVerifier.DecodeError): class GnmiDefaultVerifier(DefaultBaseVerifier): def get_config_verify(self, - raw_response: DecodedResponse, + raw_response: proto.gnmi_pb2.GetResponse, namespace: dict = None) -> bool: try: decoded_response = self.decode(raw_response, namespace) - except self.DecodeError: + except (self.DecodeError, self.EmptyResponse): return self.negative_test if not decoded_response.updates: decoded_response.updates.append((None, "/")) @@ -201,7 +213,7 @@ def get_config_verify(self, return self.negative_test != result def subscribe_verify(self, - raw_response: DecodedResponse, + raw_response: proto.gnmi_pb2.SubscribeResponse, sub_type: str = 'ONCE', namespace: dict = None): """Decode response and verify result. @@ -249,7 +261,7 @@ def end_subscription(self, errors: List[Exception]) -> bool: for delete in self.deleted: self.log.error(f"ERROR: {delete.xpath} not deleted.") result = False - return self.negative_test != result + return result def edit_config_verify(self, response: Any) -> bool: if not response: @@ -267,7 +279,7 @@ def edit_config_verify(self, response: Any) -> bool: gmc = GnmiMessageConstructor('get', self.rpc_data, **self.format) payload = gmc.payload namespace_modules = gmc.namespace_modules - response, status = GnmiMessage.run_get( + response = GnmiMessage.run_get( self.device, payload, namespace_modules ) for node in self.rpc_data.get('nodes'): @@ -378,8 +390,19 @@ def _auto_validation(self, response: Any, namespace_modules: dict) -> bool: # key values with multilist entries in response xpath_original = re.sub( self.rpc_verify.RE_FIND_PREFIXES, '/', node.get('xpath', '')) + + # Find missing prefixes and log warning + matches = re.findall(self.rpc_verify.RE_FIND_KEY_PREFIX, xpath_original) + if matches: + for m in matches: + prefix = m[0] + name = m[1] + if not prefix: + self.log.warning(f'RPC reply key "{name}" is missing prefix in {xpath_original}') + xpath_original = re.sub( - self.rpc_verify.RE_FIND_KEY_PREFIX, '[', xpath_original) + self.rpc_verify.RE_FIND_KEY_PREFIX, r'[\g', xpath_original) + # xpath with keys and namespace prefix stripped. xpath = re.sub(self.rpc_verify.RE_FIND_KEYS, '', node.get('xpath', '')) @@ -544,6 +567,7 @@ def _deletes_verify(self, decoded_response: List[DeletedPath]) -> bool: if self._find_xpath(delete_returns.xpath, delete_resp.xpath, delete_resp.keys): try: self.deleted.remove(delete_returns) + self.log.info(f"Found deleted path: {delete_returns.xpath}") finally: break return not self.deleted diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/yangexec.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/yangexec.py index b365fe16c..5170d76d6 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/yangexec.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/yangexec.py @@ -370,11 +370,11 @@ def run_gnmi(operation: str, gmc = GnmiMessageConstructor('get', rpc_data, **format) payload = gmc.payload namespace_modules = gmc.namespace_modules - response, status = GnmiMessage.run_get( + response = GnmiMessage.run_get( device, payload, namespace_modules, transaction_time=transaction_time ) - return verifier.get_config_verify(response, namespace_modules) and status + return verifier.get_config_verify(response, namespace_modules) elif operation == 'subscribe': rpc_data.update(format) rpc_data['returns'] = returns