tencent cloud

Serverless Cloud Function

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Related Concepts
How It Works
Strengths
Scenarios
Related Products
Purchase Guide
Billing Overview
Billing Mode
Billable Items and Billing Modes
Function Computing Power Support
Free Tier
SCF Pricing
Billing Example
Payment Overdue
Getting Started
Creating Event Function in Console
User Guide
Quota Management
Managing Functions
Web Function Management
Log Management
Concurrence Management
Trigger Management
Function URL
A Custom Domain Name
Version Management
Alias Management
Permission Management
Running Instance Management
Plugin Management
Managing Monitors and Alarms
Network Configuration
Layer Management
Execution Configuration
Extended Storage Management
DNS Caching Configuration
Resource Managed Mode Management
Near-Offline Resource Hosting Model
Workflow
Triggers
Trigger Overview
Trigger Event Message Structure Summary
API Gateway Trigger
COS Trigger
CLS Trigger
Timer Trigger
CKafka Trigger
Apache Kafka Trigger
MQTT Trigger
Trigger Configuration Description
MPS Trigger
CLB Trigger Description
TencentCloud API Trigger
Development Guide
Basic Concepts
Testing a Function
Environment Variables
Dependency Installation
Using Container Image
Error Types and Retry Policies
Dead Letter Queue
Connecting SCF to Database
Automated Deployment
Cloud Function Status Code
Common Errors and Solutions
Developer Tools
Serverless Web IDE
Calling SDK Across Functions
Third-Party Tools
Code Development
Python
Node.js
Golang
PHP
Java
Custom Runtime
Deploying Image as Function
Web Framework Development
Deploying Framework on Command Line
Quickly Deploying Egg Framework
Quickly Deploying Express Framework
Quickly Deploying Flask Framework
Quickly Deploying Koa Framework
Quickly Deploying Laravel Framework
Quickly Deploying Nest.js Framework
Quickly Deploying Next.js Framework
Quickly Deploying Nuxt.js Framework
Quickly Deploying Django Framework
Use Cases
Overview
Solutions with Tencent Cloud Services
Business Development
TRTC Practices
COS Practices
CKafka Practice
CLS
CLB Practice
MPS
CDN
CDWPG
VOD
SMS
ES
Scheduled Task
Video Processing
Success Stories
Tencent Online Education
Online Video Industry
Tencent Online Education
Best Practice of Tencent IEG Going Global
API Documentation
History
Introduction
API Category
Making API Requests
Other APIs
Namespace APIs
Layer Management APIs
Async Event Management APIs
Trigger APIs
Function APIs
Function and Layer Status Description
Data Types
Error Codes
SDK Documentation
FAQs
General
Web Function
Billing FAQs
Network FAQs
Log FAQs
SCF utility class
Event Handling FAQs
API Gateway Trigger FAQs
Related Agreement
Service Level Agreement
Contact Us
Glossary

Trigger Configuration Description

PDF
フォーカスモード
フォントサイズ
最終更新日: 2024-12-02 19:58:17
When you call the trigger API CreateTrigger, the corresponding TriggerDesc parameter will be the trigger description, which can be used as instructed in this document.

Timer Trigger

Please directly enter a cron expression for this parameter. For more information, please see Timer Trigger Description.

Sample TriggerDesc

Triggered once every five minutes:
0 */5 * * * * *

API Gateway Trigger

Name
Type
Required
Description
api
No
API configuration of the created API gateway
service
No
Service configuration of the created API gateway
release
No
Release environment for the created API gateway

ApigwApi

Name
Type
Required
Description
authRequired
String
No
Whether authentication is required. Valid values: TRUE, FALSE. Default value: FALSE
requestConfig
No
Configuration of request backend API
isIntegratedResponse
String
No
Whether to use integrated response. Valid values: TRUE, FALSE. Default value: FALSE
IsBase64Encoded
String
No
Whether to enable Base64-encoding. Valid values: TRUE, FALSE. Default value: FALSE

ApigwApiRequestConfig

Name
Type
Required
Description
method
String
No
Method configuration of request backend API. Valid values: ANY, GET, HEAD, POST, PUT, DELETE

ApigwService

Name
Type
Required
Description
serviceId
String
No
Apigw Service ID (if this parameter is not passed in, a new service will be created)

ApigwRelease

Name
Type
Required
Description
environmentName
String
Yes
Release environment. Valid values: release, test, prepub. If this parameter is left empty, release will be used by default

Sample TriggerDesc

{
"api":{
"authRequired":"FALSE",
"requestConfig":{
"method":"ANY"
},
"isIntegratedResponse":"FALSE"
},
"service":{
"serviceName":"SCF_API_SERVICE"
},
"release":{
"environmentName":"release"
}
}

CKafka Trigger

Name
Type
Required
Description
maxMsgNum
String
Yes
A function invocation will be triggered once every time maxMsgNum CKafka messages are aggregated within 5 seconds
offset
String
Yes
offset is the position where consumption of CKafka messages starts. Currently, three values are supported: latest, earliest, and millisecond-level timestamp
retry
String
Yes
Maximum number of retries when the function reports an error

Sample TriggerDesc

{"maxMsgNum":100,"offset":"latest","retry":10000}
{"maxMsgNum":999,"offset":"1595927203000","retry":10}

API request description

To create a CKafka trigger by using an API request, the TriggerName field needs to be defined as the instanceId and topicName of the target CKafka instance in the following format:
[instanceId]-[topicName]. Below is a sample request:
TriggerName: "ckafka-8tfxzia3-test"

COS Trigger

Name
Type
Required
Description
event
String
Yes
filter
Yes
COS filename filter

CosFilter

Name
Type
Required
Description
Prefix
String
No
Prefix rule of file filter
Suffix
String
No
Suffix rule of file filter, which must begin with .

COS event conflict rules

Core concept: an event can trigger a function invocation at most once. If an event is bound to another product, it cannot be bound to a function.
Set at most one prefix filter and one suffix filter.
If the cos:ObjectCreated:* event is set but no prefix/suffix is set, subsequent binding to any event that starts with cos:ObjectCreated will fail.
The filter will be valid only if both the prefix and suffix are matched, and if there are conflicts with both the prefix and suffix, subsequent binding will fail.

Sample TriggerDesc

{"event":"cos:ObjectCreated:*","filter":{"Prefix":"","Suffix":""}}
Note:
When TriggerDesc is used as a trigger description, the JSON string must be continuous with no spaces contained.

API request description

To create a COS trigger by using an API request, the TriggerName field needs to be defined as the XML API access domain name of the target COS bucket. Below is an example:
TriggerName: "xxx.cos.ap-guangzhou.myqcloud.com"
Note:
The access domain name can be viewed in Bucket List > Basic Configuration > Basic Information in the COS console.

CMQ Trigger

Name
Type
Required
Description
filterType
String
No
Message filter type. 1: tag; 2: route match
filterKey
String
No
When filterType is 1, it indicates the message filter tag; when filterType is 2, it indicates the Binding Key

Sample TriggerDesc

{"filterType":1,"filterKey":["test"]}
{"filterType":2,"filterKey":["#test"]}

API request description

To create a CMQ trigger by using an API request, the TriggerName field needs to be defined as CMQ Topic. Below is an example:
TriggerName: "Tabortest"


ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック