Loading .gitignore +1 −1 Original line number Diff line number Diff line Loading @@ -3,4 +3,4 @@ swagger/__pycache__/ src/__pycache__/ venv/ .env slice.db src/mapper/main.py +0 −1 Original line number Diff line number Diff line Loading @@ -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 = [ Loading src/realizer/main.py +4 −3 Original line number Diff line number Diff line Loading @@ -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): """ Loading @@ -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 src/realizer/tfs/main.py +3 −3 Original line number Diff line number Diff line Loading @@ -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 src/templates/ietf_template_empty.json +7 −3 Original line number Diff line number Diff line Loading @@ -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 Loading
.gitignore +1 −1 Original line number Diff line number Diff line Loading @@ -3,4 +3,4 @@ swagger/__pycache__/ src/__pycache__/ venv/ .env slice.db
src/mapper/main.py +0 −1 Original line number Diff line number Diff line Loading @@ -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 = [ Loading
src/realizer/main.py +4 −3 Original line number Diff line number Diff line Loading @@ -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): """ Loading @@ -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
src/realizer/tfs/main.py +3 −3 Original line number Diff line number Diff line Loading @@ -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
src/templates/ietf_template_empty.json +7 −3 Original line number Diff line number Diff line Loading @@ -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