Callback Interface
Definition
The HTTP service address accessible to the public network is used as the callback address. When an alarm is triggered, the monitoring center will push the alarm to this address.
After creating a webhook, your system can receive alarm information from SurferCloud. When there is an alarm, the SurferCloud system will send the alarm information to the specified URL by HTTP POST, and you can process the received information.
Conditions
Users need to provide an HTTP service that receives POST requests to handle POST requests sent by SurferCloud, and register the URL of this service in the alarm system of SurferCloud.
JSON Body Example
Alarm
{
SessionID: "xxxxxxxxxxxxxxxxxxxxxxx",
Region: " cn-north-03",
ResourceType: "uhost",
ResourceId: "uhost-xxxx",
MetricName: "MemUsage",
AlarmTime: 1458733318,
RecoveryTime : 0
}
Recovery
{
SessionID: "xxxxxxxxxxxxxxxxxxxxxxx",
Region: "cn-north-03",
ResourceType: "uhost",
ResourceId: "uhost-xxxx",
MetricName: "MemUsage",
AlarmTime: 0,
RecoveryTime: 1458733318
}
Field Explanation
Field | Explanation |
---|---|
SessionID | Session ID for this message |
Region | Region Name |
ResourceType | Resource Type |
MetricName | Metric Name for current warning |
AlarmTime | Alarm time |
RecoveryTime | Recovery time |
Content | Warning content |
Response
We need to receive such a response here, indicating that the user has successfully received the push information, otherwise it will try again 2 times:
{
SessionID: "xxxxxxxxxxxxxxxxxxxxxxx",
RetCode: 0
}