Skip to content

Instantly share code, notes, and snippets.



Created Oct 26, 2014
What would you like to do?
import json
from jsonrpclib import Server
switches = ["bleaf1", "bleaf2", "bleaf3", "bleaf5"]
username = "admin"
password = "admin"
for switch in switches:
urlString = "https://{}:{}@{}/command-api".format(username, password, switch)
switchReq = Server( urlString )
response = switchReq.runCmds( 1, ["enable", "show running-config"], "text" )
print response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment