Commit cc2a93db authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

PathComp component - Frontend:

- Deactivated use of interdomain topology
- Tuned devicetype NETWORK to always require creation of a sub-service
parent 10b0930e
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -46,15 +46,17 @@ class PathCompServiceServicerImpl(PathCompServiceServicer):
        context_client = ContextClient()

        context_id = json_context_id(DEFAULT_CONTEXT_NAME)
        if (len(request.services) == 1) and is_inter_domain(context_client, request.services[0].service_endpoint_ids):
            #devices = get_devices_in_topology(context_client, ADMIN_CONTEXT_ID, INTERDOMAIN_TOPOLOGY_NAME)
            #links = get_links_in_topology(context_client, ADMIN_CONTEXT_ID, INTERDOMAIN_TOPOLOGY_NAME)
            topology_id = json_topology_id(INTERDOMAIN_TOPOLOGY_NAME, context_id)
        else:
            # TODO: improve filtering of devices and links
            # TODO: add contexts, topologies, and membership of devices/links in topologies
            #devices = context_client.ListDevices(Empty())
            #links = context_client.ListLinks(Empty())
        # TODO: improve definition of topologies; for interdomain the current topology design might be not convenient
        #if (len(request.services) == 1) and is_inter_domain(context_client, request.services[0].service_endpoint_ids):
        #    #devices = get_devices_in_topology(context_client, ADMIN_CONTEXT_ID, INTERDOMAIN_TOPOLOGY_NAME)
        #    #links = get_links_in_topology(context_client, ADMIN_CONTEXT_ID, INTERDOMAIN_TOPOLOGY_NAME)
        #    topology_id = json_topology_id(INTERDOMAIN_TOPOLOGY_NAME, context_id)
        #else:
        #    # TODO: improve filtering of devices and links
        #    # TODO: add contexts, topologies, and membership of devices/links in topologies
        #    #devices = context_client.ListDevices(Empty())
        #    #links = context_client.ListLinks(Empty())
        #    topology_id = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id)
        topology_id = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id)

        topology_details = context_client.GetTopologyDetails(TopologyId(**topology_id))
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ from common.tools.grpc.Tools import grpc_message_to_json_string
DEVICE_TYPE_TO_DEEPNESS = {
    DeviceTypeEnum.EMULATED_DATACENTER.value             : 90,
    DeviceTypeEnum.DATACENTER.value                      : 90,
    DeviceTypeEnum.NETWORK.value                         : 90,

    DeviceTypeEnum.TERAFLOWSDN_CONTROLLER.value          : 80,
    DeviceTypeEnum.EMULATED_PACKET_ROUTER.value          : 70,
@@ -50,6 +49,7 @@ DEVICE_TYPE_TO_DEEPNESS = {
    DeviceTypeEnum.OPTICAL_ROADM.value                   : 10,

    DeviceTypeEnum.EMULATED_OPTICAL_SPLITTER.value       :  0,
    DeviceTypeEnum.NETWORK.value                         :  0, # network out of our control; always delegate
}

IGNORED_DEVICE_TYPES = {DeviceTypeEnum.EMULATED_OPTICAL_SPLITTER}
+5 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@
from common.DeviceTypes import DeviceTypeEnum
from common.proto.context_pb2 import ServiceTypeEnum

NETWORK_DEVICE_TYPES = {
    DeviceTypeEnum.NETWORK,
}

PACKET_DEVICE_TYPES = {
    DeviceTypeEnum.TERAFLOWSDN_CONTROLLER,
    DeviceTypeEnum.PACKET_ROUTER, DeviceTypeEnum.EMULATED_PACKET_ROUTER,
@@ -45,6 +49,7 @@ def get_service_type(device_type : DeviceTypeEnum, prv_service_type : ServiceTyp
    if device_type in PACKET_DEVICE_TYPES and prv_service_type in SERVICE_TYPE_LXNM: return prv_service_type
    if device_type in L2_DEVICE_TYPES: return ServiceTypeEnum.SERVICETYPE_L2NM
    if device_type in OPTICAL_DEVICE_TYPES: return ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE
    if device_type in NETWORK_DEVICE_TYPES: return prv_service_type

    str_fields = ', '.join([
        'device_type={:s}'.format(str(device_type)),