11-17-2025 03:18 PM
I'm exploring network programming because I've got a project where it seems like it would be critical / necessary. I want to develop an automated way to backup the running config, diff it to the last stored copy, store / version if different, and most importantly be able to automate a full restore or going back to a prior version.
I discovered RESTconf and how I can use it to pull the full running-config from Cat9300 that I setup for this testing lab. That was between use of Google, YouTube videos, and some use of GenAi. Pretty neat. Just using 'postman' at the moment to start out with delivering the API calls / curl statements.
Where I'm confused or not sure about what to research is how to "deliver" the versioned prior config. As far as REST, this can't be done. That is, I have to use a pre-existing method like scp, http, ftp, tftp, etc, first to upload. Then I might be able to use REST to "configure replace" the file or such. Or maybe I need do use something else like Anisble to script the file delivery and command execution.
In general, am I on the right track? Is there something I'm missing. Easier way to do this? Thanks, I appreciate any feedback.
11-18-2025 01:46 AM
11-18-2025 06:26 AM
Ok, so the para / netmiko, etc, looks like those are libraries for Python. While that's news to me, I am working together with a coder and they might be familiar with one or multiple. Seems like my role would then be to deliver the CLI commands / IP addressing and User / PW combos, right?
11-18-2025 06:43 AM - edited 11-18-2025 06:43 AM
Yes and this is why you are a huge asset to this group building the code, as netmiko is built specifically for network engineers to handle the CLI over SSH. It abstracts away the "human" parts of SSH sessions.
The build approach of start small and design for scale and portability and focusing on a framework is key to making your effort worthwhile across your devices as you scale up. A solid automation framework should be broken into three portable, distinct stages: Data, Logic, and Execution.
Good luck!
11-18-2025 02:15 AM
If you are starting I think it makes sense to use files to get the cli config and push the cli config to the device storage, from there use a cli command (Ansible, python) to replace/merge the config.
There is a more programmatic approach, but might be too complicated, which is using RESTCONF operations (http verbs) but you would need to handle the config in a structured way. https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/1717/b_1717_programmability_cg/m_1717_prog_restconf.html
For small projects go with the first option.
11-18-2025 06:32 AM - edited 11-18-2025 06:40 AM
Idea right now is to start small then scale. Would like to develop a framework that is transferable / portable / adaptable. Scale size maybe 10-20 network devices (mostly MLS maybe some ASA).
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide