...
|
...
|
@@ -10,12 +10,12 @@ class Api(ApiTemplate): |
10
|
10
|
def para_check(self):
|
11
|
11
|
if not self.para.get("host"):
|
12
|
12
|
raise Exception("缺乏host参数")
|
13
|
|
- if not self.para.get("user"):
|
14
|
|
- raise Exception("缺乏user参数")
|
15
|
|
- if not self.para.get("type"):
|
16
|
|
- raise Exception("缺乏type参数")
|
17
|
|
- if not self.para.get("passwd"):
|
18
|
|
- raise Exception("缺乏passwd参数")
|
|
13
|
+ # if not self.para.get("user"):
|
|
14
|
+ # raise Exception("缺乏user参数")
|
|
15
|
+ # if not self.para.get("type"):
|
|
16
|
+ # raise Exception("缺乏type参数")
|
|
17
|
+ # if not self.para.get("passwd"):
|
|
18
|
+ # raise Exception("缺乏passwd参数")
|
19
|
19
|
|
20
|
20
|
def process(self):
|
21
|
21
|
|
...
|
...
|
@@ -24,9 +24,9 @@ class Api(ApiTemplate): |
24
|
24
|
res["data"] = {}
|
25
|
25
|
try:
|
26
|
26
|
host = self.para.get("host") # server
|
27
|
|
- user = self.para.get("user")
|
28
|
|
- password = self.para.get("passwd")
|
29
|
|
- type = self.para.get("type")
|
|
27
|
+ # user = self.para.get("user")
|
|
28
|
+ # password = self.para.get("passwd")
|
|
29
|
+ # type = self.para.get("type")
|
30
|
30
|
host_name = self.para.get("host_name")
|
31
|
31
|
srcid = uuid.uuid1().__str__()
|
32
|
32
|
|
...
|
...
|
@@ -35,7 +35,7 @@ class Api(ApiTemplate): |
35
|
35
|
res["result"] = False
|
36
|
36
|
else:
|
37
|
37
|
monitorHost = MonitorHost(
|
38
|
|
- srcid=srcid, host=host, user=user, password=password, type=type, host_name=host_name)
|
|
38
|
+ srcid=srcid, host=host, host_name=host_name)
|
39
|
39
|
db.session.add(monitorHost)
|
40
|
40
|
db.session.commit()
|
41
|
41
|
res['data'] = {'host': host, 'srcid': srcid}
|
...
|
...
|
@@ -53,21 +53,21 @@ class Api(ApiTemplate): |
53
|
53
|
"type": "string",
|
54
|
54
|
"description": "主机地址",
|
55
|
55
|
"required": "true"},
|
56
|
|
- {"name": "user",
|
57
|
|
- "in": "formData",
|
58
|
|
- "type": "string",
|
59
|
|
- "description": "用户",
|
60
|
|
- "required": "true"},
|
61
|
|
- {"name": "passwd",
|
62
|
|
- "in": "formData",
|
63
|
|
- "type": "string",
|
64
|
|
- "description": "密码",
|
65
|
|
- "required": "true"},
|
66
|
|
- {"name": "type",
|
67
|
|
- "in": "formData",
|
68
|
|
- "type": "string",
|
69
|
|
- "description": "服务器类型",
|
70
|
|
- "required": "true"},
|
|
56
|
+ # {"name": "user",
|
|
57
|
+ # "in": "formData",
|
|
58
|
+ # "type": "string",
|
|
59
|
+ # "description": "用户",
|
|
60
|
+ # "required": "true"},
|
|
61
|
+ # {"name": "passwd",
|
|
62
|
+ # "in": "formData",
|
|
63
|
+ # "type": "string",
|
|
64
|
+ # "description": "密码",
|
|
65
|
+ # "required": "true"},
|
|
66
|
+ # {"name": "type",
|
|
67
|
+ # "in": "formData",
|
|
68
|
+ # "type": "string",
|
|
69
|
+ # "description": "服务器类型",
|
|
70
|
+ # "required": "true"},
|
71
|
71
|
{"name": "host_name",
|
72
|
72
|
"in": "formData",
|
73
|
73
|
"type": "string",
|
...
|
...
|
|