diff --git a/Makefile b/Makefile index 7c9aaba07..53172f414 100644 --- a/Makefile +++ b/Makefile @@ -45,9 +45,9 @@ CYTHON_CMD = compileAll # Development pkg requirements RELATED_PKGS = genie.libs.health genie.libs.clean genie.libs.conf genie.libs.ops genie.libs.robot genie.libs.sdk RELATED_PKGS += genie.libs.filetransferutils -# pinning the version of pysnmp and pyasn1 to fix the type error when using execute_power_cycle_device api +# pinning the version of pysnmp-lextudio and pyasn1 to fix the type error when using execute_power_cycle_device api # Adding pyasyncore pkg to fix pysnmp scripts for python 3.12 -DEPENDENCIES = restview psutil Sphinx wheel asynctest pysnmp-lextudio==5.0.29 pyasn1==0.4.8 pyasyncore +DEPENDENCIES = restview psutil Sphinx wheel asynctest pysnmp-lextudio==6.1.2 pyasn1==0.4.8 pyasyncore DEPENDENCIES += sphinx-rtd-theme==1.1.0 pyftpdlib tftpy\<0.8.1 robotframework DEPENDENCIES += Cython==3.0.0 requests ruamel.yaml grpcio protobuf jinja2 # Internal variables. @@ -200,6 +200,11 @@ develop: @echo "" @echo "Done." @echo "" + @echo "--------------------------------------------------------------------" + @echo "Development environment has been setup." + @echo -e "\e[1;33mWarning: Do make json to generate json files to acccess the genie features!!!\e[0m" + @echo "--------------------------------------------------------------------" + undevelop: @echo "" diff --git a/pkgs/clean-pkg/changelog/2024/july.rst b/pkgs/clean-pkg/changelog/2024/july.rst new file mode 100644 index 000000000..5aa532ab3 --- /dev/null +++ b/pkgs/clean-pkg/changelog/2024/july.rst @@ -0,0 +1,25 @@ +-------------------------------------------------------------------------------- + New +-------------------------------------------------------------------------------- + +* iosxe + * Modified + * Added prompt-level none to image install command + + +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- + +* iosxe + * Recovery + * Refactored Recovery logic to use send_break_boot api. + * Reload + * Updated logic todo Reload when the boot variable is not set. + * Modified InstallRemoveInactive + * Added new parameter force_remove to remove inactive package forcefully + * Added dialog + * api + * Added condition for golden image + + diff --git a/pkgs/clean-pkg/sdk_generator/output/github_clean.json b/pkgs/clean-pkg/sdk_generator/output/github_clean.json index 36b5d5c6b..8ce8ffd9a 100644 --- a/pkgs/clean-pkg/sdk_generator/output/github_clean.json +++ b/pkgs/clean-pkg/sdk_generator/output/github_clean.json @@ -245,7 +245,7 @@ "os": "iosxe" }, "uid": "ConfigureReplace", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2026" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2099" } } }, @@ -300,7 +300,7 @@ "os": "iosxe" }, "uid": "Connect", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2082" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2155" }, "linux": { "folders": { @@ -354,7 +354,7 @@ "os": "iosxe" }, "uid": "CopyToDevice", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1381" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1454" } }, "module_name": "stages.stages", @@ -512,7 +512,7 @@ "platform": "cat9k" }, "uid": "InstallImage", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L759" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L757" } }, "module_name": "stages.iosxe.stages", @@ -521,7 +521,7 @@ "os": "iosxe" }, "uid": "InstallImage", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L535" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L545" }, "iosxr": { "folders": { @@ -583,14 +583,14 @@ "os": "iosxe" }, "uid": "InstallPackages", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L788" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L798" } } }, "InstallRemoveInactive": { "folders": { "iosxe": { - "doc": "This stage removes partially installed packages/images left\non the device. If a super package is left partially installed,\nwe cannot attempt to install another until it is removed.\n\nStage Schema\n------------\ninstall_image:\n images (list, optional):\n image to not removed by stage.\n \n timeout (int, optional): Maximum time to wait for remove process to\n finish. Defaults to 180.\n\nExample\n-------\ninstall_remove_inactive:\n timeout: 180\n\n", + "doc": "This stage removes partially installed packages/images left\non the device. If a super package is left partially installed,\nwe cannot attempt to install another until it is removed.\n\nStage Schema\n------------\ninstall_image:\n images (list, optional):\n image to not removed by stage.\n \n timeout (int, optional): Maximum time to wait for remove process to\n finish. Defaults to 180.\n\n force_remove (bool, optional): Whether or not to remove the inactive\n package irrespective of availability of passed image. Defaults to True.\n\nExample\n-------\ninstall_remove_inactive:\n timeout: 180\n\n", "module_name": "stages.iosxe.stages", "package": "genie.libs.clean", "tokens": { @@ -691,14 +691,14 @@ "doc": " This stage reloads the device.\n\nStage Schema\n------------\nreload:\n\n reload_service_args (optional):\n\n timeout (int, optional): Maximum time in seconds allowed for the reload.\n Defaults to 800.\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n error_pattern (list, optional): List of regex patterns to check for errors.\n Defaults to an empty list (no error checking).\n\n : \n Any other arguments that the Unicon reload service supports\n\n check_modules:\n\n check (bool, optional): Enable the checking of modules after reload.\n Defaults to True.\n\n timeout (int, optional): Maximum time in seconds allowed for verifying\n the modules are in a stable state. Defaults to 180.\n\n interval (int, optional): How often to check the module states in\n seconds. Defaults to 30.\n\n reconnect_via (str, optional): Specify which connection to use after reloading.\n Defaults to the 'default' connection in the testbed yaml file.\n\n\nExample\n-------\nreload:\n reload_service_args:\n timeout: 600\n reload_creds: clean_reload_creds\n prompt_recovery: True\n check_modules:\n check: False\n", "folders": { "iosxe": { - "doc": " This stage reloads the device.\n\nStage Schema\n------------\nreload:\n license: (optional)\n check: (bool, optional): Enable the checking license inconsistency and fix\n\n reload_service_args (optional):\n\n timeout (int, optional): Maximum time in seconds allowed for the reload.\n Defaults to 800.\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n\n : \n Any other arguments that the Unicon reload service supports\n\n check_modules:\n\n check (bool, optional): Enable the checking of modules after reload.\n Defaults to True.\n\n timeout (int, optional): Maximum time in seconds allowed for verifying\n the modules are in a stable state. Defaults to 180.\n\n interval (int, optional): How often to check the module states in\n seconds. Defaults to 30.\n\n reconnect_via (str, optional): Specify which connection to use after reloading.\n Defaults to the 'default' connection in the testbed yaml file.\n\n\nExample\n-------\nreload:\n reload_service_args:\n timeout: 600\n reload_creds: clean_reload_creds\n prompt_recovery: True\n check_modules:\n check: False\n", + "doc": " This stage reloads the device.\n\nStage Schema\n------------\nreload:\n license: (optional)\n check: (bool, optional): Enable the checking license inconsistency and fix\n\n reload_service_args (optional):\n\n timeout (int, optional): Maximum time in seconds allowed for the reload.\n Defaults to 800.\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n\n : \n Any other arguments that the Unicon reload service supports\n\n check_modules:\n\n check (bool, optional): Enable the checking of modules after reload.\n Defaults to True.\n\n timeout (int, optional): Maximum time in seconds allowed for verifying\n the modules are in a stable state. Defaults to 180.\n\n interval (int, optional): How often to check the module states in\n seconds. Defaults to 30.\n\n reconnect_via (str, optional): Specify which connection to use after reloading.\n Defaults to the 'default' connection in the testbed yaml file.\n\n attempt_manual_boot (bool, optional): Enable to attempt manual boot when reload fails.\n Defaults to True.\n\nExample\n-------\nreload:\n reload_service_args:\n timeout: 600\n reload_creds: clean_reload_creds\n prompt_recovery: True\n check_modules:\n check: False\n", "module_name": "stages.iosxe.stages", "package": "genie.libs.clean", "tokens": { "os": "iosxe" }, "uid": "Reload", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L872" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L882" } }, "module_name": "stages.stages", @@ -716,7 +716,7 @@ "os": "iosxe" }, "uid": "ResetConfiguration", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2264" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2337" } } }, @@ -750,7 +750,7 @@ "os": "iosxe" }, "uid": "RommonBoot", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1119" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1195" } } }, @@ -899,7 +899,7 @@ "platform": "cat9k" }, "uid": "VerifyAccessTunnelSummary", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L584" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L582" } }, "tokens": { @@ -948,7 +948,7 @@ "platform": "cat9k" }, "uid": "VerifyApFabricSummary", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L471" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L469" } }, "tokens": { @@ -1074,7 +1074,7 @@ "platform": "cat9k" }, "uid": "VerifyLispSessionEstablished", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L527" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L525" } }, "tokens": { @@ -1096,7 +1096,7 @@ "platform": "cat9k" }, "uid": "VerifyRunningImage", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L720" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L718" } }, "tokens": { @@ -1131,7 +1131,7 @@ "platform": "cat9k" }, "uid": "VerifyWirelessProcess", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L654" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L652" } }, "tokens": { diff --git a/pkgs/clean-pkg/setup.py b/pkgs/clean-pkg/setup.py index dab374192..82d0c7815 100644 --- a/pkgs/clean-pkg/setup.py +++ b/pkgs/clean-pkg/setup.py @@ -9,7 +9,7 @@ import re import os -from setuptools import setup, find_packages +from setuptools import setup, find_packages, find_namespace_packages def read(*paths): '''read and return txt content of file''' @@ -72,11 +72,8 @@ def find_version(*paths): # project keywords keywords = 'genie clean pyats cisco', - # uses namespace package - namespace_packages = ['genie', 'genie.libs'], - # project packages - packages = find_packages(where = 'src'), + packages = find_namespace_packages(where = 'src'), # project directory package_dir = { diff --git a/pkgs/clean-pkg/src/genie/__init__.py b/pkgs/clean-pkg/src/genie/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/pkgs/clean-pkg/src/genie/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/pkgs/clean-pkg/src/genie/libs/__init__.py b/pkgs/clean-pkg/src/genie/libs/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/pkgs/clean-pkg/src/genie/libs/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/pkgs/clean-pkg/src/genie/libs/clean/__init__.py b/pkgs/clean-pkg/src/genie/libs/clean/__init__.py index 4e356fa68..1c455497e 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/__init__.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/__init__.py @@ -8,7 +8,7 @@ ''' # metadata -__version__ = '24.6' +__version__ = '24.7' __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 2439e15aa..08c2d210f 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 @@ -7,7 +7,7 @@ # Unicon from unicon.eal.dialogs import Statement, statement_decorator -from unicon.plugins.generic.statements import buffer_settled +from unicon.plugins.generic.statements import buffer_settled, enable_password_handler from genie.libs.clean.recovery.dialogs import RommonDialog as TelnetDialog # Genie @@ -15,7 +15,6 @@ log = logging.getLogger(__name__) - class BreakBootDialog(TelnetDialog): '''Dialog to stop the device to boot at reload time''' @@ -48,6 +47,19 @@ def __init__(self): self.add_statement(Statement(pattern=r'^(Router|Switch|ios|switch|.+[^#])(\\(standby\\))?(\\(-stby)\\)?(\\(boot\\))?#$', action=print_message, args={'message': 'Device has reached privileged exec prompt'})) + + # Press RETURN to get started + self.add_statement(Statement(pattern=r'^.*Press RETURN to get started.*', + action='sendline()', + loop_continue=True, + continue_timer=False)) + + # Password + self.add_statement(Statement(pattern=r'^.*Password:\s?$', + action=enable_password_handler, + args=None, + loop_continue=True, + continue_timer=False)) class RommonDialog(TelnetDialog): 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 d93891682..66ae3e764 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 @@ -44,114 +44,16 @@ def recovery_worker(start, device, console_activity_pattern=None, None """ - def telnet_breakboot(spawn, break_count): - """ Breaks the booting process on a device using telnet `send break` - - Args: - spawn (obj): Spawn connection object - break_count (int): Number of break commands to send - break_char (str): Char to send - - Returns: - None - """ - - log.info(f"Found the console_activity_pattern! Breaking the boot process using telnet break.") - - for _ in range(break_count): - log.info(f"Using telnet break") - spawn.send('\x1d') - spawn.expect(r'telnet>\s*$') - spawn.sendline('send break') - spawn.expect('.+') - time.sleep(2) - - def console_breakboot(spawn, break_count, break_char): - """ Breaks the booting process on a device - - Args: - spawn (obj): Spawn connection object - break_count (int): Number of break commands to send - break_char (str): Char to send - - Returns: - None - """ - - log.info(f"Found the console_activity_pattern! Breaking the boot process.") - - for _ in range(break_count): - log.info(f"Sending {repr(break_char)}") - spawn.send(break_char) - time.sleep(1) - - def grub_breakboot(spawn, break_char): - """ Breaks the booting process on a device - - Args: - spawn (obj): Spawn connection object - break_char (str): Char to send - - Returns: - None - """ - - log.info(f"Found the grub_activity_pattern! Breaking the boot process " - f"by sending {repr(break_char)}") - - spawn.send(break_char) - - # Set a target for each recovery session - # so it's easier to distinguish expect debug logs on the console. - device.instantiate(connection_timeout=timeout) - - # Get device console port information - last_word_in_start_match = re.match(r'.*\s(\S+)$', start) - last_word_in_start = last_word_in_start_match.group(1) \ - if last_word_in_start_match else "" - - # Set target - target = "{}_{}".format(device.hostname, last_word_in_start) - - spawn = Spawn(spawn_command=start, - settings=device.cli.settings, - target=target, - logger=device.log, - device=device) - - # Stop the device from booting - break_dialog = BreakBootDialog() - - # Either use break character or telnet escape break - # break character is ctrl-c by default - if console_activity_pattern and console_breakboot_char and not console_breakboot_telnet_break: - break_dialog.add_statement( - Statement(pattern=console_activity_pattern, - action=console_breakboot, - args={'break_count': break_count, - 'break_char': console_breakboot_char}, - loop_continue=True, - continue_timer=False), pos=0) - - # telnet escape is used only if user specified - if console_activity_pattern and console_breakboot_telnet_break: - break_dialog.add_statement( - Statement(pattern=console_activity_pattern, - action=telnet_breakboot, - args={'break_count': break_count}, - loop_continue=True, - continue_timer=False), pos=0) - - if grub_activity_pattern and grub_breakboot_char: - break_dialog.add_statement( - Statement(pattern=grub_activity_pattern, - action=grub_breakboot, - args={'break_char': grub_breakboot_char}, - loop_continue=True, - continue_timer=False), pos=0) - - break_dialog.dialog.process(spawn, timeout=timeout) - + device.api.send_break_boot( + 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) + + spawn = device.spawn # Recover the device using the specified method if kwargs.get('golden_image'): device_recovery(spawn, timeout, *args, **kwargs) @@ -182,7 +84,8 @@ def device_recovery(spawn, timeout, golden_image, recovery_password=None, **kwar '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}) + 'pass_login':1}, + prompt_recovery=True) def tftp_device_recovery(spawn, timeout, device, tftp_boot, item, recovery_password=None diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py index a519156cf..caffbb261 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py @@ -393,26 +393,24 @@ def rommon_boot(self, steps, device, image, tftp=None, timeout=TIMEOUT, recovery recovery_username=RECOVERY_USERNAME, recovery_enable_password=RECOVERY_ENABLE_PASSWORD, ether_port=ETHER_PORT): with steps.start("Boot device from rommon") as step: - if not tftp: - tftp = {} - - # Check if management attribute in device object, if not set to empty dict - if not hasattr(device, 'management'): - setattr(device, "management", {}) - - try: - # Getting the tftp information, if the info not provided by user, it takes from testbed - tftp.setdefault("ip_address", [str(device.management.get('address', '').get('ipv4', '').ip)]) - tftp.setdefault("subnet_mask", str(device.management.get('address', '').get('ipv4', '').netmask)) - tftp.setdefault("gateway", str(device.management.get('gateway').get('ipv4'))) - tftp.setdefault("tftp_server", device.testbed.servers.get('tftp', {}).get('address')) - - log.info("checking if all the tftp information is given by the user") - if not all(tftp.values()): - log.warning(f"Some TFTP information is missing: {tftp}") - except Exception as e: - log.warning(f"Tftp information is missing. Please provide it either from testbed or clean stage {tftp}.") - + if tftp is not None: + # Check if management attribute in device object, if not set to empty dict + if not hasattr(device, 'management'): + setattr(device, "management", {}) + + try: + # Getting the tftp information, if the info not provided by user, it takes from testbed + tftp.setdefault("ip_address", [str(device.management.get('address', '').get('ipv4', '').ip)]) + tftp.setdefault("subnet_mask", str(device.management.get('address', '').get('ipv4', '').netmask)) + tftp.setdefault("gateway", str(device.management.get('gateway').get('ipv4'))) + tftp.setdefault("tftp_server", device.testbed.servers.get('tftp', {}).get('address')) + + log.info("checking if all the tftp information is given by the user") + if not all(tftp.values()): + log.warning(f"Some TFTP information is missing: {tftp}") + except Exception as e: + log.warning(f"Tftp information is missing. Please provide it either from testbed or clean stage {tftp}.") + # Need to instantiate to get the device.start # The device.start only works because of a|b device.instantiate(connection_timeout=timeout) diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/sdwan/stages.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/sdwan/stages.py index d08560209..a509b74c8 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/sdwan/stages.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/sdwan/stages.py @@ -767,201 +767,6 @@ def expand_image(self, steps, device, image, timeout=TIMEOUT): image_mapping.update({image[0]: self.conf_file}) -class SetControllerMode(BaseStage): - """Set controller mode - -Stage Schema ------------- -set_controller_mode: - - mode (str, optional): `enable` or `disable`. Defaults to `enable` - - reload_timeout (int, optional): maximum time to wait for reload. - Defaults to 600 secs - - configure_retry_interval (int, optional): interval of retry configure(). - Defaults to 60 secs - - delete_inactive_versions (bool, optional): delete non active version after - changing image. Defaults to True - -Example -------- -set_controller_mode: - mode: enable - reload_timeout: 600 - configure_retry_interval: 30 - delete_inactive_versions: True -""" - - # ================= - # Argument Defaults - # ================= - MODE = 'enable' - RELOAD_TIMEOUT = 600 - CONFIGURE_RETRY_INTERVAL = 30 - delete_inactive_versions = True - - # ============ - # Stage Schema - # ============ - schema = { - Optional('mode'): str, - Optional('reload_timeout'): int, - Optional('delete_inactive_versions'): bool, - } - - # ============================== - # Execution order of Stage steps - # ============================== - exec_order = [ - 'set_controller_mode', 'confirm_and_set_default', - 'delete_inactive_versions' - ] - - def set_controller_mode( - self, - steps, - device, - mode=MODE, - reload_timeout=RELOAD_TIMEOUT, - ): - - with steps.start("setting controller mode") as step: - - if device.connected: - device.destroy_all() - - device.platform = 'iosxe' - device.connect() - - _, password = device.api.get_username_password() - - # Username: admin - # Password: - # Default admin password needs to be changed. - # - # - # Enter new password: - # Confirm password: - # - # Router# pnpa service discovery stop - - controller_mode_dialog = Dialog([ - Statement(pattern=r'Continue\? \[confirm\]', - action='sendline()', - loop_continue=True, - continue_timer=False), - Statement(pattern=r'Do you want to abort\? \(yes/\[no\]\):', - action='sendline(no)', - loop_continue=True, - continue_timer=False), - Statement(pattern=r'Username:', - action='sendline(admin)', - loop_continue=True, - continue_timer=False), - Statement(pattern=r'Password:', - action='sendline(admin)', - loop_continue=True, - continue_timer=False), - Statement(pattern=r'Enter new password:', - action=f'sendline({password})', - loop_continue=True, - continue_timer=False), - Statement(pattern=r'Confirm password:', - action=f'sendline({password})', - loop_continue=True, - continue_timer=False), - Statement( - pattern= - r'Would you like to enter basic management setup\? \[yes/no\]:', - action=f'sendline(no)', - loop_continue=True, - continue_timer=False), - ]) - device.execute(f'controller-mode {mode}', - timeout=reload_timeout, - reply=controller_mode_dialog) - - def confirm_and_set_default( - self, - steps, - device, - configure_retry_interval=CONFIGURE_RETRY_INTERVAL): - - with steps.start("upgrade-confirm and set-default") as step: - - if device.connected: - device.destroy_all() - - log.debug(f"device.platform : {device.platform}") - log.debug('changing platform to sdwan...') - device.platform = 'sdwan' - log.debug(f"device.platform : {device.platform}") - device.instantiate(learn_hostname=True, - prompt_recovery=True, - init_exec_commands=[ - 'pnpa service discovery stop', - 'show version' - ], - init_config_commands=[]) - log.debug(f"device.platform : {device.platform}") - self.output = device.connect() - for attempt in range(5): - log.info(f'Attempt#{attempt+1}:') - try: - device.configure('no logging console') - break - except Exception as e: - if attempt == 4: - raise Exception( - f"Couldn't enter to configuration mode: {e}") - else: - time.sleep(configure_retry_interval) - - parsed_output = device.parse('show sdwan software') - active_version = parsed_output.q.contains_key_value( - 'active', 'true').get_values('version', 0) - self.non_active_version = parsed_output.q.contains_key_value( - 'active', 'false').get_values('version') - - if active_version: - commands = [ - 'request platform software sdwan software upgrade-confirm', - f'request platform software sdwan software set-default {active_version}', - 'show sdwan software' - ] - device.execute(commands) - else: - step.failed('Active version was not confirmed.') - - with steps.start("Verify controller mode") as step: - - if 'Controller-Managed' in self.output: - step.passed( - "Device booted up with controller-mode successfully.") - else: - step.failed("Device couldn't boot up with controller-mode") - - def delete_inactive_versions( - self, - steps, - device, - delete_inactive_versions=delete_inactive_versions): - - with steps.start("deleting non active version") as step: - - if delete_inactive_versions and self.non_active_version: - for version in self.non_active_version: - device.execute( - f"request platform software sdwan software remove {version}" - ) - device.execute("show sdwan software") - log.info( - f"Non active versions {self.non_active_version} are deleted." - ) - - class ChangeBootVariable(XeChangeBootVariable): """This stage change boot variables of the device using the following steps: 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 7701fc0d5..70ca7ae68 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 @@ -34,6 +34,7 @@ # Unicon from unicon.eal.dialogs import Statement, Dialog +from unicon.core.errors import SubCommandFailure # Logger log = logging.getLogger(__name__) @@ -469,10 +470,13 @@ class InstallRemoveInactive(BaseStage): install_image: images (list, optional): image to not removed by stage. - + timeout (int, optional): Maximum time to wait for remove process to finish. Defaults to 180. + force_remove (bool, optional): Whether or not to remove the inactive + package irrespective of availability of passed image. Defaults to True. + Example ------- install_remove_inactive: @@ -484,6 +488,7 @@ class InstallRemoveInactive(BaseStage): # Argument Defaults # ================= TIMEOUT = 180 + FORCE_REMOVE = True # ============ # Stage Schema @@ -491,6 +496,7 @@ class InstallRemoveInactive(BaseStage): schema = { Optional('images'): list, Optional('timeout'): int, + Optional('force_remove'): bool, } # ============================== @@ -501,17 +507,22 @@ class InstallRemoveInactive(BaseStage): ] - - def remove_inactive_pkgs(self, steps, device, images, timeout=TIMEOUT): + def remove_inactive_pkgs(self, steps, device, images, timeout=TIMEOUT, force_remove=FORCE_REMOVE): with steps.start("Removing inactive packages") as step: - def _check_for_system_image(spawn, system_image=None): + def _check_for_system_image(spawn, system_image=None, force_remove=None): + if force_remove is True: + log.warning(f'Sending yes to delete files without checking {system_image} in among the files to be deleted.') + spawn.sendline('y') + return + if system_image and re.search(f"{system_image}\r", spawn.buffer): log.debug(f'{system_image} is among the files to be deleted. send no so the {system_image} is not deleted. ') spawn.sendline('n') else: log.debug(f'{system_image} is not among the files to be deleted. Hence, send yes to delete files.') spawn.sendline('y') + # split the image on the [:/] and pick up the image name image = re.split(r'[:/]', images[0])[-1] @@ -519,7 +530,7 @@ def _check_for_system_image(spawn, system_image=None): Statement( pattern=r".*Do you want to remove the above files\? \[y\/n\]", action=_check_for_system_image, - args={'system_image': image}, + args={'system_image': image, 'force_remove': force_remove}, loop_continue=False, continue_timer=False), ]) @@ -768,10 +779,10 @@ def install_image(self, steps, device, images, 'reply': install_add_one_shot_dialog }) if issu: - device.reload('install add file {} activate issu commit'.format(images[0]), + device.reload('install add file {} activate issu commit prompt-level none'.format(images[0]), **reload_args) else: - device.reload('install add file {} activate commit'.format(images[0]), + device.reload('install add file {} activate commit prompt-level none'.format(images[0]), **reload_args) device.execute('install commit') @@ -908,6 +919,8 @@ class Reload(BaseStage): reconnect_via (str, optional): Specify which connection to use after reloading. Defaults to the 'default' connection in the testbed yaml file. + attempt_manual_boot (bool, optional): Enable to attempt manual boot when reload fails. + Defaults to True. Example ------- @@ -937,6 +950,7 @@ class Reload(BaseStage): 'ignore_modules': None, } RECONNECT_VIA = None + ATTEMPT_MANUAL_BOOT = True # ============ # Stage Schema @@ -958,6 +972,8 @@ class Reload(BaseStage): Any(): Any() }, Optional('reconnect_via'): str, + Optional('attempt_manual_boot'): bool, + } # ============================== @@ -970,7 +986,7 @@ class Reload(BaseStage): 'check_modules' ] - def reload(self, steps, device, reload_service_args=None): + def reload(self, steps, device, reload_service_args=None, attempt_manual_boot=ATTEMPT_MANUAL_BOOT): if reload_service_args is None: # If user provides no custom values, take the defaults @@ -981,15 +997,39 @@ 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 + + # custom exception for reload + class ReloadError(BaseException): + """Exception raised for errors that are specific to reload. + """ + pass + + def break_reload(device): + """ Breaks the reload process on a device + """ + log.info(f"Boot variable does not exist!!! Breaking the reload process.") + # Send No to exit from reload process + device.sendline('N') + + # Throw custom reload error from base exception. + raise ReloadError('Exiting the reload process.') + # Disable device_recovey for reload in unicon self.reload_service_args.update({'device_recovery':False}) reload_dialog = Dialog([ Statement(pattern=r".*Do you wish to proceed with reload anyway\[confirm\].*", action='sendline(y)', loop_continue=True, - continue_timer=False), - ]) + continue_timer=False)]) + if attempt_manual_boot: + reload_dialog.append( + Statement(pattern=r".*Boot variable either does not exist or buffer is too small.*", + action=break_reload, + args={'device': device}, + loop_continue=False, + continue_timer=False), + ) self.reload_service_args.update({ 'reply': reload_dialog @@ -999,6 +1039,43 @@ def reload(self, steps, device, reload_service_args=None): try: device.reload(**self.reload_service_args) + except ReloadError as e: + # Get the current system image + try: + output = device.parse('show version') + system_image = output['version']['system_image'] + except Exception as e: + log.exception(f"Failed to get the system image from device {device.name}, Error: {e}") + + config_reg = None + # capture the current boot settings to restore it on later stage + try: + output = device.parse('show boot') + config_reg = output.get('active', {}).get('configuration_register') + except Exception as e: + log.exception(f"Failed to get the boot information for {device.name}, Error: {e}") + + # Bring the device state to rommon + device.rommon() + + # If the device is HA then update context for standy rp + cmd = f'boot {system_image}' + if device.is_ha and hasattr(device, 'subconnections'): + for con in device.subconnections: + if con.role=='standby': + con.context['boot_cmd'] = cmd + + with steps.start(f"Reload using manual boot for {device.name}") as step: + try: + device.reload(reload_command=cmd) + except Exception as e: + step.failed(f"Failed to reload within {self.reload_service_args['timeout']} " + f"seconds.", from_exception=e) + + # Restore the boot settings + if config_reg: + device.api.execute_set_config_register(config_register=config_reg) + except Exception as e: step.failed(f"Failed to reload within {self.reload_service_args['timeout']} " f"seconds.", from_exception=e) @@ -1282,30 +1359,27 @@ def go_to_rommon(self, steps, device, rommon_timeout=ROMMON_TIMEOUT): def rommon_boot(self, steps, device, image, tftp=None, timeout=TIMEOUT, recovery_password=RECOVERY_PASSWORD, recovery_username=RECOVERY_USERNAME, recovery_enable_password=RECOVERY_ENABLE_PASSWORD, ether_port=ETHER_PORT): with steps.start("Boot device from rommon") as step: - if not tftp: - tftp = {} - - - # Check if management attribute in device object, if not set to empty dict - if not hasattr(device, 'management'): - setattr(device, "management", {}) - - - # Getting the tftp information, if the info not provided by user, it takes from testbed - address = device.management.get('address', {}).get('ipv4', '') - if isinstance(address, IPv4Interface): - ip_address = [str(address.ip)] - subnet_mask = str(address.netmask) - elif isinstance(address, IPv6Interface): - ip_address = [str(address.ip)] - subnet_mask = str(address.netmask) - tftp.setdefault("ip_address", ip_address) - tftp.setdefault("subnet_mask", subnet_mask) - tftp.setdefault("gateway", str(device.management.get('gateway', {}).get('ipv4'))) - tftp.setdefault("tftp_server", device.testbed.servers.get('tftp', {}).get('address')) + if tftp is not None: + # Check if management attribute in device object, if not set to empty dict + if not hasattr(device, 'management'): + setattr(device, "management", {}) + + + # Getting the tftp information, if the info not provided by user, it takes from testbed + address = device.management.get('address', {}).get('ipv4', '') + if isinstance(address, IPv4Interface): + ip_address = [str(address.ip)] + subnet_mask = str(address.netmask) + elif isinstance(address, IPv6Interface): + ip_address = [str(address.ip)] + subnet_mask = str(address.netmask) + tftp.setdefault("ip_address", ip_address) + tftp.setdefault("subnet_mask", subnet_mask) + tftp.setdefault("gateway", str(device.management.get('gateway', {}).get('ipv4'))) + tftp.setdefault("tftp_server", device.testbed.servers.get('tftp', {}).get('address')) log.info("checking if all the tftp information is given by the user") - if not all(tftp.values()): + if tftp and not all(tftp.values()): log.warning(f"Some TFTP information is missing: {tftp}") # setting tftp empty if ttfp information is missing tftp = {} @@ -1690,7 +1764,7 @@ def copy_to_device(self, steps, device, origin, destination, self.skipped(f"The image file provided is same as the current running image {image_version} on the device.\n\ Setting the destination image to {dest_file_path}. Skipping the copy process.") - + # try to get file size from file directly with steps.start(f"Get filesize of '{file}'") as step: try: @@ -2218,7 +2292,7 @@ def connect(self, steps, device, via=VIA, alias=ALIAS, timeout=TIMEOUT, log.info('Configuring the manual boot') try: - + if device.is_ha and hasattr(device, 'subconnections'): states_list = [] # Switch to enable mode if one of the rps are disable mode. @@ -2353,6 +2427,7 @@ def _generate_default_config(self, device, config_dict): }, '^vrf definition Mgmt-(intf|vrf)': {}, '^switch 1 provision': {}, + '^stackwise-virtual': {}, '^crypto pki trustpoint': {}, '^crypto pki certificate chain': {}, '^license boot level': {}, @@ -2438,3 +2513,195 @@ def reset_configuration(self, steps, device, timeout=TIMEOUT): def show_running_config(self, steps, device): with steps.start('Capturing running config') as step: device.execute('show running-config') + + +class SetControllerMode(BaseStage): + """Set controller mode + +Stage Schema +------------ +set_controller_mode: + + mode (str, optional): `enable` or `disable`. Defaults to `enable` + + reload_timeout (int, optional): maximum time to wait for reload. + Defaults to 600 secs + + delete_inactive_versions (bool, optional): delete non active version after + changing image. Defaults to True + +Example +------- +set_controller_mode: + mode: enable + reload_timeout: 600 + delete_inactive_versions: True +""" + + # ================= + # Argument Defaults + # ================= + MODE = 'enable' + RELOAD_TIMEOUT = 600 + DELETE_INACTIVE_VERSIONS = True + + # ============ + # Stage Schema + # ============ + schema = { + Optional('mode'): str, + Optional('reload_timeout'): int, + Optional('delete_inactive_versions'): bool, + } + + # ============================== + # Execution order of Stage steps + # ============================== + exec_order = [ + 'set_controller_mode', 'confirm_and_set_default', + 'delete_inactive_versions' + ] + + def set_controller_mode( + self, + steps, + device, + mode=MODE, + reload_timeout=RELOAD_TIMEOUT, + ): + + # Check if we're already in the desired mode + version_data = device.parse("show version") + + # For those versions of IOSXE where version is a str + try: + router_operating_mode = version_data.get('version', {}).get('router_operating_mode') + except AttributeError: + router_operating_mode = None + + if router_operating_mode == 'Autonomous' and mode == 'disable': + self.skipped("Router already in Autonomous mode") + elif router_operating_mode == 'Controller-Managed' and mode == 'enable': + self.skipped("Router already in Controller-Managed mode") + + with steps.start("setting controller mode") as step: + + if device.connected: + device.destroy_all() + + device.connect() + + _, password = device.api.get_username_password() + + # Username: admin + # Password: + # Default admin password needs to be changed. + # + # + # Enter new password: + # Confirm password: + # + # Router# pnpa service discovery stop + + controller_mode_dialog = Dialog([ + Statement(pattern=r'Continue\? \[confirm\]', + action='sendline()', + loop_continue=True, + continue_timer=False), + Statement(pattern=r'Do you want to abort\? \(yes/\[no\]\):', + action='sendline(no)', + loop_continue=True, + continue_timer=False), + Statement(pattern=r'Username:', + action='sendline(admin)', + loop_continue=True, + continue_timer=False), + Statement(pattern=r'Password:', + action='sendline(admin)', + loop_continue=True, + continue_timer=False), + Statement(pattern=r'Enter new password:', + action=f'sendline({password})', + loop_continue=True, + continue_timer=False), + Statement(pattern=r'Confirm password:', + action=f'sendline({password})', + loop_continue=True, + continue_timer=False), + Statement( + pattern= + r'Would you like to enter basic management setup\? \[yes/no\]:', + action=f'sendline(no)', + loop_continue=True, + continue_timer=False), + ]) + + try: + device.execute(f'controller-mode {mode}', + timeout=reload_timeout, + reply=controller_mode_dialog) + except SubCommandFailure: + self.skipped("Unable to configure controller-mode. Is it a " + "feature of this device?") + + def confirm_and_set_default( + self, + steps, + device, + mode=MODE): + + with steps.start("upgrade-confirm and set-default") as step: + + if device.connected: + device.destroy_all() + self.output = device.connect() + + parsed_output = device.parse('show sdwan software') + active_version = parsed_output.q.contains_key_value( + 'active', 'true').get_values('version', 0) + self.non_active_version = parsed_output.q.contains_key_value( + 'active', 'false').get_values('version') + + if active_version: + commands = [ + 'request platform software sdwan software upgrade-confirm', + f'request platform software sdwan software set-default {active_version}', + 'show sdwan software' + ] + device.execute(commands) + else: + step.failed('Active version was not confirmed.') + + with steps.start("Verify controller mode") as step: + if 'Controller-Managed' in self.output and mode == 'enable': + step.passed( + "Device booted up with controller-mode successfully.") + elif 'Autonomous' in self.output and mode == 'disable': + step.passed( + "Device booted up with autonomous-mode successfully.") + elif 'Controller-Managed' in self.output and mode == 'disable': + step.failed( + "Device couldn't boot up with autonomous-mode") + elif 'Autonomous' in self.output and mode == 'enable': + step.failed( + "Device couldn't boot up with controller-mode") + else: + step.failed(f"Something went wrong configuring `controller-mode {mode}`") + + def delete_inactive_versions( + self, + steps, + device, + delete_inactive_versions=DELETE_INACTIVE_VERSIONS): + + with steps.start("deleting non active version") as step: + + if delete_inactive_versions and self.non_active_version: + for version in self.non_active_version: + device.execute( + f"request platform software sdwan software remove {version}" + ) + device.execute("show sdwan software") + log.info( + f"Non active versions {self.non_active_version} are deleted." + ) \ No newline at end of file diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_image.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_image.py index 8c7a1b3f9..55c33c1fb 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 @@ -330,7 +330,7 @@ def test_iosxe_install_image_pass(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, + call('install add file sftp://server/image.bin activate commit prompt-level none', reply=ANY, reload_creds='default', prompt_recovery=True, error_pattern=['FAILED:.*?$'], timeout=500, device_recovery=False) ]) @@ -357,7 +357,7 @@ def test_iosxe_install_image_grub_boot_image(self): reload_service_args=dict(grub_boot_image='packages.conf')) device.reload.assert_has_calls([ - call('install add file sftp://server/image.bin activate commit', reply=ANY, + call('install add file sftp://server/image.bin activate commit prompt-level none', reply=ANY, reload_creds='default', prompt_recovery=True, error_pattern=['FAILED:.*?$'], grub_boot_image='packages.conf', device_recovery=False, timeout=500) ]) diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_remove_inactive/mock_data/iosxe/mock_data.yaml b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_remove_inactive/mock_data/iosxe/mock_data.yaml index 0769ff5a4..555502e2f 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_remove_inactive/mock_data/iosxe/mock_data.yaml +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_remove_inactive/mock_data/iosxe/mock_data.yaml @@ -116,4 +116,59 @@ do_you_want_to_remove2: Performing REMOVE_POSTCHECK on all members Finished Post_Remove_Cleanup SUCCESS: install_remove Sat Jun 01 19:50:22 UTC 2024 - new_state: execute1 + new_state: execute2 + +remove_inactive_yes_forcefully: + <<: *connect + commands: + ? '' + : new_state: execute3 + +execute3: + commands: + <<: *execute + install remove inactive: + new_state: do_you_want_to_remove3 + prompt: "%N#" + +do_you_want_to_remove3: + preface: + timing: + - 0:,0,0.05 + response: | + install_remove: START Tue May 28 18:23:26 UTC 2024 + + install_remove: Removing IMG + + Cleaning up unnecessary package files + + No path specified, will use booted path /bootflash//packages.conf + + + Cleaning /bootflash + + Scanning boot directory for packages ... done. + + Preparing packages list to delete ... + + [R0]: /bootflash/packages.conf File is in use, will not delete. + + + The following files will be deleted: + + [R0]: /bootflash/image.bin + + prompt: Do you want to remove the above files? [y/n] + commands: + "y": + timing: + - 0:,0,0.05 + response: | + Deleting file /bootflash/image.bin ... done. + SUCCESS: Files deleted. + + --- Starting Post_Remove_Cleanup --- + Performing REMOVE_POSTCHECK on all members + Finished Post_Remove_Cleanup + SUCCESS: install_remove Sat Jun 01 19:50:22 UTC 2024 + new_state: execute3 diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_remove_inactive/test_install_remove_inactive.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_remove_inactive/test_install_remove_inactive.py index 892bc0639..b2be235cd 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_remove_inactive/test_install_remove_inactive.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_install_remove_inactive/test_install_remove_inactive.py @@ -10,7 +10,7 @@ class TestIosXEConnect(unittest.TestCase): """ Run unit testing on a mocked IOSXE c8kv device """ @classmethod - def setUpClass(cls): + def setUp(cls): # Make sure we have a unique Steps() object for result verification cls.steps = Steps() @@ -19,7 +19,7 @@ def setUpClass(cls): # And we want the following methods to be mocked to simulate the stage. cls.install_remove_inactive = InstallRemoveInactive() - def test_install_remove_inactive_pass_n(self): + def test_install_remove_inactive_force_remove_false_pass_n(self): testbed = """ devices: @@ -43,14 +43,14 @@ def test_install_remove_inactive_pass_n(self): ) with self.assertLogs(level='DEBUG') as log: - self.install_remove_inactive(steps=self.steps, device=self.device, images=[self.image]) + self.install_remove_inactive(steps=self.steps, device=self.device, images=[self.image], force_remove=False) self.assertIn(f'{self.image} is among the files to be deleted. send no so the {self.image} is not deleted.', log.output[1]) # Check the results is as expected. self.assertEqual(Passed, self.steps.details[0].result) - def test_install_remove_inactive_pass_y(self): + def test_install_remove_inactive_force_remove_false_pass_y(self): testbed = """ devices: @@ -74,8 +74,39 @@ def test_install_remove_inactive_pass_y(self): ) with self.assertLogs(level='DEBUG') as log: - self.install_remove_inactive(steps=self.steps, device=self.device, images=[self.image]) + self.install_remove_inactive(steps=self.steps, device=self.device, images=[self.image], force_remove=False, timeout=60) self.assertIn(f'{self.image} is not among the files to be deleted. Hence, send yes to delete files.', log.output[1]) # Check the results is as expected. self.assertEqual(Passed, self.steps.details[0].result) + + + def test_install_remove_inactive_force_remove_true_pass_y(self): + + testbed = """ + devices: + router: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir mock_data --state remove_inactive_yes_forcefully + protocol: unknown + os: iosxe + platform: c8kv + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['router'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + with self.assertLogs(level='DEBUG') as log: + self.install_remove_inactive(steps=self.steps, device=self.device, images=[self.image]) + self.assertIn(f'Sending yes to delete files without checking {self.image} in among the files to be deleted.', log.output[1]) + + # Check the results is as expected. + self.assertEqual(Passed, self.steps.details[0].result) diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/sdwan/tests/test_set_controller_mode.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_set_controller_mode.py similarity index 84% rename from pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/sdwan/tests/test_set_controller_mode.py rename to pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_set_controller_mode.py index be39da9f0..46046433e 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/sdwan/tests/test_set_controller_mode.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_set_controller_mode.py @@ -4,14 +4,14 @@ from unittest.mock import Mock, MagicMock, patch from collections import OrderedDict -from genie.libs.clean.stages.iosxe.sdwan.stages import SetControllerMode +from genie.libs.clean.stages.iosxe.stages import SetControllerMode from genie.libs.clean.stages.tests.utils import CommonStageTests, create_test_device from pyats.aetest.parameters import ParameterDict from pyats.aetest.steps import Steps -from pyats.results import Passed, Failed -from pyats.aetest.signals import TerminateStepSignal +from pyats.results import Passed, Failed, Skipped +from pyats.aetest.signals import TerminateStepSignal, AEtestSkippedSignal # Disable logging. It may be useful to comment this out when developing tests. @@ -37,6 +37,7 @@ def test_pass(self): # This simulates the pass case. self.device.connect = Mock() self.device.execute = Mock() + self.device.parse = Mock() self.device.api.get_username_password = Mock(return_value=('admin', 'admin')) # Call the method to be tested (clean step inside class) @@ -47,6 +48,26 @@ def test_pass(self): # Check that the result is expected self.assertEqual(Passed, steps.details[0].result) + def test_skipped(self): + # Make sure we have a unique Steps() object for result verification + steps = Steps() + + # And we want the execute method to be mocked. + # This simulates the pass case. + self.device.connect = Mock() + self.device.execute = Mock() + self.device.parse = MagicMock() + d = {'version': {'router_operating_mode': 'Controller-Managed'}} + self.device.parse.return_value = d + self.device.api.get_username_password = Mock(return_value=('admin', 'admin')) + + # Call the method to be tested (clean step inside class) + # Assert it raises a skipped signal + with self.assertRaises(AEtestSkippedSignal): + self.cls.set_controller_mode( + steps=steps, device=self.device + ) + class ConfirmAndSetDefault(unittest.TestCase): @@ -92,7 +113,7 @@ def test_pass(self): 10.106.1.0.32 true false false user 2020-04-11T09:43:37-00:00 10.106.2.0.1857 false true false auto 2020-03-30T02:13:24-00:00 - Total Space:387M Used Space:141M Available Space:241M + Total Space:387M Used Space:141M Available Space:241M ''' # And we want the following methods to be mocked. @@ -109,7 +130,7 @@ def test_pass(self): # Check that the result is expected self.assertEqual(Passed, steps.details[0].result) - + def test_fail_inactive_version(self): # Make sure we have a unique Steps() object for result verification steps = Steps() @@ -143,7 +164,7 @@ def test_fail_inactive_version(self): 10.106.1.0.32 false false false user 2020-04-11T09:43:37-00:00 10.106.2.0.1857 false true false auto 2020-03-30T02:13:24-00:00 - Total Space:387M Used Space:141M Available Space:241M + Total Space:387M Used Space:141M Available Space:241M ''' # And we want the following methods to be mocked. self.device.connect = Mock(return_value=data) @@ -158,7 +179,7 @@ def test_fail_inactive_version(self): # Check the overall result is as expected self.assertEqual(Failed, steps.details[0].result) - + def test_fail_to_set_controller_mode(self): # Make sure we have a unique Steps() object for result verification @@ -193,7 +214,7 @@ def test_fail_to_set_controller_mode(self): 10.106.1.0.32 true false false user 2020-04-11T09:43:37-00:00 10.106.2.0.1857 false true false auto 2020-03-30T02:13:24-00:00 - Total Space:387M Used Space:141M Available Space:241M + Total Space:387M Used Space:141M Available Space:241M ''' # And we want the following methods to be mocked. self.device.connect = Mock(return_value=data) 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 a1aa93fca..e8bb9a4ba 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py @@ -2940,7 +2940,7 @@ def configure_management(self, steps, device, set_hostname=SET_HOSTNAME, **kwarg class ConfigureInterfaces(BaseStage): """This stage configures interfaces on the device. - This stages uses genie Conf objects and build_config() API to configure + This stages uses genie Conf objects and build_config() API to configure interfaces on devices. Stage Schema diff --git a/pkgs/conf-pkg/changelog/2024/july.rst b/pkgs/conf-pkg/changelog/2024/july.rst new file mode 100644 index 000000000..d0300a039 --- /dev/null +++ b/pkgs/conf-pkg/changelog/2024/july.rst @@ -0,0 +1,25 @@ +-------------------------------------------------------------------------------- + New +-------------------------------------------------------------------------------- + +* nxos + * Added + * Urpf config model + * Added configuration support for nxos evpn multihoming by adding below commands + * evpn multihoming + * df-election mode modulo + * df-election mode per-flow + * ethernet-segment delay-restore time 45 + * system-mac aaaa.deaf.beef + * interface + * evpn multihoming core-tracking + * ethernet-segment + * esi system-mac + * esi system-mac + * esi + * Added interface level configuration CLI support for vpc, for following commands + * port-type fabric + * vpc peer-link + * vpc + + diff --git a/pkgs/conf-pkg/setup.py b/pkgs/conf-pkg/setup.py index 877082e7a..94a7004d9 100755 --- a/pkgs/conf-pkg/setup.py +++ b/pkgs/conf-pkg/setup.py @@ -10,7 +10,7 @@ import re import sys -from setuptools import setup, find_packages +from setuptools import setup, find_packages, find_namespace_packages def read(*paths): '''read and return txt content of file''' @@ -97,11 +97,8 @@ def version_info(*paths): # project keywords keywords = 'genie pyats test automation', - # uses namespace package - namespace_packages = ['genie', 'genie.libs'], - # project packages - packages = find_packages(where = 'src'), + packages = find_namespace_packages(where = 'src'), # project directory package_dir = { diff --git a/pkgs/conf-pkg/src/genie/__init__.py b/pkgs/conf-pkg/src/genie/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/pkgs/conf-pkg/src/genie/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/pkgs/conf-pkg/src/genie/libs/__init__.py b/pkgs/conf-pkg/src/genie/libs/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/pkgs/conf-pkg/src/genie/libs/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/pkgs/conf-pkg/src/genie/libs/conf/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/__init__.py index f0dbb3993..407912fa3 100644 --- a/pkgs/conf-pkg/src/genie/libs/conf/__init__.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/__init__.py @@ -12,7 +12,7 @@ ''' # metadata -__version__ = '24.6' +__version__ = '24.7' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/conf-pkg/src/genie/libs/conf/evpn/nxos/evpn.py b/pkgs/conf-pkg/src/genie/libs/conf/evpn/nxos/evpn.py index cb8473242..c0150b2eb 100644 --- a/pkgs/conf-pkg/src/genie/libs/conf/evpn/nxos/evpn.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/evpn/nxos/evpn.py @@ -14,15 +14,100 @@ from abc import ABC import warnings +from enum import Enum from genie.conf.base.attributes import UnsupportedAttributeWarning, AttributesHelper from genie.conf.base.cli import CliConfigBuilder import genie.conf.base.interface from genie.conf.base.config import CliConfig - +from genie.decorator import managedattribute class Evpn(ABC): + class InterfaceAttributes(ABC): + + evpn_multihoming_core_tracking = managedattribute( + name='evpn_multihoming_core_tracking', + type=bool, + read_only=False, + doc="EVPN multihoming core tracking for the interface." + ) + + ethernet_segment_intf = managedattribute( + name='ethernet_segment_intf', + type=bool, + read_only=False, + doc="EVPN ethernet-segment multihoming access facing interface." + ) + + system_mac = managedattribute( + name='system_mac', + type=str, + read_only=False, + doc="System MAC address for the ESI." + ) + + local_discriminator = managedattribute( + name='local_discriminator', + type=int, + read_only=False, + doc="Local discriminator for the ESI." + ) + + esi_tag = managedattribute( + name='esi_tag', + type=int, + read_only=False, + doc="Tag for the ESI." + ) + + def build_config(self, apply=True, attributes=None, + unconfig=False, **kwargs): + assert not apply + assert not kwargs, kwargs + attributes = AttributesHelper(self, attributes) + configurations = CliConfigBuilder(unconfig=unconfig) + + with configurations.submode_context( + attributes.format('interface {interface_name}', + force=True)): + if unconfig and attributes.iswildcard: + configurations.submode_unconfig() + + # interface Ethernet1/1 / evpn multihoming core-tracking + if attributes.value('evpn_multihoming_core_tracking'): + configurations.append_line( + attributes.format('evpn multihoming core-tracking'), unconfig_cmd='no evpn multihoming core-tracking') + + if attributes.value('ethernet_segment_intf'): + + # interface port-channel1 / switchport + configurations.append_line( + attributes.format('switchport')) + + # interface port-channel1 / ethernet-segment + with configurations.submode_context('ethernet-segment'): + if attributes.value('local_discriminator'): + if attributes.value('system_mac'): + + # interface port-channel1 / ethernet-segment / esi system-mac + configurations.append_line(attributes.format('esi system-mac {system_mac} {local_discriminator}')) + + else: + # interface port-channel1 / ethernet-segment / esi system-mac + configurations.append_line(attributes.format('esi system-mac {local_discriminator}')) + + elif attributes.value('esi_tag'): + # interface port-channel1 / ethernet-segment / esi + configurations.append_line(attributes.format('esi {esi_tag}')) + return str(configurations) + + def build_unconfig(self, apply=True, attributes=None, + **kwargs): + return self.build_config(apply=apply, + attributes=attributes, + unconfig=True, **kwargs) + class VniAttributes(ABC): def build_config(self, apply=True, attributes=None, unconfig=False): @@ -126,20 +211,82 @@ def build_unconfig(self, apply=True, attributes=None): class DeviceAttributes(ABC): - def build_config(self, apply=True, attributes=None, unconfig=False): + # evpn_mode # node01(config)# evpn multihoming + + multi_homing_enabled = managedattribute( + name='multi_homing_enabled', + default=None, + type=(None, managedattribute.test_istype(bool)), + doc="Enable Evpn Multihoming feature.") + + class DfElectionMode(Enum): + mode1 = 'modulo' + mode2 = 'per-flow' + + evpn_mutihoming_df_election = managedattribute( + name = 'evpn_mutihoming_df_election', + type = (None, DfElectionMode), + default = None, + doc = "DF election mode for EVPN multihoming" + ) + + evpn_multihoming_es_delay_restore_time = managedattribute( + name = 'evpn_multihoming_es_delay_restore_time', + type = int, + default = None, + doc = 'Delay restore time for EVPN multihoming ethernet segment' + ) + + evpn_multihoming_global_system_mac = managedattribute( + name = 'evpn_multihoming_global_system_mac', + type = str, + default = None, + doc = 'EVPN Multi homing system mac configured at global level' + ) + + def build_config(self, apply=True, attributes=None, unconfig=False, **kwargs): attributes = AttributesHelper(self, attributes) configurations = CliConfigBuilder(unconfig=unconfig) - # nxos: evpn esi multihoming + # nxos: evpn multihoming + if attributes.value('multi_homing_enabled'): + with configurations.submode_context(attributes.format( + 'evpn multihoming', force=True)): + + if unconfig and attributes.iswildcard: + configurations.submode_unconfig() + if attributes.value('evpn_mutihoming_df_election') == 'modulo': + # nxos: evpn multihoming / df-election mode modulo + configurations.append_line('df-election mode modulo', unconfig_cmd='no df-election mode modulo') + + if attributes.value('evpn_mutihoming_df_election') == 'per-flow': + # nxos: evpn multihoming / df-election mode per-flow + configurations.append_line('df-election mode per-flow', unconfig_cmd='no df-election mode per-flow') + + if attributes.value('evpn_multihoming_es_delay_restore_time'): + # nxos: evpn multihoming / ethernet-segment delay-restore time 45 + configurations.append_line(attributes.format('ethernet-segment delay-restore time {evpn_multihoming_es_delay_restore_time}'), unconfig_cmd=attributes.format('no ethernet-segment delay-restore time {evpn_multihoming_es_delay_restore_time}')) + + if attributes.value('evpn_multihoming_global_system_mac'): + # nxos: evpn multihoming / system-mac aaaa.deaf.beef + configurations.append_line(attributes.format('system-mac {evpn_multihoming_global_system_mac}'), unconfig_cmd=attributes.format('no system-mac {evpn_multihoming_global_system_mac}')) + + for sub, attributes2 in attributes.mapping_values('interface_attr', + sort=True, keys=self.interface_attr): + configurations.append_block( + sub.build_config(apply=False, + attributes=attributes2, + unconfig=unconfig)) # nxos: evpn (config-evpn) - with configurations.submode_context('evpn'): - if unconfig and attributes.iswildcard: - configurations.submode_unconfig() + else: + with configurations.submode_context('evpn'): + if unconfig and attributes.iswildcard: + configurations.submode_unconfig() - # nxos: evpn / vni 4096 l2 (config-evpn-evi) - for sub, attributes2 in attributes.mapping_values('vni_attr', keys=self.vnis, sort=True): - configurations.append_block(sub.build_config(apply=False, attributes=attributes2, unconfig=unconfig)) + # nxos: evpn / vni 4096 l2 (config-evpn-evi) + for sub, attributes2 in attributes.mapping_values('vni_attr', keys=self.vnis, sort=True): + configurations.append_block(sub.build_config(apply=False, attributes=attributes2, unconfig=unconfig)) if apply: if configurations: @@ -150,4 +297,5 @@ def build_config(self, apply=True, attributes=None, unconfig=False): def build_unconfig(self, apply=True, attributes=None): return self.build_config(apply=apply, attributes=attributes, unconfig=True) + diff --git a/pkgs/conf-pkg/src/genie/libs/conf/evpn/nxos/tests/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/evpn/nxos/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/conf-pkg/src/genie/libs/conf/evpn/nxos/tests/test_evpn.py b/pkgs/conf-pkg/src/genie/libs/conf/evpn/nxos/tests/test_evpn.py new file mode 100644 index 000000000..a24b518bd --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/evpn/nxos/tests/test_evpn.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python + +# Python +import unittest +from unittest.mock import Mock +import pdb + +# Genie +from genie.tests.conf import TestCase +from genie.conf import Genie +from genie.conf.base import Testbed, Device, Link, Interface +from genie.conf.base.attributes import UnsupportedAttributeWarning + +# Esi +from genie.libs.conf.evpn import Evpn + + +class test_evpn(TestCase): + + def setUp(self): + + # Set Genie Tb + testbed = Testbed() + Genie.testbed = testbed + + # Device + self.dev = Device(name='node01', testbed=testbed, os='nxos') + self.intf1 = Interface(device=self.dev, name='Ethernet1/1') + self.intf2 = Interface(device=self.dev, name='port-channel1') + self.intf3 = Interface(device=self.dev, name='port-channel2') + self.intf4 = Interface(device=self.dev, name='port-channel3') + + # Esi object + self.evpn = Evpn() + self.dev.add_feature(self.evpn) + + def test_evpn_config_modulo(self): + + self.evpn.device_attr[self.dev].multi_homing_enabled = True + self.evpn.device_attr[self.dev].evpn_mutihoming_df_election = 'modulo' + self.evpn.device_attr[self.dev].evpn_multihoming_es_delay_restore_time = 45 + self.evpn.device_attr[self.dev].evpn_multihoming_global_system_mac = 'aaaa.deaf.beef' + intf1 = self.intf1.name + self.evpn.device_attr[self.dev].interface_attr[intf1].evpn_multihoming_core_tracking = True + intf2 = self.intf2.name + self.evpn.device_attr[self.dev].interface_attr[intf2].ethernet_segment_intf = True + self.evpn.device_attr[self.dev].interface_attr[intf2].system_mac = '000a:000b:000c' + self.evpn.device_attr[self.dev].interface_attr[intf2].local_discriminator = '101' + intf3 = self.intf3.name + self.evpn.device_attr[self.dev].interface_attr[intf3].ethernet_segment_intf = True + self.evpn.device_attr[self.dev].interface_attr[intf3].local_discriminator = '102' + intf4 = self.intf4.name + self.evpn.device_attr[self.dev].interface_attr[intf4].ethernet_segment_intf = True + self.evpn.device_attr[self.dev].interface_attr[intf4].esi_tag = '0000.0a00.0b00.0c00.0067' + + # Build Esi configuration + cfgs = self.evpn.build_config(apply=False) + + # Check config built correctly + self.assertMultiLineEqual( + str(cfgs[self.dev.name]), + '\n'.join([ + 'evpn multihoming', + ' df-election mode modulo', + ' ethernet-segment delay-restore time 45', + ' system-mac aaaa.deaf.beef', + ' exit', + 'interface Ethernet1/1', + ' evpn multihoming core-tracking', + ' exit', + 'interface port-channel1', + ' switchport', + ' ethernet-segment', + ' esi system-mac 000a:000b:000c 101', + ' exit', + ' exit', + 'interface port-channel2', + ' switchport', + ' ethernet-segment', + ' esi system-mac 102', + ' exit', + ' exit', + 'interface port-channel3', + ' switchport', + ' ethernet-segment', + ' esi 0000.0a00.0b00.0c00.0067', + ' exit', + ' exit' + ])) + + +if __name__ == '__main__': + unittest.main() diff --git a/pkgs/conf-pkg/src/genie/libs/conf/urpf/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/urpf/__init__.py new file mode 100644 index 000000000..19e83713e --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/urpf/__init__.py @@ -0,0 +1 @@ +from .urpf import * \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/urpf/ipv6verify.py b/pkgs/conf-pkg/src/genie/libs/conf/urpf/ipv6verify.py new file mode 100644 index 000000000..5aceddfd3 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/urpf/ipv6verify.py @@ -0,0 +1,107 @@ +__all__ = ( + 'ipv6verify' +) + +# Python +import weakref +import functools + +# Genie +from genie.decorator import managedattribute +from genie.conf.base import ConfigurableBase + + +@functools.total_ordering +class Ipv6Verify(ConfigurableBase): + + @property + def testbed(self): + return self.device.testbed + + @property + def device(self): + return self._device() + + # ========================================================================== + # MANAGED ATTRIBUTES + # ========================================================================== + + # +- DeviceAttributes + # +- InterfaceAttributes + + # ipv6_verify_strict + ipv6_verify_strict = managedattribute( + name='ipv6_verify_strict', + default=None, + type=(None, managedattribute.test_istype(bool))) + + # ipv6_strict_allow_vnihosts + ipv6_strict_allow_vnihosts = managedattribute( + name='ipv6_strict_allow_vnihosts', + default=None, + type=(None, managedattribute.test_istype(bool))) + + # ipv6_verify_loose + ipv6_verify_loose = managedattribute( + name='ipv6_verify_loose', + default=None, + type=(None, managedattribute.test_istype(bool))) + + # ipv6_loose_allow_default + ipv6_loose_allow_default = managedattribute( + name='ipv6_loose_allow_default', + default=None, + type=(None, managedattribute.test_istype(bool))) + + # ========================================================================== + + # Overload __eq__ + def __eq__(self, other): + if not isinstance(other, Ipv6Verify): + raise NotImplemented + + return (self.ipv6_verify_strict, + self.ipv6_verify_loose, + self.ipv6_strict_allow_vnihosts, + self.ipv6_loose_allow_default, + self.device) == \ + (other.ipv6_verify_strict, + other.ipv6_verify_loose, + other.ipv6_strict_allow_vnihosts, + other.ipv6_loose_allow_default, + other.device) + + # Overload __lt__ + def __lt__(self, other): + if not isinstance(other, Ipv6Verify): + raise NotImplemented("Cannot compare '{s}' to a '{o}'".format( + s=type(self), o=type(other))) + + return (self.ipv6_verify_strict, + self.ipv6_verify_loose, + self.ipv6_strict_allow_vnihosts, + self.ipv6_loose_allow_default, + self.device) < \ + (other.ipv6_verify_strict, + other.ipv6_verify_loose, + other.ipv6_strict_allow_vnihosts, + other.ipv6_loose_allow_default, + other.device) + + # Overload __hash__ + def __hash__(self): + return hash((self.ipv6_verify_strict, + self.ipv6_verify_loose, + self.ipv6_strict_allow_vnihosts, + self.ipv6_loose_allow_default, + self.device)) + + # Overload __repr__ + def __repr__(self): + return '%s object at 0x%x' % ( + self.__class__.__name__, + id(self)) + + def __init__(self, device, *args, **kwargs): + self._device = weakref.ref(device) + super().__init__(*args, **kwargs) \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/urpf/ipverify.py b/pkgs/conf-pkg/src/genie/libs/conf/urpf/ipverify.py new file mode 100644 index 000000000..9eedac0ff --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/urpf/ipverify.py @@ -0,0 +1,96 @@ +__all__ = ( + 'ipverify' +) + +# Python +import weakref +import functools + +# Genie +from genie.decorator import managedattribute +from genie.conf.base import ConfigurableBase + + +@functools.total_ordering +class IpVerify(ConfigurableBase): + + @property + def testbed(self): + return self.device.testbed + + @property + def device(self): + return self._device() + + # ========================================================================== + # MANAGED ATTRIBUTES + # ========================================================================== + + # +- DeviceAttributes + # +- InterfaceAttributes + + # ip_verify_strict + ip_verify_strict = managedattribute( + name='ip_verify_strict', + default=None, + type=(None, managedattribute.test_istype(bool))) + + # ip_verify_loose + ip_verify_loose = managedattribute( + name='ip_verify_loose', + default=None, + type=(None, managedattribute.test_istype(bool))) + + # ip_loose_allow_default + ip_loose_allow_default = managedattribute( + name='ip_loose_allow_default', + default=None, + type=(None, managedattribute.test_istype(bool))) + + # ========================================================================== + + # Overload __eq__ + def __eq__(self, other): + if not isinstance(other, IpVerify): + raise NotImplemented + + return (self.ip_verify_strict, + self.ip_verify_loose, + self.ip_loose_allow_default, + self.device) == \ + (other.ip_verify_strict, + other.ip_verify_loose, + other.ip_loose_allow_default, + other.device) + + # Overload __lt__ + def __lt__(self, other): + if not isinstance(other, IpVerify): + raise NotImplemented("Cannot compare '{s}' to a '{o}'".format( + s=type(self), o=type(other))) + + return (self.ip_verify_strict, + self.ip_verify_loose, + self.ip_loose_allow_default, + self.device) < \ + (other.ip_verify_strict, + other.ip_verify_loose, + other.ip_loose_allow_default, + other.device) + + # Overload __hash__ + def __hash__(self): + return hash((self.ip_verify_strict, + self.ip_verify_loose, + self.ip_loose_allow_default, + self.device)) + + # Overload __repr__ + def __repr__(self): + return '%s object at 0x%x' % ( + self.__class__.__name__, + id(self)) + + def __init__(self, device, *args, **kwargs): + self._device = weakref.ref(device) + super().__init__(*args, **kwargs) \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/__init__.py new file mode 100644 index 000000000..046fcc782 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/__init__.py @@ -0,0 +1,7 @@ +# Enable abstraction using this directory name as the abstraction token +try: + from genie import abstract + abstract.declare_token(os='nxos') +except Exception as e: + import warnings + warnings.warn('Could not declare abstraction token: ' + str(e)) diff --git a/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/ipv6verify.py b/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/ipv6verify.py new file mode 100644 index 000000000..4e5ddc99e --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/ipv6verify.py @@ -0,0 +1,46 @@ +""" +Urpf Genie Conf Object Implementation for NXOS: + - IPv6 verify source multi-line configuration implementation for NXOS - CLI +""" + +# Python +import warnings +from abc import ABC +from attr import attrib + +# Genie +from genie.conf.base.cli import CliConfigBuilder +from genie.conf.base.attributes import AttributesHelper + + +class Ipv6Verify(ABC): + + def build_config(self, apply=True, attributes=None, unconfig=False, **kwargs): + assert not kwargs, kwargs + attributes = AttributesHelper(self, attributes) + configurations = CliConfigBuilder(unconfig=unconfig) + + # ipv6 verify unicast source reachable-via any + # ipv6 verify unicast source reachable-via any allow-default + # ipv6 verify unicast source reachable-via rx + # ipv6 verify unicast source reachable-via rx allow vni-hosts + + ip_str = "ipv6 verify unicast source reachable-via" + + if attributes.value("ipv6_verify_strict"): + ip_str += " rx" + if attributes.value("ipv6_strict_allow_vnihosts"): + ip_str += " allow vni-hosts" + elif attributes.value("ipv6_verify_loose"): + ip_str += " any" + if attributes.value("ipv6_loose_allow_default"): + ip_str += " allow-default" + + configurations.append_line(attributes.format(ip_str)) + + return str(configurations) + + def build_unconfig(self, apply=True, attributes=None, **kwargs): + return self.build_config( + apply=apply, attributes=attributes, unconfig=True, **kwargs + ) diff --git a/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/ipverify.py b/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/ipverify.py new file mode 100644 index 000000000..482929bda --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/ipverify.py @@ -0,0 +1,43 @@ +''' +Urpf Genie Conf Object Implementation for NXOS: + - IP verify source multi-line configuration implementation for NXOS - CLI +''' + +# Python +import warnings +from abc import ABC +from attr import attrib + +# Genie +from genie.conf.base.cli import CliConfigBuilder +from genie.conf.base.attributes import AttributesHelper + + +class IpVerify(ABC): + + def build_config(self, apply=True, attributes=None, unconfig=False, + **kwargs): + assert not kwargs, kwargs + attributes = AttributesHelper(self, attributes) + configurations = CliConfigBuilder(unconfig=unconfig) + + # ip verify unicast source reachable-via any + # ip verify unicast source reachable-via any allow-default + # ip verify unicast source reachable-via rx + + ip_str = 'ip verify unicast source reachable-via' + + if attributes.value('ip_verify_strict'): + ip_str += ' rx' + elif attributes.value('ip_verify_loose'): + ip_str += ' any' + if attributes.value('ip_loose_allow_default'): + ip_str += ' allow-default' + + configurations.append_line(attributes.format(ip_str)) + + return str(configurations) + + def build_unconfig(self, apply=True, attributes=None, **kwargs): + return self.build_config(apply=apply, attributes=attributes, + unconfig=True, **kwargs) \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/tests/test_urpf.py b/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/tests/test_urpf.py new file mode 100644 index 000000000..85c20d7d0 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/tests/test_urpf.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python + +# Python +import unittest +from unittest.mock import Mock + +# Genie package +from genie.tests.conf import TestCase +from genie.conf import Genie +from genie.conf.base import Testbed, Device, Link, Interface + +# Genie Conf +from genie.libs.conf.urpf import Urpf +from genie.libs.conf.urpf.ipverify import IpVerify +from genie.libs.conf.urpf.ipv6verify import Ipv6Verify + + +class test_urpf(TestCase): + + def test_urpf_strict_config(self): + + # For failures + self.maxDiff = None + + # Set testbed + Genie.testbed = testbed = Testbed() + dev1 = Device(testbed=testbed, name="PE1", os="nxos") + # Create Interface object + intf1 = Interface(name="Ethernet1/1", device=dev1) + + # Create urpf object + urpf = Urpf() + urpf.device_attr[dev1].enabled = True + + # add interface configuration to urpf + ip_verify1 = IpVerify(device=dev1) + ip_verify1.ip_verify_strict = True + urpf.device_attr[dev1].interface_attr[intf1].add_ip_urpf_key(ip_verify1) + + # add interface configuration to urpf + ipv6_verify1 = Ipv6Verify(device=dev1) + ipv6_verify1.ipv6_verify_strict = True + ipv6_verify1.ipv6_strict_allow_vnihosts = True + urpf.device_attr[dev1].interface_attr[intf1].add_ipv6_urpf_key(ipv6_verify1) + dev1.add_feature(urpf) + + # Build config + cfgs = urpf.build_config(apply=False) + # Check config strings built correctly + self.assertMultiLineEqual( + str(cfgs[dev1.name]), + "\n".join( + [ + "no system urpf disable", + "interface Ethernet1/1", + " ip verify unicast source reachable-via rx", + " ipv6 verify unicast source reachable-via rx allow vni-hosts", + " exit", + ] + ), + ) + + # Unconfig + urpf = urpf.build_unconfig(apply=False) + + # Check unconfig strings built correctly + self.assertMultiLineEqual( + str(urpf[dev1.name]), + "\n".join( + [ + "system urpf disable", + ] + ), + ) + + def test_urpf_loose_config(self): + + # For failures + self.maxDiff = None + + # Set testbed + Genie.testbed = testbed = Testbed() + dev1 = Device(testbed=testbed, name="PE1", os="nxos") + # Create Interface object + intf1 = Interface(name="Ethernet1/1", device=dev1) + + # Create urpf object + urpf = Urpf() + urpf.device_attr[dev1].enabled = True + + # add interface configuration to urpf + ip_verify1 = IpVerify(device=dev1) + ip_verify1.ip_verify_loose = True + urpf.device_attr[dev1].interface_attr[intf1].add_ip_urpf_key(ip_verify1) + + # add interface configuration to urpf + ipv6_verify1 = Ipv6Verify(device=dev1) + ipv6_verify1.ipv6_verify_loose = True + ipv6_verify1.ipv6_loose_allow_default = True + urpf.device_attr[dev1].interface_attr[intf1].add_ipv6_urpf_key(ipv6_verify1) + dev1.add_feature(urpf) + + # Build config + cfgs = urpf.build_config(apply=False) + # Check config strings built correctly + self.assertMultiLineEqual( + str(cfgs[dev1.name]), + "\n".join( + [ + "no system urpf disable", + "interface Ethernet1/1", + " ip verify unicast source reachable-via any", + " ipv6 verify unicast source reachable-via any allow-default", + " exit", + ] + ), + ) + partial_uncfg1 = urpf.build_unconfig( + apply=False, attributes={"device_attr": {"*": {"interface_attr": "*"}}} + ) + + self.assertMultiLineEqual( + str(partial_uncfg1[dev1.name]), + "\n".join( + [ + "interface Ethernet1/1", + " no ip verify unicast source reachable-via any", + " no ipv6 verify unicast source reachable-via any allow-default", + " exit", + ] + ), + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/urpf.py b/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/urpf.py new file mode 100644 index 000000000..a6ce35079 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/urpf/nxos/urpf.py @@ -0,0 +1,103 @@ +''' +Urpf Genie Conf Object Implementation for NXOS - CLI. +''' + +# Python +from abc import ABC + +# Genie +from genie.conf.base.attributes import AttributesHelper +from genie.conf.base.cli import CliConfigBuilder +from genie.conf.base.config import CliConfig + +# URPF Hierarchy +# -------------- +# URPf +# +- DeviceAttributes +# +- InterfaceAttributes + + +class Urpf(ABC): + + class DeviceAttributes(ABC): + + def build_config(self, apply=True, attributes=None, unconfig=False, + **kwargs): + assert not kwargs, kwargs + attributes = AttributesHelper(self, attributes) + configurations = CliConfigBuilder(unconfig=unconfig) + + # feature urpf + if attributes.value('enabled'): + if unconfig is False: + configurations.append_line( + attributes.format('no system urpf disable')) + + # Make sure that only enabled was provided in attributes + # If wildcard, then delete everything + elif unconfig is True and\ + attributes.attributes == {'enabled': {True: None}} or \ + attributes.iswildcard: + configurations.append_line('system urpf disable', raw=True) + if apply: + if configurations: + self.device.configure(configurations) + else: + return CliConfig(device=self.device, unconfig=unconfig, + cli_config=configurations) + + # +- DeviceAttributes + # +- InterfaceAttributes + for sub, attributes2 in attributes.mapping_values('interface_attr', + sort=True, + keys=self.interface_attr): + configurations.append_block( + sub.build_config(apply=False, + attributes=attributes2, + unconfig=unconfig)) + + if apply: + if configurations: + self.device.configure(configurations) + else: + return CliConfig(device=self.device, unconfig=unconfig, + cli_config=configurations) + + def build_unconfig(self, apply=True, attributes=None, **kwargs): + return self.build_config(apply=apply, attributes=attributes, + unconfig=True, **kwargs) + class InterfaceAttributes(ABC): + + def build_config(self, apply=True, attributes=None, unconfig=False, **kwargs): + assert not apply + attributes = AttributesHelper(self, attributes) + configurations = CliConfigBuilder(unconfig=unconfig) + + # interface Ethernet1/1 + with configurations.submode_context( + attributes.format('interface {interface_name}', force=True)): + + # ipverify attributes config + for ip_urpf_key, attributes2 in attributes.sequence_values('ip_urpf_keys', sort=True): + if unconfig: + configurations.append_block(ip_urpf_key.build_unconfig( + apply=False, attributes=attributes2, **kwargs)) + else: + configurations.append_block(ip_urpf_key.build_config( + apply=False, attributes=attributes2, **kwargs)) + + # ipv6verify attributes config + for ipv6_urpf_key, attributes2 in attributes.sequence_values('ipv6_urpf_keys', sort=True): + if unconfig: + configurations.append_block(ipv6_urpf_key.build_unconfig( + apply=False, attributes=attributes2, **kwargs)) + else: + configurations.append_block(ipv6_urpf_key.build_config( + apply=False, attributes=attributes2, **kwargs)) + + + return str(configurations) + + def build_unconfig(self, apply=True, attributes=None, **kwargs): + return self.build_config(apply=apply, attributes=attributes, + unconfig=True, **kwargs) \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/urpf/tests/nxos b/pkgs/conf-pkg/src/genie/libs/conf/urpf/tests/nxos new file mode 120000 index 000000000..a90d166ba --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/urpf/tests/nxos @@ -0,0 +1 @@ +../nxos/tests/ \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/urpf/urpf.py b/pkgs/conf-pkg/src/genie/libs/conf/urpf/urpf.py new file mode 100644 index 000000000..f67319671 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/urpf/urpf.py @@ -0,0 +1,156 @@ +__all__ = ("Urpf",) + +# genie +from genie.decorator import managedattribute +from genie.conf.base.base import DeviceFeature, InterfaceFeature +from genie.utils.cisco_collections import typedset + +# genie.libs +from genie.conf.base.attributes import ( + DeviceSubAttributes, + SubAttributesDict, + AttributesHelper, + InterfaceSubAttributes, +) + +# Multi-line config classes +from .ipverify import IpVerify +from .ipv6verify import Ipv6Verify + +# Structure Hierarchy: +# URPF +# +-- DeviceAttribute +# +--InterfaceAttribute + + +class Urpf(DeviceFeature, InterfaceFeature): + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + # ========================================================================== + # CONF CLASS STRUCTURE + # ========================================================================== + + # +- DeviceAttributes + class DeviceAttributes(DeviceSubAttributes): + + # +- DeviceAttributes + # +- InterfaceAttributes + class InterfaceAttributes(InterfaceSubAttributes): + def __init__(self, parent, key): + super().__init__(parent, key) + + # ip verify source multi-line configs + ip_urpf_keys = managedattribute( + name="ip_urpf_keys", + finit=typedset(managedattribute.test_isinstance(IpVerify)).copy, + type=typedset( + managedattribute.test_isinstance(IpVerify) + )._from_iterable, + doc="A `set` of ip verify source keys objects", + ) + + def add_ip_urpf_key(self, ip_urpf_key): + self.ip_urpf_keys.add(ip_urpf_key) + + def remove_ip_key(self, ip_urpf_key): + ip_urpf_key._device = None + try: + self.ip_urpf_keys.remove(ip_urpf_key) + except: + pass + + # ipv6 verify source multi-line configs + ipv6_urpf_keys = managedattribute( + name="ipv6_urpf_keys", + finit=typedset(managedattribute.test_isinstance(Ipv6Verify)).copy, + type=typedset( + managedattribute.test_isinstance(Ipv6Verify) + )._from_iterable, + doc="A `set` of ipv6 verify source keys objects", + ) + + def add_ipv6_urpf_key(self, ipv6_urpf_key): + self.ipv6_urpf_keys.add(ipv6_urpf_key) + + def remove_ip_key(self, ipv6_urpf_key): + ipv6_urpf_key._device = None + try: + self.ipv6_urpf_keys.remove(ipv6_urpf_key) + except: + pass + + interface_attr = managedattribute( + name="interface_attr", read_only=True, doc=InterfaceAttributes.__doc__ + ) + + @interface_attr.initter + def interface_attr(self): + return SubAttributesDict(self.InterfaceAttributes, parent=self) + + device_attr = managedattribute( + name="device_attr", read_only=True, doc=DeviceAttributes.__doc__ + ) + + @device_attr.initter + def device_attr(self): + return SubAttributesDict(self.DeviceAttributes, parent=self) + + # ========================================================================== + # MANAGED ATTRIBUTES + # ========================================================================== + + # enabled + enabled = managedattribute( + name="enabled", default=None, type=(None, managedattribute.test_istype(bool)) + ) + + # ========================================================================== + # +- DeviceAttributes + # +- InterfaceAttributes + # ========================================================================== + + # if_name - Attribute key + + # ========================================================================== + # BUILD_CONFIG & BUILD_UNCONFIG + # ========================================================================== + + def build_config(self, devices=None, apply=True, attributes=None, **kwargs): + cfgs = {} + assert not kwargs, kwargs + attributes = AttributesHelper(self, attributes) + + if devices is None: + devices = self.devices + devices = set(devices) + + for key, sub, attributes2 in attributes.mapping_items( + "device_attr", keys=devices, sort=True + ): + cfgs[key] = sub.build_config(apply=False, attributes=attributes2) + + if apply: + self.testbed.config_on_devices(cfgs, fail_invalid=True) + else: + return cfgs + + def build_unconfig(self, devices=None, apply=True, attributes=None, **kwargs): + cfgs = {} + assert not kwargs, kwargs + attributes = AttributesHelper(self, attributes) + + if devices is None: + devices = self.devices + devices = set(devices) + + for key, sub, attributes2 in attributes.mapping_items( + "device_attr", keys=devices, sort=True + ): + cfgs[key] = sub.build_unconfig(apply=False, attributes=attributes2) + + if apply: + self.testbed.config_on_devices(cfgs, fail_invalid=True) + else: + return cfgs diff --git a/pkgs/conf-pkg/src/genie/libs/conf/vpc/nxos/tests/test_vpc.py b/pkgs/conf-pkg/src/genie/libs/conf/vpc/nxos/tests/test_vpc.py index 9d2935006..7a1af170a 100755 --- a/pkgs/conf-pkg/src/genie/libs/conf/vpc/nxos/tests/test_vpc.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/vpc/nxos/tests/test_vpc.py @@ -7,7 +7,7 @@ # Genie from genie.tests.conf import TestCase from genie.conf import Genie -from genie.conf.base import Testbed, Device +from genie.conf.base import Testbed, Device, Interface from genie.conf.base.attributes import UnsupportedAttributeWarning # Vpc @@ -25,6 +25,11 @@ def setUp(self): # Device self.dev = Device(name='node01', testbed=testbed, os='nxos') + # Interfaces + self.intf1 = Interface(name='Ethernet1/1',device=self.dev) + self.intf2 = Interface(name='Ethernet1/2',device=self.dev) + self.intf3 = Interface(name='port-channel1',device=self.dev) + # Vpc object self.vpc = Vpc() self.dev.add_feature(self.vpc) @@ -58,15 +63,19 @@ def test_vpc_config(self): self.vpc.device_attr[self.dev].domain_attr[100].system_mac = '2.2.2' self.vpc.device_attr[self.dev].domain_attr[100].system_priority = 601 self.vpc.device_attr[self.dev].domain_attr[100].track = 201 - self.vpc.device_attr[self.dev].domain_attr[100].virtual_peer_link_ip = '2.2.2.2' + self.vpc.device_attr[self.dev].domain_attr[100].virtual_peer_link_dst_ip = '2.2.2.2' + self.vpc.device_attr[self.dev].domain_attr[100].virtual_peer_link_src_ip = '2.2.2.1' + self.vpc.device_attr[self.dev].domain_attr[100].virtual_peer_link_dscp = 56 self.vpc.device_attr[self.dev].domain_attr[100].keepalive_dst_ip = '10.1.1.1' self.vpc.device_attr[self.dev].domain_attr[100].keepalive_src_ip = '10.2.2.2' self.vpc.device_attr[self.dev].domain_attr[100].keepalive_vrf = 'default' self.vpc.device_attr[self.dev].domain_attr[100].keepalive_udp_port = 2000 + self.vpc.device_attr[self.dev].interface_attr[self.intf1.name].fabric_port = True + self.vpc.device_attr[self.dev].interface_attr[self.intf2.name].peer_link = True + self.vpc.device_attr[self.dev].interface_attr[self.intf3.name].vpc_id = "11" # Build vpc configuration cfgs = self.vpc.build_config(apply=False) - # Check config built correctly self.assertMultiLineEqual( str(cfgs[self.dev.name]), @@ -95,8 +104,17 @@ def test_vpc_config(self): ' system-mac 2.2.2', ' system-priority 601', ' track 201', - ' virtual peer-link destination 2.2.2.2', + ' virtual peer-link destination 2.2.2.2 source 2.2.2.1 dscp 56', ' peer-keepalive destination 10.1.1.1 source 10.2.2.2 vrf default udp-port 2000 ', + ' exit', + 'interface Ethernet1/1', + ' port-type fabric', + ' exit', + 'interface Ethernet1/2', + ' vpc peer-link', + ' exit', + 'interface port-channel1', + ' vpc 11', ' exit' ])) diff --git a/pkgs/conf-pkg/src/genie/libs/conf/vpc/nxos/vpc.py b/pkgs/conf-pkg/src/genie/libs/conf/vpc/nxos/vpc.py index db3cf0c69..c04939df2 100644 --- a/pkgs/conf-pkg/src/genie/libs/conf/vpc/nxos/vpc.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/vpc/nxos/vpc.py @@ -53,6 +53,14 @@ def build_config(self, apply=True, attributes=None, unconfig=False, sub.build_config(apply=False, attributes=attributes2, unconfig=unconfig)) + + # InterfaceAttribute + for sub, attributes2 in attributes.mapping_values('interface_attr', + sort=True, keys=self.interface_attr): + configurations.append_block( + sub.build_config(apply=False, + attributes=attributes2, + unconfig=unconfig)) if apply: if configurations: self.device.configure(configurations) @@ -185,10 +193,18 @@ def build_config(self, apply=True, attributes=None, unconfig=False, configurations.append_line( attributes.format('track {track}')) - # nxos: virtual peer-link destination - if attributes.value('virtual_peer_link_ip'): + # nxos: virtual peer-link attributes + if attributes.value('virtual_peer_link_dst_ip'): + virtual_peer_link_cfg = 'virtual peer-link destination {virtual_peer_link_dst_ip} ' + + if attributes.value('virtual_peer_link_src_ip'): + virtual_peer_link_cfg += 'source {virtual_peer_link_src_ip} ' + + if attributes.value('virtual_peer_link_dscp'): + virtual_peer_link_cfg += 'dscp {virtual_peer_link_dscp}' + configurations.append_line( - attributes.format('virtual peer-link destination {virtual_peer_link_ip}')) + attributes.format(virtual_peer_link_cfg)) # nxos: keepalive attributes if attributes.value('keepalive_dst_ip'): @@ -225,3 +241,29 @@ def build_config(self, apply=True, attributes=None, unconfig=False, def build_unconfig(self, apply=True, attributes=None, **kwargs): return self.build_config(apply=apply, attributes=attributes, unconfig=True, **kwargs) + + class InterfaceAttributes(ABC): + + def build_config(self, apply=True, attributes=None, unconfig=False, + **kwargs): + assert not kwargs, kwargs + attributes = AttributesHelper(self, attributes) + configurations = CliConfigBuilder(unconfig=unconfig) + with configurations.submode_context(attributes.format( + 'interface {interface_name}', force=True)): + if unconfig and attributes.iswildcard: + configurations.submode_unconfig() + + if attributes.value('peer_link'): + configurations.append_line('vpc peer-link', unconfig_cmd='no vpc peer-link') + if attributes.value('fabric_port'): + configurations.append_line('port-type fabric', unconfig_cmd='no port-type fabric') + if attributes.value('vpc_id'): + configurations.append_line(attributes.format( + 'vpc {vpc_id}'), unconfig_cmd=attributes.format( + 'no vpc {vpc_id}')) + return str(configurations) + + def build_unconfig(self, apply=True, attributes=None, **kwargs): + return self.build_config(apply=apply, attributes=attributes, unconfig=True, **kwargs) + \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/vpc/vpc.py b/pkgs/conf-pkg/src/genie/libs/conf/vpc/vpc.py index 9a3774915..7f9d77199 100644 --- a/pkgs/conf-pkg/src/genie/libs/conf/vpc/vpc.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/vpc/vpc.py @@ -10,13 +10,14 @@ from genie.conf.base.attributes import DeviceSubAttributes, \ SubAttributesDict,\ AttributesHelper, \ - KeyedSubAttributes + KeyedSubAttributes, \ + InterfaceSubAttributes # Structure Hierarchy: # Vpc # +-- DeviceAttribute # +--DomainAttribute - +# +--InterfaceAttribute class Vpc(DeviceFeature): @@ -188,13 +189,27 @@ class Vpc(DeviceFeature): type=(None, managedattribute.test_istype(int)), doc="Tracked object value.") - # virtual_peer_link_ip - virtual_peer_link_ip = managedattribute( - name='virtual_peer_link_ip', + # virtual_peer_link_dst_ip + virtual_peer_link_dst_ip = managedattribute( + name='virtual_peer_link_dst_ip', default=None, type=(None, managedattribute.test_istype(str)), doc="Virtual peer-link destination ip.") + # virtual_peer_link_src_ip + virtual_peer_link_src_ip = managedattribute( + name='virtual_peer_link_src_ip', + default=None, + type=(None, managedattribute.test_istype(str)), + doc="Virtual peer-link source ip.") + + # virtual_peer_link_dscp + virtual_peer_link_dscp = managedattribute( + name='virtual_peer_link_dscp', + default=None, + type=(None, managedattribute.test_istype(int)), + doc="DSCP value for vpc Fabric ports") + # keepalive_dst_ip keepalive_dst_ip = managedattribute( name='keepalive_dst_ip', @@ -258,6 +273,27 @@ class Vpc(DeviceFeature): type=(None, managedattribute.test_istype(str)), doc="Precedence Value.") + # vpc peer-link on interface + peer_link = managedattribute( + name='peer_link', + default=None, + type=(None, managedattribute.test_istype(bool)), + doc="Specifies if the interface is peer-link.") + + # vpc id on interface + vpc_id = managedattribute( + name='vpc_id', + default=None, + type=(None, managedattribute.test_istype(str)), + doc="Specifies the vpc id the interface belongs to.") + + # port type fabric on interface, for Fabric peering + fabric_port = managedattribute( + name='fabric_port', + default=None, + type=(None, managedattribute.test_istype(bool)), + doc="Specifies if the interface connects to Fabric.") + class DeviceAttributes(DeviceSubAttributes): class DomainAttributes(KeyedSubAttributes): @@ -274,7 +310,21 @@ def __init__(self, parent, key): def domain_attr(self): return SubAttributesDict( self.DomainAttributes, parent=self) + + class InterfaceAttributes(InterfaceSubAttributes): + + def __init__(self, parent, key): + super().__init__(parent=parent, key=key) + + interface_attr = managedattribute( + name='interface_attr', + read_only=True, + doc=InterfaceAttributes.__doc__) + @interface_attr.initter + def interface_attr(self): + return SubAttributesDict(self.InterfaceAttributes, parent=self) + device_attr = managedattribute( name='device_attr', read_only=True, @@ -316,3 +366,5 @@ def build_unconfig(self, devices=None, apply=True, attributes=None): self.testbed.config_on_devices(cfg, fail_invalid=True) else: return cfgs + + diff --git a/pkgs/filetransferutils-pkg/changelog/2024/july.rst b/pkgs/filetransferutils-pkg/changelog/2024/july.rst new file mode 100644 index 000000000..00c708e81 --- /dev/null +++ b/pkgs/filetransferutils-pkg/changelog/2024/july.rst @@ -0,0 +1,9 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- + +* fileutils + * Modified FileUtils + * Updated logic to use hostname if not able to resolve to IP address + + diff --git a/pkgs/filetransferutils-pkg/setup.py b/pkgs/filetransferutils-pkg/setup.py index d0da6b431..1d3aa299d 100644 --- a/pkgs/filetransferutils-pkg/setup.py +++ b/pkgs/filetransferutils-pkg/setup.py @@ -8,7 +8,7 @@ import re import os -from setuptools import setup, find_packages, Command +from setuptools import setup, find_packages, Command, find_namespace_packages def read(*paths): '''read and return txt content of file''' @@ -89,11 +89,8 @@ def find_version(*paths): # project keywords keywords = 'genie pyats test automation', - # uses namespace package - namespace_packages = ['genie', 'genie.libs'], - # project packages - packages = find_packages(where = 'src'), + packages = find_namespace_packages(where = 'src'), # project directory package_dir = { diff --git a/pkgs/filetransferutils-pkg/src/genie/__init__.py b/pkgs/filetransferutils-pkg/src/genie/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/pkgs/filetransferutils-pkg/src/genie/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/pkgs/filetransferutils-pkg/src/genie/libs/__init__.py b/pkgs/filetransferutils-pkg/src/genie/libs/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/pkgs/filetransferutils-pkg/src/genie/libs/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py index fb842de8f..0397394d7 100644 --- a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py +++ b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py @@ -9,7 +9,7 @@ ''' -__version__ = '24.6' +__version__ = '24.7' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/fileutils.py b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/fileutils.py index 9884b4166..e881d0c5a 100644 --- a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/fileutils.py +++ b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/fileutils.py @@ -415,8 +415,9 @@ def get_server(self, source, destination=None): # only include address, no port or credentials used_server = str(ipaddress.ip_address(parsed.hostname)) break - except: - continue + except Exception: + if parsed.hostname: + used_server = parsed.hostname if not used_server: # If both URLS have no valid IP addres, raise an exception diff --git a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/tests/iosxe/test_filetransferutils.py b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/tests/iosxe/test_filetransferutils.py index 0c94a292d..3404aaa7d 100644 --- a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/tests/iosxe/test_filetransferutils.py +++ b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/tests/iosxe/test_filetransferutils.py @@ -144,6 +144,14 @@ class test_filetransferutils(unittest.TestCase): 1269880464 bytes copied in 103.256 secs (12298370 bytes/sec) ''' + raw10 = ''' + copy flash:/memleak.tcl ftp://foo@bar//auto/tftp-ssr/memleak.tcl + Address or name of remote host [bar]? + Destination filename [/auto/tftp-ssr/memleak.tcl]? + !! + 104260 bytes copied in 0.396 secs (263283 bytes/sec) + ''' + outputs = {} outputs['copy flash:/memleak.tcl ' 'ftp://myuser:mypw@1.1.1.1//auto/tftp-ssr/memleak.tcl']\ @@ -160,6 +168,8 @@ class test_filetransferutils(unittest.TestCase): raw8 outputs['copy tftp://172.19.1.250//auto/tftp-kmukku/9300m-tb2/meraki1.bin flash:/meraki1.bin'] = \ raw9 + outputs['copy flash:/memleak.tcl ftp://foo@bar//auto/tftp-ssr/memleak.tcl'] = \ + raw10 def mapper(self, key, timeout=None, reply= None, prompt_recovery=False, error_pattern=None): return self.outputs[key] @@ -174,6 +184,24 @@ def test_copyfile(self): destination='ftp://1.1.1.1//auto/tftp-ssr/memleak.tcl', timeout_seconds='300', device=self.device) + self.device.execute.assert_called_once_with( + 'copy flash:/memleak.tcl ftp://myuser:mypw@1.1.1.1//auto/tftp-ssr/memleak.tcl', + prompt_recovery=True, timeout='300', reply=ANY, error_pattern=ANY) + + def test_copyfile_with_hostname(self): + + self.device.execute = Mock() + self.device.execute.side_effect = self.mapper + + # Call copyfiles + self.fu_device.copyfile(source='flash:/memleak.tcl', + destination='ftp://foo@bar//auto/tftp-ssr/memleak.tcl', + timeout_seconds='300', device=self.device) + + self.device.execute.assert_called_once_with( + 'copy flash:/memleak.tcl ftp://foo@bar//auto/tftp-ssr/memleak.tcl', + prompt_recovery=True, timeout='300', reply=ANY, error_pattern=ANY) + def test_dir(self): self.device.execute = Mock() diff --git a/pkgs/health-pkg/changelog/2024/july.rst b/pkgs/health-pkg/changelog/2024/july.rst new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/health-pkg/setup.py b/pkgs/health-pkg/setup.py index 233e055da..a8f0292b3 100644 --- a/pkgs/health-pkg/setup.py +++ b/pkgs/health-pkg/setup.py @@ -8,7 +8,7 @@ import re import os -from setuptools import setup, find_packages +from setuptools import setup, find_packages, find_namespace_packages def read(*paths): @@ -74,17 +74,14 @@ def find_version(*paths): # project keywords keywords='genie health pyats cisco', - # uses namespace package - namespace_packages=['genie', 'genie.libs'], - - # project packages - packages=find_packages(where='src'), - # project directory package_dir={ '': 'src', }, + # project packages + packages=find_namespace_packages(where='src'), + # additional package data files that goes into the package itself package_data={ '': ['health_yamls/*.yaml', diff --git a/pkgs/health-pkg/src/genie/__init__.py b/pkgs/health-pkg/src/genie/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/pkgs/health-pkg/src/genie/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/pkgs/health-pkg/src/genie/libs/__init__.py b/pkgs/health-pkg/src/genie/libs/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/pkgs/health-pkg/src/genie/libs/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/pkgs/health-pkg/src/genie/libs/health/__init__.py b/pkgs/health-pkg/src/genie/libs/health/__init__.py index 6d9d3329b..f95a053dc 100644 --- a/pkgs/health-pkg/src/genie/libs/health/__init__.py +++ b/pkgs/health-pkg/src/genie/libs/health/__init__.py @@ -8,7 +8,7 @@ ''' # metadata -__version__ = '24.6' +__version__ = '24.7' __author__ = 'Cisco Systems Inc.' __contact__ = ['asg-genie-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2020, Cisco Systems Inc.' diff --git a/pkgs/ops-pkg/changelog/2024/july.rst b/pkgs/ops-pkg/changelog/2024/july.rst new file mode 100644 index 000000000..41b364df8 --- /dev/null +++ b/pkgs/ops-pkg/changelog/2024/july.rst @@ -0,0 +1,11 @@ +-------------------------------------------------------------------------------- + New +-------------------------------------------------------------------------------- + +* sonic + * platform + * Added ops support for sonic platforms + * interface + * Added ops support for sonic interface + + diff --git a/pkgs/ops-pkg/ops_generator/output/github_ops.json b/pkgs/ops-pkg/ops_generator/output/github_ops.json index ecee1df55..824da5de8 100644 --- a/pkgs/ops-pkg/ops_generator/output/github_ops.json +++ b/pkgs/ops-pkg/ops_generator/output/github_ops.json @@ -587,6 +587,17 @@ }, "uid": "interface", "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/ops-pkg/src/genie/libs/ops/interface/nxos/interface.py#L17" + }, + "sonic": { + "class": "Interface", + "doc": "Interface Genie Ops Object", + "module_name": "interface.sonic.interface", + "package": "genie.libs.ops", + "tokens": { + "os": "sonic" + }, + "uid": "interface", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/ops-pkg/src/genie/libs/ops/interface/sonic/interface.py#L9" } }, "module_name": "interface.interface", @@ -1324,6 +1335,17 @@ }, "uid": "platform", "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/ops-pkg/src/genie/libs/ops/platform/nxos/platform.py#L13" + }, + "sonic": { + "class": "Platform", + "doc": "Platform Ops Object", + "module_name": "platform.sonic.platform", + "package": "genie.libs.ops", + "tokens": { + "os": "sonic" + }, + "uid": "platform", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/ops-pkg/src/genie/libs/ops/platform/sonic/platform.py#L7" } }, "module_name": "platform.platform", @@ -1687,7 +1709,8 @@ "iosxe", "iosxr", "junos", - "nxos" + "nxos", + "sonic" ], "platform": [ "ap", diff --git a/pkgs/ops-pkg/setup.py b/pkgs/ops-pkg/setup.py index c51c47406..f3028378d 100755 --- a/pkgs/ops-pkg/setup.py +++ b/pkgs/ops-pkg/setup.py @@ -10,7 +10,7 @@ import re import sys -from setuptools import setup, find_packages +from setuptools import setup, find_packages, find_namespace_packages def read(*paths): '''read and return txt content of file''' @@ -98,11 +98,8 @@ def version_info(*paths): # project keywords keywords = 'genie pyats test automation', - # uses namespace package - namespace_packages = ['genie', 'genie.libs'], - # project packages - packages = find_packages(where = 'src'), + packages = find_namespace_packages(where = 'src'), # project directory package_dir = { diff --git a/pkgs/ops-pkg/src/genie/__init__.py b/pkgs/ops-pkg/src/genie/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/pkgs/ops-pkg/src/genie/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/pkgs/ops-pkg/src/genie/libs/__init__.py b/pkgs/ops-pkg/src/genie/libs/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/pkgs/ops-pkg/src/genie/libs/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/pkgs/ops-pkg/src/genie/libs/ops/__init__.py b/pkgs/ops-pkg/src/genie/libs/ops/__init__.py index c64d9083d..b387077cf 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/__init__.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/__init__.py @@ -7,7 +7,7 @@ ''' # metadata -__version__ = '24.6' +__version__ = '24.7' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/ops-pkg/src/genie/libs/ops/bgp/iosxe/tests/test_bgp.py b/pkgs/ops-pkg/src/genie/libs/ops/bgp/iosxe/tests/test_bgp.py index 0341c1360..8f50b77b0 100755 --- a/pkgs/ops-pkg/src/genie/libs/ops/bgp/iosxe/tests/test_bgp.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/bgp/iosxe/tests/test_bgp.py @@ -14,14 +14,16 @@ ShowBgpAllNeighborsAdvertisedRoutes, \ ShowBgpAllNeighborsReceivedRoutes, \ ShowBgpAllNeighborsRoutes, \ - ShowIpBgpTemplatePeerPolicy, \ ShowBgpAllNeighbors, \ - ShowIpBgpAllDampeningParameters, \ - ShowIpBgpTemplatePeerSession, \ ShowBgpAllNeighborsPolicy, \ ShowBgpAllDetail, \ ShowBgpAll +from genie.libs.parser.iosxe.show_ip_bgp import \ + ShowIpBgpTemplatePeerPolicy, \ + ShowIpBgpAllDampeningParameters, \ + ShowIpBgpTemplatePeerSession + outputs = {} outputs['show bgp all summary'] = BgpOutput.show_bgp_all_summary diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/sonic/__init__.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/sonic/__init__.py new file mode 100644 index 000000000..d828c9c15 --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/sonic/__init__.py @@ -0,0 +1,6 @@ +try: + from genie import abstract + abstract.declare_token(os='sonic') +except Exception as e: + import warnings + warnings.warn('Could not declare abstraction token: ' + str(e)) diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/sonic/interface.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/sonic/interface.py new file mode 100644 index 000000000..452129308 --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/sonic/interface.py @@ -0,0 +1,37 @@ +''' +Interface Genie Ops Object for Sonic. +''' + +# super class +from genie.libs.ops.interface.interface import Interface as SuperInterface + + +class Interface(SuperInterface): + '''Interface Genie Ops Object''' + + def learn(self, custom=None, interface=None, vrf=None, address_family=None): + '''Learn Interface Ops''' + ######################################################################## + # info + ######################################################################## + # Global source + + src = '[(?P.*)]' + dest = 'info[interface][(?P.*)]' + wired_key_map = { + 'identifier': 'description', + 'oper_status': 'oper_status', + } + + # show interfaces transceiver eeprom + for src_key, dest_key in wired_key_map.items(): + self.add_leaf(cmd=f'show interfaces transceiver eeprom', + src=src + f'[{src_key}]', + dest=dest + f'[{dest_key}]',) + + # type + self.add_leaf(cmd='show interfaces transceiver eeprom', + src=src + '[application_advertisment][cable_type]', + dest=dest + '[type]') + + self.make(final_call=True) diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/sonic/tests/interface_output.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/sonic/tests/interface_output.py new file mode 100644 index 000000000..bfb60c3ef --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/sonic/tests/interface_output.py @@ -0,0 +1,87 @@ + +class InterfaceOutput(object): + + # ========================================================================== + # Sonic + # ========================================================================== + + show_interfaces_transceiver_eeprom = { + "Ethernet0": { + "application_advertisment": { + "application_type": "400G CR8", + "cable_type": "Copper", + "host_assign": "0x1", + "media_assign": "Unknown" + }, + "cable_length": 2.0, + "compliance": { + "passive_copper_media_interface": { + "specification": "passive_copper_media_interface" + } + }, + "connector": "No separable connector", + "encoding": "N/A", + "extended_identifier": "Power Class 1 (1.5W Max)", + "extended_rate_compliance": "N/A", + "identifier": "QSFP-DD Double Density 8X Pluggable Transceiver", + "input_rate_mps":0, + "oper_status": "detected", + "vendor": { + "date": "2020-05-06", + "lot": "00", + "name": "CISCO-LEONI", + "oui": "a8-b0-ae", + "pn": "L45593-K218-C20", + "rev": "LCC2419G92W-B" + } + }, + "Ethernet104": { + "application_advertisment": { + "application_type": "400G CR8", + "cable_type": "Copper", + "host_assign": "0x1", + "media_assign": "Unknown" + }, + "cable_length": 2.0, + "compliance": { + "passive_copper_media_interface": { + "specification": "passive_copper_media_interface" + } + }, + "connector": "No separable connector", + "encoding": "N/A", + "extended_identifier": "Power Class 1 (1.5W Max)", + "extended_rate_compliance": "N/A", + "identifier": "QSFP-DD Double Density 8X Pluggable Transceiver", + "input_rate_mps":0, + "oper_status": "detected", + "vendor": { + "date": "2020-05-06", + "lot": "00", + "name": "CISCO-LEONI", + "oui": "a8-b0-ae", + "pn": "L45593-K218-C20", + "rev": "LCC2419G8XL-B" + } + }, + } + + + showinterface_ops_output = { + "interface": { + "Ethernet104": { + "description": "QSFP-DD Double Density 8X Pluggable Transceiver", + "oper_status": "detected", + "type": "Copper", + }, + "Ethernet0": { + "description": "QSFP-DD Double Density 8X Pluggable Transceiver", + "oper_status": "detected", + "type": "Copper", + }, + } + } + + + + diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/sonic/tests/test_interface.py b/pkgs/ops-pkg/src/genie/libs/ops/interface/sonic/tests/test_interface.py new file mode 100644 index 000000000..b4391ed3f --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/sonic/tests/test_interface.py @@ -0,0 +1,51 @@ +# Python +import unittest + +# Ats +from pyats.topology import Device +from unittest.mock import Mock + +# Genie +from genie.libs.ops.interface.sonic.interface import Interface +from genie.libs.ops.interface.sonic.tests.interface_output import InterfaceOutput +from genie.libs.parser.sonic.show_interface import ShowInterfacesTransceiverEeprom + +class test_platform_all(unittest.TestCase): + + def setUp(self): + self.device = Device(name='aDevice', os='sonic') + self.device.custom.setdefault("abstraction", {})["order"] = ["os", "platform"] + self.device.mapping = {'cli': 'cli'} + mock_connection = Mock() + mock_connection.device = self.device + self.device.connectionmgr.connections['cli'] = mock_connection + + def test_complete_output(self): + self.maxDiff = None + f = Interface(device=self.device) + + # Get outputs + f.maker.outputs[ShowInterfacesTransceiverEeprom] = \ + {'':InterfaceOutput.show_interfaces_transceiver_eeprom} + + # Learn the feature + f.learn() + + # Verify Ops was created successfully + self.assertEqual(f.info, InterfaceOutput.showinterface_ops_output) + + def test_empty_parser_output(self): + self.maxDiff = None + f = Interface(device=self.device) + + # Get outputs + f.maker.outputs[ShowInterfacesTransceiverEeprom] = {"": {}} + + # Learn the feature + f.learn() + + # Check info was not created + self.assertFalse(hasattr(f, 'info')) + +if __name__ == '__main__': + unittest.main() diff --git a/pkgs/ops-pkg/src/genie/libs/ops/interface/tests/sonic b/pkgs/ops-pkg/src/genie/libs/ops/interface/tests/sonic new file mode 120000 index 000000000..f7d7c9789 --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/interface/tests/sonic @@ -0,0 +1 @@ +../sonic/tests/ \ No newline at end of file diff --git a/pkgs/ops-pkg/src/genie/libs/ops/lisp/iosxe/tests/test_lisp.py b/pkgs/ops-pkg/src/genie/libs/ops/lisp/iosxe/tests/test_lisp.py index 3742e50da..99a48d14c 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/lisp/iosxe/tests/test_lisp.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/lisp/iosxe/tests/test_lisp.py @@ -11,11 +11,14 @@ from genie.libs.ops.lisp.iosxe.tests.lisp_output import LispOutput # iosxe show_lisp -from genie.libs.parser.iosxe.show_lisp import ShowLispSession,\ - ShowLispPlatform,\ - ShowLispExtranet,\ - ShowLispDynamicEidDetail,\ - ShowLispService,\ +from genie.libs.parser.iosxe.show_lisp import ShowLispExtranet + + +from genie.libs.parser.iosxe.show_lisp_session import ShowLispSession +from genie.libs.parser.iosxe.show_lisp_platform import ShowLispPlatform +from genie.libs.parser.iosxe.show_lisp_dynamic import ShowLispDynamicEidDetail + +from genie.libs.parser.iosxe.show_lisp_service import ShowLispService,\ ShowLispServiceMapCache,\ ShowLispServiceRlocMembers,\ ShowLispServiceSmr,\ diff --git a/pkgs/ops-pkg/src/genie/libs/ops/ospf/iosxe/tests/test_ospf.py b/pkgs/ops-pkg/src/genie/libs/ops/ospf/iosxe/tests/test_ospf.py index e24cc19f5..f0fd99759 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/ospf/iosxe/tests/test_ospf.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/ospf/iosxe/tests/test_ospf.py @@ -16,13 +16,15 @@ ShowIpOspfNeighborDetail,\ ShowIpOspfShamLinks,\ ShowIpOspfVirtualLinks,\ + ShowIpOspfMplsLdpInterface,\ + ShowIpOspfMplsTrafficEngLink + +from genie.libs.parser.iosxe.show_ospf_database import \ ShowIpOspfDatabaseRouter,\ ShowIpOspfDatabaseExternal,\ ShowIpOspfDatabaseNetwork,\ ShowIpOspfDatabaseSummary,\ - ShowIpOspfDatabaseOpaqueArea,\ - ShowIpOspfMplsLdpInterface,\ - ShowIpOspfMplsTrafficEngLink + ShowIpOspfDatabaseOpaqueArea # iosxe show_ospf from genie.libs.parser.iosxe.show_protocols import ShowIpProtocols diff --git a/pkgs/ops-pkg/src/genie/libs/ops/platform/sonic/__init__.py b/pkgs/ops-pkg/src/genie/libs/ops/platform/sonic/__init__.py new file mode 100644 index 000000000..d828c9c15 --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/platform/sonic/__init__.py @@ -0,0 +1,6 @@ +try: + from genie import abstract + abstract.declare_token(os='sonic') +except Exception as e: + import warnings + warnings.warn('Could not declare abstraction token: ' + str(e)) diff --git a/pkgs/ops-pkg/src/genie/libs/ops/platform/sonic/platform.py b/pkgs/ops-pkg/src/genie/libs/ops/platform/sonic/platform.py new file mode 100644 index 000000000..300bcc8d6 --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/platform/sonic/platform.py @@ -0,0 +1,51 @@ +''' +Genie Ops Object for sonic. +''' +# super class +from genie.libs.ops.platform.platform import Platform as SuperPlatform + +class Platform(SuperPlatform): + '''Platform Ops Object''' + + def learn(self): + '''Learn Platform object''' + + # Place holder to make it more readable + src_ver = '' + + # === DeviceAttributes === + + # os + self.add_leaf(cmd='show version', + src=src_ver + '[sonic_os_version]', + dest='os') + + # version + self.add_leaf(cmd='show version', + src=src_ver + '[sonic_software_version]', + dest='version') + + # chassis + self.add_leaf(cmd='show platform inventory', + src='[chassis][(?P.*)][product_id]', + dest='chassis') + + # chassis_sn + self.add_leaf(cmd='show platform inventory', + src='[chassis][(?P.*)][serial_num]', + dest='chassis_sn') + + # slot section + # rp name + self.add_leaf(cmd='show platform inventory', + src='[rp][(?P.*)][name]', + dest='[slot][rp][(?P.*)][name]') + + # rp serial_num + self.add_leaf(cmd='show platform inventory', + src='[rp][(?P.*)][serial_num]', + dest='[slot][rp][(?P.*)][sn]') + + self.make(final_call=True) + + \ No newline at end of file diff --git a/pkgs/ops-pkg/src/genie/libs/ops/platform/sonic/tests/platform_output.py b/pkgs/ops-pkg/src/genie/libs/ops/platform/sonic/tests/platform_output.py new file mode 100644 index 000000000..5d08d0a15 --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/platform/sonic/tests/platform_output.py @@ -0,0 +1,50 @@ + +class PlatformOutput(object): + + # ========================================================================== + # Sonic + # ========================================================================== + + showVersion = { + 'sonic_os_version': 11, + 'sonic_software_version': 'SONiC.azure_cisco_tortuga_202305.10234-dirty-20240326.030556', + } + + showVersion_ops_output = { + 'os': 11, + 'version': 'SONiC.azure_cisco_tortuga_202305.10234-dirty-20240326.030556', + } + + showPlatformInventory = { + "chassis": { + "CHASSIS": { + "description": "Cisco 8100 32x400G QSFPDD 1RU Fixed System w/o HBM, Open SW", + "name": "CHASSIS", + "product_id": "8101-32FH-O", + "serial_num": "FLM25320591", + "version": "0.41", + } + }, + "rp": { + "RP0": { + "description": "Cisco 8100 32x400G QSFPDD 1RU Fixed System w/o HBM, Open SW", + "name": "RP0", + "product_id": "8101-32FH-O", + "serial_num": "FLM2528059A", + "version": "0.41", + } + }, + } + + showPlatformInventory_ops_output = { + "chassis": "8101-32FH-O", + "chassis_sn": "FLM25320591", + "slot": { + "rp": { + "RP0": { + "name": "RP0", + "sn": "FLM2528059A" + } + } + }, + } diff --git a/pkgs/ops-pkg/src/genie/libs/ops/platform/sonic/tests/test_platform.py b/pkgs/ops-pkg/src/genie/libs/ops/platform/sonic/tests/test_platform.py new file mode 100644 index 000000000..cbcd73182 --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/platform/sonic/tests/test_platform.py @@ -0,0 +1,61 @@ +# Python +import unittest + +# Ats +from pyats.topology import Device +from unittest.mock import Mock + +# Genie Xbu_shared +from genie.libs.ops.platform.sonic.platform import Platform +from genie.libs.ops.platform.sonic.tests.platform_output import PlatformOutput +from genie.libs.parser.sonic.show_version import ShowVersion +from genie.libs.parser.sonic.show_platform import ShowPlatformInventory + + +class test_platform_all(unittest.TestCase): + + def setUp(self): + self.device = Device(name='aDevice', os='sonic') + self.device.custom.setdefault("abstraction", {})["order"] = ["os", "platform"] + self.device.mapping = {'cli': 'cli'} + mock_connection = Mock() + mock_connection.device = self.device + self.device.connectionmgr.connections['cli'] = mock_connection + + def test_complete_output(self): + self.maxDiff = None + f = Platform(device=self.device) + + # Get outputs + f.maker.outputs[ShowVersion] = \ + {'':PlatformOutput.showVersion} + + f.maker.outputs[ShowPlatformInventory] = \ + {'':PlatformOutput.showPlatformInventory} + + # Learn the feature + f.learn() + + # # Verify Ops was created successfully + self.assertEqual(f.os, PlatformOutput.showVersion_ops_output['os']) + self.assertEqual(f.version, PlatformOutput.showVersion_ops_output['version']) + self.assertEqual(f.chassis_sn, PlatformOutput.showPlatformInventory_ops_output['chassis_sn']) + self.assertEqual(f.chassis, PlatformOutput.showPlatformInventory_ops_output['chassis']) + self.assertEqual(f.slot, PlatformOutput.showPlatformInventory_ops_output['slot']) + + def test_empty_parser_output(self): + + self.maxDiff = None + f = Platform(device=self.device) + + # Get outputs + f.maker.outputs[ShowVersion] = {"": {}} + f.maker.outputs[ShowPlatformInventory] = {"": {}} + + # Learn the feature + f.learn() + # Check info was not created + self.assertFalse(hasattr(f, 'version')) + +if __name__ == '__main__': + unittest.main() diff --git a/pkgs/ops-pkg/src/genie/libs/ops/platform/tests/sonic b/pkgs/ops-pkg/src/genie/libs/ops/platform/tests/sonic new file mode 120000 index 000000000..27c32bf6a --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/platform/tests/sonic @@ -0,0 +1 @@ +../sonic/tests \ No newline at end of file diff --git a/pkgs/ops-pkg/src/genie/libs/ops/platform/tests/tests b/pkgs/ops-pkg/src/genie/libs/ops/platform/tests/tests new file mode 120000 index 000000000..27c32bf6a --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/platform/tests/tests @@ -0,0 +1 @@ +../sonic/tests \ No newline at end of file diff --git a/pkgs/robot-pkg/changelog/2024/july.rst b/pkgs/robot-pkg/changelog/2024/july.rst new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/robot-pkg/setup.py b/pkgs/robot-pkg/setup.py index 75c23b952..b619c4cae 100755 --- a/pkgs/robot-pkg/setup.py +++ b/pkgs/robot-pkg/setup.py @@ -10,7 +10,7 @@ import re import sys -from setuptools import setup, find_packages +from setuptools import setup, find_packages, find_namespace_packages def read(*paths): '''read and return txt content of file''' @@ -97,11 +97,8 @@ def version_info(*paths): # project keywords keywords = 'genie pyats test automation robot', - # uses namespace package - namespace_packages = ['genie', 'genie.libs'], - # project packages - packages = find_packages(where = 'src'), + packages = find_namespace_packages(where = 'src'), # project directory package_dir = { diff --git a/pkgs/robot-pkg/src/genie/__init__.py b/pkgs/robot-pkg/src/genie/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/pkgs/robot-pkg/src/genie/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/pkgs/robot-pkg/src/genie/libs/__init__.py b/pkgs/robot-pkg/src/genie/libs/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/pkgs/robot-pkg/src/genie/libs/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/pkgs/robot-pkg/src/genie/libs/robot/__init__.py b/pkgs/robot-pkg/src/genie/libs/robot/__init__.py index afdd5c8a4..2ef048f16 100644 --- a/pkgs/robot-pkg/src/genie/libs/robot/__init__.py +++ b/pkgs/robot-pkg/src/genie/libs/robot/__init__.py @@ -8,7 +8,7 @@ ''' # metadata -__version__ = '24.6' +__version__ = '24.7' __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/api_generator/output/github_apis.json b/pkgs/sdk-pkg/api_generator/output/github_apis.json deleted file mode 100644 index 6cb4121f1..000000000 --- a/pkgs/sdk-pkg/api_generator/output/github_apis.json +++ /dev/null @@ -1,30423 +0,0 @@ -{ - "add_device_to_testbed_yaml_file": { - "folders": { - "nxos": { - "doc": " Add device details to the devices yaml file\n\n Args:\n device_name ('str'): Name of the device to be added as a string\n device_ip ('str'): IP address of the device to be added as a string\n yaml_file ('str'): Name(path) of the yaml file where the device\n is to be added as a string\n Return value:\n None\n\n ", - "module_name": "nxos.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "nxos" - }, - "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#L281" - } - } - }, - "analyze_core_by_bingopy": { - "folders": { - "nxos": { - "doc": " analyze core by BingoPy\n # CISCO INTERNAL\n\n Args:\n device (`obj`): Device object\n clear_cores (`bool`): To clear cores before generating core. Default to True\n service (`str`): service to generate core\n remote_server (`str`): remote server name in testbed yaml\n remote_user (`str`, optional): userid on remote server\n remote_pass (`str`, optional): password of userid on remote server\n remote_location (`str`): Location of saving core file\n remote_via: (`str`, optional): specify connection to get ip\n if not specified, use active connection one\n vrf (`str`): VRF for copying file to remote server\n Defaults to management\n private_image_tree (`str`, optional): Tree location for private image\n private_image_process_path (`str`, optional): Process path for private image\n sleep (`int`, optional): sleep for shell command. Defaults to 10 seconds\n clear_cores (`Bool`, optional): clear cores if TRUE. Defaults to True\n max_time (`int`, optional): Maximum time to wait. \n Defaults to 360 seconds\n check_interval (`int`, optional): Time interval while checking.\n Defaults to 10 seconds\n bloggered (`bool`, optional): if use bloggered command\n if False, use kill -6 command instead\n Defaults to True\n source_location (`str`, optional): source file location for BingoPy\n Defaults to /auto/andatc/independent/shellrc-files/current/rc/.bashrc.build\n bingopy_location (`str`, optional): bingopy location\n Defaults to /ws/xianqin-sjc/bingo/blogger_core.pl\n\n Returns:\n out (`str`): Output of BingoPy\n ", - "module_name": "nxos.bingopy.bingopy", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "nxos" - }, - "uid": "analyze_core_by_bingopy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/bingopy/bingopy.py#L16" - } - } - }, - "analyze_core_by_ucd": { - "folders": { - "linux": { - "doc": " analyze core by UCD\n # CISCO INTERNAL\n\n Args:\n device (`obj`): Device object\n core_file (`str`): core file name with path to analyze by UCD\n gdb_command (`str`, optional): gdb command in GDB\n Defaults to `bt full`\n ucd_command (`str`, optional): ucd command with path and options\n Defaults to `/ws/cvanka-sjc/ucd/ucd -c`\n timeout (`int`, optional): timeout to expire for device.receive()\n Defaults to 300 seconds\n\n Returns:\n out (`str`): Output of UCD\n ", - "module_name": "linux.ucd.ucd", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "linux" - }, - "uid": "analyze_core_by_ucd", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/ucd/ucd.py#L9" - } - } - }, - "analyze_rate": { - "doc": " Get the traffic rate and the corresponding unit\n\n Args:\n rate (`str`): Passed rate as a string\n\n Returns:\n rate (`int`): Traffic rate\n rate_unit (`str`): Traffic rate unit\n original_rate (`str`): Original Traffic rate\n ", - "folders": {}, - "module_name": "utils", - "package": "genie.libs.sdk.apis", - "uid": "analyze_rate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L581" - }, - "analyze_udp_in_mpls_packets": { - "folders": { - "iosxe": { - "doc": " Analyze passed packets\n\n Args:\n packets('str'): Packets to analyze\n ip_address ('str'): Destination IP address\n ttl (`int`): Time to live\n packet_count (`int`): Packet count to check during\n packet analysis\n destination_port (`int`): Destination port start \"traceroute\"\n Returns:\n pkt count\n Raises:\n None \n ", - "module_name": "iosxe.udp.get", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "analyze_udp_in_mpls_packets", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/udp/get.py#L10" - } - } - }, - "apic_rest_delete": { - "folders": { - "apic": { - "doc": "DELETE REST Command to delete information from the device\n\n Args:\n dn (`string`): Unique distinguished name that describes the object\n and its place in the tree.\n connection_alias (`str`): Connection alias\n expected_status_code (`int`): Expected result\n timeout (`int`): Maximum time\n\n Returns:\n Output from REST API\n\n Raise:\n None\n ", - "module_name": "apic.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "apic" - }, - "uid": "apic_rest_delete", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/apic/utils.py#L144" - } - } - }, - "apic_rest_get": { - "folders": { - "apic": { - "doc": "GET REST Command to retrieve information from the device\n\n Args:\n device (`obj`): Device object\n dn (`string`): Unique distinguished name that describes the object\n and its place in the tree.\n connection_alias (`str`): Connection alias\n query_target {self|children|subtree}:\n 'self': (default) MO itself\n 'children': just the MO's child objects\n 'subtree': MO and its child objects\n rsp_subtree {no|children|full}: Specifies child object level\n included in the response\n 'no': (default) the response\n does not include any children\n 'children': return only the child\n objects\n 'full': includes the full tree\n structure\n rsp_prop_include {all|naming-only|config-only}:\n 'all': all properties of the objects\n 'naming-only': only the naming properties\n 'config-only': only configurable properties\n rsp_subtree_include (`string`): specify additional contained objects\n or options to be included\n rsp_subtree_class (`string`) : specify classes\n target_subtree_class (string): specify subtree classes\n query_target_filter (`string`): filter expression\n order_by (`string`): sort the query response by one or\n more properties of a class\n expected_status_code (`int`): Expected result\n\n Returns:\n Output from REST API\n\n Raise:\n None\n ", - "module_name": "apic.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "apic" - }, - "uid": "apic_rest_get", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/apic/utils.py#L15" - } - } - }, - "apic_rest_post": { - "folders": { - "apic": { - "doc": "POST REST Command to configure information from the device\n\n Args:\n device (`obj`): Device object\n dn (`string`): Unique distinguished name that describes the object\n and its place in the tree.\n payload (`dict`): Dictionary containing the information to send via\n the post\n xml_payload (bool): Set to True if payload is in XML format\n connection_alias (`str`): Connection alias\n expected_status_code (`int`): Expected result\n timeout (`int`): Maximum time\n\n Returns:\n Output from REST API\n\n Raise:\n None\n ", - "module_name": "apic.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "apic" - }, - "uid": "apic_rest_post", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/apic/utils.py#L95" - } - } - }, - "arithmetic_operations": { - "doc": "\n Perform arithmetic operations on operands.\n\n Args:\n operation (`str`): string indicating the calculation method.\n 'addition' is '+'\n 'subtraction' is '-'\n 'multiplication' is '*'\n 'division' is '/'\n operands (`list`): operands to be calculated.\n example: [1, 2]\n\n Returns:\n Numerical : Calculation result\n None : When an abnormality occurs during calculation\n Raises:\n N/A\n ", - "folders": {}, - "module_name": "utils", - "package": "genie.libs.sdk.apis", - "uid": "arithmetic_operations", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3732" - }, - "assign_default_ipv4_sgacl": { - "folders": { - "iosxe": { - "doc": " Assign a default static SGACL(ipv4)\n Args:\n device ('obj'): device to use\n sgacl ('str'): Role-based Access-list name\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to assign default static SGACL(ipv4)\n ", - "module_name": "iosxe.cts.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "assign_default_ipv4_sgacl", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cts/configure.py#L175" - } - } - }, - "assign_static_ipv4_sgacl": { - "folders": { - "iosxe": { - "doc": " Assign static SGACL(Ipv4)\n Args:\n device ('obj'): device to use\n src_sgt (`str`): Source Group Tag\n dest_sgt (`str`): Destination Group Tag\n sgacl ('str'): Role-based Access-list name\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to assign static SGACL(IPv4)\n ", - "module_name": "iosxe.cts.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "assign_static_ipv4_sgacl", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cts/configure.py#L152" - } - } - }, - "attach_device_tracking_policy_to_interface": { - "folders": { - "iosxe": { - "doc": " Attach Device Tracking Policy to a interface\n\n Args:\n device (`obj`): Device object\n policy_name (`str`): Policy name to be attached to interface\n interface (`str`): interface to attach policy\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "attach_device_tracking_policy_to_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L2374" - } - } - }, - "attach_dhcpv6_guard_policy_to_interface": { - "folders": { - "iosxe": { - "doc": " Attach DHCPv6 Guard Policy to an interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface to attach policy\n policy_name (`str`): Policy name to be attached to interface\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "attach_dhcpv6_guard_policy_to_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L1987" - } - } - }, - "attach_dhcpv6_guard_policy_to_vlan": { - "folders": { - "iosxe": { - "doc": " Attach DHCPv6 Guard Policy to a vlan\n\n Args:\n device (`obj`): Device object\n vlan (`str`): vlan to attach policy\n policy_name (`str`): Policy name to be attached to interface\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "attach_dhcpv6_guard_policy_to_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L2306" - } - } - }, - "attach_ipv6_dhcp_guard_policy": { - "folders": { - "iosxe": { - "doc": " Attaches the given ipv6 dhcp guard policy to an interface or vlan(s)\n Args:\n device ('obj'): device to use\n policy_name ('str'): name of the policy to be attached\n interface (str): interface to attach policy to\n vlan (str): vlan or vlan range to attach the policy to. e.g: 1-10,15\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to attach ipv6 dhcp guard policy {policy_name}\n ", - "module_name": "iosxe.sisf.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "attach_ipv6_dhcp_guard_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sisf/configure.py#L356" - } - } - }, - "attach_ipv6_nd_suppress_policy": { - "folders": { - "iosxe": { - "doc": " Attaches the given ipv6 nd suppress policy to an interface or vlan(s)\n Args:\n device ('obj'): device to use\n policy_name ('str'): name of the policy to be attached\n interface (str): interface to attach policy to\n vlan (str): vlan or vlan range to attach the policy to. e.g: 1-10,15\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to attach ipv6 nd suppress policy {policy_name}\n ", - "module_name": "iosxe.sisf.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "attach_ipv6_nd_suppress_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sisf/configure.py#L428" - } - } - }, - "attach_ipv6_raguard_policy_to_interface": { - "folders": { - "iosxe": { - "doc": " Attach IPv6 RA Guard Policy to an interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface to attach policy\n policy_name (`str`): Policy name to be attached to interface\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "attach_ipv6_raguard_policy_to_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L1849" - } - } - }, - "attach_ipv6_raguard_policy_to_vlan": { - "folders": { - "iosxe": { - "doc": " Attach IPv6 RA Guard Policy to a vlan\n\n Args:\n device (`obj`): Device object\n vlan (`str`): vlan to attach policy\n policy_name (`str`): Policy name to be attached to interface\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "attach_ipv6_raguard_policy_to_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L2123" - } - } - }, - "authentication_convert_to_new_style": { - "folders": { - "iosxe": { - "doc": "Common function to configure authentication convert-to new-style for both forced and without forced\n \n Args:\n device ('obj'): device to use\n force (`str`): Cli input to continue (default value is None)\n \n Returns:\n None\n \n Raises:\n SubCommandFailure: Failed to configure authentication convert-to new-style\n ", - "module_name": "iosxe.authentication.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "authentication_convert_to_new_style", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/authentication/configure.py#L13" - } - } - }, - "bits_to_netmask": { - "doc": " Convert bits to netmask\n Args:\n bits ('int'): bits to converts\n ex.) bits = 32\n Raise:\n None\n Returns:\n Net mask\n ", - "folders": {}, - "module_name": "utils", - "package": "genie.libs.sdk.apis", - "uid": "bits_to_netmask", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L827" - }, - "cdets_lookup": { - "folders": { - "linux": { - "doc": " Function to return matching cdets given a corefile\n Note: The corefile should already be decoded as this function searches\n for the entry within the decoder archived database ", - "module_name": "linux.decoder.execute", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "linux" - }, - "uid": "cdets_lookup", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/decoder/execute.py#L29" - } - } - }, - "change_configuration_using_jinja_templates": { - "doc": "Use Jinja templates to change the device configuration\n\n Args:\n device (`obj`): Device object\n template (`obj`): Jinja template to be used in configuration\n parameters (`dict`): Dictionary of all the parameters\n to be passed to the Jinja template\n\n Returns:\n None\n Raises:\n SubCommandFailure: Failed configuring device\n ", - "folders": {}, - "module_name": "jinja.configure", - "package": "genie.libs.sdk.apis", - "uid": "change_configuration_using_jinja_templates", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/jinja/configure.py#L11" - }, - "change_hostname": { - "folders": { - "ios": { - "doc": " Change the hostname on device\n\n Args:\n device('obj'): device to change hostname on\n name('str'): name to change hostname to\n\n Returns:\n N/A\n ", - "module_name": "ios.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "ios" - }, - "uid": "change_hostname", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/ios/utils.py#L278" - }, - "iosxe": { - "doc": " Change the hostname on device\n\n Args:\n device('obj'): device to change hostname on\n name('str'): name to change hostname to\n\n Returns:\n N/A\n ", - "module_name": "iosxe.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "change_hostname", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L284" - } - } - }, - "change_power_cycler_state": { - "doc": " Turn on the power cycler\n Args:\n device ('obj'): Device object\n powercycler ('obj'): Powercycler object\n state ('str'): Power cycler state on/off\n outlets ('str'): Power cycler outlets\n Returns:\n None\n ", - "folders": {}, - "module_name": "execute", - "package": "genie.libs.sdk.apis", - "uid": "change_power_cycler_state", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/execute.py#L149" - }, - "check_if_device_in_testbed_yaml": { - "folders": { - "nxos": { - "doc": " Check if the given device name is part of the devices yaml file\n\n Args:\n device_name ('str'): Name of the device to be found as a string\n yaml_file ('str'): Name(path) of the yaml file where the device\n is to be found as a string\n Return value:\n Boolean. True, if found. False, if error/not found\n\n ", - "module_name": "nxos.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "nxos" - }, - "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#L259" - } - } - }, - "check_traffic_drop_count": { - "folders": { - "iosxe": { - "doc": "Check for the drop count\n\n Args:\n testbed (`obj`): Testbed object\n traffic_stream (`str`): Traffic stream name\n drop_count (`str`): Expected drop count\n\n Returns:\n None\n Raises:\n KeyError: Could not find device on testbed\n Exception: Traffic drops found\n ", - "module_name": "iosxe.traffic.checks", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "check_traffic_drop_count", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/traffic/checks.py#L337" - } - } - }, - "check_traffic_expected_rate": { - "folders": { - "iosxe": { - "doc": "Check the expected rate\n\n Args:\n testbed (`obj`): Testbed object\n traffic_stream (`str`): Traffic stream name\n expected_rate (`str`): Traffic expected received rate\n tolerance (`str`): Traffic loss tolerance percentage\n traffic_gen (`str`): Traffic generating device\n\n Returns:\n None\n Raises:\n KeyError: Could not find device on testbed\n Exception: Traffic drops found\n ", - "module_name": "iosxe.traffic.checks", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "check_traffic_expected_rate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/traffic/checks.py#L150" - } - } - }, - "check_traffic_transmitted_rate": { - "folders": { - "iosxe": { - "doc": "Check transmitted rate was set correctly or not\n\n Args:\n testbed (`obj`): Testbed object\n traffic_stream (`str`): Traffic stream name\n set_rate (`int`): Traffic set rate\n tolerance (`int`): Traffic tolerance\n max_time (`int`): Retry maximum time\n check_interval (`int`): Interval in seconds to do recheck\n\n Returns:\n None\n Raises:\n KeyError: Could not find device on testbed\n Exception: Traffic drops found\n ", - "module_name": "iosxe.traffic.checks", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "check_traffic_transmitted_rate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/traffic/checks.py#L60" - } - } - }, - "clear_aaa_cache": { - "folders": { - "iosxe": { - "doc": " Clear AAA Cache\n Args:\n device (`obj`): Device object\n server_grp (`str`): Radius Server Grp name\n profile ('str',optional): Profile name to clear. Default 'all.'\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring\n Examples:\n switch1.api.clear_aaa_cache('radiusGroup')\n ", - "module_name": "iosxe.aaa.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_aaa_cache", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py#L683" - } - } - }, - "clear_access_list_counters": { - "folders": { - "iosxe": { - "doc": " clear access-list counters\n Args:\n device (`obj`): Device object\n option ('str', Optional): Which data to clear. Default will clear all access-list counters or \n can give access-list name(eg:input_packet) or number(eg:100)\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.acl.clear", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_access_list_counters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/clear.py#L12" - } - } - }, - "clear_access_session": { - "folders": { - "iosxe": { - "doc": " executes clear access-sesssion CLI \n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to execute clear access-sesssion.\n ", - "module_name": "iosxe.dot1x.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_access_session", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L285" - } - } - }, - "clear_access_session_intf": { - "folders": { - "iosxe": { - "doc": " clear access-session interface {}\n Args:\n device (`obj`): Device object\n intf('str'): Name of the interface to clear access-session\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.dot1x.clear", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_access_session_intf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/clear.py#L12" - } - } - }, - "clear_arp_cache": { - "folders": { - "iosxe": { - "doc": " Clears device cache\n\n Args:\n device (`obj`): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.arp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_arp_cache", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/arp/configure.py#L49" - } - } - }, - "clear_bgp_neighbor": { - "folders": { - "junos": { - "doc": " Clear bgp neighbor using one of two commands\n Args:\n device ('obj'): Device object\n command ('str'): Command with a higher priority\n alternative_command ('str'): An alternative command that would be executed if the given command creates an error\n fail_regex ('str'): A regex string to look for which would indicate failure\n\n Returns:\n bool\n\n Raises:\n N/A or SubcommandFailure\n ", - "module_name": "junos.bgp.clear", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "junos" - }, - "uid": "clear_bgp_neighbor", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/junos/bgp/clear.py#L3" - } - } - }, - "clear_bgp_neighbor_soft": { - "folders": { - "junos": { - "doc": " Clear bgp neighbor soft using one of two commands\n Args:\n device ('obj'): Device object\n command ('str'): Command with a higher priority\n alternative_command ('str'): An alternative command that would be executed if the given command creates an error\n fail_regex ('str'): A regex string to look for which would indicate failure\n\n Returns:\n bool\n\n Raises:\n N/A or SubcommandFailure\n ", - "module_name": "junos.bgp.clear", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "junos" - }, - "uid": "clear_bgp_neighbor_soft", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/junos/bgp/clear.py#L29" - } - } - }, - "clear_bgp_neighbors_soft": { - "folders": { - "iosxe": { - "doc": " Reset connection to a BGP neighbor or to all neighbors, diretion in or out\n Args:\n device ('obj') : Device object\n direction ('str'): Direction type:\n ex.)\n direction = \"in\"\n direction = \"out\"\n neighbor (`str`): Neighbor address\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing command\n ", - "module_name": "iosxe.bgp.clear", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_bgp_neighbors_soft", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/clear.py#L39" - } - } - }, - "clear_counters": { - "folders": { - "iosxe": { - "doc": " clear logging\n Args:\n device ('obj'): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_counters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L725" - } - } - }, - "clear_crypto_sa_counters": { - "folders": { - "iosxe": { - "doc": " Clear all the ipsec sa counters\n Args:\n device (`obj`): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.ipsec.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_crypto_sa_counters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipsec/configure.py#L13" - } - } - }, - "clear_crypto_session": { - "folders": { - "iosxe": { - "doc": " Clear all crypto session\n Args:\n device (`obj`): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.ike.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_crypto_session", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ike/configure.py#L995" - } - } - }, - "clear_cts_counters": { - "folders": { - "iosxe": { - "doc": " Clear CTS credentials\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to clear cts counters\n ", - "module_name": "iosxe.cts.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_cts_counters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cts/configure.py#L428" - } - } - }, - "clear_cts_credentials": { - "folders": { - "iosxe": { - "doc": " clear CTS credentials\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to clear cts credential\n ", - "module_name": "iosxe.cts.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_cts_credentials", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cts/configure.py#L406" - } - } - }, - "clear_device_tracking_counters": { - "folders": { - "iosxe": { - "doc": " Clear device-tracking counters\n Args:\n device ('obj'): device object\n interface ('str', optional): interface name. Defaults to None\n vlan ('str', optional): vlan id. Defaults to None.\n bdi ('str', optional): bdi id. Defaults to None.\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to clear device-tracking counters\n ", - "module_name": "iosxe.sisf.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_device_tracking_counters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sisf/configure.py#L2182" - } - } - }, - "clear_device_tracking_database": { - "folders": { - "iosxe": { - "doc": " Clear device-tracking database\n Args:\n device ('obj'): device object\n options ('list'): list of policy configuration options to be removed or reset:\n dictionary contains following keys:\n address ('dict', optional):\n address ('str'): IPv4 address or \"all\"\n target ('dict', optional):\n force ('bool', optional): Force to clear all (mac) entries\n interface ('str', optional): interface\n policy ('str', optional): policy name\n vlanid ('str', optional): vlanid\n force ('bool', optional): Force to clear all (mac) entries\n interface ('str', optional):\n target ('str'): interface\n force ('bool', optional): Force to clear all (mac) entries\n vlanid ('str', optional): vlanid\n mac ('str', optional):\n address ('str'): 48-bit hardware address\n target ('dict', optional):\n force ('bool', optional): Force to clear all (mac) entries\n interface ('str', optional): interface\n policy ('str', optional): policy name\n vlanid ('str', optional): vlanid\n policy ('str', optional): policy name\n prefix ('bool', optional)\n address ('str'): IPv6 address (X:X:X:X::X/<0-128>) or \"all\"\n target ('dict', optional):\n force ('bool', optional): Force to clear all (mac) entries\n interface ('str', optional): interface\n policy ('str', optional): policy name\n vlanid ('str', optional): vlanid\n vlanid ('str', optional): vlan id\n ex.)\n [\n {\n \"force\": True,\n \"mac\": {\n \"address\": \"dead.beef.0001\"\n \"target\":\n \"force\": True\n \"interface\": \"gigabitEthernet0/0\"\n \"policy\": \"test\"\n \"vlanid\": 10\n }\n }\n ]\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to remove ipv6 source-guard policy configurations\n ", - "module_name": "iosxe.sisf.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_device_tracking_database", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sisf/configure.py#L2080" - } - } - }, - "clear_device_tracking_messages": { - "folders": { - "iosxe": { - "doc": " Clear device-tracking database\n Args:\n device ('obj'): device object\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to execute clear device-tracking messages\n ", - "module_name": "iosxe.sisf.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_device_tracking_messages", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sisf/configure.py#L2066" - } - } - }, - "clear_dhcpv4_server_stats": { - "folders": { - "iosxe": { - "doc": "Clear dhcp server statistics on device\n Args:\n device('obj'): device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.dhcp.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_dhcpv4_server_stats", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/utils.py#L11" - } - } - }, - "clear_dmvpn": { - "folders": { - "iosxe": { - "doc": " clear_dmvpn\n Args:\n device (`obj`): Device object\n peer('str', optional): DMVPN peer, default is None\n static('boolean', optional): static dmvpn entries, default is False\n vrf('str', optional) : vrf name, default is None\n timeout('int', optional): timeout for exec command execution, default is 30\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.nhrp.clear", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_dmvpn", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nhrp/clear.py#L55" - } - } - }, - "clear_dmvpn_statistics": { - "folders": { - "iosxe": { - "doc": " clear_dmvpn_statistics\n Args:\n device (`obj`): Device object\n interface('str', optional): Tunnel interface name, default is None\n vrf('str', optional) : vrf name, default is None\n timeout('int', optional): timeout for exec command execution, default is 30\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.nhrp.clear", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_dmvpn_statistics", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/nhrp/clear.py#L94" - } - } - }, - "clear_errdisable_intf_vlan": { - "folders": { - "iosxe": { - "doc": " clear errdisable interface {} vlan\n Args:\n device (`obj`): Device object\n intf('str'): Name of the interface to clear errdisable\n Vlan('str', optional): Name of the vlan to to clear errdisable, default value is None\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.vlan.clear", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_errdisable_intf_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/clear.py#L11" - } - } - }, - "clear_flow_monitor": { - "folders": { - "iosxe": { - "doc": " clear flow monitor data\n Args:\n device (`obj`): Device object\n name ('str'): Name of the flow (eg: created[ipv4_input] or user defined[monitor_ipv4_out])\n option ('str', optional): Which data to clear. Default will clear all flow monitor info or\n can give perticular option to clear eg:cache/statistics\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.flow.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_flow_monitor", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/configure.py#L248" - } - } - }, - "clear_flow_monitor_statistics": { - "folders": { - "iosxe": { - "doc": " Clears Flow Monitor statistics on device\n\n Args:\n device (`obj`): Device object\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring interface\n ", - "module_name": "iosxe.flow.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_flow_monitor_statistics", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/configure.py#L98" - } - } - }, - "clear_interface_config": { - "folders": { - "iosxe": { - "doc": " Clears interface config\n\n Args:\n device ('obj'): device to use\n interface ('str'): interface to clear\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_interface_config", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L824" - } - } - }, - "clear_interface_counters": { - "folders": { - "iosxe": { - "doc": " Clear interface counters\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_interface_counters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L377" - } - } - }, - "clear_interface_interfaces": { - "folders": { - "iosxe": { - "doc": " clear interface configuration\n\n Args:\n device ('obj'): device to use\n interfaces ('list'): List of interface to be cleared\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_interface_interfaces", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L1288" - } - } - }, - "clear_iox": { - "folders": { - "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 ", - "module_name": "iosxe.apphosting.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_iox", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/apphosting/configure.py#L53" - } - } - }, - "clear_ip_bgp_vrf_af_soft": { - "folders": { - "iosxe": { - "doc": " BGP soft clear using vrf, address family and AS number\n\n Args:\n device ('obj'): device object\n vrf ('str'): vrf name\n address_family ('str'): address family\n as_number ('int'): BGP AS number\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing command\n ", - "module_name": "iosxe.bgp.clear", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_ip_bgp_vrf_af_soft", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/clear.py#L12" - } - } - }, - "clear_ip_mroute_all": { - "folders": { - "iosxe": { - "doc": " clear ip mroute *\n Args:\n device (`obj`): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_ip_mroute_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1319" - } - } - }, - "clear_ip_mroute_vrf": { - "folders": { - "iosxe": { - "doc": " clear ipv6 mld group\n Args:\n device (`obj`): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.mcast.clear", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_ip_mroute_vrf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mcast/clear.py#L12" - } - } - }, - "clear_ip_nat_translation_all": { - "folders": { - "iosxe": { - "doc": " clear ip nat translation *\n Args:\n device (`obj`): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "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#L1299" - } - } - }, - "clear_ipv6_mfib_vrf_counters": { - "folders": { - "iosxe": { - "doc": " clear ipv6 mfib vrf * counters\n Args:\n device (`obj`): Device object\n vrf_name ('str', optional): VRF name. Default will clear all vrf counters\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.ipv6.clear", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_ipv6_mfib_vrf_counters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipv6/clear.py#L11" - } - } - }, - "clear_ipv6_mld_group": { - "folders": { - "iosxe": { - "doc": " clear ipv6 mld group\n Args:\n device (`obj`): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.ipv6.clear", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_ipv6_mld_group", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipv6/clear.py#L35" - } - } - }, - "clear_logging": { - "folders": { - "iosxe": { - "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": "iosxe.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_logging", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L746" - }, - "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": "iosxr.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxr" - }, - "uid": "clear_logging", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/utils.py#L346" - }, - "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": "nxos.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "nxos" - }, - "uid": "clear_logging", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/utils.py#L312" - } - } - }, - "clear_macsec_counters": { - "folders": { - "iosxe": { - "doc": " Clears macsec counters on device\n\n Args:\n device ('obj'): device to use\n interfaces ('list'): List of interfaces\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.macsec.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_macsec_counters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L315" - } - } - }, - "clear_mdns_query_db": { - "folders": { - "iosxe": { - "doc": " Clears mdns query database statistics on device\n Args:\n device (`obj`): Device object\n Return:\n None\n Raise:\n SubCommandFailure: Failed clearing query-db statistics\n ", - "module_name": "iosxe.mdns.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_mdns_query_db", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mdns/configure.py#L261" - } - } - }, - "clear_mdns_statistics": { - "folders": { - "iosxe": { - "doc": " Clears mdns statistics on device\n Args:\n device (`obj`): Device object\n Return:\n None\n Raise:\n SubCommandFailure: Failed clearing statistics\n ", - "module_name": "iosxe.mdns.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_mdns_statistics", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mdns/configure.py#L240" - } - } - }, - "clear_mpls_counters": { - "folders": { - "iosxe": { - "doc": " Clear mpls counters\n Args:\n device (`obj`): Device object\n\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_mpls_counters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L230" - } - } - }, - "clear_mpls_ldp_neighbor": { - "folders": { - "iosxe": { - "doc": " clear mpls ldp neighbor {}\n Args:\n device ('obj'): Device object\n neighbor_ip ('str'): neighbor ip\n\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_mpls_ldp_neighbor", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L259" - } - } - }, - "clear_ospf3_neighbor": { - "folders": { - "junos": { - "doc": " Clear ospf3 neighbor using one of two commands\n Args:\n device ('obj'): Device object\n command ('str'): Command with a higher priority\n alternative_command ('str'): An alternative command that would be executed if the given command creates an error\n fail_regex ('str'): A regex string to look for which would indicate failure\n Returns:\n bool\n\n Raises:\n N/A or SubcommandFailure\n ", - "module_name": "junos.ospf3.clear", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "junos" - }, - "uid": "clear_ospf3_neighbor", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/junos/ospf3/clear.py#L3" - } - } - }, - "clear_ospf_neighbor": { - "folders": { - "junos": { - "doc": " Clear ospf neighbor using one of two commands\n Args:\n device ('obj'): Device object\n command ('str'): Command with a higher priority\n alternative_command ('str'): An alternative command that would be executed if the given command creates an error\n fail_regex ('str'): A regex string to look for which would indicate failure\n Returns:\n bool\n\n Raises:\n N/A or SubcommandFailure\n ", - "module_name": "junos.ospf.clear", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "junos" - }, - "uid": "clear_ospf_neighbor", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/junos/ospf/clear.py#L3" - } - } - }, - "clear_ospf_trace_log": { - "folders": { - "junos": { - "doc": "\n Clear log ospf_trace_log\n\n Args:\n device (`obj`): Device object\n ospf_trace_log(`str`): OSPF trace log\n\n Returns:\n None\n ", - "module_name": "junos.ospf.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "junos" - }, - "uid": "clear_ospf_trace_log", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/junos/ospf/configure.py#L74" - } - } - }, - "clear_packet_buffer": { - "folders": { - "ios": { - "doc": "Clear packet buffer\n\n Args:\n device (`obj`): Device object\n\n Returns:\n None\n\n Raises:\n pyATS Results\n ", - "module_name": "ios.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "ios" - }, - "uid": "clear_packet_buffer", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/ios/utils.py#L211" - }, - "iosxe": { - "doc": "Clear packet buffer\n\n Args:\n device (`obj`): Device object\n\n Returns:\n None\n\n Raises:\n pyATS Results\n ", - "module_name": "iosxe.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_packet_buffer", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L217" - } - } - }, - "clear_port_security": { - "folders": { - "iosxe": { - "doc": " clear port-security all\n Args:\n device ('obj'): Device object\n interface('str',optional) : interface name, default value is None\n Returns:\n output ('str'): Output of execution\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "clear_port_security", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1363" - } - } - }, - "compare_archive_config_dicts": { - "folders": { - "iosxe": { - "doc": " Checks for differences between two 'show archive' dictionaries\n\n Args:\n dict1('dict'): first dictionary\n dict2('dict'): seconds dictionary\n\n Returns:\n list of commands that are different between the two configs\n Raises:\n None\n ", - "module_name": "iosxe.archive.verify", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "compare_archive_config_dicts", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/archive/verify.py#L9" - } - } - }, - "compare_config_dicts": { - "doc": " Compare two configuration dicts and return the differences\n\n Args:\n a (`dict`): Configuration dict\n b (`dict`): Configuration dict\n exclude (`list`): List of item to ignore. Supports Regex.\n Regex must begins with ( )\n Returns:\n out (`str`): differences\n ", - "folders": {}, - "module_name": "utils", - "package": "genie.libs.sdk.apis", - "uid": "compare_config_dicts", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L233" - }, - "compare_metric_of_route": { - "folders": { - "junos": { - "doc": " Compare the metric of best path and non best path\n\n Args:\n device ('obj'): Device object\n ip_address ('str'): IP address in show command.\n invert(bool, optional): Inverts from equals to not equals. Defaults to False.\n max_time ('int', optional): Max time, default: 60 seconds\n check_interval ('int', optional): Check interval, default: 10 seconds\n\n Returns:\n result (`bool`): Verified result\n\n Raises:\n N/A\n ", - "module_name": "junos.routing.verify", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "junos" - }, - "uid": "compare_metric_of_route", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/junos/routing/verify.py#L2643" - } - } - }, - "compared_with_running_config": { - "doc": " Show difference between given config and current config\n Args:\n config ('dict'): Config to compare with\n Raise:\n None\n Returns:\n Diff\n ", - "folders": {}, - "module_name": "utils", - "package": "genie.libs.sdk.apis", - "uid": "compared_with_running_config", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1452" - }, - "concurrent_ssh_sessions": { - "folders": { - "iosxe": { - "doc": "\n Generates multiple ssh sessions\n Args:\n device (`obj`): Device object\n testbed (`str`): Testbed object\n enable_pass (`str`): enable password\n concurrent_sessions (`int`): count of ssh session to generate\n iteration_times (`int`): count of concurrent_sessions to repeat\n Returns:\n None\n ", - "module_name": "iosxe.utils", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "concurrent_ssh_sessions", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1154" - } - } - }, - "config_acl_on_interface": { - "folders": { - "iosxe": { - "doc": " Configures acl on interface \n\n Args:\n device ('obj'): device to use\n interface ('str'): interface to configure\n acl_name ('str'): acl to apply\n ", - "module_name": "iosxe.acl.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_acl_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L138" - } - } - }, - "config_device_tracking_policy": { - "folders": { - "iosxe": { - "doc": " Configure a device-tracking policy with specified options\n Args:\n device ('obj'): device object\n policy ('str'): policy name\n options ('list'): list of policy configuration options:\n dictionary contains any of the following keys:\n cache_guard ('str', optional): cache poisoning guard mode\n data_glean ('str', optional): source address gleaning\n destination_glean ('str', optional): destination address gleaning\n device_role ('str', optional): device role\n distribution_switch ('str', optional): hostname of ip address\n limit_address_count ('dict', optional):\n all ('int', optional): max value\n ipv4 ('int', optional): address limit for ipv4 per mac\n ipv6 ('int', optional): address limit for ipv6 per mac\n origin ('str', optional): configure origin of the policy\n prefix_glean ('str', optional): glean prefixes in RA and DHCP-PD traffic\n protocol ('dict', optional):\n name ('dict'): name can be arp, dhcp4, dhcp6, ndp, or udp\n prefix_list ('str'): name of prefix-list\n security_level ('str', optional): security level\n tracking ('str', optional): tracking behavior\n trusted_port ('bool', optional): setup trusted port\n vpc ('int', optional): setup vpc port\n ex.)\n [\n {\n \"cache_guard\": \"ipv4\",\n \"data_glean\": \"log-only\",\n \"destination_glean\": \"log-only\",\n \"device_role\": \"node\",\n \"distribution-switch\": \"\"10.10.10.10\"\",\n \"limit_address_count\": {\n \"all\": 1000,\n \"ipv4\": 50,\n \"ipv6\": 10\n },\n \"origin\": \"cli\",\n \"prefix_glean\": \"only\",\n \"protocol\": {\n \"arp\": {\n \"prefix_list\": \"name1\"\n },\n \"dhcp4\": {\n \"prefix_list\": \"name2\"\n }\n },\n \"security_level\": \"guard\",\n \"tracking\": \"enable\",\n \"trusted_port\": True,\n \"vpc\": 10\n }\n ]\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to configure device-track policy\n ", - "module_name": "iosxe.sisf.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_device_tracking_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sisf/configure.py#L500" - } - } - }, - "config_edge_trunk_on_interface": { - "folders": { - "iosxe": { - "doc": " Configure spanning portf edge trunk on Interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface on which the edge trunk config to be applied\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_edge_trunk_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L2247" - } - } - }, - "config_enable_ip_routing": { - "folders": { - "iosxe": { - "doc": " Enable IP Routing\n\n Args:\n device (`obj`): Device object\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_enable_ip_routing", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L58" - } - } - }, - "config_enable_ipv6_routing": { - "folders": { - "iosxe": { - "doc": " configure ipv6 routing on device\n\n Args:\n device (`obj`): Device object\n Returns:\n None\n ", - "module_name": "iosxe.ipv6.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_enable_ipv6_routing", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipv6/configure.py#L11" - } - } - }, - "config_encapsulation_on_interface": { - "folders": { - "iosxe": { - "doc": " Configure encapsulation on Interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface on which the edge trunk config to be applied\n vlan (`str`): Vlan to be configured with encapsulation\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_encapsulation_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L584" - } - } - }, - "config_eompls_pseudowire": { - "folders": { - "iosxe": { - "doc": "configure pseudowire interface \n Args:\n device (`obj`): Device \n pseudowire_name (`str`): Specifies the pseudowire interface\n neigh (`str`) : Specifies the peer IP address\n vc_id (`str`) : virtual circuit (VC) ID value of the Layer 2 VPN (L2VPN) pseudowire.\n flow_ip (`str`) : Specifies load-balance factor Eg:dst-ip so on\n flow_label (`str`) : core load balancing based on flow-labels.\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_eompls_pseudowire", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L1083" - } - } - }, - "config_extended_acl": { - "folders": { - "iosxe": { - "doc": " Configure extended ACL on device\n Args:\n device ('obj'): device object\n acl_name ('str'): acl name\n permission ('str'): (permit | deny), default value is None\n protocol ('str'): protocol, default value is None\n src_ip ('str'): source start ip, default value is None\n src_step ('str'): increment step for source ip, default value is None\n src_wildcard ('str'): source wildcard, default value is None\n dst_ip ('str'): destination start ip, default value is None\n dst_step ('str'): increment step for destination ip, default value is None\n dst_wildcard ('str'): destination wildcard, default value is None\n dst_port ('str'): Acl destination port, default value is None\n entries ('int'): Acl entries, default value is None\n acl_type ('str', optional): type of ACL like with or without host keyword, default value is None\n sequence_num ('str',optional): specific sequence number,default value is None\n Returns:\n config\n Raises:\n SubCommandFailure: Failed to configure access-list\n ", - "module_name": "iosxe.acl.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_extended_acl", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L13" - } - } - }, - "config_flow_exporter": { - "folders": { - "iosxe": { - "doc": " Config Flow Exporter on Device\n\n Args:\n device (`obj`): Device object\n exporter_name (`str`): Flow exporter name\n monitor_name (`str`): Flow monitor name\n dest_ip (`str`): Destination IP\n udp_port (`str`): UDP port\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring interface\n ", - "module_name": "iosxe.flow.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_flow_exporter", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/configure.py#L12" - } - } - }, - "config_flow_monitor_on_interface": { - "folders": { - "iosxe": { - "doc": " Config Flow Monitor on Interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface to be configured\n exporter_name (`str`): Flow exporter name\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring interface\n ", - "module_name": "iosxe.flow.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_flow_monitor_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/flow/configure.py#L72" - } - } - }, - "config_identity_ibns": { - "folders": { - "iosxe": { - "doc": " Configured 802.1x port based authentication for\n IBNS2.0 with service policy\n Mandatory args:\n device ('obj'): device to use\n interface (`str`): Interface name\n access(bol): Set to True, False to configure in Trunk mode\n Policy_map: Name of policy map to be attached.\n Optional args:\n data_vlan(`int`): vlan_id for data traffic\n voice_vlan(`int`): vlan_id for voice traffic\n max_req:(`int`) Max No. of Retries\n max-reauth-req(`int`): Max No. of Reauthentication Attempts\n authmod('str'): default(multi-auth), mult-host peer, multi-domain etc\n closed('bol'): {False: closed | True: open (default) }\n reauth('str'): server or numberic range is 1 to 65535 seconds\n ctr('str'): {both | in}\n txp(`int`):The range is 1 to 65535 seconds\n port_control ('str'): {auto|force-authorized|force-unauthorized}. Default = 'auto'\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to configure 802.1x port based authentication\n ", - "module_name": "iosxe.dot1x.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_identity_ibns", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L303" - } - } - }, - "config_interface_carrier_delay": { - "folders": { - "iosxe": { - "doc": " Configure interface carrier delay on device\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n delay (`int`): Delay time in second\n delay_type (`str`): Delay type\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_interface_carrier_delay", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L339" - } - } - }, - "config_interface_mtu": { - "folders": { - "iosxe": { - "doc": " Config MTU on interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n mtu_bytes (`int`): MTU bytes\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_interface_mtu", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L455" - } - } - }, - "config_interface_negotiation": { - "folders": { - "iosxe": { - "doc": " Config negotiation auto on interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_interface_negotiation", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L79" - } - } - }, - "config_interface_ospf": { - "folders": { - "iosxe": { - "doc": " Config OSPF on interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n ospf_pid (`str`): Ospf process id\n area ('int'): Ospf area code\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_interface_ospf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L521" - } - } - }, - "config_interface_ospfv3": { - "folders": { - "iosxe": { - "doc": "config OSPF on interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n ospfv3_pid (`str`): Ospfv3 process id\n area ('int'): Ospf area code\n ipv4 ('boolean',optional): Flag to configure IPv4 (Default False)\n ipv6 ('boolean',optional): Flag to configure IPv6 (Default True)\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_interface_ospfv3", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L553" - } - } - }, - "config_interface_subinterface_and_secondary_addresses": { - "folders": { - "iosxe": { - "doc": " Configure sub-interface and secondary addresses on device\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n sub_interface_num (`int`): Subinterface to be added to\n interface name\n ip_address(`str`): IP addressed to be configured on interface\n prefix(`str`): prefix to be used in configuration\n encap_type (`str`): Encapsulation type\n start (`int`): start number on ip\n end (`int`): end number on ip\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_interface_subinterface_and_secondary_addresses", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L711" - } - } - }, - "config_ip_on_interface": { - "folders": { - "iosxe": { - "doc": " Configure IP on an interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface to get address\n ip_address (`str`): IP addressed to be configured on interface\n mask (`str`): Mask address to be used in configuration\n ipv6_address (`str`): IPv6 address with subnet mask\n eth_encap_type (`str`): Encapsulation type\n eth_encap_val (`str`): Encapsulation value\n sub_interface (`str`): Subinterface to be added to interface name\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_ip_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L588" - } - } - }, - "config_ip_on_vlan": { - "folders": { - "iosxe": { - "doc": "Configure an IPv4/IPv6 address on a vlan\n\n Args:\n device (`obj`): Device object\n vlanid (`str`): Vlan id\n ipv4_address (`str`): IPv4 address\n subnetmask (`str`): Subnet mask to be used for IPv4 address\n ipv6_address (`str`): Ipv6 address\n ipv6_prefix_len (`int`): length of IPv6 prefix\n Return:\n None\n Raise:\n SubCommandFailure: Failed to configure Ipv4/Ipv6 address on vlan\n ", - "module_name": "iosxe.vlan.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_ip_on_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L39" - } - } - }, - "config_ip_pim": { - "folders": { - "iosxe": { - "doc": " Enables PIM sparse mode on an interface.\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n mode (`str`): specifiy pim mode\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring interface\n ", - "module_name": "iosxe.multicast.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_ip_pim", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/multicast/configure.py#L13" - } - } - }, - "config_ip_subinterface": { - "folders": { - "iosxe": { - "doc": " Configure sub-interface with IP addresses on device\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n sub_interface_num (`int`): Subinterface to be added to\n interface name\n ip_address(`str`): IP addressed to be configured on interface\n prefix(`str`): prefix to be used in configuration\n encap_type (`str`): Encapsulation type\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_ip_subinterface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L667" - } - } - }, - "config_ipv6_nd_raguard_policy": { - "folders": { - "iosxe": { - "doc": " Configure an ipv6 nd raguard policy with specified options\n Args:\n device ('obj'): device object\n policy ('str'): policy name\n options ('list'): list of policy configuration options:\n dictionary contains following keys:\n device_role ('str', optional): device role\n hop_limit ('dict', optional):\n max ('int'): maximum hop limit\n min ('int'): minimum hop limit\n managed_config_flag ('bool', optional): enable M flag\n match ('dict', optional):\n ipv6 ('str'): access list to match\n ra ('str'): prefix list to match\n other_config_flag ('bool', optional): enable O flag\n router_preference ('dict', optional): enable router preference flag\n trusted_port ('bool', optional): setup trusted port\n ex.)\n [\n {\n \"device_role\": \"host\",\n \"hop_limit\": {\n \"max\": 100,\n \"min\": 50\n },\n \"managed_config_flag\": True,\n \"match\": {\n \"ipv6\": \"test\",\n \"ra\": \"bar\"\n },\n \"other_config_flag\": False,\n \"router_preference\": \"high\",\n \"trusted_port\": True,\n }\n ]\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to configure ipv6 nd raguard policy\n ", - "module_name": "iosxe.sisf.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_ipv6_nd_raguard_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sisf/configure.py#L733" - } - } - }, - "config_ipv6_source_guard_policy": { - "folders": { - "iosxe": { - "doc": " Configure an ipv6 source-guard policy with specified options\n Args:\n device ('obj'): device object\n policy ('str'): policy name\n options ('list'): list of policy configuration options:\n dictionary contains following keys:\n deny ('str', optional): block data traffic\n permit ('str', optional): allow data traffic\n trusted ('bool', optional): setup trusted port\n validate ('str', optional): validate source of received data traffic\n ex.)\n [\n {\n \"deny\": \"global-autoconf\",\n \"permit\": \"link-local\",\n \"trusted\": True,\n \"validate\": \"address\",\n }\n ]\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to configure ipv6 source-guard policy\n ", - "module_name": "iosxe.sisf.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_ipv6_source_guard_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sisf/configure.py#L906" - } - } - }, - "config_license": { - "folders": { - "iosxe": { - "doc": " Config license on Device\n\n Args:\n device (`obj`): Device object\n license (`str`): License name\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring interface\n ", - "module_name": "iosxe.system.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_license", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/system/configure.py#L13" - } - } - }, - "config_mac_aging_time": { - "folders": { - "iosxe": { - "doc": " Config mac-aging time under bridge domain\n\n Args:\n device (`obj`): device object\n bridge_domain (`int`): bridge domain id\n aging_time (`int`): mac aging-time\n Return:\n None\n Raises:\n SubCommandFailure: Failed configuring device\n ", - "module_name": "iosxe.mac.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_mac_aging_time", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mac/configure.py#L12" - } - } - }, - "config_mac_learning": { - "folders": { - "iosxe": { - "doc": " Config mac learning under bridge domain\n\n Args:\n device (`obj`): device object\n bridge_domain (`int`): bridge domain id\n Return:\n None\n Raises:\n SubCommandFailure: Failed configuring device\n ", - "module_name": "iosxe.mac.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_mac_learning", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mac/configure.py#L70" - } - } - }, - "config_macsec_keychain_on_device": { - "folders": { - "iosxe": { - "doc": " Configures macsec key chain on device\n\n Args:\n device ('obj'): device to use\n keychain_name ('str'): keychain name to configure\n key_string ('str'): key string to configure\n lifetime ('list'): start and end timings\n ex.)\n lifetime = [\"10:36:55 Aug 18 2021\", \"10:37:55 Aug 18 2021\"]\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.macsec.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_macsec_keychain_on_device", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L86" - } - } - }, - "config_macsec_network_link_on_interface": { - "folders": { - "iosxe": { - "doc": " Configures macsec network-link on interface\n\n Args:\n device ('obj'): device to use\n interface ('str'): interface to configure\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.macsec.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_macsec_network_link_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L191" - } - } - }, - "config_macsec_replay_protection_window_size": { - "folders": { - "iosxe": { - "doc": " Configures macsec replay-protection window-size on interface\n\n Args:\n device ('obj'): device to use\n interface ('str'): interface to configure\n window_size ('str'): window size\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.macsec.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_macsec_replay_protection_window_size", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L55" - } - } - }, - "config_mka_keychain_on_interface": { - "folders": { - "iosxe": { - "doc": " Configures mka keychain on interface\n\n Args:\n device ('obj'): device to use\n interface ('str'): interface to configure\n key_string ('str'): key string to configure\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.macsec.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_mka_keychain_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L160" - } - } - }, - "config_mka_policy_xpn": { - "folders": { - "iosxe": { - "doc": " Configures mka policy xpn on device or interface\n\n Args:\n device ('obj'): device to use\n interface ('str'): interface to configure\n cipher ('str'): Cipher suite value\n sak_rekey_int ('str'): Sak rekey interval\n key_server_priority ('str'): Key server priority\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.macsec.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_mka_policy_xpn", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L251" - } - } - }, - "config_mpls_lable_protocol": { - "folders": { - "iosxe": { - "doc": " Config mpls lable protocol on interface or device\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface to be configured\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring interface\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_mpls_lable_protocol", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L309" - } - } - }, - "config_mpls_ldp_explicit_on_device": { - "folders": { - "iosxe": { - "doc": " Config mpls ldp explicit on device\n\n Args:\n device (`obj`): Device object\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring interface\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_mpls_ldp_explicit_on_device", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L514" - } - } - }, - "config_mpls_ldp_on_device": { - "folders": { - "iosxe": { - "doc": " Config ldp on Device\n\n Args:\n device (`obj`): Device object\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring interface\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_mpls_ldp_on_device", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L61" - } - } - }, - "config_mpls_ldp_on_interface": { - "folders": { - "iosxe": { - "doc": " Config ldp on interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring interface\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_mpls_ldp_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L16" - }, - "junos": { - "doc": " Config ldp on interface on junos device\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n Return:\n None\n ", - "module_name": "junos.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "junos" - }, - "uid": "config_mpls_ldp_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/junos/mpls/configure.py#L12" - } - } - }, - "config_mpls_ldp_router_id_on_device": { - "folders": { - "iosxe": { - "doc": " Config mpls ldp router id on device\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n force ('bool') : router-id is instantly changed when the interface is down if true\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring interface\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_mpls_ldp_router_id_on_device", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L361" - } - } - }, - "config_mpls_on_device": { - "folders": { - "iosxe": { - "doc": " configure mpls on device\n Args:\n device (`obj`): Device object\n loopback_intf (`str`): Interface name\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_mpls_on_device", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L231" - } - } - }, - "config_multicast_routing_mvpn_vrf": { - "folders": { - "iosxe": { - "doc": " Enables IP multicast routing for the MVPN VRF specified for the vrf-name argument.\n\n Args:\n device (`obj`): Device object\n vrf (`str`): VRF name\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring interface\n ", - "module_name": "iosxe.multicast.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_multicast_routing_mvpn_vrf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/multicast/configure.py#L70" - } - } - }, - "config_no_keepalive_intf": { - "folders": { - "iosxe": { - "doc": " configure no switchport and no keepalive on Interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface on which the edge trunk config to be applied\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_no_keepalive_intf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L178" - } - } - }, - "config_port_security_on_interface": { - "folders": { - "iosxe": { - "doc": " Configuring port security on an interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface to get address\n maximum_addresses (`int`,optional): maximum mac addresses, default value is 1\n aging_time (`str`,optional): aging time for mac address, default value is None\n aging_type (`str`,optional): aging type for mac address, default value is None\n violation_mode (`str`,optional): violation mode, default value is None\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_port_security_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L3389" - } - } - }, - "config_portchannel_range": { - "folders": { - "iosxe": { - "doc": " Configure port channel\n e.g.\n interface range port-channel 1-50\n\n Args:\n device (`obj`): Device object\n portchannel_start(`int`): Port channel number start\n portchannel_end(`int`): Port channel number end\n\n Return:\n None\n Raise:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_portchannel_range", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L3236" - } - } - }, - "config_pseudowire_class": { - "folders": { - "iosxe": { - "doc": " configure pseudowire class\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name/ip address\n pw_class ('str'): pseudowire class name\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_pseudowire_class", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L681" - } - } - }, - "config_pw_class_interface": { - "folders": { - "iosxe": { - "doc": " configure pseudowire class on interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n peer_id (`str`): peer address\n vc_id (`str`): vc id \n pw_class (`str`): pseudowire class name\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_pw_class_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L726" - } - } - }, - "config_rp_address": { - "folders": { - "iosxe": { - "doc": "Configures a static IP address of a rendezvous point for a multicast group range.\n\n Args:\n device (`obj`): Device object\n vrf (`str`): VRF name\n ip_address (`str`): IP address of the group-range \n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring rp address\n ", - "module_name": "iosxe.multicast.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_rp_address", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/multicast/configure.py#L42" - } - } - }, - "config_speed_nonego_on_interface": { - "folders": { - "iosxe": { - "doc": " Configure speed nonego on interface\n\n Args:\n device (`obj`): Device object\n interface ('str'): Interface to be configured\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring interface\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_speed_nonego_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L559" - } - } - }, - "config_standard_acl_for_ip_pim": { - "folders": { - "iosxe": { - "doc": " Configures a standard IP access list.\n Args:\n device ('obj'): device object\n acl_name ('str'): acl name\n permission ('str'): (permit | deny)\n host_ip ('str'): source start ip\n host_wildcard ('str'): increment step for source ip\n vrf ('str'): vrf name\n rp_address ('str'): mention the IP address of the rendezvous point for the group.\n bir_enabled ('boolean', optional): sets true if enabled. Defaults to False.\n Returns:\n config\n Raises:\n SubCommandFailure: Failed to configure access-list\n ", - "module_name": "iosxe.multicast.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_standard_acl_for_ip_pim", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/multicast/configure.py#L196" - } - } - }, - "config_vc_backup_peer": { - "folders": { - "iosxe": { - "doc": "configure backup peer vc on interface\n Args:\n\t device (`obj`): Device object\n\t interface (`str`): interface, backup peer need to be configured on\n peer_address (`str`): Address of the peer, main vc\n backup_peer('str'): Peer address of backup vc\n vc_id (`str`): VC ID for the back up peer\n backup_vc_id(`str`): Backup peer vc id\n pw_class(`str`): psuedowire class \n backup_pw_class(`str`): psuedowire class of backup peer\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_vc_backup_peer", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L1047" - } - } - }, - "config_vlan": { - "folders": { - "iosxe": { - "doc": " Configures a VLAN on Interface or Device\n e.g.\n vlan 666\n\n Args:\n device (`obj`): Device object\n vlanid (`str`): Vlan id\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring interface\n ", - "module_name": "iosxe.vlan.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L15" - } - } - }, - "config_vlan_range": { - "folders": { - "iosxe": { - "doc": " Configures a VLAN on Device\n e.g.\n vlan 1 - 4094\n\n Args:\n device (`obj`): Device object\n vlanid_start (`int`): Vlan id start \n vlanid_end (`int`): Vlan id end\n\n Return:\n None\n Raise:\n SubCommandFailure\n ", - "module_name": "iosxe.vlan.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_vlan_range", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L257" - } - } - }, - "config_vlan_tag_native": { - "folders": { - "iosxe": { - "doc": " Configure vlan dot1q tag native\n\n Args:\n device (`obj`): Device object\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring device\n ", - "module_name": "iosxe.vlan.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_vlan_tag_native", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L92" - } - } - }, - "config_wan_macsec_on_interface": { - "folders": { - "iosxe": { - "doc": " Configures WAN Macsec on interface \n\n Args:\n device ('obj'): device to use\n interface ('str'): interface to configure\n speed ('str'): Operation speed\n destination_address ('str'): eapol destination-address\n eth_type ('str'): eapol eth-type\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.macsec.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_wan_macsec_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L13" - } - } - }, - "config_xconnect_on_interface": { - "folders": { - "iosxe": { - "doc": " configure xconnect neighbor on Interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface on which the edge trunk config to be applied\n neighbor (`str`): Neighbor to be configured on xconnect\n vcid (`str`): Vcid to be configured through xconnect\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "config_xconnect_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L653" - } - } - }, - "configure_aaa_default_dot1x_methods": { - "folders": { - "iosxe": { - "doc": " configure aaa default dot1x methods\n Args:\n device (`obj`): Device object\n server_grp (`str`): Radius Server Grp name\n group_type ('str'): Group type. Options are 'group','cache','local'\n server_grp2 (`str`, optional): 2nd Radius Server Grp name. i.e aaa cache feature (Default is None)\n group_type2 ('str', optional): 2nd Group type. Options are 'group','cache','local' (Default is None)\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring\n Examples:\n configure_aaa_default_dot1x_methods(switch1,'testRadiusGrp')\n configure_aaa_default_dot1x_methods(switch1,'radiusGroup',group_type='cache',\n group_type2='group',server_grp2='radiusGroup')\n ", - "module_name": "iosxe.aaa.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_aaa_default_dot1x_methods", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py#L494" - } - } - }, - "configure_aaa_login_method_none": { - "folders": { - "iosxe": { - "doc": " This configure will enable login method none that is applicable for line and vty\n from getting locked for password \n Args:\n device (`obj`): Device object\n servergrp (`str`): Radius Server Grp name\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring\n ", - "module_name": "iosxe.aaa.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_aaa_login_method_none", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py#L552" - } - } - }, - "configure_aaa_new_model": { - "folders": { - "iosxe": { - "doc": " configure aaa new-model\n Args:\n device (`obj`): Device object\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring\n ", - "module_name": "iosxe.aaa.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_aaa_new_model", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py#L475" - } - } - }, - "configure_access_session_monitor": { - "folders": { - "iosxe": { - "doc": " Enable access-session monitor\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to enable access-session monitor\n ", - "module_name": "iosxe.dot1x.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_access_session_monitor", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L209" - } - } - }, - "configure_access_session_single_policy_interface": { - "folders": { - "iosxe": { - "doc": "Common funtion to configure access-session single-policy interface for both forced and without forced\n Args:\n device ('obj'): device to use\n interface (`str`): Interface name\n force (`bool`): Force the CLI. Defaults to False\n max_time (`int`): Timeout for Dialog\n Returns:\n None\n Raises:\n SubCommandFailure:Failed to configure access-session single-policy interface\n ", - "module_name": "iosxe.single_policy.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_access_session_single_policy_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/single_policy/configure.py#L35" - } - } - }, - "configure_access_session_single_policy_policy_name": { - "folders": { - "iosxe": { - "doc": "Common function to configure access-session single-policy policy-name for both forced and without forced \n Args:\n device ('obj'): device to use\n policy_name (`str`): Policy name\n force (`bool`): Force the CLI. Defaults to False\n max_time (`int`): Timeout for Dialog\n Returns:\n None\n Raises:\n SubCommandFailure:Failed to configure access-session single-policy policy-name\n ", - "module_name": "iosxe.single_policy.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_access_session_single_policy_policy_name", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/single_policy/configure.py#L58" - } - } - }, - "configure_access_session_sticky": { - "folders": { - "iosxe": { - "doc": " configure interface-template sticky timer\n Args:\n device ('obj'): device to use\n timer (int): <1-65535> Enter a value between 1 and 65535\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to configure interface-template sticky timer\n ", - "module_name": "iosxe.dot1x.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_access_session_sticky", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L237" - } - } - }, - "configure_access_vlan": { - "folders": { - "iosxe": { - "doc": " configuring access vlan configuration on interface\n Args:\n device (`obj`): Device object\n vlanid ('int') : vlan id\n interface ('str) : interface name\n Returns:\n Bool\n Raises:\n SubCommandFailure\n Example: no vlan configuration 101\n ", - "module_name": "iosxe.vlan.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_access_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L207" - } - } - }, - "configure_any_radius_server": { - "folders": { - "iosxe": { - "doc": " Configure radius server on device\n Args:\n device (`obj`): Device object\n server_name (`str`): Radius server name\n addr_type (`str`): Address type v4 or v6\n address (`str`): ISE Ip\n authport (`int`): Auth port\n acctport (`int`): Acct port\n secret (`str`): ISE Secret key\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring\n ", - "module_name": "iosxe.aaa.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_any_radius_server", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py#L385" - } - } - }, - "configure_arp_timeout": { - "folders": { - "iosxe": { - "doc": " Config arp timeout on interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n timeout (`int`): timeout in second\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.arp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_arp_timeout", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/arp/configure.py#L12" - } - } - }, - "configure_attachment_circuit_vfi": { - "folders": { - "iosxe": { - "doc": "\n configure the Attachment Circuit with the VFI.\n Args:\n\t device (`obj`): Device \n interface(`str`): interface name\n vfiname(`str`): the Layer 2 VFI that you are binding to the VLAN port\n Returns:\n None\n Raises:\n SubCommandFailure\n\t", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_attachment_circuit_vfi", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L1385" - } - } - }, - "configure_auth_method": { - "folders": { - "iosxe": { - "doc": "Configure cli \n authentication method mab/dot1x pae authenticator\n Args:\n device (`obj`): Device object\n value (`str`): mab/dot1x\n intf (`str`): Interface to configure\n Return: \n None\n Raise:\n SubCommandFailure: Failed configuring \n ", - "module_name": "iosxe.dot1x.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_auth_method", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L831" - } - } - }, - "configure_authentication_convert_to_new_style": { - "folders": { - "iosxe": { - "doc": "Common function to configure authentication convert-to new-style for both forced and without forced\n Args:\n device ('obj'): device to use\n force (`bool`): Force the CLI. Defaults to False\n max_time (`int`): Timeout for Dialog\n Returns:\n None\n Raises:\n SubCommandFailure:Failed to configure authentication convert-to new-style\n ", - "module_name": "iosxe.single_policy.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_authentication_convert_to_new_style", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/single_policy/configure.py#L80" - } - } - }, - "configure_authentication_convert_to_new_style_single_policy_interface": { - "folders": { - "iosxe": { - "doc": "Common funtion to configure authentication convert-to new-style\n single-policy interface for both forced and without forced \n Args:\n device ('obj'): device to use\n interface (`str`): Interface name\n force (`bool`): Force the CLI. Defaults to False\n max_time (`int`): Timeout for Dialog\n Returns:\n None\n Raises:\n SubCommandFailure:Failed to configure authentication convert-to new-style single-policy interface\n ", - "module_name": "iosxe.single_policy.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_authentication_convert_to_new_style_single_policy_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/single_policy/configure.py#L11" - } - } - }, - "configure_authentication_host_mode": { - "folders": { - "iosxe": { - "doc": "Configure legacy cli authentication host-mode multi-auth/multi-domain/multi-host/single-host\n Args:\n device (`obj`): Device object\n mode (`str`): Host mode\n intf (`str`): Interface to configure\n style (`str`, optional): legacy or new (Default is legacy)\n Return: \n None\n Raise:\n SubCommandFailure: Failed configuring \n ", - "module_name": "iosxe.dot1x.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_authentication_host_mode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L537" - } - } - }, - "configure_authentication_order": { - "folders": { - "iosxe": { - "doc": "Configure legacy cli authentication order dot1x/mab/webauth\n Args:\n device (`obj`): Device object\n order (`str`): mab dot1x/dot1x/mab/dot1x mab\n intf (`str`): Interface to configure\n Return: \n None\n Raise:\n SubCommandFailure: Failed configuring \n ", - "module_name": "iosxe.dot1x.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_authentication_order", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L594" - } - } - }, - "configure_authentication_parameters_interface": { - "folders": { - "iosxe": { - "doc": " Configure authentication parameters on interface\n\n Args:\n device (`obj`): Device object\n interface (`str`): interface to configure the authentication parameters\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_authentication_parameters_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L2409" - } - } - }, - "configure_authentication_periodic": { - "folders": { - "iosxe": { - "doc": "Configure legacy cli \n authentication periodic\n Args:\n device (`obj`): Device object\n intf (`str`): Interface to configure\n Return: \n None\n Raise:\n SubCommandFailure: Failed configuring \n ", - "module_name": "iosxe.dot1x.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_authentication_periodic", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L742" - } - } - }, - "configure_authentication_port_control": { - "folders": { - "iosxe": { - "doc": "Configure legacy cli \n authentication port-control auto/force-authorized/force-unauthorized\n Args:\n device (`obj`): Device object\n control (`str`): auto/force-authorized/force-unauthorized\n intf (`str`): Interface to configure\n style (`str`, optional): legacy or new (Default is legacy)\n Return: \n None\n Raise:\n SubCommandFailure: Failed configuring \n ", - "module_name": "iosxe.dot1x.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_authentication_port_control", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L682" - } - } - }, - "configure_authentication_priority": { - "folders": { - "iosxe": { - "doc": "Configure legacy cli authentication priority dot1x/mab/webauth\n Args:\n device (`obj`): Device object\n priority (`str`): mab dot1x/dot1x/mab/dot1x mab\n intf (`str`): Interface to configure\n Return: \n None\n Raise:\n SubCommandFailure: Failed configuring \n ", - "module_name": "iosxe.dot1x.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_authentication_priority", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L638" - } - } - }, - "configure_authentication_timer_reauth": { - "folders": { - "iosxe": { - "doc": "Configure legacy cli \n authentication timer reauthenticate value/server\n Args:\n device (`obj`): Device object\n value (`str`): authentication timer reauthenticate value/server\n intf (`str`): Interface to configure\n Return: \n None\n Raise:\n SubCommandFailure: Failed configuring \n ", - "module_name": "iosxe.dot1x.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_authentication_timer_reauth", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dot1x/configure.py#L786" - } - } - }, - "configure_autodiscovery_bgp_signalling_ldp_template": { - "folders": { - "iosxe": { - "doc": " Config autodiscovery bgp signaling ldp template\n Args:\n device (`obj`): Device object\n context_name ('str'): context name for the template\n vpn_id ('str'): vpn id to be configured\n template_name('str'): name of the template\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring interface\n ", - "module_name": "iosxe.mpls.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_autodiscovery_bgp_signalling_ldp_template", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L1511" - } - } - }, - "configure_bfd_on_interface": { - "folders": { - "iosxe": { - "doc": " Configures bfd on interface\n\n Args:\n device ('obj'): device to use\n interface ('str'): interface to configure\n interval ('str'): interval\n min_rx ('str'): min_rx\n multiplier ('str'): multiplier\n Returns:\n None\n Raises:\n SubCommandFailure: Failed configuring bfd on interface\n\n ", - "module_name": "iosxe.bfd.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bfd_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bfd/configure.py#L12" - } - } - }, - "configure_bgp_additional_paths": { - "folders": { - "iosxe": { - "doc": " Configure additional_paths on bgp router\n\n Args:\n device ('obj'): device to use\n bgp_as ('int'): bgp router to configure\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing configure commands\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_additional_paths", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L825" - } - } - }, - "configure_bgp_address_advertisement": { - "folders": { - "iosxe": { - "doc": " Configure address advertisement on router bgp\n\n Args:\n device ('obj'): device to use\n bgp_as ('int'): bgp router to configure\n address_family ('str'): address family to configure under\n ip_address ('str'): ip address\n mask ('str'): mask\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing configure commands\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_address_advertisement", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L883" - } - } - }, - "configure_bgp_address_family_attributes": { - "folders": { - "iosxe": { - "doc": " configure attributes for bgp \n\n Args:\n device ('obj'): device to use\n bgp_as ('int'): bgp router to configure\n address_family ('str'): address family to configure under\n neighbor ('str'): neighbor address to send label\n send_label (`boolean`) : send MPLS labels with the routes if true\n route_reflector_client (`boolean`) : sets a device as routing information exchange server if true\n next-hop-self all (`boolean`) : sets a device as routing information exchange server if true\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing configure commands\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_address_family_attributes", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L954" - } - } - }, - "configure_bgp_advertise_additional_paths": { - "folders": { - "iosxe": { - "doc": " Configures advertisement for additional paths\n\n Args:\n device ('obj'): device to configure\n bgp_as ('str'): router bgp number\n neighbor ('str'): neighbor to advertise to\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing configure commands\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_advertise_additional_paths", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L853" - } - } - }, - "configure_bgp_graceful_restart": { - "folders": { - "iosxe": { - "doc": " Configures graceful-restart on BGP router\n\n Args:\n device('obj'): device to configure on\n bgp_as('str'): bgp_as to configure\n Return:\n N/A\n Raises:\n SubCommandFailure: Failed executing command\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_graceful_restart", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1023" - } - } - }, - "configure_bgp_import_path_selection": { - "folders": { - "iosxe": { - "doc": " Configures import path selection on BGP router\n Args:\n device('obj'): device to configure\n bgp_as('str'): bgp id\n address_family:('str'): address family\n vrf('str'): vrf name\n type('str'): type of selection to configure\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing command\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_import_path_selection", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L25" - } - } - }, - "configure_bgp_l2vpn_neighbor_activate": { - "folders": { - "iosxe": { - "doc": " Activate bgp neighbor on bgp router \n\n Args:\n device ('obj') : Device to be configured\n bgp_as ('str') : Bgp Id to be added to configuration\n neighbor_address ('str') : Address of neighbor to be added to configuration\n address_family ('str') : Address family to be configured\n address_family_modifier ('str') : the endpoint provisioning information to be distributed\n to BGP peers.\n community('str') : Specifies the communities attribute to be sent to a BGP neighbor.\n\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing configure commands\n \n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_l2vpn_neighbor_activate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L507" - } - } - }, - "configure_bgp_log_neighbor_changes": { - "folders": { - "iosxe": { - "doc": " Configures log-neighbor-changes on BGP router\n\n Args:\n device('obj'): device to configure on\n bgp_as('str'): bgp_as to configure\n Return:\n N/A\n Raises:\n SubCommandFailure: Failed executing command\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_log_neighbor_changes", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1047" - } - } - }, - "configure_bgp_neighbor": { - "folders": { - "iosxe": { - "doc": " Configures bgp neighbor on bgp router\n\n Args:\n device('obj'): device to configure on\n bgp_as('str'): bgp_as to configure\n neighbor_as('str'): neighbor_as to configure\n neighbor_address('str'): address of neighbor\n source_interface('str',optional): used to configure update-source on neighbor ( Default is None )\n ebgp('str',optional): used to configure ebgp-mulithop ( Default is None )\n address_family('str',optional): address family ( Default is None )\n vrf('str',optional): vrf to configure address_family with ( Default is None )\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing command\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_neighbor", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L95" - } - } - }, - "configure_bgp_neighbor_activate": { - "folders": { - "iosxe": { - "doc": " Activate bgp neighbor on bgp router \n\n Args:\n device ('obj') : Device to be configured\n bgp_as ('str') : Bgp Id to be added to configuration\n neighbor_address ('str') : Address of neighbor to be added to configuration\n address_family ('str') : Address family to be configured\n steps('obj') : Context manager steps\n peer_policy('str') : peer policy to be configured\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing configure commands\n \n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_neighbor_activate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L434" - } - } - }, - "configure_bgp_neighbor_as_override": { - "folders": { - "iosxe": { - "doc": " Configure AS override in VRF\n Args:\n device ('obj'): Device object\n bgp_as ('str'): Router bgp\n vrf ('str'): Vrf name\n neighbor_address ('str'): Neighbor address\n address_family ('str'): Address family\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing configure commands\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_neighbor_as_override", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L789" - } - } - }, - "configure_bgp_neighbor_remote_as": { - "folders": { - "iosxe": { - "doc": " Configure destination in vrf\n Args:\n device ('obj'): Device object\n bgp_as ('str'): Router bgp\n vrf ('str'): Vrf name\n neighbor_as ('str'): Destination\n neighbor_address ('str'): Neighbor address\n address_family ('str'): Address family\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing configure commands\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_neighbor_remote_as", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L730" - } - } - }, - "configure_bgp_neighbor_send_community": { - "folders": { - "iosxe": { - "doc": " Add send-community attribute for bgp neighbor on bgp router\n\n Args:\n device ('obj') : Device to be configured\n bgp_as ('str') : Bgp Id to be added to configuration\n neighbor_address ('str') : Address of neighbor to be added to configuration\n address_family ('str') : Address family to be configured\n vrf ('str') : vrf name\n send_community ('str') : send-community attribute to be configured\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing configure commands\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_neighbor_send_community", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1071" - } - } - }, - "configure_bgp_redistribute_connected": { - "folders": { - "iosxe": { - "doc": " Configures redistrubute connected on BGP router\n Args:\n device('obj'): device to configure\n bgp_as('str'): bgp id\n address_family:('str'): address family\n vrf('str'): vrf name\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing command\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_redistribute_connected", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1300" - } - } - }, - "configure_bgp_redistribute_ospf": { - "folders": { - "iosxe": { - "doc": " Configures redistribute ospf on BGP router\n Args:\n device('obj'): device to configure\n bgp_as('str'): bgp id\n address_family:('str'): address family\n ospf_instance('str'): ospf redistribute to configure\n vrf('str'): vrf name\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing command\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_redistribute_ospf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1195" - } - } - }, - "configure_bgp_router_id": { - "folders": { - "iosxe": { - "doc": " Configures router-id on BGP router\n\n Args:\n device('obj'): device to configure on\n bgp_as('str'): bgp_as to configure\n router_id('str'): router_id of device\n Return:\n N/A\n Raises:\n SubCommandFailure: Failed executing command\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_router_id", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L60" - } - } - }, - "configure_bgp_soo_on_inbound_from_neighbor": { - "folders": { - "iosxe": { - "doc": " Configures extended community SoO on inbound from neighbor using soo_rt\n\n Args:\n device('obj'): device to execute on\n soo_rt('str'): route to configure SoO with\n bgp_as('str'): what router bgp to configure on\n vrf('str'): what vrf to configure on\n neighbor_address('str'): what neighbor to configure on\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing configure commands\n\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_soo_on_inbound_from_neighbor", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L168" - } - } - }, - "configure_bgp_template_peer_policy": { - "folders": { - "iosxe": { - "doc": " Configures template peer-policy on BGP\n Args:\n device('obj'): device to configure\n bgp_as('str'): bgp id\n policy:('str'): policy to be configured\n send_community('str'): community to be configured\n route_reflect_client('str') : enable router to acts as a routing information exchange server for all other iBGP routers.\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing command\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_template_peer_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1233" - } - } - }, - "configure_bgp_template_peer_session": { - "folders": { - "iosxe": { - "doc": " Configures template peer-session on BGP\n Args:\n device('obj'): device to configure\n bgp_as('str'): bgp id\n session_name:('str'): session name to be used\n remote_as('str'): remote as to configured\n source_intf('str'): source interface to be used\n neighbor('str'): neighbor ip\n Returns:\n N/A\n Raises:\n SubCommandFailure: Failed executing command\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_template_peer_session", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1266" - } - } - }, - "configure_bgp_update_delay": { - "folders": { - "iosxe": { - "doc": " Configures update_delay time on BGP router\n Args:\n device('obj'): device to configure on\n bgp_as('str'): bgp_as to configure\n delay('int'): router_id of device\n Return:\n N/A\n Raises:\n SubCommandFailure: Failed executing command\n ", - "module_name": "iosxe.bgp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_bgp_update_delay", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1497" - } - } - }, - "configure_boot_manual": { - "folders": { - "iosxe": { - "doc": " boot manual\n Args:\n device (`obj`): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.platform.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_boot_manual", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L30" - } - } - }, - "configure_by_jinja2": { - "doc": " Configure using Jinja template\n\n Args:\n device ('obj'): Device object\n templates_dir ('str'): Template directory\n template_name ('str'): Template name\n kwargs ('obj'): Keyword arguments\n Returns:\n Boolean\n Raises:\n None\n ", - "folders": {}, - "module_name": "jinja.utils", - "package": "genie.libs.sdk.apis", - "uid": "configure_by_jinja2", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/jinja/utils.py#L20" - }, - "configure_cdp": { - "folders": { - "ios": { - "doc": " \n Enables cdp on target device\n Args:\n device ('obj'): Device object\n Returns:\n None\n ", - "module_name": "ios.cdp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "ios" - }, - "uid": "configure_cdp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/ios/cdp/configure.py#L11" - }, - "iosxe": { - "doc": " Enables cdp on target device\n Args:\n device ('obj'): Device object\n Returns:\n None\n ", - "module_name": "iosxe.cdp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_cdp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cdp/configure.py#L11" - }, - "iosxr": { - "doc": " Enables cdp on target device\n Args:\n device ('obj'): Device object\n Returns:\n None\n ", - "module_name": "iosxr.cdp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxr" - }, - "uid": "configure_cdp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/cdp/configure.py#L11" - }, - "nxos": { - "doc": " Enables cdp on target device\n Args:\n device ('obj'): Device object\n Returns:\n None\n ", - "module_name": "nxos.cdp.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "nxos" - }, - "uid": "configure_cdp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/cdp/configure.py#L9" - } - } - }, - "configure_class_map": { - "folders": { - "iosxe": { - "doc": " Configures class-map\n Args:\n device ('obj'): device to use\n class_name ('str'): name of the class \n match_val ('str'): values of the match\n match_mode ('str',optional): name of the match_mode, default is None\n match_val1 ('str',optional): name of the match_mode 2, default is None\n match_mode1 ('str',optional): name of the match_mode type, default is None\n class_match_type ('str',optional): name of the match type, default is match-all\n access_group ('bool', optional): create class match with acls groups, default is False\n\n Returns:\n None\n Raises:\n SubCommandFailure \n ", - "module_name": "iosxe.policy_class_map.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_class_map", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/policy_class_map/configure.py#L13" - } - } - }, - "configure_coa": { - "folders": { - "iosxe": { - "doc": "\n COA Configuration for dot1x and mab\n Args:\n device ('obj'): Device object\n config_dict ('dict'): Dictionary of interface configuration details\n dictionary contains following keys:\n auth_type(all, any, session-key) : all(Matches when all attributes match)\n any(Matches when all sent attributes match)\n session-key(Matches with session key attribute only)\n hostname(hostname/ipv4/ipv6) : Ip/ipv6 or hostname of the RADIUS client\n encryption_type(0,6,7): 0(UNENCRYPTED), 6(ENCRYPTED), 7(HIDDEN)\n server_key(str) : Specify a RADIUS client server-key\n ignore_retransmission(bool) : Drop packets using same radius id\n ignore_server-key(bool) : Ignore shared secret\n ignore_session-key(bool) : Ignore attr 151\n\n Returns:\n None\n\n Example: {\n 'auth_type': 'all',\n 'hostname': 'hostname',\n 'encryption_type' : 0,\n 'server_key' : 'secretkey',\n 'ignore_retransmission': True,\n 'ignore_server_key': True,\n 'ignore_session_key': True\n }\n\n ", - "module_name": "iosxe.aaa.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_coa", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py#L209" - } - } - }, - "configure_common_criteria_policy": { - "folders": { - "iosxe": { - "doc": " Configure aaa common criteria policy\n Args:\n device (`obj`): Device object\n policy_name (`str`): Policy name\n char_changes (`str`, optional): Number of change characters between old and new passwords\n copy (`str`, optional): Copy from policy\n lifetime (`dict`, optional): lifetime configuration\n lower_case (`str`, optional): Number of lower-case characters\n upper_case (`str`, optional): Number of upper-case characters\n max_len (`str`, optional): Specify the maximum length of the password\n min_len (`str`, optional): Specify the minimum length of the password\n no_value (`dict`, optional): value to unconfigure\n num_count (`str`, optional): Number of numeric characters\n special_case (`str`, optional): Number of special characters\n\n Return:\n None\n Raise:\n SubCommandFailure: Failed configuring\n ", - "module_name": "iosxe.aaa.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_common_criteria_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py#L846" - } - } - }, - "configure_community_list_community_list_permit": { - "folders": { - "iosxe": { - "doc": " Configure community list permit\n\n Args:\n device ('obj'): Device object\n community_list('list'): community list which contains dictionary\n dictionary contains following 3 keys:\n seq ('int'): sequence number\n permit ('str'): permit value\n community ('str'): community value - Optional\n ex.)\n [ \n {\n 'seq': 1,\n 'permit': 'deny',\n 'community': 62000:1\n },\n { \n 'seq': 1,\n 'permit': 'permit'\n },\n {\n 'seq': 2,\n 'permit': 'deny',\n 'community': '62000:2'\n },\n {\n 'seq': 2,\n 'permit': 'permit'\n }\n ]\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.community_list.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_community_list_community_list_permit", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/community_list/configure.py#L15" - } - } - }, - "configure_control_plane_control_plane_policy": { - "folders": { - "iosxe": { - "doc": " Configure control plane policy\n\n Args:\n device ('obj'): Device object\n config('list'): List of commands to configure\n ex.)\n [\n {\n 'policy_name': 'Control_Plane_In',\n 'remove': False\n },\n {\n 'policy_name': 'Control_Plane_In',\n 'remove': True\n }\n ]\n Returns:\n None\n Raises:\n SubCommandFailure: Failed configuring control plane policy\n\n ", - "module_name": "iosxe.control_plane.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_control_plane_control_plane_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/control_plane/configure.py#L11" - } - } - }, - "configure_control_policies": { - "folders": { - "iosxe": { - "doc": " Configure policy-map on an device\n\n Args:\n device (`obj`): Device object\n policy_name (`str`): name of the policy\n event (`str`,optional): event name, default value is None\n match (`str`,optional): match-all or match-first, default value is None\n class_number (`int`,optional): class number between 1 to 254, default value is None \n class_name (`str`,optional): class name if any exists, default value is None\n class_action (`str`,optional): class action to be perform, default value is None\n action_number (`int`,optional): action number between 1 to 254, default value is None\n action (`str`,optional): action to be perform under this class, default value is None\n action_method (`str`,optional): Mab or dot1x or webauth, default value is None\n auth_rest_timer ('int', optional): Authentication restart timer, default value is None\n template_name (`str`,optional): Template name, default value is None\n priority ('int', optional): Priority vlaue, default value is None\n dot1x_type (`str`,optional): Dot1 type. default value is None\n retries (`str`,optional): retries option. default value is None\n retry_time (`str`,optional): retry-time option. default value is None\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", - "module_name": "iosxe.interface.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_control_policies", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L3449" - } - } - }, - "configure_controller_service_policy": { - "folders": { - "iosxe": { - "doc": " Configure mDNS(Multicast Domain Name System) controller service-policy\n \n mdns-sd controller service-policy contrl-policy\n service-list contrl-list3\n end\n \n Args:\n device ('obj'): device to use\n name ('str')\n service_list ('list'):\n\n Returns:\n None\n Raises:\n SubCommandFailure: Failed configuring mdns controller service-policy\n ", - "module_name": "iosxe.mdns.configure", - "package": "genie.libs.sdk.apis", - "tokens": { - "os": "iosxe" - }, - "uid": "configure_controller_service_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mdns/configure.py#L1361" - } - } - }, - "configure_crypto_ikev2_NAT_keepalive": { - "folders": { - "iosxe": { - "doc": " Configure crypto ikev2 nat keepalive