Commit 9621bb8a authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Tests - Tools - SIMAP DataStore:

- Update SIMAP server configuration to support InfluxDB connection and refactor app.py
parent 9e70006f
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -13,13 +13,7 @@
# limitations under the License.


import os, secrets


RESTCONF_PREFIX  = os.environ.get('RESTCONF_PREFIX',  '/restconf'     )
YANG_SEARCH_PATH = os.environ.get('YANG_SEARCH_PATH', './yang'        )
STARTUP_FILE     = os.environ.get('STARTUP_FILE',     './startup.json')
SECRET_KEY       = os.environ.get('SECRET_KEY',       secrets.token_hex(64))
import os

# InfluxDB Configuration
INFLUXDB_HOST     = os.environ.get('INFLUXDB_HOST',     'localhost'      )
+7 −4
Original line number Diff line number Diff line
@@ -13,11 +13,14 @@
# limitations under the License.


from ......tests.tools.simap_datastore.simap_datastore.callbacks import CallbackOnLinkTelemetry, CallbackOnNodeTelemetry
from .Config import INFLUXDB_HOST, INFLUXDB_PORT, INFLUXDB_TOKEN, INFLUXDB_DATABASE
from ......tests.tools.simap_datastore.simap_datastore.influxdb_client import SimapInfluxDBClient
from .RestConfServerApplication import RestConfServerApplication
# This file overwrites default RestConf Server `app.py` file.


import logging
from common.tools.rest_conf.server.restconf_server.RestConfServerApplication import RestConfServerApplication
from .TelemetryCallbacks import CallbackOnLinkTelemetry, CallbackOnNodeTelemetry
from .Config import INFLUXDB_HOST, INFLUXDB_PORT, INFLUXDB_TOKEN, INFLUXDB_DATABASE
from .influxdb_client import SimapInfluxDBClient


logging.basicConfig(