description | keywords | redirect_from | title | |
---|---|---|---|---|
Use triggers |
API, triggers, endpoints |
|
Use triggers |
Triggers are API endpoints that redeploy or scale a specific service
whenever a POST
HTTP request is sent to them. You can create one or more
triggers per service.
Triggers do not require any authentication. This allows third party services like Docker Hub to call them, however because of this it is important that you keep their URLs secret.
The body of the POST
request is passed in to the new containers as an
environment variable called DOCKERCLOUD_TRIGGER_BODY
.
Docker Cloud supports two types of triggers:
- Redeploy triggers, which redeploy the service when called
- Scale up triggers, which scale the service by one or more containers when called
-
Click the name of the service you want to create a trigger for.
-
Go to the detail page and scroll down to the Triggers section.
-
In the Trigger name field, enter a name for the trigger.
-
Select a trigger type.
-
Click the + (plus sign) icon.
-
Use the POST request URL provided to configure the webhook in your application or third party service.
To stop a trigger from automatically scaling or redeploying, you must revoke it.
-
Go to the detail page of the service.
-
Scroll down to the Triggers section.
-
Click the trashcan icon for the trigger you want to revoke.
Once the trigger is revoked, it stops accepting requests.
See our API and CLI documentation to learn how to use triggers with our API and the CLI.