Loading src/common/tools/rest_conf/client/RestConfClient.py +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ class RestConfClient(RestApiClient): def __init__( self, address : str, port : int = 8080, scheme : str = 'http', username : Optional[str] = None, password : Optional[str] = None, restconf_version : Optional[str] = None, timeout : int = 30, verify_certs : bool = True, allow_redirects : bool = True, logger : Optional[logging.Logger] = None ) -> None: Loading @@ -34,6 +35,8 @@ class RestConfClient(RestApiClient): ) self._discover_base_url() if restconf_version is not None: self._base_url += '/{:s}'.format(restconf_version) def _discover_base_url(self) -> None: Loading src/common/tools/rest_conf/server/restconf_server/RestConfServerApplication.py +16 −1 Original line number Diff line number Diff line Loading @@ -14,8 +14,9 @@ import json, logging, time from typing import Any, Dict, Tuple, Type from flask import Flask, request from flask_restful import Api from flask_restful import Api, Resource from .Callbacks import CallbackDispatcher from .Config import RESTCONF_PREFIX, SECRET_KEY, STARTUP_FILE, YANG_SEARCH_PATH from .DispatchData import RestConfDispatchData Loading Loading @@ -82,6 +83,20 @@ class RestConfServerApplication: resource_class_args=(self._yang_handler, self._callback_dispatcher) ) def register_custom( self, resource_class : Type[Resource], *urls : str, add_prefix_to_urls : bool = True, resource_class_args : Tuple[Any, ...] = tuple(), resource_class_kwargs : Dict[str, Any] = dict() ) -> None: if add_prefix_to_urls: urls = [RESTCONF_PREFIX + u for u in urls] self._api.add_resource( resource_class, *urls, resource_class_args=resource_class_args, resource_class_kwargs=resource_class_kwargs ) def get_flask_app(self) -> Flask: return self._app Loading Loading
src/common/tools/rest_conf/client/RestConfClient.py +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ class RestConfClient(RestApiClient): def __init__( self, address : str, port : int = 8080, scheme : str = 'http', username : Optional[str] = None, password : Optional[str] = None, restconf_version : Optional[str] = None, timeout : int = 30, verify_certs : bool = True, allow_redirects : bool = True, logger : Optional[logging.Logger] = None ) -> None: Loading @@ -34,6 +35,8 @@ class RestConfClient(RestApiClient): ) self._discover_base_url() if restconf_version is not None: self._base_url += '/{:s}'.format(restconf_version) def _discover_base_url(self) -> None: Loading
src/common/tools/rest_conf/server/restconf_server/RestConfServerApplication.py +16 −1 Original line number Diff line number Diff line Loading @@ -14,8 +14,9 @@ import json, logging, time from typing import Any, Dict, Tuple, Type from flask import Flask, request from flask_restful import Api from flask_restful import Api, Resource from .Callbacks import CallbackDispatcher from .Config import RESTCONF_PREFIX, SECRET_KEY, STARTUP_FILE, YANG_SEARCH_PATH from .DispatchData import RestConfDispatchData Loading Loading @@ -82,6 +83,20 @@ class RestConfServerApplication: resource_class_args=(self._yang_handler, self._callback_dispatcher) ) def register_custom( self, resource_class : Type[Resource], *urls : str, add_prefix_to_urls : bool = True, resource_class_args : Tuple[Any, ...] = tuple(), resource_class_kwargs : Dict[str, Any] = dict() ) -> None: if add_prefix_to_urls: urls = [RESTCONF_PREFIX + u for u in urls] self._api.add_resource( resource_class, *urls, resource_class_args=resource_class_args, resource_class_kwargs=resource_class_kwargs ) def get_flask_app(self) -> Flask: return self._app Loading