Trigger Management

Last updated: 2023-09-27 17:56:10

Currently, HTTP-triggered Functions only support API Gateway triggers. You can bind API Gateway triggers in the SCF console or bind backend functions in the API Gateway console.

Trigger Type Description

For HTTP-triggered functions, triggers support two creation methods: default creation and custom creation. You can choose an appropriate method according to the actual situation:
Features
Default Creation (Basic API Gateway)
Custom Creation (Standard API Gateway)
Default domain name
Supported
Supported
Binding to custom domain name
Manual binding
Management in API Gateway console
Request method configuration
Supported
Supported
Release environment configuration
Supported
Supported
Authentication method configuration
Supported
Supported
Visibility in API Gateway console
Invisible
Visible
Advanced API Gateway capabilities (such as plugin and dedicated instance)
Not supported
Supported
Billing method
No charges are levied for the number of gateway calls.
Billed according to the standard API Gateway billing plan
Type conversion
The gateway can be upgraded to a standard API Gateway instance. After upgrade, you can use all gateway capabilities and billed by standard API Gateway billable items.
The gateway edition cannot be changed. A standard API Gateway instance cannot be rolled back to a basic API Gateway instance in default creation.
For detailed billing methods, see HTTP-triggered Function Billing Instructions.

Trigger Overview

Characteristics of HTTP API Gateway triggers:
Transparent HTTP Request Upon receiving an HTTP request, if the API on the gateway is configured to dock with a cloud function, the function will be triggered to run. At this point, the API Gateway will directly forward the HTTP request without converting it into an event type format. The relevant information of the HTTP request includes the specific service and API rules that received the request, the actual path of the request, the method, and the content of the request's path, header, and query.
Synchronous Invocation The API Gateway invokes the function synchronously, waiting for the function to return before the timeout period configured in the API Gateway expires. For more details on invocation types, please refer to Invocation Types.

Trigger Configuration

Basic gateways can only be bound through the Cloud Function console using the default creation method.
API Gateway triggers can be configured either in the Cloud Function Console or in the API Gateway Console. For more details on trigger configuration, please refer to API Gateway Trigger Configuration.

Trigger Binding Limits

In API Gateway, one API rule can be bound to only one function, but one function can be bound to multiple API rules as the backend. You can create an API with different paths in the API Gateway console and point the backend to the same function. APIs with the same path, same request method, and different release environments are regarded as the same API and cannot be bound repeatedly.

Request and Response

Request method is the method to process request sent from API Gateway to SCF, and response method is the method to process the returned value sent from SCF to API Gateway. For HTTP-triggered functions, API Gateway will add the information required for function triggering in the header and directly pass through the original request to trigger the backend function.
Note
The following parameters do not support user-defined configurations:
Connection Field
Custom fields beginning with X-SCF-