This topic describes how to create a time trigger in the Function Compute console
to trigger a function every 5 minutes.
Create a trigger
- Log on to the Function Compute console.
- In the top navigation bar, select a region.
- In the left-side navigation pane, click Service/Function.
- Find the required function in the required service and click the name of the function.
- Click the Triggers tab. On the tab, click Create Trigger.
- In the Create Trigger dialog box, enter the related information. Then click OK.
Parameter |
Action |
Example |
Trigger Type |
Select Time Trigger.
|
Time trigger |
Trigger Name |
Enter a trigger name. |
my_trigger |
Version/Alias |
Enter the version of the trigger. Default value: LATEST. For more information, see Introduction to versions.
|
LATEST |
Time Settings |
Select one of the following configuration modes as needed.
- Interval: Enter a positive integer n in this field. It indicates that the function will be
triggered every n minutes.
- Cron Expression: Enter a Cron expression in this field to trigger the function at the specified time.
The standard Cron expression is in the following format: Seconds Minutes Hours Day-of-month
Month Day-of-week.
Note The Cron expression runs in Coordinated Universal Time (UTC). In other words, the
time used in the Cron expression is the value obtained by subtracting 8 hours from
the Beijing time.
|
Interval: 5 minutes |
Enable Trigger |
Turn on Enable Trigger.
|
Turn on the switch |
Event Payload |
Enter custom parameters. |
{"name":"fc"}
|
The Cron expression, Seconds Minutes Hours Day-of-month Month Day-of-week, is described
as follows: