-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
32 lines (28 loc) · 987 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from flask import Flask
from utils import register_app_blueprints, update_app_celery_config, initialize_celery, update_app_apispec_config,\
initialize_apispec, register_apispec_methods, remove_options_from_apispec
from api import pc, get_cpu_history, get_ram_history, get_free_space, get_external_ip,\
exchange, get_rates, node, get_logs, get_message_logs, get_uptime
app = Flask(__name__)
app = register_app_blueprints(
app,
[pc, exchange, node]
)
app = update_app_celery_config(app)
celery = initialize_celery(
app
)
app = update_app_apispec_config(app)
apispec = initialize_apispec(app)
docs_methods = {
'pc': [get_cpu_history, get_ram_history, get_free_space, get_external_ip],
'exchange': [get_rates],
'node': [get_logs, get_message_logs, get_uptime]
}
for blueprint, methods in docs_methods.items():
apispec = register_apispec_methods(
apispec,
methods,
blueprint
)
apispec = remove_options_from_apispec(apispec)