docs
umon
Operation Guide
Callback Interface

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

FieldExplanation
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 here, indicating that the user has successfully received the push information, otherwise it will try again 2 times:

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