验证流转规则。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求头
该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。
请求语法
POST /routeRule/verify HTTP/1.1
请求参数
名称 | 类型 | 位置 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|---|
Object | Body | 否 | A short description of struct |
||
routeRuleId | Long | Body | 否 | 1111 | 规则id |
testSourceEvents | Array | Body | 否 | 测试告警内容 |
|
monitorSourceId | Long | Body | 否 | 1 | 监控源源ID |
monitorSourceName | String | Body | 否 | zabbix | 监控源名称 |
eventTime | String | Body | 否 | 2021-09-08 13:00:00 | 告警时间 |
eventJson | String | Body | 否 | {} | 告警JSON |
{
"testSourceEvents": { "eventJson": "{\n\t\"summary\": \"Cpu_util at 85.16% on machine 112.11.123.11\",\n\t\"priority\": \"P1\",\n\t\"name\": \"Cpu 使用超额预警\",\n\t\"timestamp\": \"2021-07-17 T08:42:58.315+0000\",\n\t\"region\": \"shanghai\",\n\t\"source\": \"112.11.123.11\",\n\t\"application\": \"zheda/mozi\",\n\t\"group\": \"线上\",\n\t\"class\": \"Load\",\n\t\"details\": {\n\t\t\"freeSpace\": \"1%\",\n\t\t\"pingTime\": \"1500ms\",\n\t\t\"loadAvg\": \"0.75\"\n\t},\n\t\"tags\": \"{}\"\n}", "eventTime": "2021-12-17 05:13:17", "monitorSourceId": 23463, "monitorSourceName": "标准集成" } ,
"routeRuleId": "160034020",
"clientToken": "7e070585-ee11-450e-8827-db353faa3419"
}
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
requestId | String | xxxxxx | Id of the request |
data | Object | 验证结果 |
|
isValidRule | Boolean | true | 验证是否成功 |
routeType | String | INCIDENT、ALERT | 事件或者报警 |
notifySubscriptionNames | Array of 订阅名称 | 订阅名称 |
|
subscriptionId | Long | 111111 | 订阅ID |
title | String | 订阅名称 | 订阅名称 |
escalationPlans | Array of 升级策略 | 升级策略名称 |
|
escalationPlanName | String | 升级计划1 | 升级计划名称 |
escalationPlanId | Long | 111111 | 升级计划ID |
routeRuleFailReason | Array of String | alertName不匹配 | 流转规则验证失败的原因 |
monitorSourceIds | Array of Long | 验证失败监控源ID | 1000 |
{
"elapsedTime": 0,
"requestId": "gdgsdgsggsdg",
"success": true,
"errCode": 200,
"errMessage": null,
"data": {
"routeRuleId": null,
"isValidRule": false,
"routeType": "INCIDENT",
"routeRuleName": null,
"assignToWhoName": null,
"notifySubscriptions": { "subscriptionId": 80002030, "title": "【测试,勿动】全部服务" }, { "subscriptionId": 100000010, "title": "撒发色分" }, { "subscriptionId": 100000030, "title": "ceshi2190830" }, { "subscriptionId": 100000040, "title": "test121" }, { "subscriptionId": 100000070, "title": "是" }, { "subscriptionId": 110000000, "title": "全部服务-个人-优先级高" }, { "subscriptionId": 110000010, "title": "111" }, { "subscriptionId": 110000030, "title": "老数据兼容测试" }, { "subscriptionId": 110000090, "title": "测试优化功能" }, { "subscriptionId": 120000000, "title": "经1" }, { "subscriptionId": 120000030, "title": "三级级联--全部服务" }, { "subscriptionId": 120000070, "title": "341" }, { "subscriptionId": 130000000, "title": "全部服务-服务组" }, { "subscriptionId": 130000010, "title": "222" }, { "subscriptionId": 130000030, "title": "ceshi0903" }, { "subscriptionId": 130000060, "title": "niidfads" }, { "subscriptionId": 130000070, "title": "e232" }, { "subscriptionId": 130000080, "title": "test0001" }, { "subscriptionId": 140000000, "title": "边界值测试" }, { "subscriptionId": 140000010, "title": "通知订阅啊" }, { "subscriptionId": 140000020, "title": "【不要乱动配置!!!】【新】通知订阅-全部" }, { "subscriptionId": 140000070, "title": "ceshiyixzia" }, { "subscriptionId": 150000000, "title": "24321" }, { "subscriptionId": 150000030, "title": "dscs" }, { "subscriptionId": 150000070, "title": "史蒂夫v" }, { "subscriptionId": 150000090, "title": "121212" }, { "subscriptionId": 160000010, "title": "3333" }, { "subscriptionId": 160000030, "title": "wj测试订阅" }, { "subscriptionId": 160000060, "title": "cdscds" }, { "subscriptionId": 160000070, "title": "ceshisd" }, { "subscriptionId": 170000000, "title": "服务--个人" }, { "subscriptionId": 170000010, "title": "4444444" }, { "subscriptionId": 170000020, "title": "测试11" }, { "subscriptionId": 170000030, "title": "这是一个测试0927" }, { "subscriptionId": 170000060, "title": "妖股仁东控股的背后操盘方景华,近日收到证监会的500万罚单。相关处罚决定书显示,这名昔日牛散在仁东控股上巨亏了近27亿,还向证监" }, { "subscriptionId": 170000070, "title": "吃" }, { "subscriptionId": 170000090, "title": "发发发" }, { "subscriptionId": 180000000, "title": "aa1" }, { "subscriptionId": 180000010, "title": "3" }, { "subscriptionId": 180000030, "title": "sdds" }, { "subscriptionId": 180000040, "title": "4fy" }, { "subscriptionId": 180000050, "title": "cadscds" }, { "subscriptionId": 180000060, "title": "sdc" }, { "subscriptionId": 180000090, "title": "速度" }, { "subscriptionId": 190000040, "title": "时间自定义配置测试" }, { "subscriptionId": 190000080, "title": "老数据兼容" }, { "subscriptionId": 190000090, "title": "当钉测试" } ,
"escalationPlans": ,
"routeRuleFailReason": "无告警内容匹配 Zabbix这条规则" ,
"monitorSourceIds": 23465
}
}
示例
请求示例
POST /routeRule/verify HTTP/1.1
Host:gemp.aliyuncs.com
Content-Type:application/json
{
"routeRuleId" : 1111,
"testSourceEvents" : [ {
"monitorSourceId" : 1,
"monitorSourceName" : "zabbix",
"eventTime" : "2021-09-08 13:00:00",
"eventJson" : "{
"summary":"Cpu_util at 85.16% on machine 112.11.123.11",
"priority":"P1",
"name":"报警--标准集成流1018",
"timestamp":"2021-07-17 T08:42:58.315+0000",
"region":"shanghai",
"source":"112.11.123.11",
"application":"zheda/mozi",
"group":"线上",
"class":"1",
"details":{
"freeSpace":"1%",
"pingTime":"1500ms",
"loadAvg":"0.75"
},
"tags":"{}"
}"
} ]
}
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<VerifyRouteRuleResponse>
<requestId>xxxxxx</requestId>
<data>
<isValidRule>true</isValidRule>
<routeType>INCIDENT、ALERT</routeType>
<notifySubscriptionNames>我的订阅</notifySubscriptionNames>
<escalationPlanNames>升级策略1</escalationPlanNames>
<routeRuleFailReason>alertName不匹配</routeRuleFailReason>
</data>
</VerifyRouteRuleResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"requestId" : "xxxxxx",
"data" : {
"isValidRule" : true,
"routeType" : "INCIDENT、ALERT",
"notifySubscriptionNames" : [ "我的订阅" ],
"escalationPlanNames" : [ "升级策略1" ],
"routeRuleFailReason" : [ "alertName不匹配" ]
}
}
错误码
访问错误中心查看更多错误码。
访问错误中心查看更多错误码。