Loading proto/context.proto +9 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import "google/protobuf/any.proto"; import "acl.proto"; import "kpi_sample_types.proto"; import "tapi_lsp.proto"; service ContextService { rpc ListContextIds (Empty ) returns ( ContextIdList ) {} Loading Loading @@ -78,7 +79,6 @@ service ContextService { rpc RemoveConnection (ConnectionId ) returns ( Empty ) {} rpc GetConnectionEvents(Empty ) returns (stream ConnectionEvent ) {} // ------------------------------ Experimental ----------------------------- rpc GetOpticalConfig (Empty ) returns (OpticalConfigList) {} rpc SetOpticalConfig (OpticalConfig ) returns (OpticalConfigId ) {} Loading Loading @@ -203,7 +203,6 @@ message Component { // Defined previously in this sectio Uuid component_uuid = 1; string name = 2; string type = 3; map<string, string> attributes = 4; // dict[attr.name => json.dumps(attr.value)] string parent = 5; } Loading Loading @@ -331,6 +330,7 @@ enum ServiceTypeEnum { SERVICETYPE_L1NM = 8; SERVICETYPE_INT = 9; SERVICETYPE_ACL = 10; SERVICETYPE_TAPI_LSP = 11; } enum ServiceStatusEnum { Loading Loading @@ -544,11 +544,17 @@ message ConfigRule_ACL { acl.AclRuleSet rule_set = 2; } message ConfigRule_TAPI_LSP { EndPointId endpoint_id = 1; tapi_lsp.TapiLspRuleSet rule_set = 2; } message ConfigRule { ConfigActionEnum action = 1; oneof config_rule { ConfigRule_Custom custom = 2; ConfigRule_ACL acl = 3; ConfigRule_TAPI_LSP tapi_lsp = 4; } } Loading Loading @@ -579,7 +585,6 @@ message Location { oneof location { string region = 1; GPS_Position gps_position = 2; string interface=3; string circuit_pack=4; } Loading proto/tapi_lsp.proto 0 → 100644 +24 −0 Original line number Diff line number Diff line // Copyright 2022-2025 ETSI OSG/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. syntax = "proto3"; package tapi_lsp; message TapiLspRuleSet { string src = 1; string dst = 2; string uuid = 3; string bw = 4; string unit = 5; } No newline at end of file src/common/tools/object_factory/Service.py +11 −1 Original line number Diff line number Diff line Loading @@ -93,3 +93,13 @@ def json_service_p4_planned( service_uuid, ServiceTypeEnum.SERVICETYPE_L1NM, context_id=json_context_id(context_uuid), status=ServiceStatusEnum.SERVICESTATUS_PLANNED, endpoint_ids=endpoint_ids, constraints=constraints, config_rules=config_rules) def json_service_tapi_lsp_planned( service_uuid : str, endpoint_ids : List[Dict] = [], constraints : List[Dict] = [], config_rules : List[Dict] = [], context_uuid : str = DEFAULT_CONTEXT_NAME ): return json_service( service_uuid, ServiceTypeEnum.SERVICETYPE_TAPI_LSP, context_id=json_context_id(context_uuid), status=ServiceStatusEnum.SERVICESTATUS_PLANNED, endpoint_ids=endpoint_ids, constraints=constraints, config_rules=config_rules) src/common/type_checkers/Assertions.py +2 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ def validate_service_type_enum(message): 'SERVICETYPE_E2E', 'SERVICETYPE_OPTICAL_CONNECTIVITY', 'SERVICETYPE_QKD', 'SERVICETYPE_TAPI_LSP', ] def validate_service_state_enum(message): Loading Loading @@ -146,6 +147,7 @@ def validate_uuid(message, allow_empty=False): CONFIG_RULE_TYPES = { 'custom', 'acl', 'tapi_lsp' } def validate_config_rule(message): assert isinstance(message, dict) Loading src/context/service/database/ConfigRule.py +3 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,9 @@ def compose_config_rules_data( _, _, endpoint_uuid = endpoint_get_uuid(config_rule.acl.endpoint_id, allow_random=False) rule_set_name = config_rule.acl.rule_set.name configrule_name = '{:s}:{:s}:{:s}:{:s}'.format(parent_kind, kind.value, endpoint_uuid, rule_set_name) elif kind == ConfigRuleKindEnum.TAPI_LSP: _, _, endpoint_uuid = endpoint_get_uuid(config_rule.tapi_lsp.endpoint_id, allow_random=False) configrule_name = '{:s}:{:s}:{:s}'.format(parent_kind, kind.value, endpoint_uuid) else: MSG = 'Name for ConfigRule({:s}) cannot be inferred '+\ '(device_uuid={:s}, service_uuid={:s}, slice_uuid={:s})' Loading Loading
proto/context.proto +9 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import "google/protobuf/any.proto"; import "acl.proto"; import "kpi_sample_types.proto"; import "tapi_lsp.proto"; service ContextService { rpc ListContextIds (Empty ) returns ( ContextIdList ) {} Loading Loading @@ -78,7 +79,6 @@ service ContextService { rpc RemoveConnection (ConnectionId ) returns ( Empty ) {} rpc GetConnectionEvents(Empty ) returns (stream ConnectionEvent ) {} // ------------------------------ Experimental ----------------------------- rpc GetOpticalConfig (Empty ) returns (OpticalConfigList) {} rpc SetOpticalConfig (OpticalConfig ) returns (OpticalConfigId ) {} Loading Loading @@ -203,7 +203,6 @@ message Component { // Defined previously in this sectio Uuid component_uuid = 1; string name = 2; string type = 3; map<string, string> attributes = 4; // dict[attr.name => json.dumps(attr.value)] string parent = 5; } Loading Loading @@ -331,6 +330,7 @@ enum ServiceTypeEnum { SERVICETYPE_L1NM = 8; SERVICETYPE_INT = 9; SERVICETYPE_ACL = 10; SERVICETYPE_TAPI_LSP = 11; } enum ServiceStatusEnum { Loading Loading @@ -544,11 +544,17 @@ message ConfigRule_ACL { acl.AclRuleSet rule_set = 2; } message ConfigRule_TAPI_LSP { EndPointId endpoint_id = 1; tapi_lsp.TapiLspRuleSet rule_set = 2; } message ConfigRule { ConfigActionEnum action = 1; oneof config_rule { ConfigRule_Custom custom = 2; ConfigRule_ACL acl = 3; ConfigRule_TAPI_LSP tapi_lsp = 4; } } Loading Loading @@ -579,7 +585,6 @@ message Location { oneof location { string region = 1; GPS_Position gps_position = 2; string interface=3; string circuit_pack=4; } Loading
proto/tapi_lsp.proto 0 → 100644 +24 −0 Original line number Diff line number Diff line // Copyright 2022-2025 ETSI OSG/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. syntax = "proto3"; package tapi_lsp; message TapiLspRuleSet { string src = 1; string dst = 2; string uuid = 3; string bw = 4; string unit = 5; } No newline at end of file
src/common/tools/object_factory/Service.py +11 −1 Original line number Diff line number Diff line Loading @@ -93,3 +93,13 @@ def json_service_p4_planned( service_uuid, ServiceTypeEnum.SERVICETYPE_L1NM, context_id=json_context_id(context_uuid), status=ServiceStatusEnum.SERVICESTATUS_PLANNED, endpoint_ids=endpoint_ids, constraints=constraints, config_rules=config_rules) def json_service_tapi_lsp_planned( service_uuid : str, endpoint_ids : List[Dict] = [], constraints : List[Dict] = [], config_rules : List[Dict] = [], context_uuid : str = DEFAULT_CONTEXT_NAME ): return json_service( service_uuid, ServiceTypeEnum.SERVICETYPE_TAPI_LSP, context_id=json_context_id(context_uuid), status=ServiceStatusEnum.SERVICESTATUS_PLANNED, endpoint_ids=endpoint_ids, constraints=constraints, config_rules=config_rules)
src/common/type_checkers/Assertions.py +2 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ def validate_service_type_enum(message): 'SERVICETYPE_E2E', 'SERVICETYPE_OPTICAL_CONNECTIVITY', 'SERVICETYPE_QKD', 'SERVICETYPE_TAPI_LSP', ] def validate_service_state_enum(message): Loading Loading @@ -146,6 +147,7 @@ def validate_uuid(message, allow_empty=False): CONFIG_RULE_TYPES = { 'custom', 'acl', 'tapi_lsp' } def validate_config_rule(message): assert isinstance(message, dict) Loading
src/context/service/database/ConfigRule.py +3 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,9 @@ def compose_config_rules_data( _, _, endpoint_uuid = endpoint_get_uuid(config_rule.acl.endpoint_id, allow_random=False) rule_set_name = config_rule.acl.rule_set.name configrule_name = '{:s}:{:s}:{:s}:{:s}'.format(parent_kind, kind.value, endpoint_uuid, rule_set_name) elif kind == ConfigRuleKindEnum.TAPI_LSP: _, _, endpoint_uuid = endpoint_get_uuid(config_rule.tapi_lsp.endpoint_id, allow_random=False) configrule_name = '{:s}:{:s}:{:s}'.format(parent_kind, kind.value, endpoint_uuid) else: MSG = 'Name for ConfigRule({:s}) cannot be inferred '+\ '(device_uuid={:s}, service_uuid={:s}, slice_uuid={:s})' Loading