I am wondering if there is a way to run the “configure replace” command using eApi. I can run other configure commands which are run from the config prompt, but “configure replace” runs out of the config mode. Any help is appreciated.
Few comments about ”I can run other configure commands which are run from the config prompt, but ”configure replace” runs out of the config mode”
Note that any/most Exec (non-config) commands can be ran in config mode. Below are examples of few Exec-only commands that run fine in Config mode. The CLI will automatically find where to execute then from.
vEOS1__21:46:02(config)#int e1
vEOS1__21:46:04(config-if-Et1)#term monitor
vEOS1__21:46:22(config-if-Et1)#show ver | i Soft
Software image version: 4.15.0F
vEOS1__21:46:27(config-if-Et1)#reload ?
at Perform reload at specified time
cancel Cancel the existing reload command
in Perform the reload after specified delay
now Perform action immediately without prompting
power Power-cycle the system
<cr>
eAPI can run any Config or non-Config (Exec) commands you want.
About the command ”configure replace” specifically, you could run it from config mode, but in your eAPI code you would not need to go in config mode for that.
Switch(config-if-Et1)#diff run start
Switch(config-if-Et1)#configure replace flash:startup-config ?
ignore-errors Replace config, ignoring any errors in loading the config
<cr>
Note that the above keywords might be slightly different in your version, the mandatory ”force” is now deprecated, with instead an optional ”ignore-errors”. I would recommend you upgrade EOS to account for the newest features available and most up to date syntax. The syntax should normally not change, it was an exception for a new feature being developed as part of the config session features.
Arista Networks, Inc. uses cookies to ensure that we give you the best experience on our website.
By continuing to use our site, you indicate that you consent to receive cookies from our website. Details about Arista's use of cookies can be found here.