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
ff09f2d7
Commit
ff09f2d7
authored
Dec 11, 2019
by
sanshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
事件表更
parent
37378dab
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
15 deletions
+13
-15
problem_acknowledge.py
WorkApi/API/Problem/problem_acknowledge.py
+13
-15
test_problem_acknowledge.py
WorkCase/API/Problem/test_problem_acknowledge.py
+0
-0
No files found.
WorkApi/API/Problem/problem_acknowledge.py
View file @
ff09f2d7
...
...
@@ -2,18 +2,15 @@
# 确认事件
# 作者: 陈磊
# 时间: 2019-10-24
from
WorkApi.ApiBase
import
ApiBase
from
WorkUtils.UtilsRequest
import
UtilsRequest
from
WorkUtils.UtilsLog
import
UtilsLog
class
ProblemAcknowledge
(
object
):
def
__init__
(
self
,
_host
,
eventids
=
None
,
action
=
None
,
message
=
None
,
severity
=
None
):
def
__init__
(
self
,
_host
):
"""
:param _host: 域名
:param eventids: 应用ID
:param action : 主机组的ID
:param message: 应用名称
:param severity: 应用程序的来源
:return:
"""
self
.
log
=
UtilsLog
()
...
...
@@ -28,18 +25,19 @@ class ProblemAcknowledge(object):
self
.
_json
=
{}
self
.
response
=
""
self
.
eventids
=
eventids
self
.
action
=
action
self
.
message
=
messag
e
self
.
severity
=
severity
self
.
eventids
=
None
self
.
action
=
None
self
.
message
=
Non
e
self
.
severity
=
None
self
.
api
=
UtilsRequest
()
def
get_response
(
self
):
self
.
_json
=
{
"eventids"
:
self
.
eventids
,
"action"
:
self
.
action
,
"message"
:
self
.
message
,
"severity"
:
self
.
severity
,
}
base
=
ApiBase
()
base
.
dict_add_key
(
_key
=
"eventids"
,
value
=
self
.
eventids
)
base
.
dict_add_key
(
_key
=
"action"
,
value
=
self
.
action
)
base
.
dict_add_key
(
_key
=
"message"
,
value
=
self
.
message
)
base
.
dict_add_key
(
_key
=
"severity"
,
value
=
self
.
severity
)
self
.
_json
=
base
.
_json
self
.
response
=
self
.
api
.
post
(
url
=
self
.
_url
,
json
=
self
.
_json
)
WorkCase/API/Problem/test_problem_acknowledge.py
View file @
ff09f2d7
This diff is collapsed.
Click to expand it.
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