修改整合相關資訊。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| IntegrationId |
integer |
是 |
警示整合 ID。 |
1234 |
| IntegrationName |
string |
是 |
警示整合名稱。 |
CloudMonitor整合 |
| IntegrationProductType |
string |
是 |
整合產品類型:
|
CLOUD_MONITOR |
| Description |
string |
否 |
警示整合描述資訊。 |
測試 |
| AutoRecover |
boolean |
否 |
警示事件是否自動回復:
|
true |
| RecoverTime |
integer |
否 |
警示事件自動回復時間,預設時間為 300 秒。 |
300 |
| DuplicateKey |
string |
否 |
去重的欄位。 |
LABEL.dimensions::LABEL.ruleId |
| State |
boolean |
否 |
警示整合是否啟用:
|
true |
| Stat |
string |
否 |
最近 1 小時總數及異常數。 |
[0,0] |
| Liveness |
string |
否 |
警示整合活躍度。 |
ready |
| FieldRedefineRules |
string |
否 |
事件映射,將源欄位對應到目標欄位。 固定欄位對應,建立整合時預設產生的固定映射。更多資訊,請參見下方補充說明。 |
[ { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"alertname", "expression":null, "mappingRuleList":[ ], "name":"警示名稱", "integrationId":1234, "jsonPath":"$.alertName", "id":10001, "fieldType":"LABEL" }, { "redefineType":"MAP", "matchExpression":null, "fieldName":"severity", "expression":null, "mappingRuleList":[ { "mappingValue":"critical", "mappingName":"P1", "mappingType":"MAP", "originValue":"CRITICAL" }, { "mappingValue":"error", "mappingName":"P2", "mappingType":"MAP", "originValue":"WARN" }, { "mappingValue":"warning", "mappingName":"P3", "mappingType":"MAP", "originValue":"INFO" } ], "name":"警示等級", "integrationId":1234, "jsonPath":"$.triggerLevel", "id":10002, "fieldType":"LABEL" }, { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"message", "expression":"{{$labels.namespace}} / {{$labels.dimensions}} 發生 {{ $labels.alertname }}, 當前值 {{$value}}。", "mappingRuleList":[ ], "name":"警示描述", "integrationId":1234, "jsonPath":null, "id":10003, "fieldType":"ANNOTATION" }, { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"value", "expression":null, "mappingRuleList":[ ], "name":"警示樣本值", "integrationId":1234, "jsonPath":"$.curValue", "id":10004, "fieldType":"ANNOTATION" }, { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"source", "expression":null, "mappingRuleList":[ ], "name":"來源", "integrationId":1234, "jsonPath":null, "id":10007, "fieldType":"LABEL" }, { "redefineType":"ADD", "matchExpression":null, "fieldName":"generatorUrl", "expression":"https://cloudmonitor.console.alibabacloud.com/index.htm#/alarmInfo/name={{$labels.ruleId}}&searchValue=&searchType=name&searchProduct=/history/all/searchKey:{{$labels.ruleId}},startTime:{{sub $startsAt 300000}},endTime:{{$endsAt}}", "mappingRuleList":[ ], "name":"事件位址", "integrationId":1234, "jsonPath":"https://cloudmonitor.console.alibabacloud.com/index.htm#/alarmInfo/name={{$labels.ruleId}}&searchValue=&searchType=name&searchProduct=/history/all/searchKey:{{$labels.ruleId}},startTime:{{sub $startsAt 300000}},endTime:{{$endsAt}}", "id":10012, "fieldType":"GENERATE_URL" } ] |
| ExtendedFieldRedefineRules |
string |
否 |
事件映射,將源欄位對應到目標欄位,拓展欄位增加映射。更多資訊,請參見下方補充說明。 |
[ { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"dimensions", "expression":null, "mappingRuleList":[ ], "name":"dimensions", "integrationId":1234, "jsonPath":"$.dimensions", "id":10013, "fieldType":"LABEL" }, { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"expression", "expression":null, "mappingRuleList":[ ], "name":"expression", "integrationId":1234, "jsonPath":"$.expression", "id":10014, "fieldType":"LABEL" } ] |
| InitiativeRecoverField |
string |
否 |
警示事件恢複欄位。系統收到恢複事件後會根據恢複事件中的欄位查詢警示事件進行恢複。 說明
僅Log Service支援設定此參數。 |
$.status |
| InitiativeRecoverValue |
string |
否 |
警示事件恢複欄位值。系統收到恢複事件後會根據恢複事件中的欄位查詢警示事件進行恢複。 說明
僅Log Service支援設定此參數。 |
ok |
FieldRedefineRules 和 ExtendedFieldRedefineRules 參數說明
完整樣本如下:
[
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"alertname",
"expression":null,
"mappingRuleList":[
],
"name":"警示名稱",
"integrationId":1234,
"jsonPath":"$.alertName",
"id":10001,
"fieldType":"LABEL"
},
{
"redefineType":"MAP",
"matchExpression":null,
"fieldName":"severity",
"expression":null,
"mappingRuleList":[
{
"mappingValue":"critical",
"mappingName":"P1",
"mappingType":"MAP",
"originValue":"CRITICAL"
},
{
"mappingValue":"error",
"mappingName":"P2",
"mappingType":"MAP",
"originValue":"WARN"
},
{
"mappingValue":"warning",
"mappingName":"P3",
"mappingType":"MAP",
"originValue":"INFO"
}
],
"name":"警示等級",
"integrationId":1234,
"jsonPath":"$.triggerLevel",
"id":10002,
"fieldType":"LABEL"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"message",
"expression":"{{$labels.namespace}} / {{$labels.dimensions}} 發生 {{ $labels.alertname }}, 當前值 {{$value}}。",
"mappingRuleList":[
],
"name":"警示描述",
"integrationId":1234,
"jsonPath":null,
"id":10003,
"fieldType":"ANNOTATION"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"value",
"expression":null,
"mappingRuleList":[
],
"name":"警示樣本值",
"integrationId":1234,
"jsonPath":"$.curValue",
"id":10004,
"fieldType":"ANNOTATION"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"imageUrl",
"expression":null,
"mappingRuleList":[
],
"name":"警示圖片",
"integrationId":1234,
"jsonPath":null,
"id":10005,
"fieldType":"ANNOTATION"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"check",
"expression":null,
"mappingRuleList":[
],
"name":"檢查項",
"integrationId":1234,
"jsonPath":null,
"id":10006,
"fieldType":"LABEL"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"source",
"expression":null,
"mappingRuleList":[
],
"name":"來源",
"integrationId":1234,
"jsonPath":null,
"id":10007,
"fieldType":"LABEL"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"class",
"expression":null,
"mappingRuleList":[
],
"name":"分類",
"integrationId":1234,
"jsonPath":null,
"id":10008,
"fieldType":"LABEL"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"service",
"expression":null,
"mappingRuleList":[
],
"name":"服務",
"integrationId":1234,
"jsonPath":null,
"id":10009,
"fieldType":"LABEL"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"startat",
"expression":null,
"mappingRuleList":[
],
"name":"開始時間",
"integrationId":1234,
"jsonPath":null,
"id":10010,
"fieldType":"START_AT"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"endat",
"expression":null,
"mappingRuleList":[
],
"name":"結束時間",
"integrationId":1234,
"jsonPath":null,
"id":10011,
"fieldType":"END_AT"
},
{
"redefineType":"ADD",
"matchExpression":null,
"fieldName":"generatorUrl",
"expression":"https://cloudmonitor.console.alibabacloud.com/index.htm#/alarmInfo/name={{$labels.ruleId}}&searchValue=&searchType=name&searchProduct=/history/all/searchKey:{{$labels.ruleId}},startTime:{{sub $startsAt 300000}},endTime:{{$endsAt}}",
"mappingRuleList":[
],
"name":"事件位址",
"integrationId":1234,
"jsonPath":"https://cloudmonitor.console.alibabacloud.com/index.htm#/alarmInfo/name={{$labels.ruleId}}&searchValue=&searchType=name&searchProduct=/history/all/searchKey:{{$labels.ruleId}},startTime:{{sub $startsAt 300000}},endTime:{{$endsAt}}",
"id":10012,
"fieldType":"GENERATE_URL"
}
]
欄位說明:
| 欄位 | 說明 |
| RedefineType | - MAP:通過映射表進列欄位映射,如警示等級映射。 - EXTRACT:通過 jsonPath 從 JSON 中解析一個欄位對應到目標欄位。 - ADD:添加一個內容映射到目標欄位。 - CONDITION:條件映射。當滿足條件時,通過 jsonPath 從 JSON 中解析一個欄位對應到目標欄位。 - CONCAT:串聯映射。將多個欄位以指定的串聯符合拼接在一起後映射到模板欄位。 |
| MatchExpression | - 如果 RedefineType 設定為 CONCAT,MatchExpression 的值即為傳遞串聯的分隔字元。 - 如果 RedefineType 設定為 CONDITION,MatchExpression 的值即為傳遞條件規則的 JSON 字串。 |
| FieldType | - LABEL:警示中繼資料,一組標籤唯一標識一個事件,標籤相同的事件為同一個事件,重複上報會進行合并,常見的標籤如 “alertname: 警示名稱 ”。 - ANNOTATION:注釋是警示事件的附加描述,注釋不屬於中繼資料。常見的注釋有 “message: 警示內容”。 - GENERATE_URL:事件 URL 地址。 - START_AT:警示事件開始時間。 - END_AT:警示事件結束時間。 |
| Expression | 條件映射樣式,作為逸出字元串值存入 Expression。 |
| MappingRuleList | 欄位重定義規則。 |
| Name | 名稱。 |
| FieldName | 欄位名稱。 |
| JsonPath | 源欄位名稱。 |
| IntegrationId | 整合 ID。 |
| Id | 映射欄位儲存表主鍵 ID。 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
Schema of Response |
||
| RequestId |
string |
請求 ID。 |
34ED024E-9E31-434A-9E4E-D9D15C3**** |
| Integration |
object |
整合資訊。 |
|
| IntegrationId |
integer |
警示整合 ID。 |
1234 |
| IntegrationName |
string |
警示整合名稱。 |
CloudMonitor整合 |
| IntegrationProductType |
string |
整合產品類型:
|
CLOUD_MONITOR |
| Description |
string |
警示整合描述資訊。 |
測試 |
| ApiEndpoint |
string |
整合地址。 |
https://alerts.aliyuncs.com/api/v1/integrations/custom/ymQBN****** |
| ShortToken |
string |
整合 Token。 |
ymQBN****** |
| AutoRecover |
boolean |
警示事件是否自動回復:
|
true |
| RecoverTime |
integer |
警示事件自動回復時間,預設時間為 300 秒。 |
300 |
| DuplicateKey |
string |
去重的欄位。 |
LABEL.dimensions::LABEL.ruleId |
| State |
boolean |
警示整合是否啟用:
|
true |
| Stat |
array |
最近 1 小時總數及異常數。 |
|
|
integer |
最近 1 小時總數及異常數。 |
[0,0] |
|
| Liveness |
string |
警示整合活躍度。 |
ready |
| FieldRedefineRules |
array<object> |
固定映射欄位。 |
|
|
object |
事件映射,將源欄位對應到目標欄位。 固定欄位對應,建立整合時預設產生的固定映射。 |
[ { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"alertname", "expression":null, "mappingRuleList":[ ], "name":"警示名稱", "integrationId":1234, "jsonPath":"$.alertName", "id":10001, "fieldType":"LABEL" }, { "redefineType":"MAP", "matchExpression":null, "fieldName":"severity", "expression":null, "mappingRuleList":[ { "mappingValue":"critical", "mappingName":"P1", "mappingType":"MAP", "originValue":"CRITICAL" }, { "mappingValue":"error", "mappingName":"P2", "mappingType":"MAP", "originValue":"WARN" }, { "mappingValue":"warning", "mappingName":"P3", "mappingType":"MAP", "originValue":"INFO" } ], "name":"警示等級", "integrationId":1234, "jsonPath":"$.triggerLevel", "id":10002, "fieldType":"LABEL" }, { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"message", "expression":"{{$labels.namespace}} / {{$labels.dimensions}} 發生 {{ $labels.alertname }}, 當前值 {{$value}}。", "mappingRuleList":[ ], "name":"警示描述", "integrationId":1234, "jsonPath":null, "id":10003, "fieldType":"ANNOTATION" }, { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"value", "expression":null, "mappingRuleList":[ ], "name":"警示樣本值", "integrationId":1234, "jsonPath":"$.curValue", "id":10004, "fieldType":"ANNOTATION" }, { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"source", "expression":null, "mappingRuleList":[ ], "name":"來源", "integrationId":1234, "jsonPath":null, "id":10007, "fieldType":"LABEL" }, { "redefineType":"ADD", "matchExpression":null, "fieldName":"generatorUrl", "expression":"https://cloudmonitor.console.alibabacloud.com/index.htm#/alarmInfo/name={{$labels.ruleId}}&searchValue=&searchType=name&searchProduct=/history/all/searchKey:{{$labels.ruleId}},startTime:{{sub $startsAt 300000}},endTime:{{$endsAt}}", "mappingRuleList":[ ], "name":"事件位址", "integrationId":1234, "jsonPath":"https://cloudmonitor.console.alibabacloud.com/index.htm#/alarmInfo/name={{$labels.ruleId}}&searchValue=&searchType=name&searchProduct=/history/all/searchKey:{{$labels.ruleId}},startTime:{{sub $startsAt 300000}},endTime:{{$endsAt}}", "id":10012, "fieldType":"GENERATE_URL" } ] |
|
| ExtendedFieldRedefineRules |
array<object> |
拓展映射欄位。 |
|
|
object |
事件映射,將源欄位對應到目標欄位,拓展欄位增加映射。 |
[ { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"dimensions", "expression":null, "mappingRuleList":[ ], "name":"dimensions", "integrationId":1234, "jsonPath":"$.dimensions", "id":10013, "fieldType":"LABEL" }, { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"expression", "expression":null, "mappingRuleList":[ ], "name":"expression", "integrationId":1234, "jsonPath":"$.expression", "id":10014, "fieldType":"LABEL" } ] |
|
| InitiativeRecoverField |
string |
警示事件恢複欄位。系統收到恢複事件後會根據恢複事件中的欄位查詢警示事件進行恢複。 說明
僅Log Service支援此參數。 |
$.status |
| InitiativeRecoverValue |
string |
警示事件恢複欄位值。系統收到恢複事件後會根據恢複事件中的欄位查詢警示事件進行恢複。 說明
僅Log Service支援此參數。 |
ok |
樣本
正常返回樣本
JSON格式
{
"RequestId": "34ED024E-9E31-434A-9E4E-D9D15C3****",
"Integration": {
"IntegrationId": 1234,
"IntegrationName": "CloudMonitor整合",
"IntegrationProductType": "CLOUD_MONITOR",
"Description": "測試",
"ApiEndpoint": "https://alerts.aliyuncs.com/api/v1/integrations/custom/ymQBN******",
"ShortToken": "ymQBN******",
"AutoRecover": true,
"RecoverTime": 300,
"DuplicateKey": "LABEL.dimensions::LABEL.ruleId",
"State": true,
"Stat": [
0
],
"Liveness": "ready",
"FieldRedefineRules": [
[
{
"redefineType": "EXTRACT",
"matchExpression": null,
"fieldName": "alertname",
"expression": null,
"mappingRuleList": [],
"name": "警示名稱",
"integrationId": 1234,
"jsonPath": "$.alertName",
"id": 10001,
"fieldType": "LABEL"
},
{
"redefineType": "MAP",
"matchExpression": null,
"fieldName": "severity",
"expression": null,
"mappingRuleList": [
{
"mappingValue": "critical",
"mappingName": "P1",
"mappingType": "MAP",
"originValue": "CRITICAL"
},
{
"mappingValue": "error",
"mappingName": "P2",
"mappingType": "MAP",
"originValue": "WARN"
},
{
"mappingValue": "warning",
"mappingName": "P3",
"mappingType": "MAP",
"originValue": "INFO"
}
],
"name": "警示等級",
"integrationId": 1234,
"jsonPath": "$.triggerLevel",
"id": 10002,
"fieldType": "LABEL"
},
{
"redefineType": "EXTRACT",
"matchExpression": null,
"fieldName": "message",
"expression": "{{$labels.namespace}} / {{$labels.dimensions}} 發生 {{ $labels.alertname }}, 當前值 {{$value}}。",
"mappingRuleList": [],
"name": "警示描述",
"integrationId": 1234,
"jsonPath": null,
"id": 10003,
"fieldType": "ANNOTATION"
},
{
"redefineType": "EXTRACT",
"matchExpression": null,
"fieldName": "value",
"expression": null,
"mappingRuleList": [],
"name": "警示樣本值",
"integrationId": 1234,
"jsonPath": "$.curValue",
"id": 10004,
"fieldType": "ANNOTATION"
},
{
"redefineType": "EXTRACT",
"matchExpression": null,
"fieldName": "source",
"expression": null,
"mappingRuleList": [],
"name": "來源",
"integrationId": 1234,
"jsonPath": null,
"id": 10007,
"fieldType": "LABEL"
},
{
"redefineType": "ADD",
"matchExpression": null,
"fieldName": "generatorUrl",
"expression": "https://cloudmonitor.console.alibabacloud.com/index.htm#/alarmInfo/name={{$labels.ruleId}}&searchValue=&searchType=name&searchProduct=/history/all/searchKey:{{$labels.ruleId}},startTime:{{sub $startsAt 300000}},endTime:{{$endsAt}}",
"mappingRuleList": [],
"name": "事件位址",
"integrationId": 1234,
"jsonPath": "https://cloudmonitor.console.alibabacloud.com/index.htm#/alarmInfo/name={{$labels.ruleId}}&searchValue=&searchType=name&searchProduct=/history/all/searchKey:{{$labels.ruleId}},startTime:{{sub $startsAt 300000}},endTime:{{$endsAt}}",
"id": 10012,
"fieldType": "GENERATE_URL"
}
]
],
"ExtendedFieldRedefineRules": [
[
{
"redefineType": "EXTRACT",
"matchExpression": null,
"fieldName": "dimensions",
"expression": null,
"mappingRuleList": [],
"name": "dimensions",
"integrationId": 1234,
"jsonPath": "$.dimensions",
"id": 10013,
"fieldType": "LABEL"
},
{
"redefineType": "EXTRACT",
"matchExpression": null,
"fieldName": "expression",
"expression": null,
"mappingRuleList": [],
"name": "expression",
"integrationId": 1234,
"jsonPath": "$.expression",
"id": 10014,
"fieldType": "LABEL"
}
]
],
"InitiativeRecoverField": "$.status",
"InitiativeRecoverValue": "ok"
}
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。