New alert notification
Webhook
The Alert Notification API provides a webhook mechanism for real-time alert notifications, allowing for immediate reaction to various types of system events. This API sends notifications as JSON payloads to pre-configured endpoints.
Upon receiving a notification, you can optionally return a HTTP 200 OK
status
code to acknowledge receipt, however we do not make repeat attempts at delivery
should publishing fail.
Events
The following events will trigger a notification:
RAISED
: A new alert has been generated.SEVERITY_INCREASED
: The severity level of an existing alert has been increased.CLOSED
: An alert has been closed. Additional information can be found in thecloseReason
property.
Signature verification
All notifications are signed using HMAC-SHA256 to ensure the authenticity of the alert. To verify the payload, you need to:
- Obtain your unique secret key via the Gardin Management Console.
- Compute the HMAC-SHA256 signature of the received payload using your secret key.
- Compare this signature with the value in the Gardin-Signature header of the request.
Below is a sample code snippet in Python that demonstrates how to verify a webhook payload:
import hmac
import hashlib
# Your unique secret key from Gardin Management Console
secret_key = "your_unique_secret_key"
# The payload received from the webhook
payload = "webhook_payload_here"
# The signature from the Gardin-Signature header
received_signature = "signature_from_header"
# Compute the HMAC digest
computed_signature = hmac.new(
secret_key.encode('utf-8'),
msg=payload.encode('utf-8'),
digestmod=hashlib.sha256
).hexdigest()
# Compare the computed and received signature
if computed_signature == received_signature:
print("Webhook verified!")
else:
print("Webhook verification failed!")
Request
Header Parameters
HMAC-SHA256 signature of the payload, used to verify the authenticity of the request. Obtain your unique secret key from the Gardin Management Console to verify the signature.
- application/json
Body
The unique identifier for the alert, represented as a ULID.
Possible values: [LOW
, MEDIUM
, HIGH
]
The severity level of the alert.
Possible values: [HEALTH
, PRODUCTIVITY
]
The type of alert.
Possible values: [RECOVERY_DETECTED
, EXPIRED
, REPLACED
]
The reason for the alert closure. Only present for CLOSED
events.
Possible values: [RAISED
, SEVERITY_INCREASED
, CLOSED
]
The event that triggered the notification.
The identifier of the growth job associated with the alert.
The unique identifier for the notification, represented as a ULID.
Possible values: [LOW
, MEDIUM
, HIGH
]
The previous severity level of the alert. Only present for SEVERITY_INCREASED
events.
The identifier for your tenancy, represented as a ULID.
The timestamp when the event occurred (RFC-3339 format).
Responses
- 200
API users can return a HTTP 200 OK
status to indicate that the data was received successfully.