Commit a21008c9 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Device - IETF ACTN Driver:

- Add mgmt endpoint by default
parent 3ab5419e
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ import json, logging, requests, threading
from typing import Any, Iterator, List, Optional, Tuple, Union
from common.method_wrappers.Decorator import MetricsPool, metered_subclass_method
from common.type_checkers.Checkers import chk_string, chk_type
from device.service.driver_api._Driver import _Driver, RESOURCE_SERVICES
from device.service.driver_api._Driver import _Driver, RESOURCE_ENDPOINTS, RESOURCE_SERVICES
from .handlers.EthtServiceHandler import EthtServiceHandler
from .handlers.OsuTunnelHandler import OsuTunnelHandler
from .handlers.RestApiClient import RestApiClient
@@ -25,6 +25,7 @@ from .Tools import get_etht_services, get_osu_tunnels, parse_resource_key
LOGGER = logging.getLogger(__name__)

ALL_RESOURCE_KEYS = [
    RESOURCE_ENDPOINTS,
    RESOURCE_SERVICES,
]

@@ -78,7 +79,12 @@ class IetfActnDriver(_Driver):
                try:
                    _results = list()

                    if resource_key == RESOURCE_SERVICES:
                    if resource_key == RESOURCE_ENDPOINTS:
                        # Add mgmt endpoint by default
                        resource_key = '/endpoints/endpoint[mgmt]'
                        resource_value = {'uuid': 'mgmt', 'name': 'mgmt', 'type': 'mgmt'}
                        results.append((resource_key, resource_value))
                    elif resource_key == RESOURCE_SERVICES:
                        get_osu_tunnels(self._handler_osu_tunnel, _results)
                        get_etht_services(self._handler_etht_service, _results)
                    else: