Loading proto/tapi.proto +1 −0 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ service TapiService { rpc GetTopology (context.TopologyId ) returns ( context.TopologyDetails ) {} rpc GetTopology (context.TopologyId ) returns ( context.TopologyDetails ) {} rpc SetService (context.ServiceList) returns (context.Empty) {} rpc SetService (context.ServiceList) returns (context.Empty) {} rpc CheckConnectivity ( SocketID) returns ( CheckStat) {} rpc CheckConnectivity ( SocketID) returns ( CheckStat) {} rpc GetOpticalConfig (context.DeviceID) returns (context.OpticalConfig) } } Loading src/tapi/service/TapiServiceServicerImpl.py +16 −2 Original line number Original line Diff line number Diff line Loading @@ -16,10 +16,10 @@ import grpc, logging, os, time , socket from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method from common.tools.context_queries.OpticalConfig import opticalconfig_uuid_get_duuid from common.proto.context_pb2 import ( from common.proto.context_pb2 import ( Topology,TopologyList ,TopologyId,Empty, Topology,TopologyList ,TopologyId,Empty, Service, ServiceId , ServiceList , TopologyDetails Service, ServiceId , ServiceList , TopologyDetails , DeviceId , OpticalConfig ) ) from common.proto.tapi_pb2 import TapiRequest , SocketID ,CheckStat from common.proto.tapi_pb2 import TapiRequest , SocketID ,CheckStat Loading Loading @@ -84,6 +84,20 @@ class TapiServiceServicerImpl(TapiService): LOGGER.info (f"Error in get topology {e}") LOGGER.info (f"Error in get topology {e}") def GetOpticalConfig (self ,device_id : DeviceId , context : grpc.ServicerContext) -> OpticalCOnfig : try: config_uuid = opticalconfig_uuid_get_duuid (device_uuid) opticalconfigId = OpticalConfigId() opticalconfigId.opticalconfig_uuid = config_uuid oconfig = self._ctxt.SelectOpticalConfig(topology_id) return oconfig except Exception as e : LOGGER.info (f"Error in get Opticalconfig {e}") def SetService (self , services : ServiceList, context : grpc.ServicerContext)-> ServiceId : def SetService (self , services : ServiceList, context : grpc.ServicerContext)-> ServiceId : Loading src/webui/service/tapi/routes.py +13 −8 Original line number Original line Diff line number Diff line Loading @@ -18,7 +18,7 @@ from flask import ( current_app, make_response current_app, make_response ) ) from common.proto.context_pb2 import ( from common.proto.context_pb2 import ( Empty, ServiceList, OpticalLink , TopologyId Empty, ServiceList, OpticalLink , TopologyId , OpticalConfigId ) ) from common.tools.object_factory.OpticalLink import extract_endpoint_names from common.tools.object_factory.OpticalLink import extract_endpoint_names Loading Loading @@ -162,16 +162,21 @@ def add_service (topo_uuid :str ,context_uuid :str) : @tapi.route('<path:device_uuid>/detail',methods=['GET']) @tapi.route('<path:device_uuid>/detail',methods=['GET']) def show_details(device_uuid): def show_details(device_uuid): ip='' config_uuid = opticalconfig_uuid_get_duuid (device_uuid) port ='' opticalconfigId = OpticalConfigId() if 'tapi_endpoint' in session : opticalconfigId.opticalconfig_uuid = config_uuid ip,port = session['tapi_endpoint'].split(':') else : flash("Please Connect To Desired Machine First!", "warning") return redirect(url_for("tapi.home")) # config_uuid = opticalconfig_uuid_get_duuid (device_uuid) # opticalconfigId = OpticalConfigId() # opticalconfigId.opticalconfig_uuid = config_uuid device_details = [] device_details = [] device_name='' device_name='' try : try : context_client.connect() tapi_client = TapiClient(ip , port) response = context_client.SelectOpticalConfig(opticalconfigId) resposne = tapi_client.GetOpticalConfig(device_uuid) context_client.close() if (response and response.opticalconfig_id.opticalconfig_uuid !=''): if (response and response.opticalconfig_id.opticalconfig_uuid !=''): opticalConfig = OpticalConfig() opticalConfig = OpticalConfig() opticalConfig.CopyFrom(response) opticalConfig.CopyFrom(response) Loading src/webui/service/templates/tapi/topo_detail.html +1 −1 Original line number Original line Diff line number Diff line Loading @@ -62,7 +62,7 @@ </ul> </ul> </td> </td> <td> <td> <a href="{{ url_for('tapi.show_details', device_uuid=device.device.device_id.device_uuid.uuid) }}"> <a href="{{ url_for('tapi.show_details', device_uuid=device.device_id.device_uuid.uuid) }}"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> Loading Loading
proto/tapi.proto +1 −0 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ service TapiService { rpc GetTopology (context.TopologyId ) returns ( context.TopologyDetails ) {} rpc GetTopology (context.TopologyId ) returns ( context.TopologyDetails ) {} rpc SetService (context.ServiceList) returns (context.Empty) {} rpc SetService (context.ServiceList) returns (context.Empty) {} rpc CheckConnectivity ( SocketID) returns ( CheckStat) {} rpc CheckConnectivity ( SocketID) returns ( CheckStat) {} rpc GetOpticalConfig (context.DeviceID) returns (context.OpticalConfig) } } Loading
src/tapi/service/TapiServiceServicerImpl.py +16 −2 Original line number Original line Diff line number Diff line Loading @@ -16,10 +16,10 @@ import grpc, logging, os, time , socket from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method from common.tools.context_queries.OpticalConfig import opticalconfig_uuid_get_duuid from common.proto.context_pb2 import ( from common.proto.context_pb2 import ( Topology,TopologyList ,TopologyId,Empty, Topology,TopologyList ,TopologyId,Empty, Service, ServiceId , ServiceList , TopologyDetails Service, ServiceId , ServiceList , TopologyDetails , DeviceId , OpticalConfig ) ) from common.proto.tapi_pb2 import TapiRequest , SocketID ,CheckStat from common.proto.tapi_pb2 import TapiRequest , SocketID ,CheckStat Loading Loading @@ -84,6 +84,20 @@ class TapiServiceServicerImpl(TapiService): LOGGER.info (f"Error in get topology {e}") LOGGER.info (f"Error in get topology {e}") def GetOpticalConfig (self ,device_id : DeviceId , context : grpc.ServicerContext) -> OpticalCOnfig : try: config_uuid = opticalconfig_uuid_get_duuid (device_uuid) opticalconfigId = OpticalConfigId() opticalconfigId.opticalconfig_uuid = config_uuid oconfig = self._ctxt.SelectOpticalConfig(topology_id) return oconfig except Exception as e : LOGGER.info (f"Error in get Opticalconfig {e}") def SetService (self , services : ServiceList, context : grpc.ServicerContext)-> ServiceId : def SetService (self , services : ServiceList, context : grpc.ServicerContext)-> ServiceId : Loading
src/webui/service/tapi/routes.py +13 −8 Original line number Original line Diff line number Diff line Loading @@ -18,7 +18,7 @@ from flask import ( current_app, make_response current_app, make_response ) ) from common.proto.context_pb2 import ( from common.proto.context_pb2 import ( Empty, ServiceList, OpticalLink , TopologyId Empty, ServiceList, OpticalLink , TopologyId , OpticalConfigId ) ) from common.tools.object_factory.OpticalLink import extract_endpoint_names from common.tools.object_factory.OpticalLink import extract_endpoint_names Loading Loading @@ -162,16 +162,21 @@ def add_service (topo_uuid :str ,context_uuid :str) : @tapi.route('<path:device_uuid>/detail',methods=['GET']) @tapi.route('<path:device_uuid>/detail',methods=['GET']) def show_details(device_uuid): def show_details(device_uuid): ip='' config_uuid = opticalconfig_uuid_get_duuid (device_uuid) port ='' opticalconfigId = OpticalConfigId() if 'tapi_endpoint' in session : opticalconfigId.opticalconfig_uuid = config_uuid ip,port = session['tapi_endpoint'].split(':') else : flash("Please Connect To Desired Machine First!", "warning") return redirect(url_for("tapi.home")) # config_uuid = opticalconfig_uuid_get_duuid (device_uuid) # opticalconfigId = OpticalConfigId() # opticalconfigId.opticalconfig_uuid = config_uuid device_details = [] device_details = [] device_name='' device_name='' try : try : context_client.connect() tapi_client = TapiClient(ip , port) response = context_client.SelectOpticalConfig(opticalconfigId) resposne = tapi_client.GetOpticalConfig(device_uuid) context_client.close() if (response and response.opticalconfig_id.opticalconfig_uuid !=''): if (response and response.opticalconfig_id.opticalconfig_uuid !=''): opticalConfig = OpticalConfig() opticalConfig = OpticalConfig() opticalConfig.CopyFrom(response) opticalConfig.CopyFrom(response) Loading
src/webui/service/templates/tapi/topo_detail.html +1 −1 Original line number Original line Diff line number Diff line Loading @@ -62,7 +62,7 @@ </ul> </ul> </td> </td> <td> <td> <a href="{{ url_for('tapi.show_details', device_uuid=device.device.device_id.device_uuid.uuid) }}"> <a href="{{ url_for('tapi.show_details', device_uuid=device.device_id.device_uuid.uuid) }}"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> Loading