I am trying to change switch configurations from different vendors using python. So far i tested using
Netmiko. While these gets the work done but requires device specific commands, which is troublesome. Currently, using
ncclient(Netconf) in python eases the process a bit but still device specific parametes has to be explicitly mentioned.
As an example,
xml to change the hostname of an FS switch:
<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <system xmlns="urn:fs:params:xml:ns:yang:system"> <hostname>device-hostname</hostname> </system> </config>
At this moment i don't have access to any other devices that supports Netconf but by looking at different examples on Cisco IOS:
<config> <native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native"> <hostname>device-hostname</hostname> </native> </config>
<configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm"> <system> <host-name>device-hostname</host-name> </system> </configuration>
i see that settings for specific vendor(or OS) is different.
Is there a universal solution for this or do i have to modify the source code every time i integrate a new device? Basically what i am trying to achieve is changing some basic device and switch interface level configurations through use of a single format(template) for any vendor.
I am quite new to networking and automation stuff, so any kind of hints or suggestions will be helpful. TIA.