Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
Loading
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment