-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathControllerREST.py
More file actions
30 lines (25 loc) · 855 Bytes
/
ControllerREST.py
File metadata and controls
30 lines (25 loc) · 855 Bytes
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
from flask import Flask, jsonify, request
import vManageAlarms
import vManageHealth
import DnacHealth
import DnacAppHealth
import vManageNWPI_readTrace
import DnacAlarms
app = Flask(__name__)
@app.route('/data', methods=['GET'])
def get_data():
"""Return data about the devices. A sample return data for this function is provided in demodbdata.py
parameters: None
returns: JSON
"""
data = {
"vManageHealth": vManageHealth.get_data(),
"DnacHealth" : DnacHealth.get_data(),
"vManageNWPI_readTrace" : vManageNWPI_readTrace.get_data(),
"DnacAppHealth": DnacAppHealth.get_data(),
"vManageAlarms": vManageAlarms.get_data(),
"DnacAlarms": DnacAlarms.get_data()
}
return jsonify({'data': data})
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5555, debug=True)