Skip to content

Instantly share code, notes, and snippets.

@fredhsu
Created October 26, 2014 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fredhsu/45e35a020366b6c92f53 to your computer and use it in GitHub Desktop.
Save fredhsu/45e35a020366b6c92f53 to your computer and use it in GitHub Desktop.
import json
from jsonrpclib import Server
username = "admin"
password = "admin"
urlString = "https://{}:{}@{}/command-api".format(username, password, "bleaf1")
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