Commit 7499455d authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Merge branch...

Merge branch 'feat/161-tid-creation-of-ip-link-with-supporting-coherent-pluggable-to-pluggable-connection' into 'develop'

Resolve "(TID) Creation of IP link with supporting coherent pluggable to pluggable connection"

See merge request !239
parents d162c7d6 a731ff57
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package context;
import "google/protobuf/any.proto";

import "acl.proto";
import "ip_link.proto";
import "kpi_sample_types.proto";

service ContextService {
@@ -347,6 +348,7 @@ enum ServiceTypeEnum {
  SERVICETYPE_L1NM = 8;
  SERVICETYPE_INT = 9;
  SERVICETYPE_ACL = 10;
  SERVICETYPE_IP_LINK = 11;
}

enum ServiceStatusEnum {
@@ -560,11 +562,17 @@ message ConfigRule_ACL {
  acl.AclRuleSet rule_set = 2;
}

message ConfigRule_IP_LINK {
  EndPointId endpoint_id           = 1;
  ip_link.IpLinkRuleSet rule_set = 2;
}

message ConfigRule {
  ConfigActionEnum action = 1;
  oneof config_rule {
    ConfigRule_Custom custom  = 2;
    ConfigRule_ACL acl        = 3;
    ConfigRule_IP_LINK ip_link = 4;
  }
}

proto/ip_link.proto

0 → 100644
+22 −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 ip_link;

message IpLinkRuleSet {
  string  ip   = 1;
  string  mask = 3;
  string  vlan = 4;
}
+11 −1
Original line number Diff line number Diff line
@@ -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_iplink_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_IP_LINK, context_id=json_context_id(context_uuid),
        status=ServiceStatusEnum.SERVICESTATUS_PLANNED, endpoint_ids=endpoint_ids, constraints=constraints,
        config_rules=config_rules)
+2 −0
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ def validate_service_type_enum(message):
        'SERVICETYPE_TAPI_CONNECTIVITY_SERVICE',
        'SERVICETYPE_TE',
        'SERVICETYPE_E2E',
        'SERVICETYPE_IP_LINK'
        'SERVICETYPE_OPTICAL_CONNECTIVITY',
        'SERVICETYPE_QKD',
    ]
@@ -152,6 +153,7 @@ def validate_uuid(message, allow_empty=False):
CONFIG_RULE_TYPES = {
    'custom',
    'acl',
    'ip_link'
}
def validate_config_rule(message):
    assert isinstance(message, dict)
+3 −0
Original line number Diff line number Diff line
@@ -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.IP_LINK: 
            _, _, endpoint_uuid = endpoint_get_uuid(config_rule.ip_link.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