Posts

Showing posts with the label Python

Working with Cisco Support APIs using Python (Part I)

Image
Now a days the buzzword is consume everything using automation through programming. And one way of the consumption is achieved by using REST API and JSON. Let's talk about one such API provided by Cisco - Support APIs. What is Cisco Support APIs? Cisco's own definition is - Cisco Support APIs allows us to programmatically access and consume Cisco Support data in the cloud in a simple, secure, and scalable manner. Let's make our own easily explainable definition - We have a Cisco Catalyst Switch; we want to know detail information about our switch like - bug lists, end-of-life data, recommended software suggestions etc. The Cisco Support APIs allows us to manage all those above and much more by consuming their support api's from cloud. Before going further on I need to introduce two URLs which is required to follow through this blog post -  https://apiconsole.cisco.com . This is the administrative portal where we configure our API access, tokens etc. https://dev...

Network Device Configuration Templating with YAML, Jinja2, Python and Ansible

It was long time I had some fun writing some programming code. The other day I was thinking about one of my daily assignment as a network engineer - configuring network devices. Most of the time when we configure a network device -  we start from a predefined configuration template which is copied from an existing device  (the actual configuration) ; then open it in a text editor and do a search and replace operation to change the configuration according to the new device and it's configurations. What is wrong with this approach? First of all most of the time there is a risk that we will forget to change something; because we are doing a search and replace in a text editor and we have not made a list what are the things/configurations only need to change. Secondly there is no reusability; every time I need to open this text file and make changes by hand. Let's think for a moment. What are the things we actually change - when we configure a new device from an existing configura...