Callback API

Last updated:2020-06-16 16:21:21

A callback API enables your system to receive alarm messages directly from Kingsoft Cloud. By using HTTP POST requests, alarm messages are pushed to publicly accessible URLs for further processing.

Concepts

  • Callback API: Provide a URL address to receive HTTP POST requests, which must be accessible through the public network, as the callback address.

  • Trigger callback: The trigger policy of the callback API is the same as that of the alarm SMS and email notifications. Alarm messages will be sent via the callback API when an alarm policy is triggered or restored.

  • Bind callback API: You can configure the callback API at the third step of creating an alarm policy. You can bind only one alarm callback URL to each alarm policy group.

Callback API parameters

The callback API will send the data in JSON format via HTTP POST requests. The parameters are as follows:

{
    "alarmState": 1,    // 1: Alarm. 0: Restore
    "alarmObjInfo": {
        "region": "Shanghai Region 2 (VPC)",              // Data center
        "namespace": "Eip",                     // Product type
        "tag": [                                //Instance ID
            "host=50fa05d9211b478293744280ac1592ag" ,
            "p1=cpu1"
        ]  
    },
    "alarmPolicyInfo": {
        "policyId": 8888,                   // Policy ID
        "policyName": "test11",             // Policy name
        "conditions": [{                    // Policy rule
            "metricAlias": "CPU utilization",        // Metric name alias
            "metricName": "cpu.util",       // Metric name
            "period": "5m",                 // Statistical period
            "function": "avg",              // Operation function, which can be max, min, avg, or happen
            "points": "1",              // Continuous period
            "op": ">",                  // Comparison operator, which can be > or <
            "threshold": "50",          // Threshold
            "CurValue": "60",           // Current alarm value
            "units": "",                // Measurement unit
            "alarmInterval": "60",           // Alarm sending interval
            "alarmMax": "3",            // Maximum times of alarm sending
        }]
    },
    "timestamp": "1547092067",          // Alarm timestamp
    "step": 1                       // Number of alarms
}

Did you find the above information helpful?

Unhelpful
Mostly Unhelpful
A little helpful
Helpful
Very helpful

What might be the problems?

Insufficient
Outdated
Unclear or awkward
Redundant or clumsy
Lack of context for the complex system or functionality

More suggestions

0/200

Please give us your feedback.

Submitted

Thank you for your feedback.

问题反馈