Created
October 26, 2014 03:50
-
-
Save fredhsu/211afdd5be3fab03cb6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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