创建动作
POST
api_jsonrpc.php
请求头
参数名
类型
描述
必填
Content-Type
String
请求的 Content-Type 头部必须设置为以下值之一: application/json-rpc, application/json 或 application/jsonrequest
必填
请求参数
参数名
类型
描述
必填
jsonrpc
String
API使用的JSON-RPC协议的版本; API实现JSON-RPC版本2.0;
必填
method
String
请求方法 action.create
必填
evaltype
integer
过滤条件评估方法。可能的值:0-和/或;1-和;2-或;3-自定义表达式。
必填
conditionid
String
操作条件的ID。
必填
conditiontype
integer
触发动作的可能值: 0-主机组; 1-主机; 2-触发; 3-触发名称; 4-触发严重性; 6-时间段; 13-主机模板; 15-申请; 16-维护状态; 25-事件代码; 26-事件代码值。 发现操作的可能值: 7-主机IP; 8-发现的服务类型; 9-发现服务端口; 10-发现状态; 11-正常运行时间或停机时间; 12-收到的价值; 18-发现规则; 19-发现检查; 20-代理; 21-发现对象。 自动注册操作的可能值: 20-代理; 22-主机名; 24-主机元数据。 内部操作的可能值: 0-主机组; 1-主机; 13-主机模板; 15-申请; 23-事件类型。
必填
value
String
要比较的价值。
必填
operationid
String
操作条件的ID。
必填
operationtype
integer
触发器操作的可能值: 0—发送消息; 1-远程命令; 11-发送恢复消息。 内部操作的可能值: 0—发送消息; 11-发送恢复消息。
必填
esc_period
String
默认操作步骤持续时间。必须大于60秒。接受秒,带后缀的时间单位和用户宏。
必填
esc_step_from
integer
步骤开始升级。 默认: 1.
必填
esc_step_to
integer
逐步结束升级 默认: 1.
必填
evaltype
integer
操作条件评估方法。 可能的值: 0 - (默认) AND / OR; 1 - AND; 2 - OR.
必填
opmessage_grp
Array
发送消息的用户组。 每个对象具有以下属性: operationid - (string) 操作的 ID; usrgrpid - (string) 用户组的ID。 如果 opmessage_usr 未设置,则为消息操作所必需。
必填
operationid
String
(string) 操作的 ID;
必填
usrgrpid
String
(string) 用户组的ID。
必填
operationid
String
操作操作的ID。
必填
default_msg
integer
是否使用默认操作消息文本和主题。 可能值: 0-(默认)使用操作中的数据; 1-使用操作中的数据。
必填
mediatypeid
String
将用于发送消息的媒体类型的ID。
必填
opconditionid
String
操作操作条件的(只读)ID
可选
conditiontype
integer
条件类型。 可能值: 14-事件已确认。
必填
value
String
要与之比较的值
必填
operationid
String
操作操作的ID。
可选
operator
integer
条件运算符。 可能值: 0-(默认值)=。
可选
operationtype
integer
触发器操作的可能值: 0—发送消息; 1-远程命令; 11-发送恢复消息。 内部操作的可能值: 0—发送消息; 11-发送恢复消息。
必填
name
String
动作的名称
必填
eventsource
integer
常量) 动作将处理的事件的类型。Possible values for trigger events: 0 - OK; 1 - problem. Possible values for discovery events: 0 - host or service up; 1 - host or service down; 2 - host or service discovered; 3 - host or service lost. Possible values for internal events: 0 - “normal” state; 1 - “unknown” or “not supported” state.
必填
esc_period
String
升级步骤的持续时间(秒)。必须大于60秒。接受秒,时间单位后缀和用户宏。如果设置为0或0,将使用默认动作升级期。 默认: 0s.
必填
def_shortdata
String
异常消息主题。
必填
def_longdata
String
异常消息文本。
必填
id
String
请求的任意标识符;
必填
auth
String
用户认证令牌;
必填