Files
fission-src/Documentation/docs-site/content/usage/trigger.en.md
T
Soam VasaniandGitHub 1ea665386a Docs update (#542)
* Misc doc updates

* Some theme updates: no all caps headers, remove blue arrows
2018-03-09 11:26:15 -08:00

54 lines
1.3 KiB
Markdown

---
title: "Triggers"
draft: false
weight: 44
---
### Create a HTTP Trigger
You can create a HTTP trigger with default method (GET) for a function:
```
$ fission ht create --url /hello --function hello
trigger '94cd5163-30dd-4fb2-ab3c-794052f70841' created
```
### Create a Time Trigger
Time based triggers can be created with cron specifications:
```
$ fission tt create --name halfhourly --function hello --cron "0 30 * * *"
trigger 'halfhourly' created
```
Also a more friendly syntax such "every 1m" or "@hourly" can be used to create a time based trigger.
```
$ fission tt create --name minute --function hello --cron "@every 1m"
trigger 'minute' created
```
You can list time based triggers to inspect their associated function and cron specifications:
```
$ fission tt list
NAME CRON FUNCTION_NAME
halfhourly 0 30 * * * hello
minute @every 1m hello
```
### Create a Message Queue Trigger
A message queue trigger invokes a function based on messages from an
message queue. Currently, NATS and Azure Storage Queue are supported
queues. (Kafka support is under development.)
```
$ fission mqt create --name hellomsg --function hello --mqtype nats-streaming --topic newfile --resptopic newfileresponse
trigger 'hellomsg' created
```
You can list or update message queue triggers with `fission mqt list`,
or `fission mqt update`.