IOSXE

This section lists down all those services which are only specific to IOSXE. For list of all the other service please refer this: Common Services.

rommon

Service to bring the device to rommon mode and execute commands (optional). If commands are specified, the router will be brought to rommon mode and the commands will be executed. If no commands are specified, the router will be brought to rommon mode only.

To bring the router back to enable mode, you can use the enable() service. See examples below.

The command to be executed can be passed as a multiline string or a list.

Argument

Type

Description

command

str or list

command(s) to be issued on device.

reply

Dialog

additional dialogs/new dialogs which are not handled by default.

timeout

int

timeout value in sec, Default Value is 600 sec

prompt_recovery

bool (default False)

Enable/Disable prompt recovery feature

return :
  • (str) command output

# bring device to rommon mode
rtr.rommon()

# specify timeout to bring device to rommon mode
rtr.rommon(timeout=1800)

# execute command in rommon mode
rtr.rommon('MANUAL_BOOT=yes')

# bring router to rommon mode
rtr.rommon()

# execute rommon command
rtr.execute('MANUAL_BOOT=yes')

# If the router is in rommon mode, you can use enable()
# to bring router to enable mode

# boot with default boot command
rtr.enable()
# boot with specified image
rtr.enable(image='flash:packages.conf')

maintenance_mode

Service to bring the device to maintenance mode. The service is intended to be used as a context manager. see example below.

# using a context manager
with uut.maintenance_mode() as m:
    m.execute('help'):

# using switchto command
uut.switchto('maintenance')
uut.execute('help')
uut.switchto('enable')

Settings

You can adjust the following timer settings for the maintenance service:

  • MAINTENANCE_MODE_WAIT_TIME (default: 30) # How long to wait before sending enter to check the prompt

  • MAINTENANCE_MODE_TIMEOUT (default: 2400) # Overall timeout for maintenance mode