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
b1933529
Commit
b1933529
authored
Dec 16, 2019
by
sanshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整个业务代码重构
parent
83c4a24e
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
179 additions
and
7 deletions
+179
-7
hostMonitor_get.py
WorkApi/APP/HostMonitor/hostMonitor_get.py
+10
-6
hostMonitor_get_hostid.py
WorkApi/APP/HostMonitor/hostMonitor_get_hostid.py
+41
-0
hostMonitor_runHistory_hostid.py
WorkApi/APP/HostMonitor/hostMonitor_runHistory_hostid.py
+41
-0
hostMonitor_runInfo_hostid.py
WorkApi/APP/HostMonitor/hostMonitor_runInfo_hostid.py
+41
-0
hostMonitor_thread_hostid.py
WorkApi/APP/HostMonitor/hostMonitor_thread_hostid.py
+41
-0
__init__.py
WorkCase/APP/__init__.py
+5
-1
No files found.
WorkApi/APP/HostMonitor/hostMonitor_get.py
View file @
b1933529
...
@@ -26,7 +26,7 @@ class HostMonitorGet(object):
...
@@ -26,7 +26,7 @@ class HostMonitorGet(object):
self
.
_data
=
{}
self
.
_data
=
{}
self
.
response
=
""
self
.
response
=
""
self
.
local_jso
n
=
{}
self
.
toke
n
=
{}
self
.
hostName
=
None
self
.
hostName
=
None
self
.
assetCode
=
None
self
.
assetCode
=
None
...
@@ -34,10 +34,15 @@ class HostMonitorGet(object):
...
@@ -34,10 +34,15 @@ class HostMonitorGet(object):
self
.
parentHost
=
None
self
.
parentHost
=
None
self
.
available
=
None
self
.
available
=
None
self
.
status
=
None
self
.
status
=
None
self
.
page
=
None
self
.
size
=
None
self
.
api
=
UtilsRequest
()
self
.
api
=
UtilsRequest
()
def
get_response
(
self
):
def
get_response
(
self
):
base
=
ApiBase
()
base
.
dict_add_key
(
_key
=
"token"
,
value
=
self
.
token
)
self
.
_headers
=
base
.
_json
base
=
ApiBase
()
base
=
ApiBase
()
base
.
dict_add_key
(
_key
=
"hostName"
,
value
=
self
.
hostName
)
base
.
dict_add_key
(
_key
=
"hostName"
,
value
=
self
.
hostName
)
...
@@ -46,8 +51,7 @@ class HostMonitorGet(object):
...
@@ -46,8 +51,7 @@ class HostMonitorGet(object):
base
.
dict_add_key
(
_key
=
"parentHost"
,
value
=
self
.
parentHost
)
base
.
dict_add_key
(
_key
=
"parentHost"
,
value
=
self
.
parentHost
)
base
.
dict_add_key
(
_key
=
"available"
,
value
=
self
.
available
)
base
.
dict_add_key
(
_key
=
"available"
,
value
=
self
.
available
)
base
.
dict_add_key
(
_key
=
"status"
,
value
=
self
.
status
)
base
.
dict_add_key
(
_key
=
"status"
,
value
=
self
.
status
)
base
.
dict_add_key
(
_key
=
"page"
,
value
=
self
.
page
)
self
.
local_json
=
base
.
_json
base
.
dict_add_key
(
_key
=
"size"
,
value
=
self
.
size
)
self
.
_params
=
base
.
_json
self
.
_json
=
self
.
local_json
self
.
response
=
self
.
api
.
get
(
url
=
self
.
_url
,
headers
=
self
.
_headers
,
params
=
self
.
_params
)
self
.
response
=
self
.
api
.
post
(
url
=
self
.
_url
,
json
=
self
.
_json
)
WorkApi/APP/HostMonitor/hostMonitor_get_hostid.py
0 → 100644
View file @
b1933529
# -*- coding: utf-8 -*-
# 查询主机监控基础信息
# 作者: 陈磊
# 时间: 2019-12-16
from
WorkUtils.UtilsRequest
import
UtilsRequest
from
WorkUtils.UtilsLog
import
UtilsLog
from
WorkApi.ApiBase
import
ApiBase
,
GetBase
class
HostMonitorGetHostid
(
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
=
"/hostmonitor/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/HostMonitor/hostMonitor_runHistory_hostid.py
0 → 100644
View file @
b1933529
# -*- coding: utf-8 -*-
# 查询主机监控运行历史
# 作者: 陈磊
# 时间: 2019-12-16
from
WorkUtils.UtilsRequest
import
UtilsRequest
from
WorkUtils.UtilsLog
import
UtilsLog
from
WorkApi.ApiBase
import
ApiBase
,
GetBase
class
HostMonitorRunHistoryHostid
(
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
=
"/hostmonitor/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/HostMonitor/hostMonitor_runInfo_hostid.py
0 → 100644
View file @
b1933529
# -*- coding: utf-8 -*-
# 查询主机监控运行信息
# 作者: 陈磊
# 时间: 2019-12-16
from
WorkUtils.UtilsRequest
import
UtilsRequest
from
WorkUtils.UtilsLog
import
UtilsLog
from
WorkApi.ApiBase
import
ApiBase
,
GetBase
class
HostMonitorRunInfoHostid
(
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
=
"/hostmonitor/runInfo/"
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/HostMonitor/hostMonitor_thread_hostid.py
0 → 100644
View file @
b1933529
# -*- coding: utf-8 -*-
# 查询主机监控进程监控
# 作者: 陈磊
# 时间: 2019-12-16
from
WorkUtils.UtilsRequest
import
UtilsRequest
from
WorkUtils.UtilsLog
import
UtilsLog
from
WorkApi.ApiBase
import
ApiBase
,
GetBase
class
HostMonitorThreadHostid
(
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
=
"/hostmonitor/thread/"
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
)
WorkCase/APP/__init__.py
View file @
b1933529
...
@@ -813,13 +813,17 @@ class AppBase(object):
...
@@ -813,13 +813,17 @@ class AppBase(object):
return
experienceid
return
experienceid
@allure.step
(
"调用接口:hostmonitor.get"
)
@allure.step
(
"调用接口:hostmonitor.get"
)
def
hostmonitor_get
(
self
,
hostName
=
None
,
assetCode
=
None
,
manageIp
=
None
,
parentHost
=
None
,
available
=
None
,
status
=
None
):
def
hostmonitor_get
(
self
,
token
=
None
,
hostName
=
None
,
assetCode
=
None
,
manageIp
=
None
,
parentHost
=
None
,
available
=
None
,
status
=
None
,
page
=
None
,
size
=
None
):
api
=
HostMonitorGet
(
_host
=
self
.
host
)
api
=
HostMonitorGet
(
_host
=
self
.
host
)
api
.
token
=
token
api
.
hostName
=
hostName
api
.
hostName
=
hostName
api
.
assetCode
=
assetCode
api
.
assetCode
=
assetCode
api
.
manageIp
=
manageIp
api
.
manageIp
=
manageIp
api
.
parentHost
=
parentHost
api
.
parentHost
=
parentHost
api
.
available
=
available
api
.
available
=
available
api
.
status
=
status
api
.
status
=
status
api
.
page
=
page
api
.
size
=
size
api
.
get_response
()
api
.
get_response
()
return
api
.
response
return
api
.
response
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