diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 873b2ac4b22143b37a96fd3ded467f586d61c8ac..df59fd9e76ee6051df3e6c20f133a9714fdf7022 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,20 +22,20 @@ stages: # include the individual .gitlab-ci.yml of each micro-service and tests include: #- local: '/manifests/.gitlab-ci.yml' - - local: '/src/monitoring/.gitlab-ci.yml' - - local: '/src/nbi/.gitlab-ci.yml' + #- local: '/src/monitoring/.gitlab-ci.yml' + #- local: '/src/nbi/.gitlab-ci.yml' - local: '/src/context/.gitlab-ci.yml' - local: '/src/device/.gitlab-ci.yml' - local: '/src/service/.gitlab-ci.yml' - - local: '/src/dbscanserving/.gitlab-ci.yml' - - local: '/src/opticalattackmitigator/.gitlab-ci.yml' - - local: '/src/opticalattackdetector/.gitlab-ci.yml' - - local: '/src/opticalattackmanager/.gitlab-ci.yml' + #- local: '/src/dbscanserving/.gitlab-ci.yml' + #- local: '/src/opticalattackmitigator/.gitlab-ci.yml' + #- local: '/src/opticalattackdetector/.gitlab-ci.yml' + #- local: '/src/opticalattackmanager/.gitlab-ci.yml' - local: '/src/opticalcontroller/.gitlab-ci.yml' - - local: '/src/ztp/.gitlab-ci.yml' - - local: '/src/policy/.gitlab-ci.yml' - - local: '/src/automation/.gitlab-ci.yml' - - local: '/src/forecaster/.gitlab-ci.yml' + #- local: '/src/ztp/.gitlab-ci.yml' + #- local: '/src/policy/.gitlab-ci.yml' + #- local: '/src/automation/.gitlab-ci.yml' + #- local: '/src/forecaster/.gitlab-ci.yml' #- local: '/src/webui/.gitlab-ci.yml' #- local: '/src/l3_distributedattackdetector/.gitlab-ci.yml' #- local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml' @@ -44,16 +44,16 @@ include: #- local: '/src/interdomain/.gitlab-ci.yml' - local: '/src/pathcomp/.gitlab-ci.yml' #- local: '/src/dlt/.gitlab-ci.yml' - - local: '/src/load_generator/.gitlab-ci.yml' - - local: '/src/bgpls_speaker/.gitlab-ci.yml' - - local: '/src/kpi_manager/.gitlab-ci.yml' - - local: '/src/kpi_value_api/.gitlab-ci.yml' - - local: '/src/kpi_value_writer/.gitlab-ci.yml' - - local: '/src/telemetry/.gitlab-ci.yml' - - local: '/src/analytics/.gitlab-ci.yml' - - local: '/src/qos_profile/.gitlab-ci.yml' - - local: '/src/vnt_manager/.gitlab-ci.yml' - - local: '/src/e2e_orchestrator/.gitlab-ci.yml' + #- local: '/src/load_generator/.gitlab-ci.yml' + #- local: '/src/bgpls_speaker/.gitlab-ci.yml' + #- local: '/src/kpi_manager/.gitlab-ci.yml' + #- local: '/src/kpi_value_api/.gitlab-ci.yml' + #- local: '/src/kpi_value_writer/.gitlab-ci.yml' + #- local: '/src/telemetry/.gitlab-ci.yml' + #- local: '/src/analytics/.gitlab-ci.yml' + #- local: '/src/qos_profile/.gitlab-ci.yml' + #- local: '/src/vnt_manager/.gitlab-ci.yml' + #- local: '/src/e2e_orchestrator/.gitlab-ci.yml' # This should be last one: end-to-end integration tests - local: '/src/tests/.gitlab-ci.yml' diff --git a/deploy/all.sh b/deploy/all.sh index f7f2a743312cf6f9152c25ac13b410f4395638bf..06b8ee701530f56381080879d0e2941b664e5197 100755 --- a/deploy/all.sh +++ b/deploy/all.sh @@ -26,8 +26,8 @@ export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"} # If not already set, set the list of components, separated by spaces, you want to build images for, and deploy. -# By default, only basic components are deployed -export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device pathcomp opticalcontroller service slice nbi webui load_generator"} +# By default, only basic components are deployed +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device pathcomp service slice nbi webui load_generator"} # Uncomment to activate Monitoring (old) #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" diff --git a/lightpath.json b/lightpath.json deleted file mode 100644 index 9ea25bbb8eedcb1ff3b80cb3c783eea1d11c1ab1..0000000000000000000000000000000000000000 --- a/lightpath.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "1": { - "flow_id": 1, - "src": "T1.1", - "dst": "T2.1", - "bitrate": 100, - "bidir": 0, - "flows": { - "T1.1": { - "f": { - "in": "0", - "out": "1" - }, - "b": {} - }, - "R1": { - "f": { - "in": "12", - "out": "101" - }, - "b": {} - }, - "R2": { - "f": { - "in": "111", - "out": "2" - }, - "b": {} - }, - "T2.1": { - "f": { - "in": "6", - "out": "0" - }, - "b": {} - } - }, - "band_type": "c_slots", - "slots": [ - 1, - 2, - 3, - 4 - ], - "fiber_forward": {}, - "fiber_backward": {}, - "op-mode": 1, - "n_slots": 4, - "links": [ - "T1.1-R1", - "R2-T2.1" - ], - "path": [ - "R1", - "R2" - ], - "band": 50000, - "freq": 192031250, - "is_active": false, - "parent_opt_band": 1, - "new_optical_band": 1 - } -} \ No newline at end of file diff --git a/src/device/service/drivers/oc_driver/OCDriver.py b/src/device/service/drivers/oc_driver/OCDriver.py index e93db2812a8919f37039ebbc365ab0e3bc9c6ed2..7ea9f00f3926b13362bb591987daab7ffbfabdf7 100644 --- a/src/device/service/drivers/oc_driver/OCDriver.py +++ b/src/device/service/drivers/oc_driver/OCDriver.py @@ -35,9 +35,9 @@ from .templates.VPN.transponder import edit_optical_channel, change_optical_chan from .RetryDecorator import retry from context.client.ContextClient import ContextClient from common.proto.context_pb2 import OpticalConfig -from .templates.descovery_tool.transponders import transponder_values_extractor -from .templates.descovery_tool.roadms import roadm_values_extractor, extract_media_channels -from .templates.descovery_tool.open_roadm import openroadm_values_extractor +from .templates.discovery_tool.transponders import transponder_values_extractor +from .templates.discovery_tool.roadms import roadm_values_extractor, extract_media_channels +from .templates.discovery_tool.open_roadm import openroadm_values_extractor from .templates.VPN.openroadm import network_media_channel_handler @@ -159,7 +159,7 @@ def edit_config( ): str_method = 'DeleteConfig' if delete else 'SetConfig' results = [] - + logging.info(f"commmit per rule {commit_per_rule}") str_config_messages=[] if str_method == 'SetConfig': @@ -309,7 +309,7 @@ class OCDriver(_Driver): self.__netconf_handler, self.__logger, resources, conditions, target='candidate', commit_per_rule=self.__netconf_handler.commit_per_rule ) - else: + else: results = edit_config( self.__netconf_handler, self.__logger, resources, conditions=conditions ) diff --git a/src/device/service/drivers/oc_driver/templates/descovery_tool/open_roadm.py b/src/device/service/drivers/oc_driver/templates/discovery_tool/open_roadm.py similarity index 99% rename from src/device/service/drivers/oc_driver/templates/descovery_tool/open_roadm.py rename to src/device/service/drivers/oc_driver/templates/discovery_tool/open_roadm.py index 3c4b099a00e362d2981aaf7d572bdc86bf5c1221..9b148c424155a01c6f9ff4df9b438b158283acd8 100644 --- a/src/device/service/drivers/oc_driver/templates/descovery_tool/open_roadm.py +++ b/src/device/service/drivers/oc_driver/templates/discovery_tool/open_roadm.py @@ -19,22 +19,20 @@ import lxml.etree as ET from typing import Collection, Dict, Any from common.proto.context_pb2 import Location from decimal import Decimal + def extract_roadm_circuits_pack (xml_data:str): - - xml_bytes = xml_data.encode("utf-8") root = ET.fromstring(xml_bytes) # with open('xml.log', 'w') as f: # print(xml_bytes, file=f) - - + namespace = {'oc': "http://org/openroadm/device"} - + circuits = root.findall('.//oc:circuit-packs',namespace) - + circuits_list =[] # print(f"component {components}") - + if (circuits is not None): for circuit in circuits: circuit_info ={} @@ -244,13 +242,5 @@ def openroadm_values_extractor (data_xml:str,resource_keys:list,dic:dict): 'location':{"interface":location_interface} } ports_result.append((resource_key, resource_value)) - - + return [dic,ports_result] - - - - - - - \ No newline at end of file diff --git a/src/device/service/drivers/oc_driver/templates/descovery_tool/roadms.py b/src/device/service/drivers/oc_driver/templates/discovery_tool/roadms.py similarity index 100% rename from src/device/service/drivers/oc_driver/templates/descovery_tool/roadms.py rename to src/device/service/drivers/oc_driver/templates/discovery_tool/roadms.py diff --git a/src/device/service/drivers/oc_driver/templates/descovery_tool/transponders.py b/src/device/service/drivers/oc_driver/templates/discovery_tool/transponders.py similarity index 100% rename from src/device/service/drivers/oc_driver/templates/descovery_tool/transponders.py rename to src/device/service/drivers/oc_driver/templates/discovery_tool/transponders.py diff --git a/src/tests/.gitlab-ci.yml b/src/tests/.gitlab-ci.yml index b7da988bf33175e149906243f28b0df0d78d9d8b..b6903b70ed4d40542aae0da1ab8cf974f96ae957 100644 --- a/src/tests/.gitlab-ci.yml +++ b/src/tests/.gitlab-ci.yml @@ -14,11 +14,11 @@ # include the individual .gitlab-ci.yml of each end-to-end integration test include: - - local: '/src/tests/ofc22/.gitlab-ci.yml' + #- local: '/src/tests/ofc22/.gitlab-ci.yml' #- local: '/src/tests/oeccpsc22/.gitlab-ci.yml' - - local: '/src/tests/ecoc22/.gitlab-ci.yml' + #- local: '/src/tests/ecoc22/.gitlab-ci.yml' #- local: '/src/tests/nfvsdn22/.gitlab-ci.yml' #- local: '/src/tests/ofc23/.gitlab-ci.yml' - local: '/src/tests/ofc24/.gitlab-ci.yml' - - local: '/src/tests/eucnc24/.gitlab-ci.yml' + #- local: '/src/tests/eucnc24/.gitlab-ci.yml' #- local: '/src/tests/ecoc24/.gitlab-ci.yml' diff --git a/src/tests/ofc24/or/openroadm4deg.tar b/src/tests/ofc24/or/openroadm4deg.tar deleted file mode 100644 index 100b7d038d5fd6a162c50e3fa2096e06752f12ed..0000000000000000000000000000000000000000 Binary files a/src/tests/ofc24/or/openroadm4deg.tar and /dev/null differ diff --git a/src/webui/service/__init__.py b/src/webui/service/__init__.py index a7c0898559606e182c4326761c04b03c8e8fa57f..5b19d632b29b62b666de223ac4ca133dcdb4db05 100644 --- a/src/webui/service/__init__.py +++ b/src/webui/service/__init__.py @@ -14,12 +14,11 @@ import json from typing import List, Tuple, Union -from flask import Flask, request, session +from flask import Flask, session from flask_healthz import healthz, HealthError from common.tools.grpc.Tools import grpc_message_to_json from context.client.ContextClient import ContextClient from device.client.DeviceClient import DeviceClient -from qkd_app.client.QKDAppClient import QKDAppClient from common.Settings import ( is_deployed_bgpls, is_deployed_load_gen, is_deployed_optical, is_deployed_policy, is_deployed_qkd_app, is_deployed_slice @@ -42,10 +41,6 @@ def readiness(): device_client = DeviceClient() device_client.connect() device_client.close() - # DEPENDENCY QKD - # qkd_app_client = QKDAppClient() - # qkd_app_client.connect() - # qkd_app_client.close() except Exception as e: raise HealthError("Can't connect with the service: {:s}".format(str(e))) from e diff --git a/src/webui/service/opticalconfig/routes.py b/src/webui/service/opticalconfig/routes.py index 257e867bf2a631818690140127b944d73dff8528..9fa60fb4ef3c07bee9ecfc4617cc9f885e63380c 100644 --- a/src/webui/service/opticalconfig/routes.py +++ b/src/webui/service/opticalconfig/routes.py @@ -20,15 +20,15 @@ from flask import ( from common.proto.context_pb2 import ( Empty, OpticalConfig, OpticalConfigId, OpticalConfigList ) +from common.tools.context_queries.OpticalConfig import opticalconfig_get_uuid +from common.DeviceTypes import DeviceTypeEnum from context.client.ContextClient import ContextClient from device.client.DeviceClient import DeviceClient from service.client.ServiceClient import ServiceClient from slice.client.SliceClient import SliceClient from .forms import UpdateDeviceForm, AddTrancseiver, UpdateStatusForm -from common.tools.context_queries.OpticalConfig import opticalconfig_get_uuid -from common.DeviceTypes import DeviceTypeEnum -opticalconfig = Blueprint('opticalconfig', __name__,url_prefix="/opticalconfig") +opticalconfig = Blueprint('opticalconfig', __name__, url_prefix="/opticalconfig") context_client = ContextClient() device_client = DeviceClient() @@ -42,7 +42,6 @@ DESCRIPTOR_LOADER_NUM_WORKERS = 10 @opticalconfig.get("/") def home() : list_config = [] - channels_num = 0 if 'context_uuid' not in session or 'topology_uuid' not in session: flash("Please select a context!", "warning") return redirect(url_for("main.home")) @@ -81,7 +80,7 @@ def show_details(config_uuid): if (response and response.opticalconfig_id.opticalconfig_uuid !=''): opticalConfig = OpticalConfig() opticalConfig.CopyFrom(response) - + device_name = "" config = json.loads(opticalConfig.config) if "device_name" in config: @@ -100,7 +99,7 @@ def show_details(config_uuid): new_config['line_port']=channel["line-port"] if 'line-port' in channel else '' new_config["status"] = channel['status'] if 'status' in channel else "" device_details.append(new_config) - + if config_type == DeviceTypeEnum.OPTICAL_ROADM._value_: LOGGER.info("config details from show detail %s",config) if 'channels' in config: @@ -346,7 +345,7 @@ def update_status (config_uuid,channel_name): return render_template( 'opticalconfig/update_status.html', form=form, channel_name=channel_name, submit_text='Update Device Status' - ) + ) @opticalconfig.route('/configure_openroadm', methods=['POST']) def update_openroadm(): diff --git a/src/webui/service/templates/opticalconfig/details.html b/src/webui/service/templates/opticalconfig/details.html index 8d9b4b0bc15a6a6f9c9ed64e7dde8b6ca869423e..f74538eed82789514a4ef6e52f12c6a4593cf0f9 100644 --- a/src/webui/service/templates/opticalconfig/details.html +++ b/src/webui/service/templates/opticalconfig/details.html @@ -14,145 +14,129 @@ limitations under the License. --> - - {% extends 'base.html' %} {% block content %} - <h1>Optical Configurations</h1> <div class="row"> - {% if device %} - <div class="col-sm-12"> - <span>Device ID:</span> - <h5>{{config_id}}</h5> - </div> - <div class="col-sm-12"> - <div class="col-sm-12"> - <div class="row mb-3 "> - - <div class="col-sm-3"> - <button type="button" class="btn btn-success" onclick="window.location.href='{{ url_for('opticalconfig.home') }}'"> - <i class="bi bi-box-arrow-in-left"></i> - Back to device list - </button> + <div class="col-sm-12"> + <span>Device ID:</span> + <h5>{{config_id}}</h5> + </div> + <div class="col-sm-12"> + <div class="col-sm-12"> + <div class="row mb-3 "> + <div class="col-sm-3"> + <button type="button" class="btn btn-success" onclick="window.location.href='{{ url_for('opticalconfig.home') }}'"> + <i class="bi bi-box-arrow-in-left"></i> + Back to device list + </button> + </div> + <div class="col-sm-3"> + <!-- <button type="button" class="btn btn-danger"><i class="bi bi-x-square"></i>Delete device</button> --> + <button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#deleteModal"> + <i class="bi bi-x-square"></i> + Delete Optical Config + </button> + </div> </div> - <div class="col-sm-3"> - <!-- <button type="button" class="btn btn-danger"><i class="bi bi-x-square"></i>Delete device</button> --> - <button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#deleteModal"> - <i class="bi bi-x-square"></i> - Delete Optical Config - </button> + </div> + <div class="col-sm-12"> + <span>Device Name:</span> + <span>{{device_name}}</span> </div> </div> - </div> - <div class="col-sm-12"> - <span>Device Name:</span> - <span>{{device_name}}</span> - </div> - - </div> - - {% if type == 'optical-transponder' %} - <table class="table table-striped table-hover"> - <thead> - <tr> - <th scope="col">channel name</th> - <th scope="col">Frequency</th> - <th scope="col">Target Output Power</th> - <th scope="col">Operational Mode</th> - <th scope="col">Line Port</th> - <th scope="col">Channel Status</th> - </tr> - </thead> - <tbody> - - {% for channel in device %} - <tr style="background-color:{%if channel.status == 'DISABLED' %} gray {% endif %};"> - <td>{{channel.name.index}}</td> - <td>{{channel.frequency}}</td> - <td> {{channel.targetOutputPower}}</td> - <td>{{channel.operationalMode}}</td> - <td>{{channel.line_port}}</td> - <td> {{channel.status}}</td> - </tr> - {% endfor %} - </tbody> - </table> - {% elif type == 'openroadm' %} - - <table class="table table-striped table-hover"> - <thead> - <tr> - <th scope="col"> name</th> - <th scope="col"> type</th> - <th scope="col">administrative state</th> - <th scope="col">circuit pack name</th> - <th scope="col">port</th> - <th scope="col">interface list</th> - <th scope="col">frequency</th> - <th scope="col">width</th> - </tr> - </thead> - <tbody> - - {% for channel in device %} - <tr style="background-color:{%if channel.status == 'DISABLED' %} gray {% endif %};"> - <td>{{channel.name}}</td> - <td>{{channel.type}}</td> - <td>{{channel.administrative_state}}</td> - <td> {{channel.circuit_pack_name}}</td> - <td>{{channel.port}}</td> - <td>{{channel.interface_list}}</td> - <td> {{channel.frequency}}</td> - <td> {{channel.width}}</td> - </tr> - {% endfor %} - </tbody> - </table> - {%else%} - <table class="table table-striped table-hover"> - <thead> - <tr> - <th scope="col">Channel Index</th> - <th scope="col">Optical Band Parent</th> - <th scope="col">Band Name</th> - <th scope="col">Lower Frequency</th> - <th scope="col">Upper Frequency</th> - <th scope="col">type</th> - <th scope="col"> Source Port</th> - <th scope="col">Destination Port</th> - <th scope="col">Channel Status </th> - - </tr> - </thead> - <tbody> - - {% for channel in device %} - <tr> - <td>{{channel.channel_index}}</td> - <td>{{channel.optical_band_parent}}</td> - <td> {{channel.band_name}}</td> - <td>{{channel.lower_frequency}}</td> - <td>{{channel.upper_frequency}}</td> - <td> {{channel.type}}</td> - <td>{{channel.src_port}}</td> - <td>{{channel.dest_port}}</td> - <td> {{channel.status}}</td> - - </tr> - {% endfor %} - - </tbody> - </table> - - {% endif%} - -</div> + {% if type == 'optical-transponder' %} + <table class="table table-striped table-hover"> + <thead> + <tr> + <th scope="col">channel name</th> + <th scope="col">Frequency</th> + <th scope="col">Target Output Power</th> + <th scope="col">Operational Mode</th> + <th scope="col">Line Port</th> + <th scope="col">Channel Status</th> + </tr> + </thead> + <tbody> + {% for channel in device %} + <tr style="background-color:{%if channel.status == 'DISABLED' %} gray {% endif %};"> + <td>{{channel.name.index}}</td> + <td>{{channel.frequency}}</td> + <td>{{channel.targetOutputPower}}</td> + <td>{{channel.operationalMode}}</td> + <td>{{channel.line_port}}</td> + <td>{{channel.status}}</td> + </tr> + {% endfor %} + </tbody> + </table> + {% elif type == 'openroadm' %} + <table class="table table-striped table-hover"> + <thead> + <tr> + <th scope="col"> name</th> + <th scope="col"> type</th> + <th scope="col">administrative state</th> + <th scope="col">circuit pack name</th> + <th scope="col">port</th> + <th scope="col">interface list</th> + <th scope="col">frequency</th> + <th scope="col">width</th> + </tr> + </thead> + <tbody> + {% for channel in device %} + <tr style="background-color:{%if channel.status == 'DISABLED' %} gray {% endif %};"> + <td>{{channel.name}}</td> + <td>{{channel.type}}</td> + <td>{{channel.administrative_state}}</td> + <td>{{channel.circuit_pack_name}}</td> + <td>{{channel.port}}</td> + <td>{{channel.interface_list}}</td> + <td>{{channel.frequency}}</td> + <td>{{channel.width}}</td> + </tr> + {% endfor %} + </tbody> + </table> + {% else %} + <table class="table table-striped table-hover"> + <thead> + <tr> + <th scope="col">Channel Index</th> + <th scope="col">Optical Band Parent</th> + <th scope="col">Band Name</th> + <th scope="col">Lower Frequency</th> + <th scope="col">Upper Frequency</th> + <th scope="col">type</th> + <th scope="col">Source Port</th> + <th scope="col">Destination Port</th> + <th scope="col">Channel Status </th> + </tr> + </thead> + <tbody> + {% for channel in device %} + <tr> + <td>{{channel.channel_index}}</td> + <td>{{channel.optical_band_parent}}</td> + <td>{{channel.band_name}}</td> + <td>{{channel.lower_frequency}}</td> + <td>{{channel.upper_frequency}}</td> + <td>{{channel.type}}</td> + <td>{{channel.src_port}}</td> + <td>{{channel.dest_port}}</td> + <td>{{channel.status}}</td> + </tr> + {% endfor %} + </tbody> + </table> + {% endif%} + </div> {% else %} <div class="col"> diff --git a/src/webui/service/templates/qkd_app/home.html b/src/webui/service/templates/qkd_app/home.html index e84b9230abc87c455c99afe6529905560f448782..d715562f91be568f8d2392eace2d5928345e6902 100644 --- a/src/webui/service/templates/qkd_app/home.html +++ b/src/webui/service/templates/qkd_app/home.html @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. --> -<!-- + {% extends 'base.html' %} {% block content %} @@ -91,4 +91,4 @@ </tbody> </table> -{% endblock %} --> +{% endblock %}