06-08-2016 05:53 AM - edited 03-01-2019 04:28 AM
My team is looking for a suggestion of the best way to implement a method to change of the assigned Voice VLAN on a port. Here are the assumptions:
- All switches are Catalyst switches, but of various models and IOS versions
- The program will be written in Node.JS
- We will know the switchport name, IP address of the switch, IP address and MAC Address of a currently connected endpoint to that switch port, and any credentials to the switch
- We will know the Voice VLAN that we want to set on the port
We had looked into APIC-EM as an option, but it does not appear to have the Northbound APIs to make these kinds of changes.
Otherwise we wanted to get some opinions on whether to implement a SSH client in Node.JS, or possibly use SNMP. In addition, if there are any other ideas of other tools or methods to simplify the effort, it would be greatly appreciated.
06-08-2016 12:25 PM
You are correct, APIC-EM does not expose a "VLAN" change API. There is a reason for that.
There are two other options:
1) If you have Prime Infrastructure, it will let you run command templates that would do this via a REST API.
2) You could use something like WSMA to talk to the switch as well. I wrote a little WSMA python library that shows you how this can be done. GitHub - aradford123/wsma_python: a python module and examples for using the Cisco WSMA protocol for device programabili…
If you are interested in the Prime option I can share some code to show how that works with a template.
06-09-2016 12:30 AM
I was also looking for a solution beside APIC-EM to change the configuration of devices. I'm developing a webportal which is able to communicate with APIC-EM. PI seems to be a good combination alongside APIC-EM.
If you could share some code of the Prime option you mentioned, that would be awesome!
06-14-2016 11:12 PM
Some sample code here. .https://github.com/aradford123/cisco-prime-infrastructure-examples.git
auto_templates/configure_interface.py shows the API calls you can use. It is actually pretty simple.
I will add more info on the README
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