Overview
Webhooks allow you to trigger a URL for a variety of trigger conditions. You can configure webhooks to listen for specific events like autostopping gateway warmup. Lightwing will send a POST request with data to the webhook URL.
Setting up a webhook integration
- Navigate to the settings page
- Click on the
Integrations
tab - Add a new Webhook and configure the URL
Securing endpoints
You can secure the endpoint with a secret token. If secret token is set, lightwing will set X-Lightwing-SecretToken
header with the secret value.
Event format
Autostopping events
Cooldown
Only relevant parts of the payload is displayed here.
{
"machine": {
"id": "i-06d0f2574d5ff1dd5",
"name": "server1",
"region": "us-east-1",
"availability_zone": "us-east-1c",
"status": "running",
"type": "t2.micro",
"launch_time": "2020-05-12T11:26:09Z"
},
"service_id": 38,
"trigger": "autostopping_cooldown",
"ts": "2020-05-12T11:27:49.178821049Z"
}
Warmup
{
"machine": {
"id": "i-06d0f2574d5ff1dd5",
"name": "server1",
"region": "us-east-1",
"availability_zone": "us-east-1c",
"status": "running",
"type": "t2.micro",
"launch_time": "2020-05-12T11:26:09Z"
},
"service_id": 38,
"trigger": "autostopping_warmedup",
"ts": "2020-05-12T11:27:49.178821049Z"
}