Hi all,
I have manged to access to GUI on Nexus9K Sandbox. I run show version and copied th python output into a script on my local machine. I run it but I don t get any output. Any idea why?
#!/usr/bin/env python
import requests
import json
from ncclient import manager
url='http://10.10.20.58/ins'
switchuser='cisco'
switchpassword='cisco123'
myheaders={'content-type':'application/json-rpc'}
payload=[
{
"jsonrpc": "2.0",
"method": "cli",
"params": {
"cmd": "show version",
"version": 1
},
"id": 1
}
]
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
federico@federico:~/git/network_automation $ ./nexus_9k_test.py
federico@federico:~/git/network_automation $