For details about the APIG event source, see Supported Event Sources.
You have created an API group, for example, APIGroup_test. For details, see Creating an API Group.
# -*- coding:utf-8 -*-import jsondef handler (event, context):body = "<html><title>Functiongraph Demo</title><body><p>Hello, FunctionGraph!</p></body></html>"print(body)return {"statusCode":200,"body":body,"headers": {"Content-Type": "text/html",},"isBase64Encoded": False}
Parameter | Description |
|---|---|
Trigger Type | Select API Gateway (Dedicated Gateway). |
API Name | Enter an API name, for example, API_apig. |
API Group | An API group is a collection of APIs. You can manage APIs by API group. Select APIGroup_test. |
Environment | An API can be called in different environments, such as production, test, and development environments. API Gateway provides the environment management function, which allows you to define different request paths for an API in different environments. To ensure that the API can be called, select RELEASE. |
Security Authentication | There are three authentication modes:
Select None. |
Protocol | There are two types of protocols:
Select HTTPS. |
Timeout (ms) | Enter 5000. |
Figure 1 APIG trigger
