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
589bd25a
Commit
589bd25a
authored
Dec 17, 2019
by
sanshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
封装网络监控
parent
32aa1540
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
212 additions
and
5 deletions
+212
-5
networkMonitor_get.py
WorkApi/APP/NetworkMonitor/networkMonitor_get.py
+7
-5
networkmonitor_deviceInfo_hostid.py
...pi/APP/NetworkMonitor/networkmonitor_deviceInfo_hostid.py
+41
-0
networkmonitor_get_hostid.py
WorkApi/APP/NetworkMonitor/networkmonitor_get_hostid.py
+41
-0
networkmonitor_historyWarning_hostid.py
...PP/NetworkMonitor/networkmonitor_historyWarning_hostid.py
+41
-0
networkmonitor_runHistory_hostid.py
...pi/APP/NetworkMonitor/networkmonitor_runHistory_hostid.py
+41
-0
networkmonitor_running_hostid.py
WorkApi/APP/NetworkMonitor/networkmonitor_running_hostid.py
+41
-0
No files found.
WorkApi/APP/NetworkMonitor/networkMonitor_get.py
View file @
589bd25a
...
...
@@ -26,10 +26,11 @@ class NetworkMonitorGet(object):
self
.
_data
=
{}
self
.
response
=
""
self
.
local_jso
n
=
{}
self
.
toke
n
=
{}
self
.
hostName
=
None
self
.
assetCode
=
None
self
.
manageLevel
=
None
self
.
manageIp
=
None
self
.
parentHost
=
None
self
.
available
=
None
...
...
@@ -41,6 +42,9 @@ class NetworkMonitorGet(object):
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
)
...
...
@@ -53,7 +57,5 @@ class NetworkMonitorGet(object):
base
.
dict_add_key
(
_key
=
"page"
,
value
=
self
.
page
)
base
.
dict_add_key
(
_key
=
"size"
,
value
=
self
.
size
)
self
.
local_json
=
base
.
_json
self
.
_json
=
self
.
local_json
self
.
response
=
self
.
api
.
post
(
url
=
self
.
_url
,
json
=
self
.
_json
)
self
.
_params
=
base
.
_json
self
.
response
=
self
.
api
.
get
(
url
=
self
.
_url
,
headers
=
self
.
_headers
,
params
=
self
.
_params
)
WorkApi/APP/NetworkMonitor/networkmonitor_deviceInfo_hostid.py
0 → 100644
View file @
589bd25a
# -*- coding: utf-8 -*-
# 查询网络监控硬件信息
# 作者: 陈磊
# 时间: 2019-12-09
from
WorkUtils.UtilsRequest
import
UtilsRequest
from
WorkUtils.UtilsLog
import
UtilsLog
from
WorkApi.ApiBase
import
ApiBase
,
GetBase
class
NetworkMonitorDeviceInfoHostId
(
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
=
"/networkmonitor/deviceInfo/"
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
)
WorkApi/APP/NetworkMonitor/networkmonitor_get_hostid.py
0 → 100644
View file @
589bd25a
# -*- coding: utf-8 -*-
# 查询网络监控基础信息
# 作者: 陈磊
# 时间: 2019-12-09
from
WorkUtils.UtilsRequest
import
UtilsRequest
from
WorkUtils.UtilsLog
import
UtilsLog
from
WorkApi.ApiBase
import
ApiBase
,
GetBase
class
NetworkMonitorGetHostId
(
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
=
"/networkmonitor/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
)
WorkApi/APP/NetworkMonitor/networkmonitor_historyWarning_hostid.py
0 → 100644
View file @
589bd25a
# -*- coding: utf-8 -*-
# 查询历史告警
# 作者: 陈磊
# 时间: 2019-12-09
from
WorkUtils.UtilsRequest
import
UtilsRequest
from
WorkUtils.UtilsLog
import
UtilsLog
from
WorkApi.ApiBase
import
ApiBase
,
GetBase
class
NetworkMonitorHistoryWarningHostId
(
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
=
"/networkmonitor/historyWarning/"
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
)
WorkApi/APP/NetworkMonitor/networkmonitor_runHistory_hostid.py
0 → 100644
View file @
589bd25a
# -*- coding: utf-8 -*-
# 查询网络监控运行历史
# 作者: 陈磊
# 时间: 2019-12-09
from
WorkUtils.UtilsRequest
import
UtilsRequest
from
WorkUtils.UtilsLog
import
UtilsLog
from
WorkApi.ApiBase
import
ApiBase
,
GetBase
class
NetworkMonitorRunHistoryHostId
(
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
=
"/networkmonitor/runHistory/"
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
)
WorkApi/APP/NetworkMonitor/networkmonitor_running_hostid.py
0 → 100644
View file @
589bd25a
# -*- coding: utf-8 -*-
# 查询网络监控运行信息
# 作者: 陈磊
# 时间: 2019-12-09
from
WorkUtils.UtilsRequest
import
UtilsRequest
from
WorkUtils.UtilsLog
import
UtilsLog
from
WorkApi.ApiBase
import
ApiBase
,
GetBase
class
NetworkMonitorRunningHostId
(
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
=
"/networkmonitor/running/"
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
)
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