docs
umon
Callback Interface

Callback Interface

Definition

The http service address accessible to the public network serves 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 SurferCloud alarm information. When there is an alarm, SurferCloud's system will send the alarm information to the designated URL by HTTP POST method, and you can handle the received information.

Condition

Users need to provide an HTTP service that receives POST requests to handle the POST requests sent by SurferCloud, and register the URL of this service with SurferCloud's alarm system.

JSON Body Example

Alarm

{
    SessionID: "xxxxxxxxxxxxxxxxxxxxxxx",
    Region: " cn-north-03",
    ResourceType: "uhost",
    ResourceId: "uhost-xxxx",
    MetricName: "MemUsage",
    AlarmTime: 1458733318,
    RecoveryTime : 0,
    Content:"【SurferCloud】Alarm: Beijing Two 2023-08-05 11:30:04 uhost(ID:uhost-xxxx-0.0.0.0-) Connection number(330.00)<6000 (SurferCloud)"
}

Recovery

{
    SessionID: "xxxxxxxxxxxxxxxxxxxxxxx",
    Region: "cn-north-03",
    ResourceType: "uhost",
    ResourceId: "uhost-xxxx",
    MetricName: "MemUsage",
    AlarmTime: 0,
    RecoveryTime: 1458733318,
    Content:"【SurferCloud】Alarm Recovery: Beijing Two 2023-08-05 11:30:04 uhost(ID:uhost-xxxx-0.0.0.0-) Connection number(330.00)<6000 (SurferCloud)"
}

Field Explaination

FieldExplaination
SessionIDSession ID for this message
RegionRegion Name
ResourceTypeResource Type
MetricNameMetric Name for current warning
AlarmTimeAlarm time
RecoveryTimeRecovery time
ContentWarning content

Response

We need to receive such a response, indicating that the user has successfully received the push information, otherwise it will retry 2 times:

{
    SessionID: "xxxxxxxxxxxxxxxxxxxxxxx",
    RetCode: 0
}
  • Company
  • ContactUs
  • Blog
Copyright © 2024 SurferCloud All Rights Reserved