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

Service component:

- Added translation of UUID to name for optical connection endpoint devices
- Extended Task_ConnectionConfigure to delegate on remote TeraFlowSDN controllers when needed
parent 761810ec
No related branches found
No related tags found
2 merge requests!328Resolve "(CTTC) Update recommendations to use SocketIO on NBI and E2E Orch components",!286Resolve "(CTTC) Implement integration test between E2E-IP-Optical SDN Controllers"
......@@ -13,7 +13,7 @@
# limitations under the License.
import grpc, json, logging, random, uuid
from typing import Optional
from typing import Dict, Optional
from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method
from common.method_wrappers.ServiceExceptions import (
AlreadyExistsException, InvalidArgumentException, NotFoundException, NotImplementedException,
......@@ -265,10 +265,18 @@ class ServiceServiceServicerImpl(ServiceServiceServicer):
devices = topology_details.devices
context_uuid_x = topology_details.topology_id.context_id.context_uuid.uuid
topology_uuid_x = topology_details.topology_id.topology_uuid.uuid
device_names : Dict[str, str] = dict()
for device in devices:
device_uuid = device.device_id.device_uuid.uuid
device_names[device_uuid] = device.name
devs = []
ports = []
for endpoint_id in service.service_endpoint_ids:
devs.append(endpoint_id.device_id.device_uuid.uuid)
endpoint_device_uuid = endpoint_id.device_id.device_uuid.uuid
endpoint_device_name = device_names[endpoint_device_uuid]
devs.append(endpoint_device_name)
ports.append(endpoint_id.endpoint_uuid.uuid)
src = devs[0]
dst = devs[1]
......
......@@ -56,12 +56,15 @@ class Task_ConnectionConfigure(_Task):
endpointids_to_set = endpointids_to_raw(connection.path_hops_endpoint_ids)
errors = list()
for _, (service_handler, connection_devices) in service_handlers.items():
_endpointids_to_set = [
(device_uuid, endpoint_uuid, topology_uuid)
for device_uuid, endpoint_uuid, topology_uuid in endpointids_to_set
if device_uuid in connection_devices
]
for device_type, (service_handler, connection_devices) in service_handlers.items():
if device_type == DeviceTypeEnum.TERAFLOWSDN_CONTROLLER:
_endpointids_to_set = endpointids_to_set
else:
_endpointids_to_set = [
(device_uuid, endpoint_uuid, topology_uuid)
for device_uuid, endpoint_uuid, topology_uuid in endpointids_to_set
if device_uuid in connection_devices
]
results_setendpoint = service_handler.SetEndpoint(
_endpointids_to_set, connection_uuid=connection_uuid
)
......
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