diff --git a/src/Constants.py b/src/Constants.py index c88b5b9b1b8bfca46acef49f4abf34dbc49b3d1e..62ec457212d9254c945f689e9b3bbbdfe7af7ad0 100644 --- a/src/Constants.py +++ b/src/Constants.py @@ -17,7 +17,7 @@ import logging, os, json # Default logging level -DEFAULT_LOGGING_LEVEL = logging.INFO +DEFAULT_LOGGING_LEVEL = logging.DEBUG # Default port for NSC deployment NSC_PORT = 8081 @@ -31,6 +31,20 @@ with open(os.path.join(SRC_PATH, 'IPs.json')) as f: # Create the path to the desired file relative to the current file TEMPLATES_PATH = os.path.join(SRC_PATH, "templates") +# Dump templates +DUMP_TEMPLATES = False + +# Mapper + +# Flag to determine if the NSC performs NRPs +NRP_ENABLED = False +# Planner Flags +PLANNER_ENABLED = True +# Flag to determine if external PCE is used +PCE_EXTERNAL = False + +# Realizer + # Controller Flags # If True, config is not sent to controllers DUMMY_MODE = True @@ -42,5 +56,6 @@ TFS_L2VPN_SUPPORT = False IXIA_IP = ips.get('IXIA_IP') # WebUI + # Flag to deploy the WebUI WEBUI_DEPLOY = True \ No newline at end of file diff --git a/src/network_slice_controller.py b/src/network_slice_controller.py index d280ebb62ee9ede47ed03956dd3695f1cfb86cd6..fd7dfcc01f19c330820323e7d2b95213ef194880 100644 --- a/src/network_slice_controller.py +++ b/src/network_slice_controller.py @@ -17,8 +17,9 @@ import json, time, os, logging, uuid, traceback, sys from datetime import datetime from src.helpers import tfs_connector, cisco_connector -from src.Constants import DEFAULT_LOGGING_LEVEL, TFS_IP, TFS_L2VPN_SUPPORT, IXIA_IP, SRC_PATH, TEMPLATES_PATH, DUMMY_MODE +from src.Constants import DEFAULT_LOGGING_LEVEL, TFS_IP, TFS_L2VPN_SUPPORT, IXIA_IP, SRC_PATH, TEMPLATES_PATH, DUMMY_MODE, DUMP_TEMPLATES, PLANNER_ENABLED, NRP_ENABLED from src.realizers.ixia.NEII_V4 import NEII_controller +from src.planner.planner import Planner # Configure logging to provide clear and informative log messages logging.basicConfig( @@ -262,10 +263,20 @@ class NSController: # Reset requests and load IETF template self.__load_template(1, os.path.join(TEMPLATES_PATH, "ietf_template_empty.json")) requests = {"services":[]} + + # Store the received template for debugging + if DUMP_TEMPLATES: + with open(os.path.join(TEMPLATES_PATH, "nbi_template.json"), "w") as file: + file.write(json.dumps(intent_json,indent=2)) # Process intent (translate if 3GPP) ietf_intents = self.__nbi_processor(intent_json) + # Store the generated template for debugging + if DUMP_TEMPLATES: + with open(os.path.join(TEMPLATES_PATH, "ietf_template.json"), "w") as file: + file.write(json.dumps(ietf_intents,indent=2)) + if ietf_intents: for intent in ietf_intents: # Extract and store slice request details @@ -278,9 +289,11 @@ class NSController: requests["services"].append(tfs_request) else: return self.__send_response(False, code=404, message="No intents found") - - # Generated service - logging.debug(json.dumps(requests, indent=2)) + + # Store the generated template for debugging + if DUMP_TEMPLATES: + with open(os.path.join(TEMPLATES_PATH, "realizer_template.json"), "w") as archivo: + archivo.write(json.dumps(requests,indent=2)) # Optional: Upload template to Teraflow if not DUMMY_MODE: @@ -330,7 +343,6 @@ class NSController: # Detect the input JSON format (3GPP or IETF) format = self.__detect_format(intent_json) ietf_intents = [] - logging.debug("--------NEW REQUEST--------") # TODO Needs to be generalized to support different names of slicesubnets # Process different input formats @@ -343,8 +355,6 @@ class NSController: # If already in IETF format, add directly logging.info(f"IETF intent received") ietf_intents.append(intent_json) - with open(os.path.join(TEMPLATES_PATH, "ietf_template_example.json"), "w") as archivo: - archivo.write(json.dumps(ietf_intents,indent=2)) else: # Handle unrecognized format logging.error(f"JSON request format not recognized") @@ -369,36 +379,42 @@ class NSController: Raises: Exception: If no suitable NRP is found and slice creation fails. """ - # Retrieve NRP view - self.__realizer(None, True, "READ") - - # Extract Service Level Objectives (SLOs) from the intent - slos = ietf_intent["ietf-network-slice-service:network-slice-services"]["slo-sle-templates"]["slo-sle-template"][0]["slo-policy"]["metric-bound"] - - if slos: - # Find candidate NRPs that can meet the SLO requirements - candidates = [ - (nrp, self.__slo_viability(slos, nrp)[1]) - for nrp in self.__nrp_view - if self.__slo_viability(slos, nrp)[0] and nrp["available"] - ] - logging.debug(f"Candidates: {candidates}") - - # Select the best NRP based on candidates - best_nrp = max(candidates, key=lambda x: x[1])[0] if candidates else None - logging.debug(f"Best NRP: {best_nrp}") - - if best_nrp: - best_nrp["slices"].append(ietf_intent["ietf-network-slice-service:network-slice-services"]["slice-service"][0]["id"]) - # Update NRP view - self.__realizer(ietf_intent, True, "UPDATE") - # TODO Here we should put how the slice is attached to an already created nrp - else: - # Request the controller to create a new NRP that meets the SLOs - answer = self.__realizer(ietf_intent, True, "CREATE", best_nrp) - if not answer: - raise Exception("Slice rejected due to lack of NRPs") - # TODO Here we should put how the slice is attached to the new nrp + if NRP_ENABLED: + # Retrieve NRP view + self.__realizer(None, True, "READ") + + # Extract Service Level Objectives (SLOs) from the intent + slos = ietf_intent["ietf-network-slice-service:network-slice-services"]["slo-sle-templates"]["slo-sle-template"][0]["slo-policy"]["metric-bound"] + + if slos: + # Find candidate NRPs that can meet the SLO requirements + candidates = [ + (nrp, self.__slo_viability(slos, nrp)[1]) + for nrp in self.__nrp_view + if self.__slo_viability(slos, nrp)[0] and nrp["available"] + ] + logging.debug(f"Candidates: {candidates}") + + # Select the best NRP based on candidates + best_nrp = max(candidates, key=lambda x: x[1])[0] if candidates else None + logging.debug(f"Best NRP: {best_nrp}") + + if best_nrp: + best_nrp["slices"].append(ietf_intent["ietf-network-slice-service:network-slice-services"]["slice-service"][0]["id"]) + # Update NRP view + self.__realizer(ietf_intent, True, "UPDATE") + # TODO Here we should put how the slice is attached to an already created nrp + else: + # Request the controller to create a new NRP that meets the SLOs + answer = self.__realizer(ietf_intent, True, "CREATE", best_nrp) + if not answer: + raise Exception("Slice rejected due to lack of NRPs") + # TODO Here we should put how the slice is attached to the new nrp + + if PLANNER_ENABLED: + optimal_path = Planner().planner(ietf_intent) + + logging.info(f"Optimal path: {optimal_path}") def __realizer(self, ietf_intent, need_nrp=False, order=None, nrp=None): """ @@ -476,7 +492,6 @@ class NSController: "setup_time": self.setup_time } # Add slice details to the response - logging.info(self.answer) for subnet in self.answer: slice_info = { "id": subnet, @@ -672,10 +687,6 @@ class NSController: ietf_i["ietf-network-slice-service:network-slice-services"]["slice-service"][0]["sdps"]["sdp"][0]["service-match-criteria"]["match-criterion"][0]["target-connection-group-id"] = f"{ep_transport_objects[0].split(' ', 1)[1]}_{ep_transport_objects[1].split(' ', 1)[1]}" ietf_i["ietf-network-slice-service:network-slice-services"]["slice-service"][0]["sdps"]["sdp"][1]["service-match-criteria"]["match-criterion"][0]["target-connection-group-id"] = f"{ep_transport_objects[0].split(' ', 1)[1]}_{ep_transport_objects[1].split(' ', 1)[1]}" - # Log translated intent for debugging - logging.debug(json.dumps(ietf_i,indent=2)) - with open(os.path.join(TEMPLATES_PATH, "ietf_template_example.json"), "w") as archivo: - archivo.write(json.dumps(ietf_i,indent=2)) return ietf_i ### Mapper functionalities @@ -723,102 +734,6 @@ class NSController: score = sum(flexibility_scores) / len(flexibility_scores) if flexibility_scores else 0 return True, score # Si pasó todas las verificaciones, la NRP es viable - def __planner(self, intent, nrp_view): - """ - TODO - Request slice viability from the Planner module. - - This method prepares and sends a viability request for network slice creation, - detaching the implementation from the main core thread. - - Args: - intent (dict): Network slice intent - nrp_view (list): Current Network Resource Pool view - - Returns: - tuple: A tuple containing: - - Viability status (str): "Good" or other status - - Reason (str): Explanation of viability - - Notes: - - Calculates source and destination service delivery points (SDP) - - Extracts QoS requirements - - Performs viability check through internal methods - """ - - #Version 1 - matriz = {} - matriz["payloads"] = [] - #for i in intent: - # SI ya existe, suma, si no existe, lo crea - origen = self.__calculate_sdp(intent["ietf-network-slice-service:network-slice-services"]["slice-service"][0]["sdps"]["sdp"][0]["sdp-ip-address"]) - destino = self.__calculate_sdp(intent["ietf-network-slice-service:network-slice-services"]["slice-service"][0]["sdps"]["sdp"][1]["sdp-ip-address"]) - #qos_req = i["ietf-network-slice-service:network-slice-services"]["slice-service"][0]["slo-sle-policy"]["slo-sle-template"] - qos_req = intent["ietf-network-slice-service:network-slice-services"]["slo-sle-templates"]["slo-sle-template"][0]["slo-policy"]["metric-bound"][0]["bound"] - payload = { - "Source": origen, - "Destination": destino, - "QoS requirements": qos_req - } - matriz["payloads"].append(payload) - m_res = [] - m_qos = [] - for p in matriz["payloads"]: - res = p - m_res.append(res) - m_qos.append(p["QoS requirements"]) - m_res, m_qos = self.__viability(m_res,intent, m_qos) - reason="Viable" - viability = "Good" - return viability, reason - - def __viability(self, matrix, intent, qos): - """ - TODO - """ - aux = {} - aux["good"] = [] - aux["bad"] = [] - l_qos = [] - for i in range(len(intent)): - # if matrix[i]['success'] == True: - aux["good"].append(matrix[i]) - l_qos.append(qos[i]) - # else: - # aux["bad"].append(intent[i]) - return aux, l_qos - - def __calculate_sdp(self, pip): - ''' - TODO - Imput: - Output: - Work: Identifies the network entpoint from the IP-sdp received. - Version 0 will be done directly with next hop. - Version 1 will translate directly from the public IP of each node to their Loopback address. - ''' - nid = 0 - with open(os.path.join(TEMPLATES_PATH, "ips.json"), 'r') as source: - jason = source.read() - jason = jason.replace('\t', '').replace('\n', '').replace("'", '"').strip() - nodos = json.loads(str(jason)) - #template = json.loads(str(jason)) - # Once we have the template, we search for the one charged. - for nodo in nodos["public-prefixes"]: - if pip == nodo["prefix"]: - #nid = nodo["node-id"] - nid = nodo["node-name"] - for nodo in nodos["CU"]: - if pip == nodo["prefix"]: - #nid = nodo["node-id"] - nid = nodo["node-name"] - for nodo in nodos["DU"]: - if pip == nodo["prefix"]: - #nid = nodo["node-id"] - nid = nodo["node-name"] - return nid - - ### Realizer functionalities. def __nrp(self, request, nrp): """ @@ -1126,8 +1041,6 @@ class NSController: logging.info(f"L3VPN Intent realized\n") self.answer[self.subnet]["VLAN"] = vlan_value - with open(os.path.join(TEMPLATES_PATH, "L3-VPN_template_example.json"), "w") as archivo: - archivo.write(json.dumps(tfs_request,indent=2)) return tfs_request def __ixia(self, ietf_intent): diff --git a/src/planner/energy_ddbb.json b/src/planner/energy_ddbb.json new file mode 100644 index 0000000000000000000000000000000000000000..7826de6031621fb4103690cc02ac8b655c8996ad --- /dev/null +++ b/src/planner/energy_ddbb.json @@ -0,0 +1,156 @@ +[ + { + "name": "A", + "typical-power": 3500, + "maximum-traffic": 100.0, + "max-power": 150.0, + "efficiency": 0.9, + "nominal-power": 130.0, + "carbon-emissions": 130.0, + "renewable-energy-usage": 0.7, + "power-supply": [ + {"name": "PSU-1", "type": "AC", "capacity": 200.0, "typical-power": 100.0, "nominal-power": 110.0} + ], + "boards": [ + {"name": "Board-1", "type": "Linecard", "capacity": 40.0, "typical-power": 20.0, "nominal-power": 25.0} + ], + "components": [ + {"name": "CPU", "type": "Control", "capacity": 10.0, "typical-power": 5.0, "nominal-power": 6.0} + ], + "transceivers": [ + {"name": "XFP1", "type": "10G", "capacity": 10.0, "typical-power": 2.0, "nominal-power": 2.5} + ] + }, + { + "name": "B", + "typical-power": 6000, + "maximum-traffic": 120.0, + "max-power": 180.0, + "efficiency": 1, + "nominal-power": 160.0, + "carbon-emissions": 180.0, + "renewable-energy-usage": 0.6, + "power-supply": [ + {"name": "PSU-1", "type": "DC", "capacity": 250.0, "typical-power": 120.0, "nominal-power": 130.0} + ], + "boards": [ + {"name": "Board-2", "type": "Switching", "capacity": 60.0, "typical-power": 30.0, "nominal-power": 35.0} + ], + "components": [ + {"name": "ASIC", "type": "Forwarding", "capacity": 15.0, "typical-power": 7.0, "nominal-power": 8.0} + ], + "transceivers": [ + {"name": "SFP1", "type": "1G", "capacity": 1.0, "typical-power": 1.0, "nominal-power": 1.2} + ] + }, + { + "name": "C", + "typical-power": 3200, + "maximum-traffic": 150.0, + "max-power": 250.0, + "efficiency": 1.2, + "nominal-power": 210.0, + "carbon-emissions": 160.0, + "renewable-energy-usage": 0.5, + "power-supply": [ + {"name": "PSU-2", "type": "AC", "capacity": 300.0, "typical-power": 150.0, "nominal-power": 160.0} + ], + "boards": [ + {"name": "Board-3", "type": "Routing", "capacity": 80.0, "typical-power": 40.0, "nominal-power": 45.0} + ], + "components": [ + {"name": "FPGA", "type": "Processing", "capacity": 20.0, "typical-power": 10.0, "nominal-power": 12.0} + ], + "transceivers": [ + {"name": "QSFP1", "type": "40G", "capacity": 40.0, "typical-power": 4.0, "nominal-power": 5.0} + ] + }, + { + "name": "D", + "typical-power": 6000, + "maximum-traffic": 200.0, + "max-power": 300.0, + "efficiency": 0.9, + "nominal-power": 260.0, + "carbon-emissions": 100.0, + "renewable-energy-usage": 0.5, + "power-supply": [ + {"name": "PSU-3", "type": "DC", "capacity": 350.0, "typical-power": 180.0, "nominal-power": 190.0} + ], + "boards": [ + {"name": "Board-4", "type": "Access", "capacity": 100.0, "typical-power": 50.0, "nominal-power": 55.0} + ], + "components": [ + {"name": "GPU", "type": "Accelerator", "capacity": 25.0, "typical-power": 12.0, "nominal-power": 14.0} + ], + "transceivers": [ + {"name": "CFP1", "type": "100G", "capacity": 100.0, "typical-power": 8.0, "nominal-power": 10.0} + ] + }, + { + "name": "E", + "typical-power": 4500, + "maximum-traffic": 250.0, + "max-power": 350.0, + "efficiency": 1.4, + "nominal-power": 310.0, + "carbon-emissions": 180, + "renewable-energy-usage": 0.6, + "power-supply": [ + {"name": "PSU-4", "type": "AC", "capacity": 400.0, "typical-power": 200.0, "nominal-power": 210.0} + ], + "boards": [ + {"name": "Board-5", "type": "Core", "capacity": 120.0, "typical-power": 60.0, "nominal-power": 65.0} + ], + "components": [ + {"name": "TPU", "type": "Neural Processing", "capacity": 30.0, "typical-power": 15.0, "nominal-power": 18.0} + ], + "transceivers": [ + {"name": "OSFP1", "type": "400G", "capacity": 400.0, "typical-power": 12.0, "nominal-power": 15.0} + ] + }, + { + "name": "F", + "typical-power": 3000, + "maximum-traffic": 300.0, + "max-power": 400.0, + "efficiency": 1.3, + "nominal-power": 360.0, + "carbon-emissions": 140, + "renewable-energy-usage": 0.6, + "power-supply": [ + {"name": "PSU-5", "type": "DC", "capacity": 450.0, "typical-power": 220.0, "nominal-power": 230.0} + ], + "boards": [ + {"name": "Board-6", "type": "Edge", "capacity": 150.0, "typical-power": 75.0, "nominal-power": 80.0} + ], + "components": [ + {"name": "ASIC2", "type": "Edge Processing", "capacity": 40.0, "typical-power": 20.0, "nominal-power": 22.0} + ], + "transceivers": [ + {"name": "QSFP-DD1", "type": "800G", "capacity": 800.0, "typical-power": 16.0, "nominal-power": 20.0} + ] + }, + { + "name": "G", + "typical-power": 3100, + "maximum-traffic": 350.0, + "max-power": 450.0, + "efficiency": 1.1, + "nominal-power": 410.0, + "carbon-emissions": 105.0, + "renewable-energy-usage": 0.6, + "power-supply": [ + {"name": "PSU-6", "type": "AC", "capacity": 500.0, "typical-power": 250.0, "nominal-power": 260.0} + ], + "boards": [ + {"name": "Board-7", "type": "Virtualization", "capacity": 180.0, "typical-power": 90.0, "nominal-power": 95.0} + ], + "components": [ + {"name": "FPGA2", "type": "Reconfigurable Processing", "capacity": 50.0, "typical-power": 25.0, "nominal-power": 28.0} + ], + "transceivers": [ + {"name": "CFP2", "type": "1.6T", "capacity": 1600.0, "typical-power": 20.0, "nominal-power": 25.0} + ] + } +] \ No newline at end of file diff --git a/src/planner/ext_topo_ddbb.json b/src/planner/ext_topo_ddbb.json new file mode 100644 index 0000000000000000000000000000000000000000..72dc93dc10ca271adf670d9b85466920a4736929 --- /dev/null +++ b/src/planner/ext_topo_ddbb.json @@ -0,0 +1,195 @@ +{ +"nodes": [ + { + "nodeId": 1, + "name": "A", + "type": "SITE", + "footprint": { "cpu": 2, "memory": 1024, "disk": 5000 }, + "vulnerability": 1 + }, + { + "nodeId": 2, + "name": "B", + "type": "SITE", + "footprint": { "cpu": 1, "memory": 512, "disk": 3000 }, + "vulnerability": 2 + }, + { + "nodeId": 3, + "name": "C", + "type": "SITE", + "footprint": { "cpu": 2, "memory": 2048, "disk": 6000 }, + "vulnerability": 3 + }, + { + "nodeId": 4, + "name": "D", + "type": "SITE", + "footprint": { "cpu": 1, "memory": 1024, "disk": 4000 }, + "vulnerability": 1 + }, + { + "nodeId": 5, + "name": "E", + "type": "SITE", + "footprint": { "cpu": 2, "memory": 1024, "disk": 5000 }, + "vulnerability": 2 + }, + { + "nodeId": 6, + "name": "F", + "type": "SITE", + "footprint": { "cpu": 1, "memory": 512, "disk": 3000 }, + "vulnerability": 2 + }, + { + "nodeId": 7, + "name": "G", + "type": "SITE", + "footprint": { "cpu": 2, "memory": 1024, "disk": 7000 }, + "vulnerability": 3 + } +], +"links":[ + { + "linkId": "A-E", + "sourceNodeId": "1", + "destNodeId": "5", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 5 }] + }, + { + "linkId": "E-A", + "sourceNodeId": "5", + "destNodeId": "1", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 5 }] + }, + { + "linkId": "A-D", + "sourceNodeId": "1", + "destNodeId": "4", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 4 }] + }, + { + "linkId": "D-A", + "sourceNodeId": "4", + "destNodeId": "1", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 4 }] + }, + { + "linkId": "A-C", + "sourceNodeId": "1", + "destNodeId": "3", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 3 }] + }, + { + "linkId": "C-A", + "sourceNodeId": "3", + "destNodeId": "1", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 3 }] + }, + { + "linkId": "B-C", + "sourceNodeId": "2", + "destNodeId": "3", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 6 }] + }, + { + "linkId": "C-B", + "sourceNodeId": "3", + "destNodeId": "2", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 6 }] + }, + { + "linkId": "B-D", + "sourceNodeId": "2", + "destNodeId": "4", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 7 }] + }, + { + "linkId": "D-B", + "sourceNodeId": "4", + "destNodeId": "2", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 7 }] + }, + { + "linkId": "B-F", + "sourceNodeId": "2", + "destNodeId": "6", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 5 }] + }, + { + "linkId": "F-B", + "sourceNodeId": "6", + "destNodeId": "2", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 5 }] + }, + { + "linkId": "D-E", + "sourceNodeId": "4", + "destNodeId": "5", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 2 }] + }, + { + "linkId": "E-D", + "sourceNodeId": "5", + "destNodeId": "4", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 2 }] + }, + { + "linkId": "D-F", + "sourceNodeId": "4", + "destNodeId": "6", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 6 }] + }, + { + "linkId": "F-D", + "sourceNodeId": "6", + "destNodeId": "4", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 6 }] + }, + { + "linkId": "E-G", + "sourceNodeId": "5", + "destNodeId": "7", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 3 }] + }, + { + "linkId": "G-E", + "sourceNodeId": "7", + "destNodeId": "5", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 3 }] + }, + { + "linkId": "F-G", + "sourceNodeId": "6", + "destNodeId": "7", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 4 }] + }, + { + "linkId": "G-F", + "sourceNodeId": "7", + "destNodeId": "6", + "bandwidth": 1000000000, + "metrics": [{ "metric": "DELAY", "value": 4 }] + } +] +} \ No newline at end of file diff --git a/src/planner/planner.py b/src/planner/planner.py new file mode 100644 index 0000000000000000000000000000000000000000..b5fb1ba1ee624fcc090d4c85dfc252f2463ac042 --- /dev/null +++ b/src/planner/planner.py @@ -0,0 +1,286 @@ +# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file is an original contribution from Telefonica Innovación Digital S.L. + +import logging, random, os, json, heapq +from src.Constants import SRC_PATH, PCE_EXTERNAL, DEFAULT_LOGGING_LEVEL + +# Configure logging to provide clear and informative log messages +logging.basicConfig( + level=DEFAULT_LOGGING_LEVEL, + format='%(levelname)s - %(message)s') + +class Planner: + """ + Planner class to compute the optimal path for a network slice based on energy consumption and topology. + """ + + def planner(self, intent): + """ + Plan the optimal path for a network slice based on energy consumption and topology. + """ + energy_metrics = self.__retrieve_energy() + topology = self.__retrieve_topology() + source = intent.get("ietf-network-slice-service:network-slice-services", {}).get("slice-service", [])[0].get("sdps", {}).get("sdp", [])[0].get("id") or "A" + destination = intent.get("ietf-network-slice-service:network-slice-services", {}).get("slice-service", [])[0].get("sdps", {}).get("sdp", [])[1].get("id") or "B" + optimal_path = [] + # If using an external PCE + if PCE_EXTERNAL: + logging.info("Using external PCE for path planning") + def build_slice_input(node_source, node_destination): + return { + "clientName": "demo-client", + "requestId": random.randint(1000, 9999), + "sites": [node_source["nodeId"], node_destination["nodeId"]], + "graph": { + "nodes": [ + { + "nodeId": node_source["nodeId"], + "name": node_source["name"], + "footprint": node_source["footprint"], + "sticky": [node_source["nodeId"]] + }, + { + "nodeId": node_destination["nodeId"], + "name": node_destination["name"], + "footprint": node_destination["footprint"], + "sticky": [node_destination["nodeId"]] + } + ], + "links": [ + { + "fromNodeId": node_source["nodeId"], + "toNodeId": node_destination["nodeId"], + "bandwidth": 1000000000, + "metrics": [ + { + "metric": "DELAY", + "value": 10, + "bound": True, + "required": True + } + ] + } + ], + "constraints": { + "maxVulnerability": 3, + "maxDeployedServices": 10, + "metricLimits": [] + } + } + } + source = next((node for node in topology["nodes"] if node["name"] == source), None) + destination = next((node for node in topology["nodes"] if node["name"] == destination), None) + slice_input = build_slice_input(source, destination) + + # POST /sss/v1/slice/compute + def simulate_slice_output(input_data): + return { + "input": input_data, + "slice": { + "nodes": [ + {"site": 1, "service": 1}, + {"site": 2, "service": 2} + ], + "links": [ + { + "fromNodeId": 1, + "toNodeId": 2, + "lspId": 500, + "path": { + "ingressNodeId": 1, + "egressNodeId": 2, + "hops": [ + {"nodeId": 3, "linkId": "A-C", "portId": 1}, + {"nodeId": 2, "linkId": "C-B", "portId": 2} + ] + } + } + ], + "metric": {"value": 9} + }, + "error": None + } + slice_output = simulate_slice_output(slice_input) + # Mostrar resultado + optimal_path.append(source["name"]) + for link in slice_output["slice"]["links"]: + for hop in link["path"]["hops"]: + optimal_path.append(next((node for node in topology["nodes"] if node["nodeId"] == hop['nodeId']), None)["name"]) + + else: + logging.info("Using internal PCE for path planning") + ietf_dlos = intent["ietf-network-slice-service:network-slice-services"]["slo-sle-templates"]["slo-sle-template"][0]["slo-policy"]["metric-bound"] + logging.info(ietf_dlos), + # Solo asigna los DLOS que existan, el resto a None + dlos = { + "EC": next((item.get("bound") for item in ietf_dlos if item.get("metric-type") == "energy_consumption"), None), + "CE": next((item.get("bound") for item in ietf_dlos if item.get("metric-type") == "carbon_emission"), None), + "EE": next((item.get("bound") for item in ietf_dlos if item.get("metric-type") == "energy_efficiency"), None), + "URE": next((item.get("bound") for item in ietf_dlos if item.get("metric-type") == "renewable_energy_usage"), None) + } + logging.debug(f"Planning optimal path from {source} to {destination} with DLOS: {dlos}") + optimal_path = self.__calculate_optimal_path(topology, energy_metrics, source, destination, dlos) + + if not optimal_path: + logging.error("No valid path found") + raise Exception("No valid energy path found") + + return optimal_path + + def __retrieve_energy(self): + # TODO : Implement the logic to retrieve energy consumption data from controller + # Taking it from static file + with open(os.path.join(SRC_PATH, "planner/energy_ddbb.json"), "r") as archivo: + energy_metrics = json.load(archivo) + return energy_metrics + + def __retrieve_topology(self): + if PCE_EXTERNAL: + # TODO : Implement the logic to retrieve topology data from external PCE + # GET /sss/v1/topology/node and /sss/v1/topology/link + with open(os.path.join(SRC_PATH, "planner/ext_topo_ddbb.json"), "r") as archivo: + topology = json.load(archivo) + else: + # TODO : Implement the logic to retrieve topology data from controller + # Taking it from static file + with open(os.path.join(SRC_PATH, "planner/topo_ddbb.json"), "r") as archivo: + topology = json.load(archivo) + return topology + + + + def __calculate_optimal_path(self, topology, energy_metrics, source, destination, dlos): + logging.debug("Starting optimal path calculation...") + + # Create a dictionary with the weights of each node + node_data_map = {} + for node_data in energy_metrics: + node_id = node_data["name"] + ec = node_data["typical-power"] + ce = node_data["carbon-emissions"] + ee = node_data["efficiency"] + ure = node_data["renewable-energy-usage"] + + total_power_supply = sum(ps["typical-power"] for ps in node_data["power-supply"]) + total_power_boards = sum(b["typical-power"] for b in node_data["boards"]) + total_power_components = sum(c["typical-power"] for c in node_data["components"]) + total_power_transceivers = sum(t["typical-power"] for t in node_data["transceivers"]) + + logging.debug(f"Node {node_id}: EC={ec}, CE={ce}, EE={ee}, URE={ure}") + logging.debug(f"Node {node_id}: PS={total_power_supply}, BO={total_power_boards}, CO={total_power_components}, TR={total_power_transceivers}") + + weight = self.__compute_node_weight(ec, ce, ee, ure, + total_power_supply, + total_power_boards, + total_power_components, + total_power_transceivers) + logging.debug(f"Weight for node {node_id}: {weight}") + + node_data_map[node_id] = { + "weight": weight, + "ec": ec, + "ce": ce, + "ee": ee, + "ure": ure + } + + # Create a graph representation of the topology + graph = {} + for node in topology["ietf-network:networks"]["network"][0]["node"]: + graph[node["node-id"]] = [] + for link in topology["ietf-network:networks"]["network"][0]["link"]: + src = link["source"]["source-node"] + dst = link["destination"]["dest-node"] + graph[src].append((dst, node_data_map[dst]["weight"])) + logging.debug(f"Added link: {src} -> {dst} with weight {node_data_map[dst]['weight']}") + + # Dijkstra's algorithm with restrictions + queue = [(0, source, [], 0, 0, 0, 1)] # (accumulated cost, current node, path, sum_ec, sum_ce, sum_ee, min_ure) + visited = set() + + logging.debug(f"Starting search from {source} to {destination} with restrictions: {dlos}") + + + while queue: + cost, node, path, sum_ec, sum_ce, sum_ee, min_ure = heapq.heappop(queue) + logging.debug(f"Exploring node {node} with cost {cost} and path {path + [node]}") + + if node in visited: + logging.debug(f"Node {node} already visited, skipped.") + continue + visited.add(node) + path = path + [node] + + node_metrics = node_data_map[node] + sum_ec += node_metrics["ec"] + sum_ce += node_metrics["ce"] + sum_ee += node_metrics["ee"] + min_ure = min(min_ure, node_metrics["ure"]) if path[:-1] else node_metrics["ure"] + + logging.debug(f"Accumulated -> EC: {sum_ec}, CE: {sum_ce}, EE: {sum_ee}, URE min: {min_ure}") + + if dlos["EC"] is not None and sum_ec > dlos["EC"]: + logging.debug(f"Discarded path {path} for exceeding EC ({sum_ec} > {dlos['EC']})") + continue + if dlos["CE"] is not None and sum_ce > dlos["CE"]: + logging.debug(f"Discarded path {path} for exceeding CE ({sum_ce} > {dlos['CE']})") + continue + if dlos["EE"] is not None and sum_ee > dlos["EE"]: + logging.debug(f"Discarded path {path} for exceeding EE ({sum_ee} > {dlos['EE']})") + continue + if dlos["URE"] is not None and min_ure < dlos["URE"]: + logging.debug(f"Discarded path {path} for not reaching minimum URE ({min_ure} < {dlos['URE']})") + continue + + if node == destination: + logging.debug(f"Destination {destination} reached with a valid path: {path}") + return path + + for neighbor, weight in graph.get(node, []): + if neighbor not in visited: + logging.debug(f"Qeue -> neighbour: {neighbor}, weight: {weight}") + heapq.heappush(queue, ( + cost + weight, + neighbor, + path, + sum_ec, + sum_ce, + sum_ee, + min_ure + )) + logging.debug("No valid path found that meets the restrictions.") + return [] + + + def __compute_node_weight(self, ec, ce, ee, ure, total_power_supply, total_power_boards, total_power_components, total_power_transceivers, alpha=1, beta=1, gamma=1, delta=1): + """ + Calcula el peso de un nodo con la fórmula: + w(v) = α·EC + β·CE + γ/EE + δ·(1 - URE) + """ + traffic = 100 + # Measure one hour of traffic + time = 1 + + power_idle = ec + total_power_supply + total_power_boards + total_power_components + total_power_transceivers + power_traffic = traffic * ee + + power_total = (power_idle + power_traffic) + + green_index = power_total * time / 1000 * (1 - ure) * ce + + return green_index + + diff --git a/src/planner/topo_ddbb.json b/src/planner/topo_ddbb.json new file mode 100644 index 0000000000000000000000000000000000000000..76fb08c68d4c7337e09f79ce827004fba810a5b9 --- /dev/null +++ b/src/planner/topo_ddbb.json @@ -0,0 +1,43 @@ +{ + "ietf-network:networks":{ + "network":[ + { + "network-id":"example_network", + "network-types":{ + + }, + "node":[ + {"node-id":"A"}, + {"node-id":"B"}, + {"node-id":"C"}, + {"node-id":"D"}, + {"node-id":"E"}, + {"node-id":"F"}, + {"node-id":"G"} + ], + "link":[ + {"link-id":"A-E","source":{"source-node":"A"},"destination":{"dest-node":"E"}}, + {"link-id":"E-A","source":{"source-node":"E"},"destination":{"dest-node":"A"}}, + {"link-id":"A-D","source":{"source-node":"A"},"destination":{"dest-node":"D"}}, + {"link-id":"D-A","source":{"source-node":"D"},"destination":{"dest-node":"A"}}, + {"link-id":"A-C","source":{"source-node":"A"},"destination":{"dest-node":"C"}}, + {"link-id":"C-A","source":{"source-node":"C"},"destination":{"dest-node":"A"}}, + {"link-id":"B-C","source":{"source-node":"B"},"destination":{"dest-node":"C"}}, + {"link-id":"C-B","source":{"source-node":"C"},"destination":{"dest-node":"B"}}, + {"link-id":"B-D","source":{"source-node":"B"},"destination":{"dest-node":"D"}}, + {"link-id":"D-B","source":{"source-node":"D"},"destination":{"dest-node":"B"}}, + {"link-id":"B-F","source":{"source-node":"B"},"destination":{"dest-node":"F"}}, + {"link-id":"F-B","source":{"source-node":"F"},"destination":{"dest-node":"B"}}, + {"link-id":"D-E","source":{"source-node":"D"},"destination":{"dest-node":"E"}}, + {"link-id":"E-D","source":{"source-node":"E"},"destination":{"dest-node":"D"}}, + {"link-id":"D-F","source":{"source-node":"D"},"destination":{"dest-node":"F"}}, + {"link-id":"F-D","source":{"source-node":"F"},"destination":{"dest-node":"D"}}, + {"link-id":"E-G","source":{"source-node":"E"},"destination":{"dest-node":"G"}}, + {"link-id":"G-E","source":{"source-node":"G"},"destination":{"dest-node":"E"}}, + {"link-id":"F-G","source":{"source-node":"F"},"destination":{"dest-node":"G"}}, + {"link-id":"G-F","source":{"source-node":"G"},"destination":{"dest-node":"F"}} + ] + } + ] + } + } \ No newline at end of file diff --git a/src/realizers/ixia/NEII_V4.py b/src/realizers/ixia/NEII_V4.py index 64a13318f4f4e1239ff5d5d36fd5ff04293b0f49..f9379d2cc0ddb0aceecb38ad918e0a995b0cebfe 100644 --- a/src/realizers/ixia/NEII_V4.py +++ b/src/realizers/ixia/NEII_V4.py @@ -1,5 +1,18 @@ -###SPDX-FileCopyrightText: © 2024 Telefónica Innovación Digital S.L. -###SPDX-License-Identifier: AGPL-3.0-or-later +# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file is an original contribution from Telefonica Innovación Digital S.L. from .automatizacion_ne2v4 import automatizacion import ipaddress, logging diff --git a/src/realizers/ixia/automatizacion_ne2v4.py b/src/realizers/ixia/automatizacion_ne2v4.py index bc822a0b24a7a2f327307496cc62d999bef053f7..fd8fc4f5c7b5f093fc60963687d8564001eb224d 100644 --- a/src/realizers/ixia/automatizacion_ne2v4.py +++ b/src/realizers/ixia/automatizacion_ne2v4.py @@ -1,5 +1,18 @@ -###SPDX-FileCopyrightText: © 2024 Telefónica Innovación Digital S.L. -###SPDX-License-Identifier: AGPL-3.0-or-later +# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file is an original contribution from Telefonica Innovación Digital S.L. import requests class automatizacion: diff --git a/src/templates/3gpp_template_example.json b/src/templates/3gpp_template_example.json deleted file mode 100644 index 28471a8b2026b00c6d60222e8a9943290c6bc45a..0000000000000000000000000000000000000000 --- a/src/templates/3gpp_template_example.json +++ /dev/null @@ -1,187 +0,0 @@ -{ - "NetworkSlice1": { - "operationalState": "", - "administrativeState": "", - "serviceProfileList": [], - "networkSliceSubnetRef": "TopSliceSubnet1" - }, - "TopSliceSubnet1": { - "operationalState": "", - "administrativeState": "", - "nsInfo": {}, - "managedFunctionRef": [], - "networkSliceSubnetType": "TOP_SLICESUBNET", - "SliceProfileList": [ - { - "sliceProfileId": "TopId", - "pLMNInfoList": null, - "TopSliceSubnetProfile": { - "dLThptPerSliceSubnet": { - "GuaThpt": 200, - "MaxThpt": 400 - }, - "uLThptPerSliceSubnet": { - "GuaThpt": 200, - "MaxThpt": 400 - }, - "dLLatency": 20, - "uLLatency": 20 - } - } - ], - "networkSliceSubnetRef": [ - "CNSliceSubnet1", - "RANSliceSubnet1" - ] - }, - "CNSliceSubnet1": { - "operationalState": "", - "administrativeState": "", - "nsInfo": {}, - "managedFunctionRef": [], - "networkSliceSubnetType": "CN_SLICESUBNET", - "SliceProfileList": [ - { - "sliceProfileId": "CNId", - "pLMNInfoList": null, - "CNSliceSubnetProfile": { - "dLThptPerSliceSubnet": { - "GuaThpt": 100, - "MaxThpt": 200 - }, - "uLThptPerSliceSubnet": { - "GuaThpt": 100, - "MaxThpt": 200 - }, - "dLLatency": 8, - "uLLatency": 8 - } - } - ] - }, - "RANSliceSubnet1": { - "operationalState": "", - "administrativeState": "", - "nsInfo": {}, - "managedFunctionRef": [], - "networkSliceSubnetType": "RAN_SLICESUBNET", - "SliceProfileList": [ - { - "sliceProfileId": "RANId", - "pLMNInfoList": null, - "RANSliceSubnetProfile": { - "dLThptPerSliceSubnet": { - "GuaThpt": 100, - "MaxThpt": 200 - }, - "uLThptPerSliceSubnet": { - "GuaThpt": 100, - "MaxThpt": 200 - }, - "dLLatency": 12, - "uLLatency": 12 - } - } - ], - "networkSliceSubnetRef": [ - "MidhaulSliceSubnet1", - "BackhaulSliceSubnet1" - ] - }, - "MidhaulSliceSubnet1": { - "operationalState": "", - "administrativeState": "", - "nsInfo": {}, - "managedFunctionRef": [], - "networkSliceSubnetType": "RAN_SLICESUBNET", - "SliceProfileList": [ - { - "sliceProfileId": "MidhaulId", - "pLMNInfoList": null, - "RANSliceSubnetProfile": { - "dLThptPerSliceSubnet": { - "GuaThpt": 60, - "MaxThpt": 120 - }, - "uLThptPerSliceSubnet": { - "GuaThpt": 60, - "MaxThpt": 120 - }, - "dLLatency": 4, - "uLLatency": 4 - } - } - ], - "EpTransport": [ - "EpTransport CU-UP1", - "EpTransport DU3" - ] - }, - "BackhaulSliceSubnet1": { - "operationalState": "", - "administrativeState": "", - "nsInfo": {}, - "managedFunctionRef": [], - "networkSliceSubnetType": "RAN_SLICESUBNET", - "SliceProfileList": [ - { - "sliceProfileId": "BackhaulId", - "pLMNInfoList": null, - "RANSliceSubnetProfile": { - "dLThptPerSliceSubnet": { - "GuaThpt": 40, - "MaxThpt": 80 - }, - "uLThptPerSliceSubnet": { - "GuaThpt": 40, - "MaxThpt": 80 - }, - "dLLatency": 8, - "uLLatency": 8 - } - } - ], - "EpTransport": [ - "EpTransport CU-UP2", - "EpTransport UPF" - ] - }, - "EpTransport CU-UP1": { - "IpAddress": "100.1.1.1", - "logicalInterfaceInfo": { - "logicalInterfaceType": "VLAN", - "logicalInterfaceId": "300" - }, - "NextHopInfo": "100.1.1.254", - "qosProfile": "5QI100", - "EpApplicationRef": [ - "EP_F1U CU-UP1" - ] - }, - "EP_F1U CU-UP1": { - "localAddress": "100.1.1.2", - "remoteAddress": "1.1.3.2", - "epTransportRef": [ - "EpTransport CU-UP1" - ] - }, - "EpTransport DU3": { - "IpAddress": "1.1.3.1", - "logicalInterfaceInfo": { - "logicalInterfaceType": "VLAN", - "logicalInterfaceId": "300" - }, - "NextHopInfo": "1.1.3.254", - "qosProfile": "5QI100", - "EpApplicationRef": [ - "EP_F1U DU3" - ] - }, - "EP_F1U DU3": { - "localAddress": "1.1.3.2", - "remoteAddress": "100.1.1.2", - "epTransportRef": [ - "EpTransport DU3" - ] - } -} \ No newline at end of file diff --git a/src/templates/3gpp_template_filled.json b/src/templates/3gpp_template_filled.json deleted file mode 100644 index dcab03aa3d095fd133fbddbac12c3621ddb481ee..0000000000000000000000000000000000000000 --- a/src/templates/3gpp_template_filled.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "NetworkSlice1":{ - "operationalState":"", - "administrativeState":"", - "serviceProfileList":[ // Requisitos generales de una NetworkSlice. Lo suponemos vacío. The attributes in ServiceProfile represent mapped requirements from an Network Slice Customer (e.g. an enterprise) to an Network Slice Provider - //{ - // "serviceProfileId":"", - // "pLMNInfoList": null, //It defines which PLMN and S-NSSAI combinations that are assigned for the service to satisfy service requirements represented by the ServiceProfile - // "sST":"2" // 1 (eMBB), 2(URLLC), 3(MIoT), 4(V2X) o 5(HMTC) - //} - ], - "networkSliceSubnetRef":"TopSliceSubnet1" //Es un DN (string) - }, - "TopSliceSubnet1":{ - "operationalState":"", - "administrativeState":"", - "nsInfo":{}, // Se usa si la slice está en un entorno virtualizado - "managedFunctionRef":[], // ??? Es un DNList (array de strings) - "networkSliceSubnetType":"TOP_SLICESUBNET", - "SliceProfileList":[ // Requisitos de una NetworkSliceSubnet, la cual representa un conjunto de funciones de red agrupadas. - { - "sliceProfileId":"TopId", - "pLMNInfoList":null, - "TopSliceSubnetProfile":{ //Condition: It shall be present when the slice profile is for top/root network slice subnet - "dLThptPerSliceSubnet":{ //kbps - "GuaThpt":1000, - "MaxThpt":2000 - }, - "uLThptPerSliceSubnet":{ - "GuaThpt":1000, - "MaxThpt":2000 - }, - "dLLatency":5, //ms - "uLLatency":5 - } - } - ], - "networkSliceSubnetRef":["CNSliceSubnet1","RANSliceSubnet1"] - }, - "CNSliceSubnet1":{ - "operationalState":"", - "administrativeState":"", - "nsInfo":{}, // Se usa si la slice está en un entorno virtualizado - "managedFunctionRef":[], // ??? Es un DNList (array de strings) - "networkSliceSubnetType":"CN_SLICESUBNET", - "SliceProfileList":[ // Requisitos de una NetworkSliceSubnet, la cual representa un conjunto de funciones de red agrupadas. Los requisitos de transporte se representan aquí - { - "sliceProfileId":"CNId", - "pLMNInfoList":null, - "CNSliceSubnetProfile":{ - "dLThptPerSliceSubnet":{ - "GuaThpt":500, - "MaxThpt":1000 - }, - "uLThptPerSliceSubnet":{ - "GuaThpt":500, - "MaxThpt":1000 - }, - "dLLatency":2, - "uLLatency":2 - } - } - ] - }, - "RANSliceSubnet1":{ - "operationalState":"", - "administrativeState":"", - "nsInfo":{}, // Se usa si la slice está en un entorno virtualizado - "managedFunctionRef":[], // ??? Es un DNList (array de strings) - "networkSliceSubnetType":"RAN_SLICESUBNET", - "SliceProfileList":[ // Requisitos de una NetworkSliceSubnet, la cual representa un conjunto de funciones de red agrupadas. Los requisitos de transporte se representan aquí - { - "sliceProfileId":"RANId", - "pLMNInfoList":null, - "RANSliceSubnetProfile":{ - "dLThptPerSliceSubnet":{ - "GuaThpt":500, - "MaxThpt":1000 - }, - "uLThptPerSliceSubnet":{ - "GuaThpt":500, - "MaxThpt":1000 - }, - "dLLatency":3, - "uLLatency":3 - } - } - ], - "networkSliceSubnetRef":["MidhaulSliceSubnet1", "BackhaulSliceSubnet1"] - }, - "MidhaulSliceSubnet1":{ - "operationalState":"", - "administrativeState":"", - "nsInfo":{}, // Se usa si la slice está en un entorno virtualizado - "managedFunctionRef":[], // ??? Es un DNList (array de strings), - "networkSliceSubnetType":"RAN_SLICESUBNET", - "SliceProfileList":[ // Requisitos de una NetworkSliceSubnet, la cual representa un conjunto de funciones de red agrupadas. Los requisitos de transporte se representan aquí - { - "sliceProfileId":"MidhaulId", - "pLMNInfoList":null, - "RANSliceSubnetProfile":{ - "dLThptPerSliceSubnet":{ - "GuaThpt":300, - "MaxThpt":600 - }, - "uLThptPerSliceSubnet":{ - "GuaThpt":300, - "MaxThpt":600 - }, - "dLLatency":1, - "uLLatency":1 - } - } - ], - "EpTransport":["EpTransport DU1","EpTransport CU-UP1"] // Es un DNList (array de strings) - }, - "BackhaulSliceSubnet1":{ - "operationalState":"", - "administrativeState":"", - "nsInfo":{}, // Se usa si la slice está en un entorno virtualizado - "managedFunctionRef":[], // ??? Es un DNList (array de strings), - "networkSliceSubnetType":"RAN_SLICESUBNET", - "SliceProfileList":[ // Requisitos de una NetworkSliceSubnet, la cual representa un conjunto de funciones de red agrupadas. Los requisitos de transporte se representan aquí - { - "sliceProfileId":"BackhaulId", - "pLMNInfoList":null, - "RANSliceSubnetProfile":{ - "dLThptPerSliceSubnet":{ - "GuaThpt":200, - "MaxThpt":400 - }, - "uLThptPerSliceSubnet":{ - "GuaThpt":200, - "MaxThpt":400 - }, - "dLLatency":2, - "uLLatency":2 - } - } - ], - "EpTransport":["EpTransport CU-UP2","EpTransport UPF"] // Es un DNList (array de strings) - }, - "EpTransport DU1": - { - "IpAddress":"100.1.1.1", - "logicalInterfaceInfo":{ - "logicalInterfaceType":"VLAN", //VLAN, MPLS o Segment - "logicalInterfaceId":"100" - }, - "NextHopInfo": "100.1.1.254", - "qosProfile":"5QI100", //Revisar el mapeo de los requisitos de la slice con esto - "EpApplicationRef":["EP_F1U DU1"] //Es un DNList (array de string) - }, - "EpTransport CU-UP1": - { - "IpAddress":"1.1.1.1", - "logicalInterfaceInfo":{ - "logicalInterfaceType":"VLAN", //VLAN, MPLS o Segment - "logicalInterfaceId":"100" - }, - "NextHopInfo": "1.1.1.254", - "QosProfile":"5QI100", - "EpApplicationRef":["EP_F1U CU-UP1"] //Es un DNList (array de string) - }, - "EP_F1U DU1":[ // El 3GPP parece que aun no ha definido las interfaces entre los distinos functional splits, por lo que estos objetos no están claros. Suponemos EP_F1U para todo, que es el que se usa para la interfaz F1-U entre gNB-DU y gNB-CU - { - "localAddress":"100.1.1.2", - "remoteAddress":"1.1.1.2", - "epTransportRef":["EpTransport DU1"] //Es un DNList (array de string) - } - ], - "EP_F1U CU-UP1":[ //Otras opciones son EP_N3 (interfaz N3 entre RAN y UPF) y EP_NgU (interfaz NG-U entre gNB y UPF) - { - "localAddress":"1.1.1.2", - "remoteAddress":"100.1.1.2", - "epTransportRef":["EpTransport CU-UP1"] //Es un DNList (array de string) - } - ] -} - - - diff --git a/src/templates/L2-VPN_template_example.json b/src/templates/L2-VPN_template_example.json deleted file mode 100644 index 2d6af092213d71a5ff011000c466c182fa84be45..0000000000000000000000000000000000000000 --- a/src/templates/L2-VPN_template_example.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "services":[ - { - "service_id":{ - "context_id":{ - "context_uuid":{ - "uuid":"admin" - } - }, - "service_uuid":{ - "uuid":"l2-acl-svc-17429923732568250765476542" - } - }, - "service_type":2, - "service_status":{ - "service_status":1 - }, - "service_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"1.1.1.1" - } - }, - "endpoint_uuid":{ - "uuid":"eth0" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"3.3.3.3" - } - }, - "endpoint_uuid":{ - "uuid":"eth0" - } - } - ], - "service_constraints":[ - { - "custom":{ - "constraint_type":"bandwidth[kbps]", - "constraint_value":"20" - } - }, - { - "custom":{ - "constraint_type":"latency[ms]", - "constraint_value":"20" - } - } - ], - "service_config":{ - "config_rules":[ - { - "action":1, - "custom":{ - "resource_key":"/settings", - "resource_value":{ - - } - } - }, - { - "action":1, - "custom":{ - "resource_key":"/device[1.1.1.1]/endpoint[eth0]/settings", - "resource_value":{ - "sub_interface_index":0, - "vlan_id":100, - "circuit_id":"100", - "remote_router":"3.3.3.3", - "ni_name":"ELAN100" - } - } - }, - { - "action":1, - "custom":{ - "resource_key":"/device[3.3.3.3]/endpoint[eth0]/settings", - "resource_value":{ - "sub_interface_index":0, - "vlan_id":100, - "circuit_id":"100", - "remote_router":"1.1.1.1", - "ni_name":"ELAN100" - } - } - } - ] - } - } - ] -} \ No newline at end of file diff --git a/src/templates/L2-VPN_template_filled.json b/src/templates/L2-VPN_template_filled.json deleted file mode 100644 index 594fc27321d4628b7f1fb3cf803063eceb228b7f..0000000000000000000000000000000000000000 --- a/src/templates/L2-VPN_template_filled.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "services": [ - { - "service_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, //Siempre usaremos admin - "service_uuid": {"uuid": "l2-acl-svc"} //identificador unico - }, - "service_type": 2, // Numero que identifica que es una vpn de nivel 2, se mantiene - "service_status": {"service_status": 1}, - "service_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R149"}}, "endpoint_uuid": {"uuid": "eth-1/0/21"}}, // Se tiene que cambiar por el endpoint de origen - {"device_id": {"device_uuid": {"uuid": "R155"}}, "endpoint_uuid": {"uuid": "eth-1/0/21"}} // Se tiene que cambiar por el endpoint de destino - ], - "service_constraints": [ //Requerimientos que han de darse, de momento no funciona por lo que mantener igual - {"custom": {"constraint_type": "bandwidth[kbps]", "constraint_value": "10.0"}}, - {"custom": {"constraint_type": "latency[ms]", "constraint_value": "15.2"}} - ], - "service_config": {"config_rules": [ - {"action": 1, "custom": {"resource_key": "/settings", "resource_value": { //Regla default, se mantiene - }}}, - {"action": 1, "custom": {"resource_key": "/device[R149]/endpoint[eth-1/0/21]/settings", "resource_value": { //Camino de ida, hay que cambiar la vlan, circuit_id y sub_interface_index por el valor de vlan que queramos usar - "sub_interface_index": 0, - "vlan_id": 999, - "circuit_id": "999", - "remote_router":"5.5.5.1" // Este valor es la ip del router en el otro extremo - }}}, - {"action": 1, "custom": {"resource_key": "/device[R155]/endpoint[eth-1/0/21]/settings", "resource_value": { //Camino de vuelta, hay que cambiar la vlan, circuit_id y sub_interface_index por el valor de vlan que queramos usar - "sub_interface_index": 0, - "vlan_id": 999, - "circuit_id": "999", - "remote_router":"5.5.5.5" // Este valor es la ip del router en el otro extremo - }}} - ]} - } - ] -} \ No newline at end of file diff --git a/src/templates/L3-VPN_template_example.json b/src/templates/L3-VPN_template_example.json deleted file mode 100644 index b4334e98a0b6e67e0f42822c7c6a3af41f3baedd..0000000000000000000000000000000000000000 --- a/src/templates/L3-VPN_template_example.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "service_id": { - "context_id": { - "context_uuid": { - "uuid": "admin" - } - }, - "service_uuid": { - "uuid": "l3-acl-svc-17536941472398060" - } - }, - "service_type": 1, - "service_status": { - "service_status": 1 - }, - "service_endpoint_ids": [ - { - "device_id": { - "device_uuid": { - "uuid": "10.10.10.10" - } - }, - "endpoint_uuid": { - "uuid": "0/0/0-GigabitEthernet0/0/0/0" - } - }, - { - "device_id": { - "device_uuid": { - "uuid": "11.11.11.11" - } - }, - "endpoint_uuid": { - "uuid": "0/0/0-GigabitEthernet0/0/0/0" - } - } - ], - "service_constraints": [ - { - "custom": { - "constraint_type": "one-way-bandwidth[Mbps]", - "constraint_value": "10" - } - }, - { - "custom": { - "constraint_type": "one-way-delay-maximum[milliseconds]", - "constraint_value": "30" - } - } - ], - "service_config": { - "config_rules": [ - { - "action": 1, - "custom": { - "resource_key": "/settings", - "resource_value": { - "bgp_as": 65000, - "route_distinguisher": "65000:533" - } - } - }, - { - "action": 1, - "custom": { - "resource_key": "/device[10.10.10.10]/endpoint[0/0/0-GigabitEthernet0/0/0/0]/settings", - "resource_value": { - "router_id": "11.11.11.11", - "sub_interface_index": 0, - "vlan_id": 200, - "address_ip": "11.11.11.11", - "address_prefix": 16, - "policy_AZ": "policyA", - "policy_ZA": "policyB", - "ni_name": "ELAN200" - } - } - }, - { - "action": 1, - "custom": { - "resource_key": "/device[11.11.11.11]/endpoint[0/0/0-GigabitEthernet0/0/0/0]/settings", - "resource_value": { - "router_id": "10.10.10.10", - "sub_interface_index": 0, - "vlan_id": 200, - "address_ip": "10.10.10.10", - "address_prefix": 16, - "policy_AZ": "policyA", - "policy_ZA": "policyB", - "ni_name": "ELAN200" - } - } - } - ] - } -} \ No newline at end of file diff --git a/src/templates/L3-VPN_template_filled.json b/src/templates/L3-VPN_template_filled.json deleted file mode 100644 index 12bea2aa922a55b17d5906cc03032ac9c5bdba42..0000000000000000000000000000000000000000 --- a/src/templates/L3-VPN_template_filled.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "servs": [ - { - "service_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, //Siempre usaremos admin - "service_uuid": {"uuid": "l3-svc"} //identificador unico - }, - "service_type": 1, // Numero que identifica que es una vpn de nivel 3, se mantiene - "service_status": {"service_status": 1}, - "service_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R149"}}, "endpoint_uuid": {"uuid": "eth-1/0/20"}}, // Se tiene que cambiar por el endpoint de origen - {"device_id": {"device_uuid": {"uuid": "R155"}}, "endpoint_uuid": {"uuid": "eth-1/0/20"}} // Se tiene que cambiar por el endpoint de destino - ], - "service_constraints": [ // Requerimientos que han de darse, de momento no funciona por lo que mantener igual - {"custom": {"constraint_type": "bandwidth[gbps]", "constraint_value": "10.0"}}, - {"custom": {"constraint_type": "latency[ms]", "constraint_value": "15.2"}} - ], - "service_config": {"config_rules": [ - {"action": 1, "custom": {"resource_key": "/settings", "resource_value": { //Regla default, se mantiene - "bgp_as" : 65000, - "route_distinguisher": "65000:533" - }}}, - {"action": 1, "custom": {"resource_key": "/device[R149]/endpoint[eth-1/0/20]/settings", "resource_value": { - "router_id" : "5.5.5.5", - "sub_interface_index": 0, - "vlan_id" : 533, - "address_ip" : "172.16.12.12", - "address_prefix" : 16, - "policy_AZ" : "srv_ACL", - "policy_ZA" : "srv_ACLr" - }}}, - {"action": 1, "custom": {"resource_key": "/device[R155]/endpoint[eth-1/0/20]/settings", "resource_value": { - "router_id" : "5.5.5.1", - "sub_interface_index": 0, - "vlan_id" : 533, - "address_ip" : "172.16.13.13", - "address_prefix" : 16, - "policy_AZ" : "srv_ACLr", - "policy_ZA" : "srv_ACL" - }}} - ]} - } - ] -} \ No newline at end of file diff --git a/src/templates/descriptor-topology copy.json b/src/templates/descriptor-topology copy.json deleted file mode 100644 index 304373aceb7a48ac4898c361833d46e21590d04b..0000000000000000000000000000000000000000 --- a/src/templates/descriptor-topology copy.json +++ /dev/null @@ -1,570 +0,0 @@ -{ - "dummy_mode": true, - "contexts":[ - { - "context_id":{ - "context_uuid":{ - "uuid":"admin" - } - }, - "topology_ids":[ - - ], - "service_ids":[ - - ] - } - ], - "topologies":[ - { - "topology_id":{ - "context_id":{ - "context_uuid":{ - "uuid":"admin" - } - }, - "topology_uuid":{ - "uuid":"admin" - } - }, - "device_ids":[ - { - "device_uuid":{ - "uuid":"1.1.1.1" - } - }, - { - "device_uuid":{ - "uuid":"2.2.2.2" - } - } - ], - "link_ids":[ - { - "link_uuid":{ - "uuid":"4.4.4.4/0/0/1-GigabitEthernet0/0/0/1==2.2.2.2/GigabitEthernet2" - } - }, - { - "link_uuid":{ - "uuid":"2.2.2.2/GigabitEthernet2==4.4.4.4/0/0/1-GigabitEthernet0/0/0/1" - } - }, - { - "link_uuid":{ - "uuid":"2.2.2.2/GigabitEthernet1==1.1.1.1/GigabitEthernet1" - } - }, - { - "link_uuid":{ - "uuid":"1.1.1.1/GigabitEthernet1==2.2.2.2/GigabitEthernet1" - } - }, - { - "link_uuid":{ - "uuid":"2.2.2.2/GigabitEthernet4==5.5.5.5/0/0/0-GigabitEthernet0/0/0/0" - } - }, - { - "link_uuid":{ - "uuid":"5.5.5.5/0/0/0-GigabitEthernet0/0/0/0==2.2.2.2/GigabitEthernet4" - } - }, - { - "link_uuid":{ - "uuid":"2.2.2.2/GigabitEthernet3==3.3.3.3/0/0/3-GigabitEthernet0/0/0/3" - } - }, - { - "link_uuid":{ - "uuid":"3.3.3.3/0/0/3-GigabitEthernet0/0/0/3==2.2.2.2/GigabitEthernet3" - } - }, - { - "link_uuid":{ - "uuid":"1.1.1.1/GigabitEthernet2==5.5.5.5/0/0/2-GigabitEthernet0/0/0/2" - } - }, - { - "link_uuid":{ - "uuid":"5.5.5.5/0/0/2-GigabitEthernet0/0/0/2==1.1.1.1/GigabitEthernet2" - } - } - ] - } - ], - "devices":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"1.1.1.1" - } - }, - "device_type":"packet-router", - "device_config":{ - "config_rules":[ - { - "action":1, - "custom":{ - "resource_key":"_connect/address", - "resource_value":"10.60.125.41" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/port", - "resource_value":"830" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/settings", - "resource_value":{ - "username":"cisco", - "password":"cisco12345", - "vendor":"CISCO", - "force_running":false, - "hostkey_verify":false, - "message_renderer":"pyangbind", - "look_for_keys":false, - "allow_agent":false, - "commit_per_rule":true, - "device_params":{ - "name":"default" - }, - "manager_params":{ - "timeout":120 - } - } - } - }, - {"action": 1, "custom": {"resource_key": "/endpoints/endpoint[GigabitEthernet1]", "resource_value": { - "uuid": "GigabitEthernet1", "name": "GigabitEthernet1", "type": "-" - }}}, - {"action": 1, "custom": {"resource_key": "/endpoints/endpoint[GigabitEthernet2]", "resource_value": { - "uuid": "GigabitEthernet2", "name": "GigabitEthernet2", "type": "-" - }}}, - {"action": 1, "custom": {"resource_key": "/endpoints/endpoint[GigabitEthernet3]", "resource_value": { - "uuid": "GigabitEthernet3", "name": "GigabitEthernet3", "type": "-" - }}}, - {"action": 1, "custom": {"resource_key": "/endpoints/endpoint[GigabitEthernet4]", "resource_value": { - "uuid": "GigabitEthernet4", "name": "GigabitEthernet4", "type": "-" - }}}, - {"action": 1, "custom": {"resource_key": "/endpoints/endpoint[GigabitEthernet5]", "resource_value": { - "uuid": "GigabitEthernet5", "name": "GigabitEthernet5", "type": "-" - }}} - ] - }, - "device_operational_status":2, - "device_drivers":[ - 1 - ], - "device_endpoints":[ - {"name": "GigabitEthernet1", "endpoint_type": "-", "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "1.1.1.1"}}, "endpoint_uuid": {"uuid": "GigabitEthernet1"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} - }}, - {"name": "GigabitEthernet2", "endpoint_type": "-", "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "1.1.1.1"}}, "endpoint_uuid": {"uuid": "GigabitEthernet2"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} - }}, - {"name": "GigabitEthernet3", "endpoint_type": "-", "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "1.1.1.1"}}, "endpoint_uuid": {"uuid": "GigabitEthernet3"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} - }}, - {"name": "GigabitEthernet4", "endpoint_type": "-", "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "1.1.1.1"}}, "endpoint_uuid": {"uuid": "GigabitEthernet4"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} - }}, - {"name": "GigabitEthernet5", "endpoint_type": "-", "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "1.1.1.1"}}, "endpoint_uuid": {"uuid": "GigabitEthernet5"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} - }} - ] - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "device_type":"packet-router", - "device_config":{ - "config_rules":[ - { - "action":1, - "custom":{ - "resource_key":"_connect/address", - "resource_value":"10.60.125.42" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/port", - "resource_value":"830" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/settings", - "resource_value":{ - "username":"cisco", - "password":"cisco12345", - "vendor":"CISCO", - "force_running":false, - "hostkey_verify":false, - "message_renderer":"pyangbind", - "look_for_keys":false, - "allow_agent":false, - "commit_per_rule":true, - "device_params":{ - "name":"default" - }, - "manager_params":{ - "timeout":120 - } - } - } - }, - {"action": 1, "custom": {"resource_key": "/endpoints/endpoint[GigabitEthernet1]", "resource_value": { - "uuid": "GigabitEthernet1", "name": "GigabitEthernet1", "type": "-" - }}}, - {"action": 1, "custom": {"resource_key": "/endpoints/endpoint[GigabitEthernet2]", "resource_value": { - "uuid": "GigabitEthernet2", "name": "GigabitEthernet2", "type": "-" - }}}, - {"action": 1, "custom": {"resource_key": "/endpoints/endpoint[GigabitEthernet3]", "resource_value": { - "uuid": "GigabitEthernet3", "name": "GigabitEthernet3", "type": "-" - }}}, - {"action": 1, "custom": {"resource_key": "/endpoints/endpoint[GigabitEthernet4]", "resource_value": { - "uuid": "GigabitEthernet4", "name": "GigabitEthernet4", "type": "-" - }}}, - {"action": 1, "custom": {"resource_key": "/endpoints/endpoint[GigabitEthernet5]", "resource_value": { - "uuid": "GigabitEthernet5", "name": "GigabitEthernet5", "type": "-" - }}} - ] - }, - "device_operational_status":2, - "device_drivers":[ - 1 - ], - "device_endpoints":[ - {"name": "GigabitEthernet1", "endpoint_type": "-", "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "2.2.2.2"}}, "endpoint_uuid": {"uuid": "GigabitEthernet1"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} - }}, - {"name": "GigabitEthernet2", "endpoint_type": "-", "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "2.2.2.2"}}, "endpoint_uuid": {"uuid": "GigabitEthernet2"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} - }}, - {"name": "GigabitEthernet3", "endpoint_type": "-", "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "2.2.2.2"}}, "endpoint_uuid": {"uuid": "GigabitEthernet3"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} - }}, - {"name": "GigabitEthernet4", "endpoint_type": "-", "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "2.2.2.2"}}, "endpoint_uuid": {"uuid": "GigabitEthernet4"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} - }}, - {"name": "GigabitEthernet5", "endpoint_type": "-", "endpoint_id": { - "device_id": {"device_uuid": {"uuid": "2.2.2.2"}}, "endpoint_uuid": {"uuid": "GigabitEthernet5"}, - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}} - }} - ] - } - ], - "links":[ - { - "link_id":{ - "link_uuid":{ - "uuid":"4.4.4.4/0/0/1-GigabitEthernet0/0/0/1==2.2.2.2/GigabitEthernet2" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"4.4.4.4" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"GigabitEthernet2" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"2.2.2.2/GigabitEthernet2==4.4.4.4/0/0/1-GigabitEthernet0/0/0/1" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"GigabitEthernet2" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"4.4.4.4" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"2.2.2.2/GigabitEthernet1==1.1.1.1/GigabitEthernet1" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"GigabitEthernet1" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"1.1.1.1" - } - }, - "endpoint_uuid":{ - "uuid":"GigabitEthernet1" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"1.1.1.1/GigabitEthernet1==2.2.2.2/GigabitEthernet1" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"1.1.1.1" - } - }, - "endpoint_uuid":{ - "uuid":"GigabitEthernet1" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"GigabitEthernet1" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"2.2.2.2/GigabitEthernet4==5.5.5.5/0/0/0-GigabitEthernet0/0/0/0" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"GigabitEthernet4" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"5.5.5.5" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/0-GigabitEthernet0/0/0/0" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"5.5.5.5/0/0/0-GigabitEthernet0/0/0/0==2.2.2.2/GigabitEthernet4" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"5.5.5.5" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/0-GigabitEthernet0/0/0/0" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"GigabitEthernet4" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"2.2.2.2/GigabitEthernet3==3.3.3.3/0/0/3-GigabitEthernet0/0/0/3" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"GigabitEthernet3" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"3.3.3.3" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/3-GigabitEthernet0/0/0/3" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"3.3.3.3/0/0/3-GigabitEthernet0/0/0/3==2.2.2.2/GigabitEthernet3" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"3.3.3.3" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/3-GigabitEthernet0/0/0/3" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"GigabitEthernet3" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"1.1.1.1/GigabitEthernet2==5.5.5.5/0/0/2-GigabitEthernet0/0/0/2" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"1.1.1.1" - } - }, - "endpoint_uuid":{ - "uuid":"GigabitEthernet2" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"5.5.5.5" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/2-GigabitEthernet0/0/0/2" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"5.5.5.5/0/0/2-GigabitEthernet0/0/0/2==1.1.1.1/GigabitEthernet2" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"5.5.5.5" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/2-GigabitEthernet0/0/0/2" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"1.1.1.1" - } - }, - "endpoint_uuid":{ - "uuid":"GigabitEthernet2" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/src/templates/descriptor-topology-tid.json b/src/templates/descriptor-topology-tid.json deleted file mode 100644 index 588d9e90e08589b8d78d7a51c6c5ef8c3f607c0b..0000000000000000000000000000000000000000 --- a/src/templates/descriptor-topology-tid.json +++ /dev/null @@ -1,752 +0,0 @@ -{ - "contexts":[ - { - "context_id":{ - "context_uuid":{ - "uuid":"admin" - } - }, - "topology_ids":[ - - ], - "service_ids":[ - - ] - } - ], - "topologies":[ - { - "topology_id":{ - "context_id":{ - "context_uuid":{ - "uuid":"admin" - } - }, - "topology_uuid":{ - "uuid":"admin" - } - }, - "device_ids":[ - { - "device_uuid":{ - "uuid":"1.1.1.1" - } - }, - { - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - { - "device_uuid":{ - "uuid":"3.3.3.3" - } - }, - { - "device_uuid":{ - "uuid":"4.4.4.4" - } - }, - { - "device_uuid":{ - "uuid":"5.5.5.5" - } - } - ], - "link_ids":[ - { - "link_uuid":{ - "uuid":"5.5.5.5/0/0/1-GigabitEthernet0/0/0/1==3.3.3.3/0/0/1-GigabitEthernet0/0/0/1" - } - }, - { - "link_uuid":{ - "uuid":"3.3.3.3/0/0/1-GigabitEthernet0/0/0/1==5.5.5.5/0/0/1-GigabitEthernet0/0/0/1" - } - }, - { - "link_uuid":{ - "uuid":"5.5.5.5/0/0/2-GigabitEthernet0/0/0/2==1.1.1.1/0/0/1-GigabitEthernet0/0/0/1" - } - }, - { - "link_uuid":{ - "uuid":"1.1.1.1/0/0/1-GigabitEthernet0/0/0/1==5.5.5.5/0/0/2-GigabitEthernet0/0/0/2" - } - }, - { - "link_uuid":{ - "uuid":"5.5.5.5/0/0/0-GigabitEthernet0/0/0/0==2.2.2.2/0/0/2-GigabitEthernet0/0/0/2" - } - }, - { - "link_uuid":{ - "uuid":"2.2.2.2/0/0/2-GigabitEthernet0/0/0/2==5.5.5.5/0/0/0-GigabitEthernet0/0/0/0" - } - }, - { - "link_uuid":{ - "uuid":"3.3.3.3/0/0/3-GigabitEthernet0/0/0/3==2.2.2.2/0/0/3-GigabitEthernet0/0/0/3" - } - }, - { - "link_uuid":{ - "uuid":"2.2.2.2/0/0/3-GigabitEthernet0/0/0/3==3.3.3.3/0/0/3-GigabitEthernet0/0/0/3" - } - }, - { - "link_uuid":{ - "uuid":"1.1.1.1/0/0/0-GigabitEthernet0/0/0/0==2.2.2.2/0/0/0-GigabitEthernet0/0/0/0" - } - }, - { - "link_uuid":{ - "uuid":"2.2.2.2/0/0/0-GigabitEthernet0/0/0/0==1.1.1.1/0/0/0-GigabitEthernet0/0/0/0" - } - }, - { - "link_uuid":{ - "uuid":"4.4.4.4/0/0/1-GigabitEthernet0/0/0/1==2.2.2.2/0/0/1-GigabitEthernet0/0/0/1" - } - }, - { - "link_uuid":{ - "uuid":"2.2.2.2/0/0/1-GigabitEthernet0/0/0/1==4.4.4.4/0/0/1-GigabitEthernet0/0/0/1" - } - } - ] - } - ], - "devices":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"1.1.1.1" - } - }, - "device_type":"packet-router", - "device_config":{ - "config_rules":[ - { - "action":1, - "custom":{ - "resource_key":"_connect/address", - "resource_value":"10.95.90.41" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/port", - "resource_value":"830" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/settings", - "resource_value":{ - "username":"cisco", - "password":"cisco12345", - "vendor":"CISCO", - "force_running":false, - "hostkey_verify":false, - "message_renderer":"pyangbind", - "look_for_keys":false, - "allow_agent":false, - "commit_per_rule":true, - "device_params":{ - "name":"default" - }, - "manager_params":{ - "timeout":120 - } - } - } - } - ] - }, - "device_operational_status":2, - "device_drivers":[ - 1 - ], - "device_endpoints":[ - - ] - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "device_type":"packet-router", - "device_config":{ - "config_rules":[ - { - "action":1, - "custom":{ - "resource_key":"_connect/address", - "resource_value":"10.95.90.42" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/port", - "resource_value":"830" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/settings", - "resource_value":{ - "username":"cisco", - "password":"cisco12345", - "vendor":"CISCO", - "force_running":false, - "hostkey_verify":false, - "message_renderer":"pyangbind", - "look_for_keys":false, - "allow_agent":false, - "commit_per_rule":true, - "device_params":{ - "name":"default" - }, - "manager_params":{ - "timeout":120 - } - } - } - } - ] - }, - "device_operational_status":2, - "device_drivers":[ - 1 - ], - "device_endpoints":[ - - ] - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"3.3.3.3" - } - }, - "device_type":"packet-router", - "device_config":{ - "config_rules":[ - { - "action":1, - "custom":{ - "resource_key":"_connect/address", - "resource_value":"10.95.90.43" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/port", - "resource_value":"830" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/settings", - "resource_value":{ - "username":"cisco", - "password":"cisco12345", - "vendor":"CISCO", - "force_running":false, - "hostkey_verify":false, - "message_renderer":"pyangbind", - "look_for_keys":false, - "allow_agent":false, - "commit_per_rule":true, - "device_params":{ - "name":"default" - }, - "manager_params":{ - "timeout":120 - } - } - } - } - ] - }, - "device_operational_status":2, - "device_drivers":[ - 1 - ], - "device_endpoints":[ - - ] - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"4.4.4.4" - } - }, - "device_type":"packet-router", - "device_config":{ - "config_rules":[ - { - "action":1, - "custom":{ - "resource_key":"_connect/address", - "resource_value":"10.95.90.44" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/port", - "resource_value":"830" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/settings", - "resource_value":{ - "username":"cisco", - "password":"cisco12345", - "vendor":"CISCO", - "force_running":false, - "hostkey_verify":false, - "message_renderer":"pyangbind", - "look_for_keys":false, - "allow_agent":false, - "commit_per_rule":true, - "device_params":{ - "name":"default" - }, - "manager_params":{ - "timeout":120 - } - } - } - } - ] - }, - "device_operational_status":2, - "device_drivers":[ - 1 - ], - "device_endpoints":[ - - ] - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"5.5.5.5" - } - }, - "device_type":"packet-router", - "device_config":{ - "config_rules":[ - { - "action":1, - "custom":{ - "resource_key":"_connect/address", - "resource_value":"10.95.90.45" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/port", - "resource_value":"830" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/settings", - "resource_value":{ - "username":"cisco", - "password":"cisco12345", - "vendor":"CISCO", - "force_running":false, - "hostkey_verify":false, - "message_renderer":"pyangbind", - "look_for_keys":false, - "allow_agent":false, - "commit_per_rule":true, - "device_params":{ - "name":"default" - }, - "manager_params":{ - "timeout":120 - } - } - } - } - ] - }, - "device_operational_status":2, - "device_drivers":[ - 1 - ], - "device_endpoints":[ - - ] - } - ], - "links":[ - { - "link_id":{ - "link_uuid":{ - "uuid":"5.5.5.5/0/0/1-GigabitEthernet0/0/0/1==3.3.3.3/0/0/1-GigabitEthernet0/0/0/1" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"5.5.5.5" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"3.3.3.3" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"3.3.3.3/0/0/1-GigabitEthernet0/0/0/1==5.5.5.5/0/0/1-GigabitEthernet0/0/0/1" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"3.3.3.3" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"5.5.5.5" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"5.5.5.5/0/0/2-GigabitEthernet0/0/0/2==1.1.1.1/0/0/1-GigabitEthernet0/0/0/1" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"5.5.5.5" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/2-GigabitEthernet0/0/0/2" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"1.1.1.1" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"1.1.1.1/0/0/1-GigabitEthernet0/0/0/1==5.5.5.5/0/0/2-GigabitEthernet0/0/0/2" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"1.1.1.1" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"5.5.5.5" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/2-GigabitEthernet0/0/0/2" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"5.5.5.5/0/0/0-GigabitEthernet0/0/0/0==2.2.2.2/0/0/2-GigabitEthernet0/0/0/2" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"5.5.5.5" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/0-GigabitEthernet0/0/0/0" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/2-GigabitEthernet0/0/0/2" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"2.2.2.2/0/0/2-GigabitEthernet0/0/0/2==5.5.5.5/0/0/0-GigabitEthernet0/0/0/0" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/2-GigabitEthernet0/0/0/2" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"5.5.5.5" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/0-GigabitEthernet0/0/0/0" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"3.3.3.3/0/0/3-GigabitEthernet0/0/0/3==2.2.2.2/0/0/3-GigabitEthernet0/0/0/3" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"3.3.3.3" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/3-GigabitEthernet0/0/0/3" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/3-GigabitEthernet0/0/0/3" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"2.2.2.2/0/0/3-GigabitEthernet0/0/0/3==3.3.3.3/0/0/3-GigabitEthernet0/0/0/3" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/3-GigabitEthernet0/0/0/3" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"3.3.3.3" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/3-GigabitEthernet0/0/0/3" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"1.1.1.1/0/0/0-GigabitEthernet0/0/0/0==2.2.2.2/0/0/0-GigabitEthernet0/0/0/0" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"1.1.1.1" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/0-GigabitEthernet0/0/0/0" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/0-GigabitEthernet0/0/0/0" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"2.2.2.2/0/0/0-GigabitEthernet0/0/0/0==1.1.1.1/0/0/0-GigabitEthernet0/0/0/0" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/0-GigabitEthernet0/0/0/0" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"1.1.1.1" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/0-GigabitEthernet0/0/0/0" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"4.4.4.4/0/0/1-GigabitEthernet0/0/0/1==2.2.2.2/0/0/1-GigabitEthernet0/0/0/1" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"4.4.4.4" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"2.2.2.2/0/0/1-GigabitEthernet0/0/0/1==4.4.4.4/0/0/1-GigabitEthernet0/0/0/1" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"2.2.2.2" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"4.4.4.4" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/src/templates/descriptor-topology.json b/src/templates/descriptor-topology.json deleted file mode 100644 index e22737b52783b5db72e5809d83f4cbbc3a936c09..0000000000000000000000000000000000000000 --- a/src/templates/descriptor-topology.json +++ /dev/null @@ -1,290 +0,0 @@ -{ - "contexts":[ - { - "context_id":{ - "context_uuid":{ - "uuid":"admin" - } - }, - "topology_ids":[ - - ], - "service_ids":[ - - ] - } - ], - "topologies":[ - { - "topology_id":{ - "context_id":{ - "context_uuid":{ - "uuid":"admin" - } - }, - "topology_uuid":{ - "uuid":"admin" - } - }, - "device_ids":[ - { - "device_uuid":{ - "uuid":"3.3.3.3" - } - }, - { - "device_uuid":{ - "uuid":"4.4.4.4" - } - }, - { - "device_uuid":{ - "uuid":"5.5.5.5" - } - } - ], - "link_ids":[ - { - "link_uuid":{ - "uuid":"5.5.5.5/0/0/1-GigabitEthernet0/0/0/1==3.3.3.3/0/0/1-GigabitEthernet0/0/0/1" - } - }, - { - "link_uuid":{ - "uuid":"3.3.3.3/0/0/1-GigabitEthernet0/0/0/1==5.5.5.5/0/0/1-GigabitEthernet0/0/0/1" - } - } - ] - } - ], - "devices":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"3.3.3.3" - } - }, - "device_type":"packet-router", - "device_config":{ - "config_rules":[ - { - "action":1, - "custom":{ - "resource_key":"_connect/address", - "resource_value":"10.60.125.43" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/port", - "resource_value":"830" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/settings", - "resource_value":{ - "username":"cisco", - "password":"cisco12345", - "vendor":"CISCO", - "force_running":false, - "hostkey_verify":false, - "message_renderer":"pyangbind", - "look_for_keys":false, - "allow_agent":false, - "commit_per_rule":true, - "device_params":{ - "name":"default" - }, - "manager_params":{ - "timeout":120 - } - } - } - } - ] - }, - "device_operational_status":2, - "device_drivers":[ - 1 - ], - "device_endpoints":[ - - ] - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"4.4.4.4" - } - }, - "device_type":"packet-router", - "device_config":{ - "config_rules":[ - { - "action":1, - "custom":{ - "resource_key":"_connect/address", - "resource_value":"10.60.125.44" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/port", - "resource_value":"830" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/settings", - "resource_value":{ - "username":"cisco", - "password":"cisco12345", - "vendor":"CISCO", - "force_running":false, - "hostkey_verify":false, - "message_renderer":"pyangbind", - "look_for_keys":false, - "allow_agent":false, - "commit_per_rule":true, - "device_params":{ - "name":"default" - }, - "manager_params":{ - "timeout":120 - } - } - } - } - ] - }, - "device_operational_status":2, - "device_drivers":[ - 1 - ], - "device_endpoints":[ - - ] - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"5.5.5.5" - } - }, - "device_type":"packet-router", - "device_config":{ - "config_rules":[ - { - "action":1, - "custom":{ - "resource_key":"_connect/address", - "resource_value":"10.60.125.45" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/port", - "resource_value":"830" - } - }, - { - "action":1, - "custom":{ - "resource_key":"_connect/settings", - "resource_value":{ - "username":"cisco", - "password":"cisco12345", - "vendor":"CISCO", - "force_running":false, - "hostkey_verify":false, - "message_renderer":"pyangbind", - "look_for_keys":false, - "allow_agent":false, - "commit_per_rule":true, - "device_params":{ - "name":"default" - }, - "manager_params":{ - "timeout":120 - } - } - } - } - ] - }, - "device_operational_status":2, - "device_drivers":[ - 1 - ], - "device_endpoints":[ - - ] - } - ], - "links":[ - { - "link_id":{ - "link_uuid":{ - "uuid":"5.5.5.5/0/0/1-GigabitEthernet0/0/0/1==3.3.3.3/0/0/1-GigabitEthernet0/0/0/1" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"5.5.5.5" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"3.3.3.3" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - } - ] - }, - { - "link_id":{ - "link_uuid":{ - "uuid":"3.3.3.3/0/0/1-GigabitEthernet0/0/0/1==5.5.5.5/0/0/1-GigabitEthernet0/0/0/1" - } - }, - "link_endpoint_ids":[ - { - "device_id":{ - "device_uuid":{ - "uuid":"3.3.3.3" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - }, - { - "device_id":{ - "device_uuid":{ - "uuid":"5.5.5.5" - } - }, - "endpoint_uuid":{ - "uuid":"0/0/1-GigabitEthernet0/0/0/1" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/src/templates/descriptor.json b/src/templates/descriptor.json deleted file mode 100644 index 4923ab4427b5723d970c006043242373fb4eafdd..0000000000000000000000000000000000000000 --- a/src/templates/descriptor.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "contexts": [ - { - "context_id": { - "context_uuid": { - "uuid": "admin" - } - }, - "topology_ids": [], - "service_ids": [] - } - ], - "topologies": [ - { - "topology_id": { - "context_id": { - "context_uuid": { - "uuid": "admin" - } - }, - "topology_uuid": { - "uuid": "admin" - } - } - } - ] - } \ No newline at end of file diff --git a/src/templates/ietf_template_empty.json b/src/templates/ietf_template_empty.json index fc458ea4b86f06b84a91241f8ceee1578e9570a1..cdaf66cdad3fbd7f01c09a7987cf8729600952b0 100644 --- a/src/templates/ietf_template_empty.json +++ b/src/templates/ietf_template_empty.json @@ -43,7 +43,7 @@ "sdps":{ "sdp":[ { - "id":"01", + "id": "", "geo-location":"", "node-id":"", "sdp-ip-address":"", @@ -90,7 +90,7 @@ "sdp-monitoring":"" }, { - "id":"02", + "id":"", "geo-location":"", "node-id":"", "sdp-ip-address":"", diff --git a/src/templates/ietf_template_example.json b/src/templates/ietf_template_example.json deleted file mode 100644 index d9a660f5fb41479577561c0668e10a78844f723a..0000000000000000000000000000000000000000 --- a/src/templates/ietf_template_example.json +++ /dev/null @@ -1,149 +0,0 @@ -[ - { - "ietf-network-slice-service:network-slice-services": { - "slo-sle-templates": { - "slo-sle-template": [ - { - "id": "qos-profile-0bbf32f4-aa3d-4ef1-b3fb-806f4ed73912", - "description": "", - "slo-policy": { - "metric-bound": [] - }, - "sle-policy": { - "security": "", - "isolation": "", - "path-constraints": { - "service-functions": "", - "diversity": { - "diversity": { - "diversity-type": "" - } - } - } - } - } - ] - }, - "slice-service": [ - { - "id": "slice-service-561d9dd7-c2e0-40c9-a222-ec6913ea5a57", - "description": "example 5G Slice mapping", - "service-tags": { - "tag-type": { - "tag-type": "", - "value": "" - } - }, - "slo-sle-policy": { - "slo-sle-template": "qos-profile-0bbf32f4-aa3d-4ef1-b3fb-806f4ed73912" - }, - "status": {}, - "sdps": { - "sdp": [ - { - "id": "01", - "geo-location": "", - "node-id": "source-node", - "sdp-ip-address": "1.1.1.1", - "tp-ref": "", - "service-match-criteria": { - "match-criterion": [ - { - "index": 1, - "match-type": "VLAN", - "value": null, - "target-connection-group-id": "" - } - ] - }, - "incoming-qos-policy": "", - "outgoing-qos-policy": "", - "sdp-peering": { - "peer-sap-id": "", - "protocols": "" - }, - "ac-svc-ref": [], - "attachment-circuits": { - "attachment-circuit": [ - { - "id": "100", - "ac-ipv4-address": "", - "ac-ipv4-prefix-length": 0, - "sdp-peering": { - "peer-sap-id": "1.1.1.1" - }, - "status": {} - } - ] - }, - "status": {}, - "sdp-monitoring": "" - }, - { - "id": "02", - "geo-location": "", - "node-id": "destination-node", - "sdp-ip-address": "3.3.3.3", - "tp-ref": "", - "service-match-criteria": { - "match-criterion": [ - { - "index": 1, - "match-type": "VLAN", - "value": null, - "target-connection-group-id": "" - } - ] - }, - "incoming-qos-policy": "", - "outgoing-qos-policy": "", - "sdp-peering": { - "peer-sap-id": "", - "protocols": "" - }, - "ac-svc-ref": [], - "attachment-circuits": { - "attachment-circuit": [ - { - "id": "200", - "ac-ipv4-address": "", - "ac-ipv4-prefix-length": 0, - "sdp-peering": { - "peer-sap-id": "3.3.3.3" - }, - "status": {} - } - ] - }, - "status": {}, - "sdp-monitoring": "" - } - ] - }, - "connection-groups": { - "connection-group": [ - { - "id": "source-node_destination-node", - "connectivity-type": "ietf-vpn-common:any-to-any", - "connectivity-construct": [ - { - "id": 1, - "a2a-sdp": [ - { - "sdp-id": "01" - }, - { - "sdp-id": "02" - } - ] - } - ], - "status": {} - } - ] - } - } - ] - } - } -] \ No newline at end of file diff --git a/src/templates/ietf_template_filled.json b/src/templates/ietf_template_filled.json deleted file mode 100644 index e7a525e096c027323a4feb63ff8407f9385a2ee0..0000000000000000000000000000000000000000 --- a/src/templates/ietf_template_filled.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "ietf-network-slice-service:network-slice-services":{ - "slo-sle-templates":{ - "slo-sle-template":[ - { - "id":"MidhaulId", - "slo-policy":{ - "metric-bound":[ - { - "metric-type":"one-way-bandwidth", - "metric-unit":"kbps", - "bound":300 - }, - { - "metric-type":"one-way-delay-maximum", - "metric-unit":"milliseconds", - "bound":1 - } - ] - }, - "sle-policy":{ - "security":[ - - ], - "isolation":[ - - ], - "steering-constraints":{ - "path-constraints":"", - "service-function":"" - } - } - } - ] - }, - "slice-service":[ - { - "id":"5GSliceMapping", - "description":"example 5G Slice mapping", - "slo-sle-template":"MidhaulId", - "status":{ - - }, - "sdps":{ - "sdp":[ - { - "id":"01", - "node-id":"DU1", - "sdp-ip-address":"1.1.1.2", - "service-match-criteria":{ - "match-criterion":[ - { - "index":1, - "match-type":"vlan-match", - "value":[ - "100" - ], - "target-connection-group-id":"DU-CU" - } - ] - }, - "sdp-peering":{ - "peer-sap-id":"", - "protocols":"" - }, - "ac-svc-name":[ - - ], - "attachment-circuits":{ - "attachment-circuit":[ - { - "id":"100", - "ac-ipv4-address":"1.1.1.1", - "ac-ipv4-prefix-length":0, - "sdp-peering":{ - "peer-sap-id":"1.1.1.254" - }, - "status":{ - - } - } - ] - }, - "status":{ - - } - }, - { - "id":"02", - "node-id":"CU-UP1", - "sdp-ip-address":"100.1.1.2", - "service-match-criteria":{ - "match-criterion":[ - { - "index":1, - "match-type":"vlan-match", - "value":[ - "100" - ], - "target-connection-group-id":"DU-CU" - } - ] - }, - "attachment-circuits":{ - "attachment-circuit":[ - { - "id":"200", - "ac-ipv4-address":"100.1.1.1", - "ac-ipv4-prefix-length":0, - "sdp-peering":{ - "peer-sap-id":"100.1.1.254" - }, - "status":{ - - } - } - ] - }, - "status":{ - - } - } - ] - }, - "connection-groups":{ - "connection-group":[ - { - "id":"DU-CU", - "connectivity-type":"ietf-vpn-common:any-to-any", - "connectivity-construct":[ - { - "id":1, - "a2a-sdp":[ - { - "sdp-id":"01" - }, - { - "sdp-id":"02" - } - ] - } - ], - "status":{ - - } - } - ] - } - } - ] - } -} \ No newline at end of file diff --git a/src/templates/ips.json b/src/templates/ips.json deleted file mode 100644 index c041c4c41f46e678598ae13d0743923e2998a114..0000000000000000000000000000000000000000 --- a/src/templates/ips.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "CU":[ - {"prefix":"100.1.1.2", "node-name":"CU-UP1" }, - {"prefix":"100.1.2.2", "node-name":"CU-UP2" } - ], - "DU":[ - {"prefix":"1.1.1.2", "node-name":"DU1" }, - {"prefix":"1.1.2.2", "node-name":"DU2" }, - {"prefix":"1.1.3.2", "node-name":"DU3" } - ], - "public-prefixes":[ - {"prefix":"10.95.90.125", "node-name":"HL5-2-2" }, - {"prefix":"10.95.90.126", "node-name":"HL5-1-2" }, - {"prefix":"10.95.86.167", "node-name":"HL5-3-2" }, - {"prefix":"10.95.86.107", "node-name":"HL4-1-2" }, - {"prefix":"10.95.90.85", "node-name":"HL4-2-2" } - ] -} diff --git a/src/webui/gui.py b/src/webui/gui.py index 82f414deab93e2f1197f2974536342b12de8cf67..1afb831c6410b8a58d51c1b077a86c4a665db33d 100644 --- a/src/webui/gui.py +++ b/src/webui/gui.py @@ -1,5 +1,18 @@ -###SPDX-FileCopyrightText: © 2024 Telefónica Innovación Digital S.L. -###SPDX-License-Identifier: AGPL-3.0-or-later +# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file is an original contribution from Telefonica Innovación Digital S.L. import json, logging, uuid import requests diff --git a/src/webui/templates/dev.html b/src/webui/templates/dev.html index ef6d18ddc123b3c214983e0d6fe5b5de18eb9cba..7a18ecc9c9577eea29ec69a80cdc2142b07b7704 100644 --- a/src/webui/templates/dev.html +++ b/src/webui/templates/dev.html @@ -1,3 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/webui/templates/index.html b/src/webui/templates/index.html index 9328ac3c6336c07bddcdaf162f474e8a8ebf51a4..bef6b7ac3f4b3df673bce0751d5259e236b06262 100644 --- a/src/webui/templates/index.html +++ b/src/webui/templates/index.html @@ -1,3 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/webui/templates/ixia.html b/src/webui/templates/ixia.html index 47e51a1212a2e1f111d2f107a55d113eed62453b..f9821e81bfe3c9c5098155fdacfeeae449b77d85 100644 --- a/src/webui/templates/ixia.html +++ b/src/webui/templates/ixia.html @@ -1,3 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/webui/templates/login.html b/src/webui/templates/login.html index 9ef6fa42dc960a4db549617b5d4877d16aeb8f1f..5dd54b61e4303b3502cafdc0c4b020ed536fab8d 100644 --- a/src/webui/templates/login.html +++ b/src/webui/templates/login.html @@ -1,3 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/webui/templates/search.html b/src/webui/templates/search.html index 676705bb194405f0eddb25e8cbc4ffaeb68b7481..6ace2c126f20e95d73bf9fe480bb80a357676b2b 100644 --- a/src/webui/templates/search.html +++ b/src/webui/templates/search.html @@ -1,3 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/webui/templates/welcome.html b/src/webui/templates/welcome.html index d04082c9d585c2baa416803e98507ecb8d94d2d8..3fa27b2355a99e3f5c2250e5ecf156670874882c 100644 --- a/src/webui/templates/welcome.html +++ b/src/webui/templates/welcome.html @@ -1,3 +1,18 @@ + + + + + + + + + + + + + + +