From fde03662bea3fa4edcc83d6443fc1972f876ed8f Mon Sep 17 00:00:00 2001 From: Anh H Nguyen Date: Tue, 26 Sep 2023 16:44:42 -0400 Subject: [PATCH] Add pip package, fix docs path --- bootstrap.py | 46 +++++++++--------- configs/control.json | 28 +++++++++++ .../__pycache__/session.cpython-39.pyc | Bin 0 -> 3146 bytes .../control/__pycache__/uptime.cpython-39.pyc | Bin 0 -> 981 bytes .../__pycache__/session_helper.cpython-39.pyc | Bin 0 -> 2198 bytes .../retrofit_results.cpython-39.pyc | Bin 0 -> 3959 bytes requirements.txt | 3 +- 7 files changed, 54 insertions(+), 23 deletions(-) create mode 100644 configs/control.json create mode 100644 hub_api/control/__pycache__/session.cpython-39.pyc create mode 100644 hub_api/control/__pycache__/uptime.cpython-39.pyc create mode 100644 hub_api/helpers/__pycache__/session_helper.cpython-39.pyc create mode 100644 hub_api/persistence/__pycache__/retrofit_results.cpython-39.pyc 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 0000000000000000000000000000000000000000..50c02c31d4788d7b5ac4e91e89107df95c117d07 GIT binary patch literal 3146 zcmb_ePj4K>67QaWJ3BkOb{xkcJcL$&fDOtzgj@)D$azl0i(;7w6aI{ZMw98bJ~Pf~Q^5|GGAoN<=kCp~`j`4!S;`B^LA%X(p|ahKi);O@PwsAk>4V{A zkfrEf$`i#!uvtzXiEM9Q^?!cazjFD?mHu5(j(Dp2H!8Ic^NM85`+HTE=Uj}-;a;U+ zIl&Lcr6?8ONXsHE1K zt$Tux%ZEIc^&zz1C{iy8zAL!gpAV(D`r^-SI`S=0IDwRq$ohfon$$e@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OCR5BTjrCp zhLd00@-mt;hc3D?Uq(#j!v+>-npfg9X$?Ne_tF2~?N5`$HfGP={-FZnd)6!a1Sw+A z(b@GSy$q(6J0S>q`zAtO2m8sH&4JAXK0J28d2ReP-1u433vf+T^XG~qxZ@njELD}y zShXp+%4ND)s^Q$k8-2qzE$YK0%@xn2g|R^a(ObgvuC{1brT&K$Gdc24;1o6clX!wj=HDLO>s|edR-ELEZ78)Znt^TtZF|hprQ>M2QYR2v5q8^4!#9=5u z)XNP8v%04RTQqifFG)>KL>_z=^?F=}P(lR literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..5168fd53ccb31e0528dcb09ae7af9bc2a53053d7 GIT binary patch literal 3959 zcmaJ^-ESMm5#ReFkKYt2>&te`d^&VuNtW#^A8`;Kr>V4hRmX+ogEY@s8fx zQzGIB6p(=cMGYA3V^u(U%zx77KJ;N<`p~}QFDTF=KxdA}6Gg`%!QsqrXLe_Hc4v2; zTCGgr)4EY%e_AHwUntCe3=lqnUo-+j2~~Vz;lJuD1JzOonx!cyYrZ}(EF6X;3;-_dgh9{S zgC2?zOF`M-tjAf@w=)1cx*vN!^@2SY$D93VnGn4N3?r68iKTu+dJ0vj`pmR6s!{zJ zvGi|&6TfT-A01mC9`PEufNn(S6j4SibIz|%eYg+vJ7v^tA*>Y;O~>m{b9+!wfEnOUXh~qKnVf{iShBEGG-c%Kpl@owVqs zr1Tf^S9O)pC77wj3&=7cmo6YHfGk}=RsmVQfUH5Zv;AJ4ldsIlSLfu{=HzR0atGu^ z`uZw4T|GnYjhuTk=ibV>w{z~DoV%WL@8(>0!qFQir3>D_2Q%}2rge$l%(?ZP+sL`i zoVzvQ=+=pmEYsT=zD)1r+}%v$Cnws4@jig@KFqY1=tnvC)13QRX1RT$(Vw5xAln~r zlcWv*zt|>E|NZnIuU@U)Pe#8kci?mH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