All Products
Search
Document Center

Application Real-Time Monitoring Service:UpdateIntegration

Last Updated:Nov 05, 2024

Modifies the information about an integration.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
arms:UpdateIntegrationnone
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
IntegrationIdlongYes

The ID of the alert integration.

1234
IntegrationNamestringYes

The name of the alert integration.

CloudMonitor integration
IntegrationProductTypestringYes

The service of the alert integration. Valid values:

  • CLOUD_MONITOR: CloudMonitor
  • LOG_SERVICE: Log Service
CLOUD_MONITOR
DescriptionstringNo

The description of the alert integration.

Test
AutoRecoverbooleanNo

Specifies whether to automatically clear alert events. Valid values:

  • true (default)
  • false
true
RecoverTimelongNo

The period of time within which alert events are automatically cleared. Unit: seconds. Default value: 300.

300
DuplicateKeystringNo

The fields whose values are deduplicated.

LABEL.dimensions::LABEL.ruleId
StatebooleanNo

Indicates whether the alert integration was enabled. Valid values:

  • true
  • false
true
StatstringNo

The total number of alert events and the number of abnormal alert events in the last hour.

[0,0]
LivenessstringNo

The activity of the alert integration

ready
FieldRedefineRulesstringNo

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" } ]
ExtendedFieldRedefineRulesstringNo

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" } ]
InitiativeRecoverFieldstringNo

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
InitiativeRecoverValuestringNo

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.

FieldDescription
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.
ExpressionThe conditional mapping style. An escaped string value is passed to the Expression field.
MappingRuleListThe redefinition rules of fields.
NameThe name of the mapping rule.
FieldNameThe name of the field.
JsonPathThe name of the source field.
IntegrationIdThe ID of the alert integration.
IdThe primary key ID of the table for the mapped fields.

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The ID of the request.

34ED024E-9E31-434A-9E4E-D9D15C3****
Integrationobject

The Information about the alert integration.

IntegrationIdlong

The ID of the alert integration.

1234
IntegrationNamestring

The name of the alert integration.

CloudMonitor integration
IntegrationProductTypestring

The service of the alert integration. Valid values:

  • CLOUD_MONITOR: CloudMonitor
  • LOG_SERVICE: Log Service
CLOUD_MONITOR
Descriptionstring

The description of the alert integration.

Test
ApiEndpointstring

The endpoint of the alert integration.

https://alerts.aliyuncs.com/api/v1/integrations/custom/ymQBN******
ShortTokenstring

The authentication token of the alert integration.

ymQBN******
AutoRecoverboolean

Indicates whether alert events are automatically cleared. Valid values:

  • true (default)
  • false
true
RecoverTimelong

The time when alert events are automatically cleared. Unit: seconds. Default value: 300.

300
DuplicateKeystring

The fields whose values are deduplicated.

LABEL.dimensions::LABEL.ruleId
Stateboolean

Indicates whether the alert integration is enabled. Valid values:

  • true
  • false
true
Statarray

The total number of alert events and the number of abnormal alert events in the last hour.

statlong

The total number of alert events and the number of abnormal alert events in the last hour.

[0,0]
Livenessstring

The activity of the alert integration

ready
FieldRedefineRulesarray<object>

The predefined mapped fields of the alert source.

fieldRedefineRulesobject

The predefined mapped fields are mapped to the fields of ARMS alerts. The predefined mapped fields were generated when the alert integration was created.

ExtendedFieldRedefineRulesarray<object>

The extended mapped fields of the alert source.

extendedFieldRedefineRulesobject

The extended mapped fields are mapped to the fields of ARMS alerts.

[ { "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" } ]
InitiativeRecoverFieldstring

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 Log Service supports this parameter.
$.status
InitiativeRecoverValuestring

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 Log Service supports this parameter.
ok

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
2023-06-12The request parameters of the API has changedView Change Details
2022-08-11The internal configuration of the API is changed, but the call is not affectedView Change Details