diff --git a/bootstrap.py b/bootstrap.py index ba099a0..0291566 100644 --- a/bootstrap.py +++ b/bootstrap.py @@ -46,37 +46,39 @@ api.add_resource(IdfGenerator, '/v1.4/energy-plus/idf-generator') # workflows api.add_resource(Costs, '/v1.4/workflow/costs') api.add_resource(EnergyPlus, '/v1.4/workflow/energy-plus') -api.add_resource(InselMonthlyEnergyBalance, '/v1.4/workflow/insel-monthly-energy-balance') +api.add_resource(InselMonthlyEnergyBalance, + '/v1.4/workflow/insel-monthly-energy-balance') -yml_path = Path('./docs/openapi-specs.yml').resolve() +yml_path = Path('./hub/docs/openapi-specs.yml').resolve() with open(yml_path, "r") as stream: - swagger_config = { - "headers": [], - "specs": [ - { - "endpoint": '/api/apispec', - "route": '/api/apispec/apispec.json', - "rule_filter": lambda rule: True, # all in - "model_filter": lambda tag: True, # all in - } - ], - "static_url_path": "/api/static", - "specs_route": "/api/api-docs/", - "openapi": "3.0.0" - } - try: - Swagger(app, template=yaml.safe_load(stream), config=swagger_config) - except yaml.YAMLError as exc: - print(f'error: {exc}') + swagger_config = { + "headers": [], + "specs": [ + { + "endpoint": '/api/apispec', + "route": '/api/apispec/apispec.json', + "rule_filter": lambda rule: True, # all in + "model_filter": lambda tag: True, # all in + } + ], + "static_url_path": "/api/static", + "specs_route": "/api/api-docs/", + "openapi": "3.0.0" + } + try: + Swagger(app, template=yaml.safe_load(stream), config=swagger_config) + except yaml.YAMLError as exc: + print(f'error: {exc}') @app.route("/") def home(): - return Response(headers={'Access-Control-Allow-Origin': '*'}) + return Response(headers={'Access-Control-Allow-Origin': '*'}) sh.debug_mode = True -threading.Thread(target=sh.expired_sessions_collector, daemon=True, args="5").start() +threading.Thread(target=sh.expired_sessions_collector, + daemon=True, args="5").start() app.run(port=15789, host="0.0.0.0", debug=sh.debug_mode) diff --git a/configs/control.json b/configs/control.json new file mode 100644 index 0000000..3e843b6 --- /dev/null +++ b/configs/control.json @@ -0,0 +1,28 @@ +{ + "serviceName": "session", + "dotenv": ".env", + "environment": "prod", + "httpRequestDefinitions": { + "sessionStart": { + "put": { + "username": "", + "password": "", + "appUUID": "" + } + }, + "sessionEnd": { + "put": { + "sessionID": "", + "token": "", + "appUUID": "" + } + }, + "keepSessionAlive": { + "put": { + "sessionID": "", + "token": "", + "appUUID": "" + } + } + } +} \ No newline at end of file diff --git a/hub_api/control/__pycache__/session.cpython-39.pyc b/hub_api/control/__pycache__/session.cpython-39.pyc new file mode 100644 index 0000000..50c02c3 Binary files /dev/null and b/hub_api/control/__pycache__/session.cpython-39.pyc differ diff --git a/hub_api/control/__pycache__/uptime.cpython-39.pyc b/hub_api/control/__pycache__/uptime.cpython-39.pyc new file mode 100644 index 0000000..0a32e27 Binary files /dev/null and b/hub_api/control/__pycache__/uptime.cpython-39.pyc differ diff --git a/hub_api/helpers/__pycache__/session_helper.cpython-39.pyc b/hub_api/helpers/__pycache__/session_helper.cpython-39.pyc new file mode 100644 index 0000000..a48d787 Binary files /dev/null and b/hub_api/helpers/__pycache__/session_helper.cpython-39.pyc differ diff --git a/hub_api/persistence/__pycache__/retrofit_results.cpython-39.pyc b/hub_api/persistence/__pycache__/retrofit_results.cpython-39.pyc new file mode 100644 index 0000000..5168fd5 Binary files /dev/null and b/hub_api/persistence/__pycache__/retrofit_results.cpython-39.pyc differ diff --git a/requirements.txt b/requirements.txt index e99d08f..12854d3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -27,4 +27,5 @@ flasgger cerc-hub python-dotenv mapbox_earcut -cerc-costs \ No newline at end of file +cerc-costs +cerc-co2-emission \ No newline at end of file