Moler provides command support for two Juniper device families:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nokia/moler/llms.txt
Use this file to discover all available pages before exploring further.
moler.cmd.juniper— Junos CLI and configuration mode commands for Juniper routers.moler.cmd.juniper_ex— Commands for Juniper EX-series switches (extends the router module).
GenericJuniperCommand (moler.cmd.juniper.genericjuniper), which itself extends CommandTextualGeneric.
Juniper commands are typically connection-changing: they transition between the CLI (
> prompt) and configuration (# prompt) modes. They signal completion by detecting the target prompt rather than returning parsed data.Command list
Juniper (router) — moler.cmd.juniper
| Class | Module | Shell command | Mode |
|---|---|---|---|
Configure | moler.cmd.juniper.cli.configure | configure | CLI → configure |
ExitConfigure | moler.cmd.juniper.configure.exit_configure | exit | configure → CLI |
GenericJuniperCommand | moler.cmd.juniper.genericjuniper | (abstract base) | — |
Juniper EX (switch) — moler.cmd.juniper_ex
| Class | Module | Shell command | Mode |
|---|---|---|---|
GenericJuniperExCommand | moler.cmd.juniper_ex.genericjuniperex | (abstract base) | — |
Detailed reference
Configure — moler.cmd.juniper.cli.configure
Switches the Juniper device from CLI mode to configuration mode by sending the configure command and waiting for the configuration-mode prompt.
Moler connection to the Juniper device.
Regex for the starting CLI prompt. Defaults to generic detection.
Regex for the target configuration-mode prompt. Default
r'^admin@switch#'.Characters used to split output lines.
Newline characters for the remote system. Default
"\r\n".Runner used to execute the command.
{} when the expected configuration-mode prompt is detected. ret_required is False.
ExitConfigure — moler.cmd.juniper.configure.exit_configure
Exits Juniper configuration mode by sending exit and waiting for the CLI-mode prompt.
Moler connection to the Juniper device.
Regex for the starting configuration-mode prompt.
Regex for the target CLI-mode prompt. Default
r'^admin@switch>'.Newline characters for the remote system. Default
"\r\n".{} when the expected CLI-mode prompt is detected.
Typical Juniper workflow
A typical test sequence enters configuration mode, applies changes, then returns to CLI mode:Base classes
GenericJuniperCommand — moler.cmd.juniper.genericjuniper
Abstract base for all Juniper router commands. Accepts connection, prompt, newline_chars, and runner. Inherits all textual parsing infrastructure from CommandTextualGeneric.
GenericJuniperExCommand — moler.cmd.juniper_ex.genericjuniperex
Abstract base for Juniper EX-series switch commands. Extends GenericJuniperCommand with EX-specific defaults.