URL_CONFIG_ORDM_NET = "{}/config/ietf-network:networks/network/openroadm-network/"
URL_PORTMAPPING = "{}/config/transportpce-portmapping:network/nodes/"
URL_OPER_SERV_LIST = "{}/operational/org-openroadm-service:service-list/"
+URL_GET_NBINOTIFICATIONS_SERV = "{}/operations/nbi-notifications:get-notifications-service/"
URL_SERV_CREATE = "{}/operations/org-openroadm-service:service-create"
URL_SERV_DELETE = "{}/operations/org-openroadm-service:service-delete"
URL_SERVICE_PATH = "{}/operations/transportpce-device-renderer:service-path"
URL_OTN_SERVICE_PATH = "{}/operations/transportpce-device-renderer:otn-service-path"
URL_CREATE_OTS_OMS = "{}/operations/transportpce-device-renderer:create-ots-oms"
URL_PATH_COMPUTATION_REQUEST = "{}/operations/transportpce-pce:path-computation-request"
+URL_FULL_PORTMAPPING = "{}/config/transportpce-portmapping:network"
TYPE_APPLICATION_JSON = {'Content-Type': 'application/json', 'Accept': 'application/json'}
TYPE_APPLICATION_XML = {'Content-Type': 'application/xml', 'Accept': 'application/xml'}
os.path.dirname(os.path.realpath(__file__)),
"..", "..", "..", "karaf", "target", "assembly", "bin", "client")
return subprocess.run([executable],
- input='feature:install ' + feature_name + '\n feature:list | grep tapi \n logout \n',
+ input='feature:install ' + feature_name + '\n feature:list | grep '
+ + feature_name + ' \n logout \n',
universal_newlines=True, check=False)
def post_request(url, data):
if data:
+ print(json.dumps(data))
return requests.request(
"POST", url.format(RESTCONF_BASE_URL),
data=json.dumps(data),
headers=TYPE_APPLICATION_JSON,
auth=(ODL_LOGIN, ODL_PWD))
+def rawpost_request(url, data):
+ return requests.request(
+ "POST", url.format(RESTCONF_BASE_URL),
+ data=data,
+ headers=TYPE_APPLICATION_JSON,
+ auth=(ODL_LOGIN, ODL_PWD))
+
def delete_request(url):
return requests.request(
return get_request(url)
+def get_notifications_service_request(attr):
+ return post_request(URL_GET_NBINOTIFICATIONS_SERV, attr)
+
+
def get_service_list_request(suffix: str):
url = URL_OPER_SERV_LIST + suffix
return get_request(url)
return post_request(URL_SERV_DELETE, attr)
-def service_path_request(operation: str, servicename: str, wavenumber: str, nodes):
+def service_path_request(operation: str, servicename: str, wavenumber: str, nodes, centerfreq: str,
+ slotwidth: int, minfreq: float, maxfreq: float, lowerslotnumber: int,
+ higherslotnumber: int):
attr = {"renderer:input": {
"renderer:service-name": servicename,
"renderer:wave-number": wavenumber,
- "renderer:modulation-format": "qpsk",
+ "renderer:modulation-format": "dp-qpsk",
"renderer:operation": operation,
- "renderer:nodes": nodes}}
+ "renderer:nodes": nodes,
+ "renderer:center-freq": centerfreq,
+ "renderer:width": slotwidth,
+ "renderer:min-freq": minfreq,
+ "renderer:max-freq": maxfreq,
+ "renderer:lower-spectral-slot-number": lowerslotnumber,
+ "renderer:higher-spectral-slot-number": higherslotnumber}}
return post_request(URL_SERVICE_PATH, attr)