Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • tfs/controller
1 result
Show changes
Showing
with 1391 additions and 144 deletions
......@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import itertools, json, logging, re
from typing import Dict, List, Optional, Tuple
import copy, itertools, json, logging, re
from typing import Dict, Iterable, List, Optional, Set, Tuple
from common.proto.context_pb2 import ConfigRule
from common.tools.grpc.Tools import grpc_message_to_json_string
from common.tools.object_factory.ConfigRule import json_config_rule_set
......@@ -21,19 +21,26 @@ from common.tools.object_factory.ConfigRule import json_config_rule_set
LOGGER = logging.getLogger(__name__)
SETTINGS_RULE_NAME = '/settings'
STATIC_ROUTING_RULE_NAME = '/static_routing'
DEVICE_SETTINGS = re.compile(r'\/device\[([^\]]+)\]\/settings')
ENDPOINT_SETTINGS = re.compile(r'\/device\[([^\]]+)\]\/endpoint\[([^\]]+)\]\/settings')
RE_UUID = re.compile(r'([0-9a-fA-F]{8})\-([0-9a-fA-F]{4})\-([0-9a-fA-F]{4})\-([0-9a-fA-F]{4})\-([0-9a-fA-F]{12})')
RE_DEVICE_SETTINGS = re.compile(r'\/device\[([^\]]+)\]\/settings')
RE_ENDPOINT_SETTINGS = re.compile(r'\/device\[([^\]]+)\]\/endpoint\[([^\]]+)\]\/settings')
RE_ENDPOINT_VLAN_SETTINGS = re.compile(r'\/device\[([^\]]+)\]\/endpoint\[([^\]]+)\]\/vlan\[([^\]]+)\]\/settings')
TMPL_ENDPOINT_SETTINGS = '/device[{:s}]/endpoint[{:s}]/settings'
TMPL_ENDPOINT_VLAN_SETTINGS = '/device[{:s}]/endpoint[{:s}]/vlan[{:s}]/settings'
L2NM_SETTINGS_FIELD_DEFAULTS = {
'encapsulation_type': 'dot1q',
'vlan_id' : 100,
#'encapsulation_type': 'dot1q',
#'vlan_id' : 100,
'mtu' : 1450,
}
L3NM_SETTINGS_FIELD_DEFAULTS = {
'encapsulation_type': 'dot1q',
'vlan_id' : 100,
#'encapsulation_type': 'dot1q',
#'vlan_id' : 100,
'mtu' : 1450,
}
......@@ -54,26 +61,48 @@ def find_custom_config_rule(config_rules : List, resource_name : str) -> Optiona
return resource_value
def compose_config_rules(
main_service_config_rules : List, subservice_config_rules : List, field_defaults : Dict
main_service_config_rules : List, subservice_config_rules : List, settings_rule_name : str, field_defaults : Dict
) -> None:
settings = find_custom_config_rule(main_service_config_rules, SETTINGS_RULE_NAME)
settings = find_custom_config_rule(main_service_config_rules, settings_rule_name)
if settings is None: return
json_settings = {}
for field_name,default_value in field_defaults.items():
json_settings[field_name] = settings.get(field_name, default_value)
config_rule = ConfigRule(**json_config_rule_set('/settings', json_settings))
if len(field_defaults) == 0:
for field_name,field_value in settings.items():
json_settings[field_name] = field_value
else:
for field_name,default_value in field_defaults.items():
field_value = settings.get(field_name, default_value)
if field_value is None: continue
json_settings[field_name] = field_value
if len(json_settings) == 0: return
config_rule = ConfigRule(**json_config_rule_set(settings_rule_name, json_settings))
subservice_config_rules.append(config_rule)
def compose_l2nm_config_rules(main_service_config_rules : List, subservice_config_rules : List) -> None:
compose_config_rules(main_service_config_rules, subservice_config_rules, L2NM_SETTINGS_FIELD_DEFAULTS)
CONFIG_RULES = [
(SETTINGS_RULE_NAME, L2NM_SETTINGS_FIELD_DEFAULTS),
]
for rule_name, defaults in CONFIG_RULES:
compose_config_rules(main_service_config_rules, subservice_config_rules, rule_name, defaults)
def compose_l3nm_config_rules(main_service_config_rules : List, subservice_config_rules : List) -> None:
compose_config_rules(main_service_config_rules, subservice_config_rules, L3NM_SETTINGS_FIELD_DEFAULTS)
CONFIG_RULES = [
(SETTINGS_RULE_NAME, L3NM_SETTINGS_FIELD_DEFAULTS),
(STATIC_ROUTING_RULE_NAME, {}),
]
for rule_name, defaults in CONFIG_RULES:
compose_config_rules(main_service_config_rules, subservice_config_rules, rule_name, defaults)
def compose_tapi_config_rules(main_service_config_rules : List, subservice_config_rules : List) -> None:
compose_config_rules(main_service_config_rules, subservice_config_rules, TAPI_SETTINGS_FIELD_DEFAULTS)
CONFIG_RULES = [
(SETTINGS_RULE_NAME, TAPI_SETTINGS_FIELD_DEFAULTS),
]
for rule_name, defaults in CONFIG_RULES:
compose_config_rules(main_service_config_rules, subservice_config_rules, rule_name, defaults)
def compose_device_config_rules(
config_rules : List, subservice_config_rules : List, path_hops : List,
......@@ -127,25 +156,31 @@ def compose_device_config_rules(
elif config_rule.WhichOneof('config_rule') == 'custom':
LOGGER.debug('[compose_device_config_rules] is custom')
match = DEVICE_SETTINGS.match(config_rule.custom.resource_key)
match = RE_DEVICE_SETTINGS.match(config_rule.custom.resource_key)
if match is not None:
device_uuid_or_name = match.group(1)
device_name_or_uuid = device_name_mapping[device_uuid_or_name]
device_keys = {device_uuid_or_name, device_name_or_uuid}
device_keys = {device_uuid_or_name}
device_name_or_uuid = device_name_mapping.get(device_uuid_or_name)
if device_name_or_uuid is not None: device_keys.add(device_name_or_uuid)
if len(device_keys.intersection(devices_traversed)) == 0: continue
subservice_config_rules.append(config_rule)
match = ENDPOINT_SETTINGS.match(config_rule.custom.resource_key)
match = RE_ENDPOINT_SETTINGS.match(config_rule.custom.resource_key)
if match is None:
match = RE_ENDPOINT_VLAN_SETTINGS.match(config_rule.custom.resource_key)
if match is not None:
device_uuid_or_name = match.group(1)
device_name_or_uuid = device_name_mapping[device_uuid_or_name]
device_keys = {device_uuid_or_name, device_name_or_uuid}
device_keys = {device_uuid_or_name}
device_name_or_uuid = device_name_mapping.get(device_uuid_or_name)
if device_name_or_uuid is not None: device_keys.add(device_name_or_uuid)
endpoint_uuid_or_name = match.group(2)
endpoint_name_or_uuid_1 = endpoint_name_mapping[(device_uuid_or_name, endpoint_uuid_or_name)]
endpoint_name_or_uuid_2 = endpoint_name_mapping[(device_name_or_uuid, endpoint_uuid_or_name)]
endpoint_keys = {endpoint_uuid_or_name, endpoint_name_or_uuid_1, endpoint_name_or_uuid_2}
endpoint_keys = {endpoint_uuid_or_name}
endpoint_name_or_uuid_1 = endpoint_name_mapping.get((device_uuid_or_name, endpoint_uuid_or_name))
if endpoint_name_or_uuid_1 is not None: endpoint_keys.add(endpoint_name_or_uuid_1)
endpoint_name_or_uuid_2 = endpoint_name_mapping.get((device_name_or_uuid, endpoint_uuid_or_name))
if endpoint_name_or_uuid_2 is not None: endpoint_keys.add(endpoint_name_or_uuid_2)
device_endpoint_keys = set(itertools.product(device_keys, endpoint_keys))
if len(device_endpoint_keys.intersection(endpoints_traversed)) == 0: continue
......@@ -153,4 +188,146 @@ def compose_device_config_rules(
else:
continue
for config_rule in subservice_config_rules:
LOGGER.debug('[compose_device_config_rules] result config_rule: {:s}'.format(
grpc_message_to_json_string(config_rule)))
LOGGER.debug('[compose_device_config_rules] end')
def pairwise(iterable : Iterable) -> Tuple[Iterable, Iterable]:
# TODO: To be replaced by itertools.pairwise() when we move to Python 3.10
# Python 3.10 introduced method itertools.pairwise()
# Standalone method extracted from:
# - https://docs.python.org/3/library/itertools.html#itertools.pairwise
a, b = itertools.tee(iterable, 2)
next(b, None)
return zip(a, b)
def compute_device_keys(
device_uuid_or_name : str, device_name_mapping : Dict[str, str]
) -> Set[str]:
LOGGER.debug('[compute_device_keys] begin')
LOGGER.debug('[compute_device_keys] device_uuid_or_name={:s}'.format(str(device_uuid_or_name)))
#LOGGER.debug('[compute_device_keys] device_name_mapping={:s}'.format(str(device_name_mapping)))
device_keys = {device_uuid_or_name}
for k,v in device_name_mapping.items():
if device_uuid_or_name not in {k, v}: continue
device_keys.add(k)
device_keys.add(v)
LOGGER.debug('[compute_device_keys] device_keys={:s}'.format(str(device_keys)))
LOGGER.debug('[compute_device_keys] end')
return device_keys
def compute_endpoint_keys(
device_keys : Set[str], endpoint_uuid_or_name : str, endpoint_name_mapping : Dict[str, str]
) -> Set[str]:
LOGGER.debug('[compute_endpoint_keys] begin')
LOGGER.debug('[compute_endpoint_keys] device_keys={:s}'.format(str(device_keys)))
LOGGER.debug('[compute_endpoint_keys] endpoint_uuid_or_name={:s}'.format(str(endpoint_uuid_or_name)))
#LOGGER.debug('[compute_device_endpoint_keys] endpoint_name_mapping={:s}'.format(str(endpoint_name_mapping)))
endpoint_keys = {endpoint_uuid_or_name}
for k,v in endpoint_name_mapping.items():
if (k[0] in device_keys or v in device_keys) and (endpoint_uuid_or_name in {k[1], v}):
endpoint_keys.add(k[1])
endpoint_keys.add(v)
LOGGER.debug('[compute_endpoint_keys] endpoint_keys={:s}'.format(str(endpoint_keys)))
LOGGER.debug('[compute_endpoint_keys] end')
return endpoint_keys
def compute_device_endpoint_keys(
device_uuid_or_name : str, endpoint_uuid_or_name : str,
device_name_mapping : Dict[str, str], endpoint_name_mapping : Dict[Tuple[str, str], str]
) -> Set[Tuple[str, str]]:
LOGGER.debug('[compute_device_endpoint_keys] begin')
LOGGER.debug('[compute_device_endpoint_keys] device_uuid_or_name={:s}'.format(str(device_uuid_or_name)))
LOGGER.debug('[compute_device_endpoint_keys] endpoint_uuid_or_name={:s}'.format(str(endpoint_uuid_or_name)))
#LOGGER.debug('[compute_device_endpoint_keys] device_name_mapping={:s}'.format(str(device_name_mapping)))
#LOGGER.debug('[compute_device_endpoint_keys] endpoint_name_mapping={:s}'.format(str(endpoint_name_mapping)))
device_keys = compute_device_keys(device_uuid_or_name, device_name_mapping)
endpoint_keys = compute_endpoint_keys(device_keys, endpoint_uuid_or_name, endpoint_name_mapping)
device_endpoint_keys = set(itertools.product(device_keys, endpoint_keys))
LOGGER.debug('[compute_device_endpoint_keys] device_endpoint_keys={:s}'.format(str(device_endpoint_keys)))
LOGGER.debug('[compute_device_endpoint_keys] end')
return device_endpoint_keys
def generate_neighbor_endpoint_config_rules(
config_rules : List[Dict], path_hops : List[Dict],
device_name_mapping : Dict[str, str], endpoint_name_mapping : Dict[Tuple[str, str], str]
) -> List[Dict]:
LOGGER.debug('[generate_neighbor_endpoint_config_rules] begin')
LOGGER.debug('[generate_neighbor_endpoint_config_rules] config_rules={:s}'.format(str(config_rules)))
LOGGER.debug('[generate_neighbor_endpoint_config_rules] path_hops={:s}'.format(str(path_hops)))
LOGGER.debug('[generate_neighbor_endpoint_config_rules] device_name_mapping={:s}'.format(str(device_name_mapping)))
LOGGER.debug('[generate_neighbor_endpoint_config_rules] endpoint_name_mapping={:s}'.format(str(endpoint_name_mapping)))
generated_config_rules = list()
for link_endpoint_a, link_endpoint_b in pairwise(path_hops):
LOGGER.debug('[generate_neighbor_endpoint_config_rules] loop begin')
LOGGER.debug('[generate_neighbor_endpoint_config_rules] link_endpoint_a={:s}'.format(str(link_endpoint_a)))
LOGGER.debug('[generate_neighbor_endpoint_config_rules] link_endpoint_b={:s}'.format(str(link_endpoint_b)))
device_endpoint_keys_a = compute_device_endpoint_keys(
link_endpoint_a['device'], link_endpoint_a['egress_ep'],
device_name_mapping, endpoint_name_mapping
)
device_endpoint_keys_b = compute_device_endpoint_keys(
link_endpoint_b['device'], link_endpoint_b['ingress_ep'],
device_name_mapping, endpoint_name_mapping
)
for config_rule in config_rules:
# Only applicable, by now, to Custom Config Rules for endpoint settings
if 'custom' not in config_rule: continue
match = RE_ENDPOINT_SETTINGS.match(config_rule['custom']['resource_key'])
if match is None:
match = RE_ENDPOINT_VLAN_SETTINGS.match(config_rule['custom']['resource_key'])
if match is None: continue
resource_key_values = match.groups()
if resource_key_values[0:2] in device_endpoint_keys_a:
resource_key_values = list(resource_key_values)
resource_key_values[0] = link_endpoint_b['device']
resource_key_values[1] = link_endpoint_b['ingress_ep']
elif resource_key_values[0:2] in device_endpoint_keys_b:
resource_key_values = list(resource_key_values)
resource_key_values[0] = link_endpoint_a['device']
resource_key_values[1] = link_endpoint_a['egress_ep']
else:
continue
device_keys = compute_device_keys(resource_key_values[0], device_name_mapping)
device_names = {device_key for device_key in device_keys if RE_UUID.match(device_key) is None}
if len(device_names) != 1:
MSG = 'Unable to identify name for Device({:s}): device_keys({:s})'
raise Exception(MSG.format(str(resource_key_values[0]), str(device_keys)))
resource_key_values[0] = device_names.pop()
endpoint_keys = compute_endpoint_keys(device_keys, resource_key_values[1], endpoint_name_mapping)
endpoint_names = {endpoint_key for endpoint_key in endpoint_keys if RE_UUID.match(endpoint_key) is None}
if len(endpoint_names) != 1:
MSG = 'Unable to identify name for Endpoint({:s}): endpoint_keys({:s})'
raise Exception(MSG.format(str(resource_key_values[1]), str(endpoint_keys)))
resource_key_values[1] = endpoint_names.pop()
resource_value : Dict = json.loads(config_rule['custom']['resource_value'])
if 'neighbor_address' not in resource_value: continue
resource_value['ip_address'] = resource_value.pop('neighbor_address')
# remove neighbor_address also from original rule as it is already consumed
resource_key_template = TMPL_ENDPOINT_VLAN_SETTINGS if len(match.groups()) == 3 else TMPL_ENDPOINT_SETTINGS
generated_config_rule = copy.deepcopy(config_rule)
generated_config_rule['custom']['resource_key'] = resource_key_template.format(*resource_key_values)
generated_config_rule['custom']['resource_value'] = json.dumps(resource_value)
generated_config_rules.append(generated_config_rule)
LOGGER.debug('[generate_neighbor_endpoint_config_rules] generated_config_rules={:s}'.format(str(generated_config_rules)))
LOGGER.debug('[generate_neighbor_endpoint_config_rules] end')
return generated_config_rules
......@@ -95,6 +95,36 @@ def convert_explicit_path_hops_to_connections(
connections.append(connection)
connection_stack.queue[-1][3].append(connection[0])
#connection_stack.queue[-1][2].append(path_hop)
elif prv_res_class[2] is None and res_class[2] is not None:
# entering domain of a device controller, create underlying connection
LOGGER.debug(' entering domain of a device controller, create underlying connection')
sub_service_uuid = str(uuid.uuid4())
prv_service_type = connection_stack.queue[-1][1]
service_type = get_service_type(res_class[1], prv_service_type)
connection_stack.put((sub_service_uuid, service_type, [path_hop], []))
elif prv_res_class[2] is not None and res_class[2] is None:
# leaving domain of a device controller, terminate underlying connection
LOGGER.debug(' leaving domain of a device controller, terminate underlying connection')
connection = connection_stack.get()
connections.append(connection)
connection_stack.queue[-1][3].append(connection[0])
connection_stack.queue[-1][2].append(path_hop)
elif prv_res_class[2] is not None and res_class[2] is not None:
if prv_res_class[2] == res_class[2]:
# stay in domain of a device controller, connection continues
LOGGER.debug(' stay in domain of a device controller, connection continues')
connection_stack.queue[-1][2].append(path_hop)
else:
# switching to different device controller, chain connections
LOGGER.debug(' switching to different device controller, chain connections')
connection = connection_stack.get()
connections.append(connection)
connection_stack.queue[-1][3].append(connection[0])
sub_service_uuid = str(uuid.uuid4())
prv_service_type = connection_stack.queue[-1][1]
service_type = get_service_type(res_class[1], prv_service_type)
connection_stack.put((sub_service_uuid, service_type, [path_hop], []))
elif prv_res_class[0] is None:
# path ingress
LOGGER.debug(' path ingress')
......
......@@ -24,6 +24,9 @@ DEVICE_TYPE_TO_DEEPNESS = {
DeviceTypeEnum.DATACENTER.value : 90,
DeviceTypeEnum.TERAFLOWSDN_CONTROLLER.value : 80,
DeviceTypeEnum.EMULATED_IP_SDN_CONTROLLER.value : 80,
DeviceTypeEnum.IP_SDN_CONTROLLER.value : 80,
DeviceTypeEnum.EMULATED_PACKET_ROUTER.value : 70,
DeviceTypeEnum.PACKET_ROUTER.value : 70,
......
......@@ -22,6 +22,7 @@ NETWORK_DEVICE_TYPES = {
PACKET_DEVICE_TYPES = {
DeviceTypeEnum.TERAFLOWSDN_CONTROLLER,
DeviceTypeEnum.IP_SDN_CONTROLLER, DeviceTypeEnum.EMULATED_IP_SDN_CONTROLLER,
DeviceTypeEnum.PACKET_ROUTER, DeviceTypeEnum.EMULATED_PACKET_ROUTER,
DeviceTypeEnum.PACKET_SWITCH, DeviceTypeEnum.EMULATED_PACKET_SWITCH,
}
......
......@@ -2284,6 +2284,12 @@ public class Serializer {
return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_XR;
case IETF_L2VPN:
return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN;
case GNMI_OPENCONFIG:
return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG;
case FLEXSCALE:
return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_FLEXSCALE;
case IETF_ACTN:
return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_ACTN;
case UNDEFINED:
default:
return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_UNDEFINED;
......@@ -2307,6 +2313,12 @@ public class Serializer {
return DeviceDriverEnum.XR;
case DEVICEDRIVER_IETF_L2VPN:
return DeviceDriverEnum.IETF_L2VPN;
case DEVICEDRIVER_GNMI_OPENCONFIG:
return DeviceDriverEnum.GNMI_OPENCONFIG;
case DEVICEDRIVER_FLEXSCALE:
return DeviceDriverEnum.FLEXSCALE;
case DEVICEDRIVER_IETF_ACTN:
return DeviceDriverEnum.IETF_ACTN;
case DEVICEDRIVER_UNDEFINED:
case UNRECOGNIZED:
default:
......
......@@ -24,5 +24,8 @@ public enum DeviceDriverEnum {
IETF_NETWORK_TOPOLOGY,
ONF_TR_532,
XR,
IETF_L2VPN
IETF_L2VPN,
GNMI_OPENCONFIG,
FLEXSCALE,
IETF_ACTN
}
......@@ -3614,6 +3614,13 @@ class SerializerTest {
Arguments.of(
DeviceDriverEnum.IETF_L2VPN,
ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN),
Arguments.of(
DeviceDriverEnum.GNMI_OPENCONFIG,
ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG),
Arguments.of(
DeviceDriverEnum.FLEXSCALE, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_FLEXSCALE),
Arguments.of(
DeviceDriverEnum.IETF_ACTN, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_ACTN),
Arguments.of(
DeviceDriverEnum.UNDEFINED, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_UNDEFINED));
}
......
......@@ -185,6 +185,14 @@ public final class ContextOuterClass {
* <code>DEVICEDRIVER_GNMI_OPENCONFIG = 8;</code>
*/
DEVICEDRIVER_GNMI_OPENCONFIG(8),
/**
* <code>DEVICEDRIVER_FLEXSCALE = 9;</code>
*/
DEVICEDRIVER_FLEXSCALE(9),
/**
* <code>DEVICEDRIVER_IETF_ACTN = 10;</code>
*/
DEVICEDRIVER_IETF_ACTN(10),
UNRECOGNIZED(-1),
;
 
......@@ -228,6 +236,14 @@ public final class ContextOuterClass {
* <code>DEVICEDRIVER_GNMI_OPENCONFIG = 8;</code>
*/
public static final int DEVICEDRIVER_GNMI_OPENCONFIG_VALUE = 8;
/**
* <code>DEVICEDRIVER_FLEXSCALE = 9;</code>
*/
public static final int DEVICEDRIVER_FLEXSCALE_VALUE = 9;
/**
* <code>DEVICEDRIVER_IETF_ACTN = 10;</code>
*/
public static final int DEVICEDRIVER_IETF_ACTN_VALUE = 10;
 
 
public final int getNumber() {
......@@ -263,6 +279,8 @@ public final class ContextOuterClass {
case 6: return DEVICEDRIVER_XR;
case 7: return DEVICEDRIVER_IETF_L2VPN;
case 8: return DEVICEDRIVER_GNMI_OPENCONFIG;
case 9: return DEVICEDRIVER_FLEXSCALE;
case 10: return DEVICEDRIVER_IETF_ACTN;
default: return null;
}
}
......@@ -461,6 +479,10 @@ public final class ContextOuterClass {
* <code>SERVICETYPE_TE = 4;</code>
*/
SERVICETYPE_TE(4),
/**
* <code>SERVICETYPE_E2E = 5;</code>
*/
SERVICETYPE_E2E(5),
UNRECOGNIZED(-1),
;
 
......@@ -484,6 +506,10 @@ public final class ContextOuterClass {
* <code>SERVICETYPE_TE = 4;</code>
*/
public static final int SERVICETYPE_TE_VALUE = 4;
/**
* <code>SERVICETYPE_E2E = 5;</code>
*/
public static final int SERVICETYPE_E2E_VALUE = 5;
 
 
public final int getNumber() {
......@@ -515,6 +541,7 @@ public final class ContextOuterClass {
case 2: return SERVICETYPE_L2NM;
case 3: return SERVICETYPE_TAPI_CONNECTIVITY_SERVICE;
case 4: return SERVICETYPE_TE;
case 5: return SERVICETYPE_E2E;
default: return null;
}
}
......@@ -75826,114 +75853,116 @@ public final class ContextOuterClass {
"\0132\022.context.ContextId\022\025\n\rauthenticated\030\002" +
" \001(\010*j\n\rEventTypeEnum\022\027\n\023EVENTTYPE_UNDEF" +
"INED\020\000\022\024\n\020EVENTTYPE_CREATE\020\001\022\024\n\020EVENTTYP" +
"E_UPDATE\020\002\022\024\n\020EVENTTYPE_REMOVE\020\003*\231\002\n\020Dev" +
"E_UPDATE\020\002\022\024\n\020EVENTTYPE_REMOVE\020\003*\321\002\n\020Dev" +
"iceDriverEnum\022\032\n\026DEVICEDRIVER_UNDEFINED\020" +
"\000\022\033\n\027DEVICEDRIVER_OPENCONFIG\020\001\022\036\n\032DEVICE" +
"DRIVER_TRANSPORT_API\020\002\022\023\n\017DEVICEDRIVER_P" +
"4\020\003\022&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOG" +
"Y\020\004\022\033\n\027DEVICEDRIVER_ONF_TR_532\020\005\022\023\n\017DEVI" +
"CEDRIVER_XR\020\006\022\033\n\027DEVICEDRIVER_IETF_L2VPN" +
"\020\007\022 \n\034DEVICEDRIVER_GNMI_OPENCONFIG\020\010*\217\001\n" +
"\033DeviceOperationalStatusEnum\022%\n!DEVICEOP" +
"ERATIONALSTATUS_UNDEFINED\020\000\022$\n DEVICEOPE" +
"RATIONALSTATUS_DISABLED\020\001\022#\n\037DEVICEOPERA" +
"TIONALSTATUS_ENABLED\020\002*\225\001\n\017ServiceTypeEn" +
"um\022\027\n\023SERVICETYPE_UNKNOWN\020\000\022\024\n\020SERVICETY" +
"PE_L3NM\020\001\022\024\n\020SERVICETYPE_L2NM\020\002\022)\n%SERVI" +
"CETYPE_TAPI_CONNECTIVITY_SERVICE\020\003\022\022\n\016SE" +
"RVICETYPE_TE\020\004*\304\001\n\021ServiceStatusEnum\022\033\n\027" +
"SERVICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICESTAT" +
"US_PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022\032" +
"\n\026SERVICESTATUS_UPDATING\020\003\022!\n\035SERVICESTA" +
"TUS_PENDING_REMOVAL\020\004\022\036\n\032SERVICESTATUS_S" +
"LA_VIOLATED\020\005*\251\001\n\017SliceStatusEnum\022\031\n\025SLI" +
"CESTATUS_UNDEFINED\020\000\022\027\n\023SLICESTATUS_PLAN" +
"NED\020\001\022\024\n\020SLICESTATUS_INIT\020\002\022\026\n\022SLICESTAT" +
"US_ACTIVE\020\003\022\026\n\022SLICESTATUS_DEINIT\020\004\022\034\n\030S" +
"LICESTATUS_SLA_VIOLATED\020\005*]\n\020ConfigActio" +
"nEnum\022\032\n\026CONFIGACTION_UNDEFINED\020\000\022\024\n\020CON" +
"FIGACTION_SET\020\001\022\027\n\023CONFIGACTION_DELETE\020\002" +
"*m\n\024ConstraintActionEnum\022\036\n\032CONSTRAINTAC" +
"TION_UNDEFINED\020\000\022\030\n\024CONSTRAINTACTION_SET" +
"\020\001\022\033\n\027CONSTRAINTACTION_DELETE\020\002*\203\002\n\022Isol" +
"ationLevelEnum\022\020\n\014NO_ISOLATION\020\000\022\026\n\022PHYS" +
"ICAL_ISOLATION\020\001\022\025\n\021LOGICAL_ISOLATION\020\002\022" +
"\025\n\021PROCESS_ISOLATION\020\003\022\035\n\031PHYSICAL_MEMOR" +
"Y_ISOLATION\020\004\022\036\n\032PHYSICAL_NETWORK_ISOLAT" +
"ION\020\005\022\036\n\032VIRTUAL_RESOURCE_ISOLATION\020\006\022\037\n" +
"\033NETWORK_FUNCTIONS_ISOLATION\020\007\022\025\n\021SERVIC" +
"E_ISOLATION\020\0102\245\026\n\016ContextService\022:\n\016List" +
"ContextIds\022\016.context.Empty\032\026.context.Con" +
"textIdList\"\000\0226\n\014ListContexts\022\016.context.E" +
"mpty\032\024.context.ContextList\"\000\0224\n\nGetConte" +
"xt\022\022.context.ContextId\032\020.context.Context" +
"\"\000\0224\n\nSetContext\022\020.context.Context\032\022.con" +
"text.ContextId\"\000\0225\n\rRemoveContext\022\022.cont" +
"ext.ContextId\032\016.context.Empty\"\000\022=\n\020GetCo" +
"ntextEvents\022\016.context.Empty\032\025.context.Co" +
"ntextEvent\"\0000\001\022@\n\017ListTopologyIds\022\022.cont" +
"ext.ContextId\032\027.context.TopologyIdList\"\000" +
"\022=\n\016ListTopologies\022\022.context.ContextId\032\025" +
".context.TopologyList\"\000\0227\n\013GetTopology\022\023" +
".context.TopologyId\032\021.context.Topology\"\000" +
"\022E\n\022GetTopologyDetails\022\023.context.Topolog" +
"yId\032\030.context.TopologyDetails\"\000\0227\n\013SetTo" +
"pology\022\021.context.Topology\032\023.context.Topo" +
"logyId\"\000\0227\n\016RemoveTopology\022\023.context.Top" +
"ologyId\032\016.context.Empty\"\000\022?\n\021GetTopology" +
"Events\022\016.context.Empty\032\026.context.Topolog" +
"yEvent\"\0000\001\0228\n\rListDeviceIds\022\016.context.Em" +
"pty\032\025.context.DeviceIdList\"\000\0224\n\013ListDevi" +
"ces\022\016.context.Empty\032\023.context.DeviceList" +
"\"\000\0221\n\tGetDevice\022\021.context.DeviceId\032\017.con" +
"text.Device\"\000\0221\n\tSetDevice\022\017.context.Dev" +
"ice\032\021.context.DeviceId\"\000\0223\n\014RemoveDevice" +
"\022\021.context.DeviceId\032\016.context.Empty\"\000\022;\n" +
"\017GetDeviceEvents\022\016.context.Empty\032\024.conte" +
"xt.DeviceEvent\"\0000\001\022<\n\014SelectDevice\022\025.con" +
"text.DeviceFilter\032\023.context.DeviceList\"\000" +
"\022I\n\021ListEndPointNames\022\027.context.EndPoint" +
"IdList\032\031.context.EndPointNameList\"\000\0224\n\013L" +
"istLinkIds\022\016.context.Empty\032\023.context.Lin" +
"kIdList\"\000\0220\n\tListLinks\022\016.context.Empty\032\021" +
".context.LinkList\"\000\022+\n\007GetLink\022\017.context" +
".LinkId\032\r.context.Link\"\000\022+\n\007SetLink\022\r.co" +
"ntext.Link\032\017.context.LinkId\"\000\022/\n\nRemoveL" +
"ink\022\017.context.LinkId\032\016.context.Empty\"\000\0227" +
"\n\rGetLinkEvents\022\016.context.Empty\032\022.contex" +
"t.LinkEvent\"\0000\001\022>\n\016ListServiceIds\022\022.cont" +
"ext.ContextId\032\026.context.ServiceIdList\"\000\022" +
":\n\014ListServices\022\022.context.ContextId\032\024.co" +
"ntext.ServiceList\"\000\0224\n\nGetService\022\022.cont" +
"ext.ServiceId\032\020.context.Service\"\000\0224\n\nSet" +
"Service\022\020.context.Service\032\022.context.Serv" +
"iceId\"\000\0226\n\014UnsetService\022\020.context.Servic" +
"e\032\022.context.ServiceId\"\000\0225\n\rRemoveService" +
"\022\022.context.ServiceId\032\016.context.Empty\"\000\022=" +
"\n\020GetServiceEvents\022\016.context.Empty\032\025.con" +
"text.ServiceEvent\"\0000\001\022?\n\rSelectService\022\026" +
".context.ServiceFilter\032\024.context.Service" +
"List\"\000\022:\n\014ListSliceIds\022\022.context.Context" +
"Id\032\024.context.SliceIdList\"\000\0226\n\nListSlices" +
"\022\022.context.ContextId\032\022.context.SliceList" +
"\"\000\022.\n\010GetSlice\022\020.context.SliceId\032\016.conte" +
"xt.Slice\"\000\022.\n\010SetSlice\022\016.context.Slice\032\020" +
".context.SliceId\"\000\0220\n\nUnsetSlice\022\016.conte" +
"xt.Slice\032\020.context.SliceId\"\000\0221\n\013RemoveSl" +
"ice\022\020.context.SliceId\032\016.context.Empty\"\000\022" +
"9\n\016GetSliceEvents\022\016.context.Empty\032\023.cont" +
"ext.SliceEvent\"\0000\001\0229\n\013SelectSlice\022\024.cont" +
"ext.SliceFilter\032\022.context.SliceList\"\000\022D\n" +
"\021ListConnectionIds\022\022.context.ServiceId\032\031" +
".context.ConnectionIdList\"\000\022@\n\017ListConne" +
"ctions\022\022.context.ServiceId\032\027.context.Con" +
"nectionList\"\000\022=\n\rGetConnection\022\025.context" +
".ConnectionId\032\023.context.Connection\"\000\022=\n\r" +
"SetConnection\022\023.context.Connection\032\025.con" +
"text.ConnectionId\"\000\022;\n\020RemoveConnection\022" +
"\025.context.ConnectionId\032\016.context.Empty\"\000" +
"\022C\n\023GetConnectionEvents\022\016.context.Empty\032" +
"\030.context.ConnectionEvent\"\0000\001b\006proto3"
"\020\007\022 \n\034DEVICEDRIVER_GNMI_OPENCONFIG\020\010\022\032\n\026" +
"DEVICEDRIVER_FLEXSCALE\020\t\022\032\n\026DEVICEDRIVER" +
"_IETF_ACTN\020\n*\217\001\n\033DeviceOperationalStatus" +
"Enum\022%\n!DEVICEOPERATIONALSTATUS_UNDEFINE" +
"D\020\000\022$\n DEVICEOPERATIONALSTATUS_DISABLED\020" +
"\001\022#\n\037DEVICEOPERATIONALSTATUS_ENABLED\020\002*\252" +
"\001\n\017ServiceTypeEnum\022\027\n\023SERVICETYPE_UNKNOW" +
"N\020\000\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n\020SERVICETYPE" +
"_L2NM\020\002\022)\n%SERVICETYPE_TAPI_CONNECTIVITY" +
"_SERVICE\020\003\022\022\n\016SERVICETYPE_TE\020\004\022\023\n\017SERVIC" +
"ETYPE_E2E\020\005*\304\001\n\021ServiceStatusEnum\022\033\n\027SER" +
"VICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICESTATUS_" +
"PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022\032\n\026S" +
"ERVICESTATUS_UPDATING\020\003\022!\n\035SERVICESTATUS" +
"_PENDING_REMOVAL\020\004\022\036\n\032SERVICESTATUS_SLA_" +
"VIOLATED\020\005*\251\001\n\017SliceStatusEnum\022\031\n\025SLICES" +
"TATUS_UNDEFINED\020\000\022\027\n\023SLICESTATUS_PLANNED" +
"\020\001\022\024\n\020SLICESTATUS_INIT\020\002\022\026\n\022SLICESTATUS_" +
"ACTIVE\020\003\022\026\n\022SLICESTATUS_DEINIT\020\004\022\034\n\030SLIC" +
"ESTATUS_SLA_VIOLATED\020\005*]\n\020ConfigActionEn" +
"um\022\032\n\026CONFIGACTION_UNDEFINED\020\000\022\024\n\020CONFIG" +
"ACTION_SET\020\001\022\027\n\023CONFIGACTION_DELETE\020\002*m\n" +
"\024ConstraintActionEnum\022\036\n\032CONSTRAINTACTIO" +
"N_UNDEFINED\020\000\022\030\n\024CONSTRAINTACTION_SET\020\001\022" +
"\033\n\027CONSTRAINTACTION_DELETE\020\002*\203\002\n\022Isolati" +
"onLevelEnum\022\020\n\014NO_ISOLATION\020\000\022\026\n\022PHYSICA" +
"L_ISOLATION\020\001\022\025\n\021LOGICAL_ISOLATION\020\002\022\025\n\021" +
"PROCESS_ISOLATION\020\003\022\035\n\031PHYSICAL_MEMORY_I" +
"SOLATION\020\004\022\036\n\032PHYSICAL_NETWORK_ISOLATION" +
"\020\005\022\036\n\032VIRTUAL_RESOURCE_ISOLATION\020\006\022\037\n\033NE" +
"TWORK_FUNCTIONS_ISOLATION\020\007\022\025\n\021SERVICE_I" +
"SOLATION\020\0102\245\026\n\016ContextService\022:\n\016ListCon" +
"textIds\022\016.context.Empty\032\026.context.Contex" +
"tIdList\"\000\0226\n\014ListContexts\022\016.context.Empt" +
"y\032\024.context.ContextList\"\000\0224\n\nGetContext\022" +
"\022.context.ContextId\032\020.context.Context\"\000\022" +
"4\n\nSetContext\022\020.context.Context\032\022.contex" +
"t.ContextId\"\000\0225\n\rRemoveContext\022\022.context" +
".ContextId\032\016.context.Empty\"\000\022=\n\020GetConte" +
"xtEvents\022\016.context.Empty\032\025.context.Conte" +
"xtEvent\"\0000\001\022@\n\017ListTopologyIds\022\022.context" +
".ContextId\032\027.context.TopologyIdList\"\000\022=\n" +
"\016ListTopologies\022\022.context.ContextId\032\025.co" +
"ntext.TopologyList\"\000\0227\n\013GetTopology\022\023.co" +
"ntext.TopologyId\032\021.context.Topology\"\000\022E\n" +
"\022GetTopologyDetails\022\023.context.TopologyId" +
"\032\030.context.TopologyDetails\"\000\0227\n\013SetTopol" +
"ogy\022\021.context.Topology\032\023.context.Topolog" +
"yId\"\000\0227\n\016RemoveTopology\022\023.context.Topolo" +
"gyId\032\016.context.Empty\"\000\022?\n\021GetTopologyEve" +
"nts\022\016.context.Empty\032\026.context.TopologyEv" +
"ent\"\0000\001\0228\n\rListDeviceIds\022\016.context.Empty" +
"\032\025.context.DeviceIdList\"\000\0224\n\013ListDevices" +
"\022\016.context.Empty\032\023.context.DeviceList\"\000\022" +
"1\n\tGetDevice\022\021.context.DeviceId\032\017.contex" +
"t.Device\"\000\0221\n\tSetDevice\022\017.context.Device" +
"\032\021.context.DeviceId\"\000\0223\n\014RemoveDevice\022\021." +
"context.DeviceId\032\016.context.Empty\"\000\022;\n\017Ge" +
"tDeviceEvents\022\016.context.Empty\032\024.context." +
"DeviceEvent\"\0000\001\022<\n\014SelectDevice\022\025.contex" +
"t.DeviceFilter\032\023.context.DeviceList\"\000\022I\n" +
"\021ListEndPointNames\022\027.context.EndPointIdL" +
"ist\032\031.context.EndPointNameList\"\000\0224\n\013List" +
"LinkIds\022\016.context.Empty\032\023.context.LinkId" +
"List\"\000\0220\n\tListLinks\022\016.context.Empty\032\021.co" +
"ntext.LinkList\"\000\022+\n\007GetLink\022\017.context.Li" +
"nkId\032\r.context.Link\"\000\022+\n\007SetLink\022\r.conte" +
"xt.Link\032\017.context.LinkId\"\000\022/\n\nRemoveLink" +
"\022\017.context.LinkId\032\016.context.Empty\"\000\0227\n\rG" +
"etLinkEvents\022\016.context.Empty\032\022.context.L" +
"inkEvent\"\0000\001\022>\n\016ListServiceIds\022\022.context" +
".ContextId\032\026.context.ServiceIdList\"\000\022:\n\014" +
"ListServices\022\022.context.ContextId\032\024.conte" +
"xt.ServiceList\"\000\0224\n\nGetService\022\022.context" +
".ServiceId\032\020.context.Service\"\000\0224\n\nSetSer" +
"vice\022\020.context.Service\032\022.context.Service" +
"Id\"\000\0226\n\014UnsetService\022\020.context.Service\032\022" +
".context.ServiceId\"\000\0225\n\rRemoveService\022\022." +
"context.ServiceId\032\016.context.Empty\"\000\022=\n\020G" +
"etServiceEvents\022\016.context.Empty\032\025.contex" +
"t.ServiceEvent\"\0000\001\022?\n\rSelectService\022\026.co" +
"ntext.ServiceFilter\032\024.context.ServiceLis" +
"t\"\000\022:\n\014ListSliceIds\022\022.context.ContextId\032" +
"\024.context.SliceIdList\"\000\0226\n\nListSlices\022\022." +
"context.ContextId\032\022.context.SliceList\"\000\022" +
".\n\010GetSlice\022\020.context.SliceId\032\016.context." +
"Slice\"\000\022.\n\010SetSlice\022\016.context.Slice\032\020.co" +
"ntext.SliceId\"\000\0220\n\nUnsetSlice\022\016.context." +
"Slice\032\020.context.SliceId\"\000\0221\n\013RemoveSlice" +
"\022\020.context.SliceId\032\016.context.Empty\"\000\0229\n\016" +
"GetSliceEvents\022\016.context.Empty\032\023.context" +
".SliceEvent\"\0000\001\0229\n\013SelectSlice\022\024.context" +
".SliceFilter\032\022.context.SliceList\"\000\022D\n\021Li" +
"stConnectionIds\022\022.context.ServiceId\032\031.co" +
"ntext.ConnectionIdList\"\000\022@\n\017ListConnecti" +
"ons\022\022.context.ServiceId\032\027.context.Connec" +
"tionList\"\000\022=\n\rGetConnection\022\025.context.Co" +
"nnectionId\032\023.context.Connection\"\000\022=\n\rSet" +
"Connection\022\023.context.Connection\032\025.contex" +
"t.ConnectionId\"\000\022;\n\020RemoveConnection\022\025.c" +
"ontext.ConnectionId\032\016.context.Empty\"\000\022C\n" +
"\023GetConnectionEvents\022\016.context.Empty\032\030.c" +
"ontext.ConnectionEvent\"\0000\001b\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
......@@ -3,8 +3,8 @@ apiVersion: v1
kind: Service
metadata:
annotations:
app.quarkus.io/commit-id: 46486023929121fc955e9550fc8fd625ded433d2
app.quarkus.io/build-timestamp: 2023-12-15 - 11:56:20 +0000
app.quarkus.io/commit-id: 5f8866be9cb91871607627819258b0b375410467
app.quarkus.io/build-timestamp: 2024-01-26 - 16:40:15 +0000
prometheus.io/scrape: "true"
prometheus.io/path: /q/metrics
prometheus.io/port: "8080"
......@@ -15,12 +15,12 @@ metadata:
name: policyservice
spec:
ports:
- name: grpc-server
port: 6060
targetPort: 6060
- name: http
port: 9192
targetPort: 8080
- name: grpc-server
port: 6060
targetPort: 6060
selector:
app.kubernetes.io/name: policyservice
type: ClusterIP
......@@ -29,8 +29,8 @@ apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
app.quarkus.io/commit-id: 46486023929121fc955e9550fc8fd625ded433d2
app.quarkus.io/build-timestamp: 2023-12-15 - 11:56:20 +0000
app.quarkus.io/commit-id: 5f8866be9cb91871607627819258b0b375410467
app.quarkus.io/build-timestamp: 2024-01-26 - 16:40:15 +0000
prometheus.io/scrape: "true"
prometheus.io/path: /q/metrics
prometheus.io/port: "8080"
......@@ -47,8 +47,8 @@ spec:
template:
metadata:
annotations:
app.quarkus.io/commit-id: 46486023929121fc955e9550fc8fd625ded433d2
app.quarkus.io/build-timestamp: 2023-12-15 - 11:56:20 +0000
app.quarkus.io/commit-id: 5f8866be9cb91871607627819258b0b375410467
app.quarkus.io/build-timestamp: 2024-01-26 - 16:40:15 +0000
prometheus.io/scrape: "true"
prometheus.io/path: /q/metrics
prometheus.io/port: "8080"
......@@ -63,12 +63,12 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CONTEXT_SERVICE_HOST
value: contextservice
- name: MONITORING_SERVICE_HOST
value: monitoringservice
- name: SERVICE_SERVICE_HOST
value: serviceservice
- name: MONITORING_SERVICE_HOST
value: monitoringservice
- name: CONTEXT_SERVICE_HOST
value: contextservice
image: labs.etsi.org:5050/tfs/controller/policy:0.1.0
imagePullPolicy: Always
livenessProbe:
......@@ -83,12 +83,12 @@ spec:
timeoutSeconds: 10
name: policyservice
ports:
- containerPort: 6060
name: grpc-server
protocol: TCP
- containerPort: 8080
name: http
protocol: TCP
- containerPort: 6060
name: grpc-server
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
......
......@@ -15,6 +15,7 @@
anytree==2.8.0
geopy==2.3.0
netaddr==0.9.0
networkx==2.6.3
pydot==1.4.2
redis==4.1.2
......@@ -39,6 +39,7 @@ DEVICE_DRIVER_VALUES = {
DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN,
DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG,
DeviceDriverEnum.DEVICEDRIVER_FLEXSCALE,
DeviceDriverEnum.DEVICEDRIVER_IETF_ACTN,
}
# Map allowed filter fields to allowed values per Filter field. If no restriction (free text) None is specified
......
......@@ -20,6 +20,7 @@ from .l2nm_openconfig.L2NMOpenConfigServiceHandler import L2NMOpenConfigServiceH
from .l3nm_emulated.L3NMEmulatedServiceHandler import L3NMEmulatedServiceHandler
from .l3nm_openconfig.L3NMOpenConfigServiceHandler import L3NMOpenConfigServiceHandler
from .l3nm_gnmi_openconfig.L3NMGnmiOpenConfigServiceHandler import L3NMGnmiOpenConfigServiceHandler
from .l3nm_ietf_actn.L3NMIetfActnServiceHandler import L3NMIetfActnServiceHandler
from .microwave.MicrowaveServiceHandler import MicrowaveServiceHandler
from .p4.p4_service_handler import P4ServiceHandler
from .tapi_tapi.TapiServiceHandler import TapiServiceHandler
......@@ -57,6 +58,12 @@ SERVICE_HANDLERS = [
FilterFieldEnum.DEVICE_DRIVER : DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG,
}
]),
(L3NMIetfActnServiceHandler, [
{
FilterFieldEnum.SERVICE_TYPE : ServiceTypeEnum.SERVICETYPE_L3NM,
FilterFieldEnum.DEVICE_DRIVER : DeviceDriverEnum.DEVICEDRIVER_IETF_ACTN,
}
]),
(TapiServiceHandler, [
{
FilterFieldEnum.SERVICE_TYPE : ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE,
......
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
# These hardcoded values will be updated with proper logic in second phase of the PoC
VPN_VLAN_TAGS_TO_SERVICE_NAME = {
(21, 101): ('osu_tunnel_1', 'etht_service_1'),
(31, 201): ('osu_tunnel_2', 'etht_service_2'),
}
OSU_TUNNEL_SETTINGS = {
'osu_tunnel_1': {
'odu_type': 'osuflex',
'osuflex_number': 40,
'bidirectional': True,
'delay': 20,
'ttp_channel_names': {
('10.0.10.1', '200'): 'och:1-odu2:1-oduflex:1-osuflex:2',
('10.0.30.1', '200'): 'och:1-odu2:1-oduflex:3-osuflex:1',
}
},
'osu_tunnel_2': {
'odu_type': 'osuflex',
'osuflex_number': 40,
'bidirectional': True,
'delay': 20,
'ttp_channel_names': {
('10.0.10.1', '200'): 'och:1-odu2:1-oduflex:1-osuflex:2',
('10.0.30.1', '200'): 'och:1-odu2:1-oduflex:3-osuflex:1',
}
},
}
ETHT_SERVICE_SETTINGS = {
'etht_service_1': {
'service_type': 'op-mp2mp-svc',
},
'etht_service_2': {
'service_type': 'op-mp2mp-svc',
},
}
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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 diff is collapsed.
This diff is collapsed.
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
FROM python:3.9-slim
# Set Python to show logs as they occur
ENV PYTHONUNBUFFERED=0
# Get generic Python packages
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --upgrade setuptools wheel
RUN python3 -m pip install --upgrade pip-tools
# Create component sub-folders, and copy content
RUN mkdir -p /var/teraflow/mock_ietf_actn_sdn_ctrl
WORKDIR /var/teraflow/mock_ietf_actn_sdn_ctrl
COPY . .
# Get specific Python packages
RUN pip-compile --quiet --output-file=requirements.txt requirements.in
RUN python3 -m pip install -r requirements.txt
RUN python3 -m pip list
# Start the service
ENTRYPOINT ["python", "MockIetfActnSdnCtrl.py"]
This diff is collapsed.