cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
307
Views
0
Helpful
0
Replies

SDWAN VMANAGE API

BlackAvatar
Level 1
Level 1

Hello Guys 

Please I am getting an error running the program from the Cisco Devnet repository "https://github.com/CiscoDevNet/Getting-started-with-Cisco-SD-WAN-REST-APIs" . Am getting the error below when I run the script against my production VMANAGE 

BlackAvatar_0-1665564882704.png

However the program works fine when I run it against the sandbox Vmanage on developer.cisco 

I'm running vmanage version 19.2.4 in production 

And the code below is from the original sdwan.py script that is giving the said error.

 

class Authentication:

@staticmethod
def get_jsessionid(vmanage_host, vmanage_port, username, password
api = "/j_security_check"
base_url = "https://%s:%s"%(vmanage_host, vmanage_port)
url = base_url + api
payload = {'j_username' : username, 'j_password' : password}
 
response = requests.post(url=url, data=payload, verify=False)
try:
cookies = response.headers["Set-Cookie"]
jsessionid = cookies.split(";")
return(jsessionid[0])
except:
if logger is not None:
logger.error("No valid JSESSION ID returned\n")
exit()

 

Can anyone help please 

 

0 Replies 0

Review Cisco Networking for a $25 gift card