Skip to content
Snippets Groups Projects
Commit 69337db4 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

NBI component - TFS API connector:

- Implemented vLink creation
parent 7f1e6dd1
No related branches found
No related tags found
3 merge requests!359Release TeraFlowSDN 5.0,!328Resolve "(CTTC) Update recommendations to use SocketIO on NBI and E2E Orch components",!286Resolve "(CTTC) Implement integration test between E2E-IP-Optical SDN Controllers"
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
import json import json
import logging import logging
from typing import Dict, List
from flask.json import jsonify from flask.json import jsonify
from flask_restful import Resource, request from flask_restful import Resource, request
from werkzeug.exceptions import BadRequest from werkzeug.exceptions import BadRequest
...@@ -296,10 +297,15 @@ class Links(_Resource): ...@@ -296,10 +297,15 @@ class Links(_Resource):
json_requests = request.get_json() json_requests = request.get_json()
if 'links' in json_requests: if 'links' in json_requests:
json_requests = json_requests['links'] json_requests = json_requests['links']
return jsonify([ json_link_ids : List[Dict] = list()
grpc_message_to_json(self.context_client.SetLink(grpc_link(link))) for link_json in json_requests:
for link in json_requests link = grpc_link(link_json)
]) if link.link_type == LinkTypeEnum.LINKTYPE_VIRTUAL:
link_id = self.vntmanager_client.SetVirtualLink(link)
else:
link_id = self.context_client.SetLink(link)
json_link_ids.append(grpc_message_to_json(link_id))
return jsonify(json_link_ids)
class Link(_Resource): class Link(_Resource):
def get(self, link_uuid : str): def get(self, link_uuid : str):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment