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 b75d627b422f93fe1b9b0c06caed46c87d83a135..ccc55794ae37717bcfa0a92a1ab91cf64cd0a749 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': 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/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..51ab5b5d6edd6c380477a8440ac9bff6b3f33906 100644 --- a/src/webui/service/templates/opticalconfig/details.html +++ b/src/webui/service/templates/opticalconfig/details.html @@ -74,10 +74,10 @@ <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.targetOutputPower}}</td> <td>{{channel.operationalMode}}</td> <td>{{channel.line_port}}</td> - <td> {{channel.status}}</td> + <td>{{channel.status}}</td> </tr> {% endfor %} </tbody> @@ -112,9 +112,9 @@ </tr> {% endfor %} </tbody> - </table> + </table> - {%else%} + {% else %} <table class="table table-striped table-hover"> <thead> <tr> 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 %}