Custom Callback API Variables

Last updated: 2021-10-25 14:46:11

    When you configure a custom callback API, you can insert system variables to the API. The system automatically parses the variables when alarms are sent. The following is a list of variables that are applicable to custom callback APIs. For more information, please see Receiving Alarm Notifications via Custom Callback APIs and Configuring Alarm Policy.

    Variable List

    VariableDescription
    {{.UIN}}User account
    {{.User}}Username
    {{.Region}}Region
    {{.AlarmID}}Alarm policy ID
    {{.AlarmName}}Alarm policy name
    {{.Condition}}Trigger condition and parameter
    {{.TriggerTime}}Trigger time
    {{.ConsecutiveAlertNums}}Number of consecutive alarms
    {{.TopicName}}Log topic name
    {{.TopicID}}Log topic ID
    {{.LogsetName}}Logset name
    {{.LogsetID}}Logset ID
    {{.FireTime}}Time when the alarm is triggered for the first time
    {{.Duration}}Alarm duration
    {{.Query}}Monitoring statement
    {{.CustomizeMessage}}Custom alarm notification content

    Example

    Custom API callback configuration:

    Request header: Content-Type: application/json

    Request content:

    {
    "UIN":"{{.UIN}}",
    "User":"{{.User}}",
    "Region":"{{.Region}}",
    "AlarmID":"{{.AlarmID}}",
    "AlarmName":"{{.AlarmName}}",
    "Condition":"{{.Condition}}",
    "TriggerTime":"{{.TriggerTime}}",
    "ConsecutiveAlertNums":"{{.ConsecutiveAlertNums}}",
    "TopicName":"{{.TopicName}}",
    "TopicID":"{{.TopicID}}",
    "LogsetName":"{{.LogsetName}}",
    "LogsetID":"{{.LogsetID}}",
    "FireTime":"{{.FireTime}}",
    "Duration":"{{.Duration}}",
    "Query":"{{.Query}}",
    "CustomizeMessage":"{{.CustomizeMessage}}"
    }