Skip to content
Snippets Groups Projects

Resolve "Add setting ImportTopology to IETF L2VPN SBI"

2 files
+ 49
5
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -19,6 +19,7 @@ from common.tools.object_factory.Device import json_device_id
from common.tools.object_factory.EndPoint import json_endpoint_id
from common.type_checkers.Checkers import chk_string, chk_type
from device.service.driver_api._Driver import _Driver, RESOURCE_ENDPOINTS, RESOURCE_SERVICES
from device.service.driver_api.ImportTopologyEnum import ImportTopologyEnum, get_import_topology
from device.service.drivers.ietf_l2vpn.TfsDebugApiClient import TfsDebugApiClient
from .Tools import connection_point, wim_mapping
from .WimconnectorIETFL2VPN import WimconnectorIETFL2VPN
@@ -59,6 +60,14 @@ class IetfL2VpnDriver(_Driver):
self.wim = WimconnectorIETFL2VPN(wim, wim_account, config=config)
self.conn_info = {} # internal database emulating OSM storage provided to WIM Connectors
# Options are:
# disabled --> just import endpoints as usual
# devices --> imports sub-devices but not links connecting them.
# (a remotely-controlled transport domain might exist between them)
# topology --> imports sub-devices and links connecting them.
# (not supported by XR driver)
self.__import_topology = get_import_topology(self.settings, default=ImportTopologyEnum.DEVICES)
def Connect(self) -> bool:
with self.__lock:
try:
@@ -93,7 +102,7 @@ class IetfL2VpnDriver(_Driver):
chk_string(str_resource_name, resource_key, allow_empty=False)
if resource_key == RESOURCE_ENDPOINTS:
# return endpoints through debug-api and list-devices method
results.extend(self.dac.get_devices_endpoints())
results.extend(self.dac.get_devices_endpoints(self.__import_topology))
elif resource_key == RESOURCE_SERVICES:
# return all services through
reply = self.wim.get_all_active_connectivity_services()
Loading