Commit f7da0b68 authored by Javier Velázquez's avatar Javier Velázquez
Browse files

Merge branch 'feat/2-challenge-2-realization-technology-selection' into 'develop'

Merge feat/2-challenge-2-realization-technology-selection

See merge request !12
parents b765be2c 1a846a81
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3,4 +3,4 @@ swagger/__pycache__/
src/__pycache__/
venv/
.env
slice.db
+0 −1
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ def mapper(ietf_intent):

        # 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"]
        print(f"SLOs: {slos}")
        if slos:
            # Find candidate NRPs that can meet the SLO requirements
            candidates = [
+4 −3
Original line number Diff line number Diff line
@@ -12,10 +12,12 @@
# 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.
# This file includes original contributions from Telefonica Innovación Digital S.L.

import logging
from .select_way import select_way
from .nrp_handler import nrp_handler
from src.utils.safe_get import safe_get

def realizer(ietf_intent, need_nrp=False, order=None, nrp=None, controller_type=None, response=None):
    """
@@ -37,7 +39,6 @@ def realizer(ietf_intent, need_nrp=False, order=None, nrp=None, controller_type=
        return nrp_view
    else:
        # Select slice service method
        way = ietf_intent["ietf-network-slice-service:network-slice-services"]["slice-service"][0]["service-tags"]["tag-type"]["value"]
        way = "L2VPN"
        way = safe_get(ietf_intent, ['ietf-network-slice-service:network-slice-services', 'slice-service', 0, 'service-tags', 'tag-type', 0, 'tag-type-value', 0])
        request = select_way(controller=controller_type, way=way, ietf_intent=ietf_intent, response=response)
        return request
+3 −3
Original line number Diff line number Diff line
@@ -19,11 +19,11 @@ from .service_types.tfs_l2vpn import tfs_l2vpn
from .service_types.tfs_l3vpn import tfs_l3vpn

def tfs(ietf_intent, way=None, response=None):
    if way == "L2VPN":
    if way == "L2":
        realizing_request = tfs_l2vpn(ietf_intent, response)
    elif way == "L3VPN":
    elif way == "L3":
        realizing_request = tfs_l3vpn(ietf_intent, response)
    else:
        logging.warning(f"Unsupported way: {way}. Defaulting to L2VPN realization.")
        logging.warning(f"Unsupported way: {way}. Defaulting to L2 realization.")
        realizing_request = tfs_l2vpn(ietf_intent, response)
    return realizing_request
 No newline at end of file
+7 −3
Original line number Diff line number Diff line
@@ -29,10 +29,14 @@
           "id":"5GSliceMapping",
           "description":"example 5G Slice mapping",
           "service-tags":{
              "tag-type":{
            "tag-type": [
              {
                "tag-type": "",
                 "value":""
                "tag-type-value": [
                  ""
                ]
              }
            ]
           },
           "slo-sle-policy":{
              "slo-sle-template":""
Loading