__init__.py
2.1 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# coding=utf-8
# author: 4N
#createtime: 2021/5/18
#email: nheweijun@sina.com
from flasgger import swag_from
from flask import Blueprint
from app.util import BlueprintApi
from . import monitor_info, monitoring, metrics, monitor_host_create, monitor_host_list, monitor_host_delete, monitor_host_edit
user_socket_list = []
user_socket_dict = {}
class Monitor(BlueprintApi):
bp = Blueprint("Monitor", __name__, url_prefix="/API/Monitor")
@staticmethod
@bp.route('/Info', methods=['GET'])
@swag_from(monitor_info.Api.api_doc)
def monitor_info():
"""
性能监控
"""
return monitor_info.Api().result
@staticmethod
@bp.route('/baseMonitoring', methods=['GET'])
@swag_from(monitoring.Api.api_doc)
def monitoring():
"""
基础监控
"""
return monitoring.Api().result
@staticmethod
@bp.route('/metrics', methods=['GET'])
@swag_from(metrics.Api.api_doc)
def metrics():
'''
指标统计
'''
return metrics.Api().result
@staticmethod
@bp.route('/RegisterHost', methods=['POST'])
@swag_from(monitor_host_create.Api.api_doc)
def monitor_host_create():
'''
注册监控主机
'''
return monitor_host_create.Api().result
@staticmethod
@bp.route('/HostList', methods=['GET'])
@swag_from(monitor_host_list.Api.api_doc)
def monitor_host_list():
'''
获取监控主机列表
'''
return monitor_host_list.Api().result
@staticmethod
@bp.route('/HostDelete', methods=['POST'])
@swag_from(monitor_host_delete.Api.api_doc)
def monitor_host_delete():
'''
删除主机
'''
return monitor_host_delete.Api().result
@staticmethod
@bp.route('/HostEdit', methods=['POST'])
@swag_from(monitor_host_edit.Api.api_doc)
def monitor_host_edit():
'''
编辑主机配置
'''
return monitor_host_edit.Api().result