Commit f424819b authored by Pablo Armingol's avatar Pablo Armingol
Browse files

feat: Enhance L3VPN service template generation with dynamic site...

feat: Enhance L3VPN service template generation with dynamic site configurations, QoS, and static routing, and improve endpoint name extraction.
parent 884f9ed8
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -190,10 +190,15 @@ class IetfL3VpnDriver(_Driver):
        if len(resources) == 0: return results
        with self.__lock:
            if 'ipowdm' in str(resources):
                # Build controller URL from device address and port
                scheme = self.settings.get('scheme', 'http')
                controller_url = f"{scheme}://{self.address}:{self.port}"
                LOGGER.info("IPoWDM: Using controller URL: %s", controller_url)

                for resource in resources:
                    if 'ipowdm' in str(resource):
                        try:
                            create_request(resource)
                            create_request(resource, controller_url)
                            LOGGER.info('Request created successfully')
                            results.append((resource, True))
                        except Exception as e:
+3 −2
Original line number Diff line number Diff line
@@ -144,7 +144,8 @@ class TfsApiClient(RestApiClient):
                cr_rk : str = cr['custom']['resource_key']
                if not cr_rk.startswith('/endpoints/endpoint['): continue
                settings = json.loads(cr['custom']['resource_value'])
                ep_name = settings['name']
                ep_name = settings.get('name', settings.get('uuid'))
                if ep_name:
                    config_rule_dict[ep_name] = settings

            for json_endpoint in json_device['device_endpoints']:
+352 −259

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@

import logging, requests
from typing import Dict, List, Optional
from common.tools.client.RestClient import RestClient
from common.tools.rest_api.client.RestApiClient import RestApiClient
from device.service.driver_api.ImportTopologyEnum import ImportTopologyEnum

GET_CONTEXT_IDS_URL = '/tfs-api/context_ids'
@@ -51,7 +51,7 @@ MAPPING_DRIVER = {

LOGGER = logging.getLogger(__name__)

class TfsApiClient(RestClient):
class TfsApiClient(RestApiClient):
    def __init__(
        self, address : str, port : int, scheme : str = 'http',
        username : Optional[str] = None, password : Optional[str] = None,