Modifies the information about an integration.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
arms:UpdateIntegration | none |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
IntegrationId | long | Yes | The ID of the alert integration. | 1234 |
IntegrationName | string | Yes | The name of the alert integration. | CloudMonitor integration |
IntegrationProductType | string | Yes | The service of the alert integration. Valid values:
| CLOUD_MONITOR |
Description | string | No | The description of the alert integration. | Test |
AutoRecover | boolean | No | Specifies whether to automatically clear alert events. Valid values:
| true |
RecoverTime | long | No | The period of time within which alert events are automatically cleared. Unit: seconds. Default value: 300. | 300 |
DuplicateKey | string | No | The fields whose values are deduplicated. | LABEL.dimensions::LABEL.ruleId |
State | boolean | No | Indicates whether the alert integration was enabled. Valid values:
| true |
Stat | string | No | The total number of alert events and the number of abnormal alert events in the last hour. | [0,0] |
Liveness | string | No | The activity of the alert integration | ready |
FieldRedefineRules | string | No | The predefined mapped fields are mapped to the fields of ARMS alerts. The predefined mapped fields were generated when the alert integration was created. For more information, see the description of the FieldRedefineRules parameter. | \[ { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"alertname", "expression":null, "mappingRuleList":\[ ], "name":"Alert 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":"Alert level", "integrationId":1234, "jsonPath":"$.triggerLevel", "id":10002, "fieldType":"LABEL" }, { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"message", "expression":"{{$labels.namespace}} / {{$labels.dimensions}} Alert content {{ $labels.alertname }}, Current value {{$value}}.", "mappingRuleList":\[ ], "name":"Alert description", "integrationId":1234, "jsonPath":null, "id":10003, "fieldType":"ANNOTATION" }, { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"value", "expression":null, "mappingRuleList":\[ ], "name":"Alert sample value", "integrationId":1234, "jsonPath":"$.curValue", "id":10004, "fieldType":"ANNOTATION" }, { "redefineType":"EXTRACT", "matchExpression":null, "fieldName":"source", "expression":null, "mappingRuleList":\[ ], "name":"Source", "integrationId":1234, "jsonPath":null, "id":10007, "fieldType":"LABEL" }, { "redefineType":"ADD", "matchExpression":null, "fieldName":"generatorUrl", "expression":"https://cloudmonitor.console.aliyun.com/index.htm#/alarmInfo/name={{$labels.ruleId}}\&searchValue=\&searchType=name\&searchProduct=/history/all/searchKey:{{$labels.ruleId}},startTime:{{sub $startsAt 300000}},endTime:{{$endsAt}}", "mappingRuleList":\[ ], "name":"Event URL", "integrationId":1234, "jsonPath":"https://cloudmonitor.console.aliyun.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 | No | The extended mapped fields are mapped to the fields of ARMS alerts. For more information, see the description of the ExtendedFieldRedefineRules parameter. | [ { "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 | No | The field for clearing alert events. The system queries alert events based on the field of alert clearing events and clears the alert events. Note
Only the Log Service alert integration supports the parameter.
| $.status |
InitiativeRecoverValue | string | No | The value of the field for clearing alert events. The system queries alert events based on the field of alert clearing events and clears the alert events. Note
Only the Log Service alert integration supports the parameter.
| ok |
FieldRedefineRules and ExtendedFieldRedefineRules description
Example:
[
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"alertname",
"expression":null,
"mappingRuleList":[
],
"name":"Alert 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":"Alert level",
"integrationId":1234,
"jsonPath":"$.triggerLevel",
"id":10002,
"fieldType":"LABEL"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"message",
"expression":"{{$labels.namespace}} / {{$labels.dimensions}} Alert content {{ $labels.alertname }}, Current value {{$value}}.",
"mappingRuleList":[
],
"name":"Alert description",
"integrationId":1234,
"jsonPath":null,
"id":10003,
"fieldType":"ANNOTATION"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"value",
"expression":null,
"mappingRuleList":[
],
"name":"Alert sample value",
"integrationId":1234,
"jsonPath":"$.curValue",
"id":10004,
"fieldType":"ANNOTATION"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"imageUrl",
"expression":null,
"mappingRuleList":[
],
"name":"Alert image",
"integrationId":1234,
"jsonPath":null,
"id":10005,
"fieldType":"ANNOTATION"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"check",
"expression":null,
"mappingRuleList":[
],
"name":"Check item",
"integrationId":1234,
"jsonPath":null,
"id":10006,
"fieldType":"LABEL"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"source",
"expression":null,
"mappingRuleList":[
],
"name":"Source",
"integrationId":1234,
"jsonPath":null,
"id":10007,
"fieldType":"LABEL"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"class",
"expression":null,
"mappingRuleList":[
],
"name":"Category",
"integrationId":1234,
"jsonPath":null,
"id":10008,
"fieldType":"LABEL"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"service",
"expression":null,
"mappingRuleList":[
],
"name":"Service",
"integrationId":1234,
"jsonPath":null,
"id":10009,
"fieldType":"LABEL"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"startat",
"expression":null,
"mappingRuleList":[
],
"name":"Start time",
"integrationId":1234,
"jsonPath":null,
"id":10010,
"fieldType":"START_AT"
},
{
"redefineType":"EXTRACT",
"matchExpression":null,
"fieldName":"endat",
"expression":null,
"mappingRuleList":[
],
"name":"End time",
"integrationId":1234,
"jsonPath":null,
"id":10011,
"fieldType":"END_AT"
},
{
"redefineType":"ADD",
"matchExpression":null,
"fieldName":"generatorUrl",
"expression":"https://cloudmonitor.console.aliyun.com/index.htm#/alarmInfo/name={{$labels.ruleId}}&searchValue=&searchType=name&searchProduct=/history/all/searchKey:{{$labels.ruleId}},startTime:{{sub $startsAt 300000}},endTime:{{$endsAt}}",
"mappingRuleList":[
],
"name":"Event URL",
"integrationId":1234,
"jsonPath":"https://cloudmonitor.console.aliyun.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"
}
]
The following table describes the fields of the preceding parameters.
Field | Description |
---|---|
RedefineType | - MAP: maps fields such as the alert level based on a mapping table.- EXTRACT: uses jsonPath to map fields from a JSON file to ARMS alerts.- ADD: adds content mapping to ARMS alerts.- CONDITION: maps fields to ARMS alerts based on the specified conditions. If the specified conditions are met, jsonPath is used to map fields from a JSON file to ARMS alerts.- CONCAT: concatenates multiple fields into one field and then map this field to ARMS alerts. |
MatchExpression | - If the RedefineType field is set to CONCAT, the value of the MatchExpression field is the delimiter that is used for concatenation.- If the RedefineType field is set to CONDITION, the value of the MatchExpression field is the JSON string that specifies conditions. |
FieldType | - LABEL: the metadata of the alert. A set of labels uniquely identifies an alert event. Alert events with the same labels are compressed into one event. Example: "alertname: alert name".- ANNOTATION: the additional information of the alert. Annotations are not metadata. Example: "message: alert content".- GENERATE_URL: the URL of the alert event.- START_AT: the start time of the alert event.- END_AT: the end time of the alert event. |
Expression | The conditional mapping style. An escaped string value is passed to the Expression field. |
MappingRuleList | The redefinition rules of fields. |
Name | The name of the mapping rule. |
FieldName | The name of the field. |
JsonPath | The name of the source field. |
IntegrationId | The ID of the alert integration. |
Id | The primary key ID of the table for the mapped fields. |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "34ED024E-9E31-434A-9E4E-D9D15C3****",
"Integration": {
"IntegrationId": 1234,
"IntegrationName": "CloudMonitor integration\n",
"IntegrationProductType": "CLOUD_MONITOR",
"Description": "Test\n",
"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": [
{
"test": "test",
"test2": 1
}
],
"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"
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-06-12 | The request parameters of the API has changed | View Change Details |
2022-08-11 | The internal configuration of the API is changed, but the call is not affected | View Change Details |