I'm having difficulty generating an LSP via API against WAE v6.4.8 controller. The python script entitled generate-pcep-lsp.py is as follows:
import json
import requests
from requests.auth import HTTPBasicAuth
url = ('http://x.x.x.x:7777/wae/network/modeled/entries/tunnel/pcep/new/create-basic')
headers = ('Content-type: application/json')
content = open('lsp.cfg', 'rb').read()
config = requests.post(url, auth=HTTPBasicAuth('username', 'password'), headers=headers, data=content)
print config.text
=====================================
The lsp.cfg file has contents as follows:
{
"teTunnel":{
"name":"tunnel-te204",
"source":"rtr1",
"destination":"rtr4"
}
}
When executing the script, I get an error that states the following:
AttributeError: 'set' object has no attribute 'items'
Can someone provide insight as to why the above python script and associated json file are producing errors?