Commit ae27cfff authored by Maria Ruiz's avatar Maria Ruiz
Browse files

#primeras pruebas

parent c74fe044
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -65,6 +65,11 @@ TFS_L2VPN_SUPPORT = False
# IXIA NEII IP
IXIA_IP = ips.get('IXIA_IP')


#####SATNMS#####
# SAT NMS IP
SATNMS_IP = ips.get('SATNMS_IP')

# WebUI

# Flag to deploy the WebUI
+2 −1
Original line number Diff line number Diff line
{
    "TFS_IP": "192.168.27.165",
    "IXIA_IP": "192.168.27.59"
    "IXIA_IP": "192.168.27.59",
    "SATNMS_IP": "192.168.27.31"
}
 No newline at end of file
+20 −2
Original line number Diff line number Diff line
@@ -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, DUMP_TEMPLATES, PLANNER_ENABLED, NRP_ENABLED, UPLOAD_TYPE, NBI_L2_PATH, NBI_L3_PATH
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, UPLOAD_TYPE, NBI_L2_PATH, NBI_L3_PATH, SATNMS_IP
from src.realizers.ixia.NEII_V4 import NEII_controller
from src.realizers.sat.SATNMS import SAT_NMS 
from src.planner.planner import Planner

# Configure logging to provide clear and informative log messages
@@ -42,7 +43,7 @@ class NSController:
    - Slice Realization: Convert intents to specific network configurations (L2VPN, L3VPN)
    """

    def __init__(self, controller_type = "TFS", tfs_ip=TFS_IP, ixia_ip =IXIA_IP, need_l2vpn_support=TFS_L2VPN_SUPPORT): 
    def __init__(self, controller_type = "TFS", tfs_ip=TFS_IP, ixia_ip =IXIA_IP, need_l2vpn_support=TFS_L2VPN_SUPPORT, satnms_ip=SATNMS_IP): 
        """
        Initialize the Network Slice Controller.

@@ -288,6 +289,8 @@ class NSController:
                    # Realizer
                    tfs_request = self.__realizer(intent)
                    requests["services"].append(tfs_request)
                    logging.info("*************DEBUGGING1*************")
                    logging.info("Realizing request: {tfs_request}")
            else:
                return self.__send_response(False, code=404, message="No intents found")
            
@@ -314,6 +317,7 @@ class NSController:
                        self.__tfs_l2vpn_support(requests["services"])

                    logging.info("Request sent to Teraflow")

                elif self.controller_type == "IXIA":
                    neii_controller = NEII_controller()
                    for intent in requests["services"]:
@@ -321,6 +325,12 @@ class NSController:
                        neii_controller.nscNEII(intent)
                    logging.info("Requests sent to Ixia")

                elif self.controller_type == "sat":
                    sat_nms = SAT_NMS()
                    for intent in requests["services"]:
                        sat_nms.nscSATNMS(intent)
                    logging.info("Request sent to SATELLITE NMS")

            # End performance tracking
            self.end_time = time.perf_counter()
            return self.__send_response(True, code=200)
@@ -803,6 +813,7 @@ class NSController:
                Supported values:
                - "IXIA": IXIA NEII for network testing
                - "TFS": TeraFlow Service for network slice management
                - "SAT": SAT NMS for network slice creation
            way (str): The type of technology to use.
                Supported values:
                - "L2VPN": Layer 2 Virtual Private Network
@@ -825,6 +836,8 @@ class NSController:
                realizing_request = self.__tfs_l2vpn(ietf_intent)
        elif controller == "IXIA":
            realizing_request = self.__ixia(ietf_intent)
        elif controller == "sat":
            realizing_request = self.__sat(ietf_intent)
        else:
            logging.warning(f"Unsupported controller: {controller}. Defaulting to TFS L2VPN realization.")
            realizing_request = self.__tfs_l2vpn(ietf_intent)
@@ -1257,3 +1270,8 @@ class NSController:
        logging.info(f"IXIA Intent realized\n")
        return intent
    
    def __sat(self, ietf_intent):
        """
        Prepare an SAT NMS service request based on the IETF intent
        """
    
+25 −0
Original line number Diff line number Diff line
# 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 ipaddress, logging
from src.Constants import SATNMS_IP

class SAT_NMS:
    def __init__(self, satnms_ip=SATNMS_IP):
        self.satnms_ip = satnms_ip

    def nscSATNMS(self, json_data):
        print(f'\n\n{json_data}\n')
 No newline at end of file
+486 −0

File changed.

Preview size limit exceeded, changes collapsed.

Loading