Enabling the LSP delegation in the ODL using PCEP protocol.

asked 2017-07-31 06:40:08 -0800

purushotham gravatar image

Installed PCEP protocol plugins in the ODL. Post operation response, getting as 404 using RESTCONF in the python script. using below url url:- /restconf/operations/network-topology-pcep:update-lsp souce code:

!/usr/bin/python

import os,sys,logging import requests import json,xml import generatelogs,getconfig,creatTopo

generatelogs.getlogs() net=creatTopo.getTopo() net.pingAll() ip = getconfig.getsys_ip() logging.info('ip address of the system is.... %s'%ip) url = "http://%s:8080/restconf/operations/network-topology-pcep:update-lsp"%ip

client = requests.Session() client.auth=("admin","admin") client.verify=False headers={'Content-Type':'application/xml','Accept':'application/xml'}

foo=open("PCEPtestCase4LSPdeligation.xml","r") text=foo.read()

response=client.post(url, headers=headers, data=text) logging.info('printing rest-put response... %s'%response)

resp=client.get(url, headers=headers)

logging.info('printing rest-get response... %s'%resp) data=resp.content logging.info('open file to write the result...') fp = open("out.txt",'w') fp.write(data) logging.info('closing the opend file.......') fp.close()

Please suggest the quires?

edit retag flag offensive close merge delete