Webhooks
Webhooks allow you to subscribe to events that occur as Nullstone provisions and deploys your applications and infrastructure. When an event occurs, Nullstone will send a POST request to the url you provide.
The request will contain a JSON payload with the details of the event. An example payload for a first-deployed
event is shown below.
{
"blockId": 123687,
"envId": 220299,
"envName": "dev",
"envType": "PipelineEnv",
"event": "first-deployed",
"orgName": "ssickles",
"stackId": 4845
}
Any response with a status code less than 400 will be considered a success, although 200 is typically used. Each webhook callback has a timeout of 10 seconds. Your endpoint should queue a job and then return quickly. It is not recommended to perform a full data load directly in your endpoint.
Configuration
Webhooks can be configured for each block in your stack. Navigate to the settings page for any block (app, datastore, etc). There is a section for webhooks. Each webhook is listed with the callback URL, event, and environment.
To view all the webhooks configured in the entire stack, navigate to the settings page for the stack. Each webhook is listed along with the block (app, datastore, etc) that it is configured on.
Environments
For each webhook configured, you can specify which environment(s) you would like to have the callback triggered. You can select specific environments or a set of environments.
Environment | Description |
---|---|
dev , staging , prod | These are example environments. Select from any environments you have created. |
any-preview | Configure your webhook to be called for any preview environment, including those created after configuring your webhook. |
any-pipeline | Configure your webhook to be called for any pipeline environment. This would include the environments dev, staging, and prod. It would also include any future pipeline environments created at a later time. |
Events
There are currently 5 events that can be subscribed to.
Event | Description |
---|---|
launched | Triggered when the infrastructure for a block has been first launched. |
updated | Triggered any time the infrastructure for a block has been updated. |
destroyed | Triggered when the infrastructure for a block has been destroyed. |
first-deployed | Triggered when the code for an application has been deployed for the first time. |
deployed | Triggered any time the code for an application has been deployed. |