文档
测试

获取告警

POST

请求头

参数名
类型
描述
必填
Content-Type
String
请求的 Content-Type 头部必须设置为以下值之一: application/json-rpc, application/json 或 application/jsonrequest
必填

请求参数

参数名
类型
描述
必填
jsonrpc
String
API使用的JSON-RPC协议的版本; API实现JSON-RPC版本2.0;
必填
method
String
user.login调用的API方法;
必填
params
JSON
请求传递参数
必填
output
String
定义所需输出的参数
必填
eventids
String
只返回给定事件生成的alerts.
必填
id
String
请求的任意标识符;
必填
auth
String
用户认证令牌;
必填

响应参数

参数名
类型
描述
必填
jsonrpc
string
示例:2.0 JSON-RPC协议的版本;
必填
result
array
数据列表 方法返回的数据;
必填
alertid
string
示例:1 报警列表ID
必填
actionid
string
示例:3 方法ID
必填
eventid
string
示例:21243 触发Action的事件ID.
必填
userid
string
示例:1 用户ID
必填
clock
string
示例:1362128008 报警世间
必填
mediatypeid
string
示例:1 用于发送消息的报警媒介类型的ID.
必填
sendto
string
示例:support@company.com 地址,用户名或接收者的其他标识符. 用于消息告警.
必填
subject
string
示例:PROBLEM: agent on Linux server is unreachable for 5 minutes: 消息主题. 用于消息告警.
必填
message
string
示例:Trigger: agent on Linux server is unreachable for 5 minutes: Trigger status: PROBLEMTrigger severity: Not classified 消息文本. 用于消息告警.
必填
status
string
示例:0 指示action操作是否已被成功执行的状态. 消息告警的可能值: 0 - 消息未发送; 1 - 消息已发送; 2 - 经多次重试后失败. 命令告警的可能值: 1 - 命令运行; 2 - 尝试在 agent上运行命令但不可用.
必填
retries
string
示例:3 尝试发送消息的次数.
必填
error
string
示例: Alert发送Message或者执行一个命令产生的报错信息.
必填
esc_step
string
示例:1 生成Alert后Action的处理步骤.
必填
alerttype
string
示例:0 Alert类型. 可用值: 0 - message; 1 - remote command.
必填
id
number
示例:1
必填

说明 / 示例

请求示例 { "jsonrpc": "2.0", "method": "alert.get", "params": { "output": "extend", "actionids": "3" }, "auth": "038e1d7b1735c6a5436ee9eae095879e", "id": 1 } 返回示例 { "jsonrpc": "2.0", "result": [ { "alertid": "1", "actionid": "3", "eventid": "21243", "userid": "1", "clock": "1362128008", "mediatypeid": "1", "sendto": "support@company.com", "subject": "PROBLEM: agent on Linux server is unreachable for 5 minutes: ", "message": "Trigger: agent on Linux server is unreachable for 5 minutes: \nTrigger status: PROBLEM\nTrigger severity: Not classified", "status": "0", "retries": "3", "error": "", "esc_step": "1", "alerttype": "0" } ], "id": 1 }