# ============LICENSE_START===============================================
-# Copyright (C) 2020 Nordix Foundation. All rights reserved.
+# Copyright (C) 2021 Nordix Foundation. All rights reserved.
# ========================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
from pathlib import Path
from flask import Flask, escape, request, Response, jsonify
from jsonschema import validate
-from var_declaration import policy_instances, policy_types, policy_status, policy_fingerprint, forced_settings, hosts_set
+from var_declaration import policy_instances, policy_types, policy_status, policy_fingerprint, forced_settings, hosts_set, app
from maincommon import check_apipath, apipath, get_supported_interfaces_response, extract_host_name
from time import sleep
check_apipath()
-app = connexion.FlaskApp(__name__, specification_dir=apipath)
+# app is created in var_declarations
+
+import payload_logging # app var need to be initialized
#Check alive function
@app.route('/', methods=['GET'])
elif (countername == "remote_hosts"):
hosts=",".join(hosts_set)
return str(hosts),200
+ elif (countername == "datadelivery"):
+ return Response(str(0),200, mimetype=TEXT_PLAIN)
else:
return Response("Counter name: "+countername+" not found.",404, mimetype=TEXT_PLAIN)