Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zmops-test
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sanshi
zmops-test
Commits
d785d648
Commit
d785d648
authored
Dec 17, 2019
by
sanshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
封装类
parent
8e4c184d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
3 deletions
+110
-3
Administrator.xml
.idea/dictionaries/Administrator.xml
+3
-0
__init__.py
WorkApi/APP/Databasemonitor/__init__.py
+0
-0
databasemonitor_get.py
WorkApi/APP/Databasemonitor/databasemonitor_get.py
+61
-0
databasemonitor_get_hostid.py
WorkApi/APP/Databasemonitor/databasemonitor_get_hostid.py
+41
-0
monitorgeneral_get.py
WorkApi/APP/MonitorGeneral/monitorgeneral_get.py
+5
-3
No files found.
.idea/dictionaries/Administrator.xml
View file @
d785d648
...
...
@@ -13,6 +13,7 @@
<w>
businessids
</w>
<w>
contextname
</w>
<w>
correlationid
</w>
<w>
databasemonitor
</w>
<w>
dcheckid
</w>
<w>
dchecks
</w>
<w>
departmentid
</w>
...
...
@@ -67,6 +68,7 @@
<w>
mediatype
</w>
<w>
mediatypeids
</w>
<w>
memberid
</w>
<w>
monitorgeneral
</w>
<w>
monitorid
</w>
<w>
mtime
</w>
<w>
networkmonitor
</w>
...
...
@@ -75,6 +77,7 @@
<w>
objectid
</w>
<w>
objectids
</w>
<w>
percpu
</w>
<w>
personid
</w>
<w>
preservekeys
</w>
<w>
privatekey
</w>
<w>
privpassphrase
</w>
...
...
WorkApi/APP/Databasemonitor/__init__.py
0 → 100644
View file @
d785d648
WorkApi/APP/Databasemonitor/databasemonitor_get.py
0 → 100644
View file @
d785d648
# -*- coding: utf-8 -*-
# 查询数据库监控
# 作者: 陈磊
# 时间: 2019-12-17
from
WorkUtils.UtilsRequest
import
UtilsRequest
from
WorkUtils.UtilsLog
import
UtilsLog
from
WorkApi.ApiBase
import
ApiBase
,
GetBase
class
DatabaseMonitorGet
(
object
):
def
__init__
(
self
,
_host
):
"""
:param _host: 域名
:return:
"""
self
.
log
=
UtilsLog
()
self
.
log
.
info
(
"调用查询数据库监控"
)
self
.
log
.
info
(
self
.
__class__
)
self
.
_host
=
_host
self
.
_headers
=
{}
self
.
_path
=
"/databasemonitor/get"
self
.
_url
=
self
.
_host
+
self
.
_path
self
.
_params
=
{}
self
.
_json
=
{}
self
.
_data
=
{}
self
.
response
=
""
self
.
token
=
{}
self
.
hostName
=
None
self
.
manageLevel
=
None
self
.
parentHostName
=
None
self
.
businessid
=
None
self
.
manageIp
=
None
self
.
available
=
None
self
.
status
=
None
self
.
opsPersonid
=
None
self
.
page
=
None
self
.
size
=
None
self
.
api
=
UtilsRequest
()
def
get_response
(
self
):
base
=
ApiBase
()
base
.
dict_add_key
(
_key
=
"token"
,
value
=
self
.
token
)
self
.
_headers
=
base
.
_json
base
=
ApiBase
()
base
.
dict_add_key
(
_key
=
"hostName"
,
value
=
self
.
hostName
)
base
.
dict_add_key
(
_key
=
"manageLevel"
,
value
=
self
.
manageLevel
)
base
.
dict_add_key
(
_key
=
"parentHostName"
,
value
=
self
.
parentHostName
)
base
.
dict_add_key
(
_key
=
"businessid"
,
value
=
self
.
businessid
)
base
.
dict_add_key
(
_key
=
"manageIp"
,
value
=
self
.
manageIp
)
base
.
dict_add_key
(
_key
=
"available"
,
value
=
self
.
available
)
base
.
dict_add_key
(
_key
=
"status"
,
value
=
self
.
status
)
base
.
dict_add_key
(
_key
=
"opsPersonid"
,
value
=
self
.
opsPersonid
)
base
.
dict_add_key
(
_key
=
"page"
,
value
=
self
.
page
)
base
.
dict_add_key
(
_key
=
"size"
,
value
=
self
.
size
)
self
.
_params
=
base
.
_json
self
.
response
=
self
.
api
.
get
(
url
=
self
.
_url
,
headers
=
self
.
_headers
,
params
=
self
.
_params
)
WorkApi/APP/Databasemonitor/databasemonitor_get_hostid.py
0 → 100644
View file @
d785d648
# -*- coding: utf-8 -*-
# 查询数据库监控基础信息
# 作者: 陈磊
# 时间: 2019-12-17
from
WorkUtils.UtilsRequest
import
UtilsRequest
from
WorkUtils.UtilsLog
import
UtilsLog
from
WorkApi.ApiBase
import
ApiBase
,
GetBase
class
DatabaseMonitorGetHostid
(
object
):
def
__init__
(
self
,
_host
):
"""
:param _host: 域名
:return:
"""
self
.
log
=
UtilsLog
()
self
.
log
.
info
(
"调用查询数据库监控基础信息"
)
self
.
log
.
info
(
self
.
__class__
)
self
.
_host
=
_host
self
.
_headers
=
{}
self
.
_path
=
"/databasemonitor/get/"
self
.
_url
=
self
.
_host
+
self
.
_path
self
.
_params
=
{}
self
.
_json
=
{}
self
.
_data
=
{}
self
.
response
=
""
self
.
token
=
{}
self
.
hostid
=
None
self
.
api
=
UtilsRequest
()
def
get_response
(
self
):
base
=
ApiBase
()
base
.
dict_add_key
(
_key
=
"token"
,
value
=
self
.
token
)
self
.
_headers
=
base
.
_json
self
.
_url
=
self
.
_url
+
str
(
self
.
hostid
)
self
.
response
=
self
.
api
.
get
(
url
=
self
.
_url
,
headers
=
self
.
_headers
,
params
=
self
.
_params
)
WorkApi/APP/MonitorGeneral/monitorgeneral_get.py
View file @
d785d648
...
...
@@ -26,10 +26,12 @@ class MonitorGeneralGet(object):
self
.
_data
=
{}
self
.
response
=
""
self
.
local_jso
n
=
{}
self
.
toke
n
=
{}
self
.
api
=
UtilsRequest
()
def
get_response
(
self
):
self
.
_json
=
self
.
local_json
self
.
response
=
self
.
api
.
post
(
url
=
self
.
_url
,
json
=
self
.
_json
)
base
=
ApiBase
()
base
.
dict_add_key
(
_key
=
"token"
,
value
=
self
.
token
)
self
.
_headers
=
base
.
_json
self
.
response
=
self
.
api
.
get
(
url
=
self
.
_url
,
headers
=
self
.
_headers
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment