cisco IOS XE 17.16.x — Cisco Python Module

except CLIConfigurationError as e: print "Failed configurations:" for failure in e.failed: print failure Args: configuration (str or iterable): Configuration commands, separated by newlines. Returns: list(ConfigResult): A list of results, one for each line. Raises: CLISyntaxError: If there is a syntax error in the configuration. >>> help(configurep) Help on function configurep in module cli: configurep(configuration) Apply a configuration (set of Cisco IOS CLI config-mode commands) to the device and prints the result. configuration = '''interface gigabitEthernet 0/0 no shutdown''' # push it through the Cisco IOS CLI. configurep(configuration) Args: configuration (str or iterable):

Configuration commands, separated by newlines. >>> help(execute) Help on function execute in module cli: execute(command) Execute Cisco IOS CLI exec-mode command and return the result. command_output = execute("show version") Args: command (str): The exec-mode command to run. Returns: str: The output of the command. Raises: CLISyntaxError: If there is a syntax error in the command. >>> help(executep) Help on function executep in module cli: executep(command) Execute Cisco IOS CLI exec-mode command and print the result. executep("show version") Args: command (str): The exec-mode command to run. >>> help(cli) Help on function cli in module cli:

cli(command) Execute Cisco IOS CLI command(s) and return the result. Shells and Scripting Cisco Python Module Programmability Configuration Guide, Cisco IOS XE 17.16.x 134