Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions content/en/docs/cli/entities/triggers/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,39 @@ In this example, whenever a user visits either the homepage or the
contact page, the "SendSlackNotification" action will be triggered,
resulting in a Slack notification being sent.

### Step 3: Firing your triggers

Triggers can be fired in two different ways:

- With the CLI:

```sh
ops trigger fire <TRIGGER-NAME>
```

- With the API:

```sh
curl -u $AUTH https://{API_HOST}/api/v1/namespaces/{namespace}/triggers/{triggerName}
```

`API_HOST` is your Openwhisk url (`ops debug apihost`), `namespace` can be `_` to
use your default namespace, and `triggerName` is obviously the trigger name.

So if you create a trigger with name `event`, and you host on openserverless.dev,
the URL to fire it would be:

```sh
https://openserverless.dev/api/v1/namespaces/_/triggers/event
```

See more details in the [REST API docs](/docs/reference/references/rest_api/_index.md#triggers).

> ⚠️ **WARN**
>
> Unfortunately, at the moment both options require authentication, which prevents
> triggers from being used as simple web hooks.

## Conclusion

Triggers provide a flexible and scalable way to automate workflows based
Expand Down