Custom Callback Content Templates

Last Updated At: 2025-11-17 14:43:28

Scenarios

Through a custom callback content template, you can customize the content and field mapping of the callback message body. This document describes how to create a custom callback content template.

Operation Steps

  1. Log in to the cloud platform console, choose Cloud Monitor > Notification Template, and select the Callback Content Template tab.
  2. Click Create Callback Content Template, and configure the content and field mapping of the callback message body on the page.
    Note:

    Write the callback content template in JSON format. For details, see the callback content example on the right side of the page. Format issues may cause the callback content to fail to parse.

    1. Users can click Use the Preset Callback Content to automatically fill in the preset callback content and perform customization based on the preset callback content.

    2. The list on the right of the callback content shows the currently supported variable placeholders. Users can directly click to copy and use them.


3. Click OK to complete the creation of the callback content template.
4. When you choose Create Alarm Policy > Configure Alarm Notifications, if the notification template includes a callback method, you can select a custom callback content template. After the configuration is completed, the callback content will be sent based on the template.

Note:

Users can only select a callback content template with the same language as the notification template.

Variable Description

Currently, only the following variables can be used as placeholders for custom notification content. If an invalid variable is used, the field of the callback content may have no data in it.

VariableDescriptionExample
{{.uin}}Account UIN.233332
{{.appId}}Account AppID.1232312
{{.sessionId}}Alarm sessionId.LxePI1H4oYQCeg9BN1WZ74JG
{{.alarmStatus}}Alarm status.0: alarm recovered; 1: alarm triggered; -: no status notification
{{.region}}Region.Cavite
{{.namespace}}Namespace.convergecloud/cvm
{{.alarmObject}}Cloud product dimension information.{"unInstanceId": "ins-o9p3rg3m", "objId": "xxxxxxxxxxxx"}
{{.policyType}}Alarm policy type.cvm_device
{{.policyName}}Alarm policy name.CVM alarm
{{.metricName}}Metric name.cpu usage
{{.metricShowName}}Metric display name.CPU utilization
{{.calcType}}Calculation type.>
{{.calcValue}}Threshold.90
{{.currentValue}}Current value.92
{{.unit}}Unit.%
{{.period}}Statistical granularity (unit: s).5
{{.periodNum}}Number of lasted data points.5
{{.alarmNotifyType}}Whether repeated alarms are supported. singleAlarm: single alarm; exponentialAlarm: exponential period alarm; continuousAlarm: continuous alarm. For metrics without thresholds, this field is not returned.singleAlarm
{{.alarmNotifyPeriod}}Alarm notification frequency (unit: s).300
{{.firstOccurTime}}First occurrence time.2024-07-09 14:35:00 (UTC+08:00)
{{.durationTime}}Alarm duration (unit: s).500
{{.recoverTime}}Recovery time (0 when not recovered).0