forked from docs/doc-exports
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
7.7 KiB
7.7 KiB
Creating a Function Using a Template
Introduction
FunctionGraph provides templates to automatically complete code and running environment configurations when you create a function, helping you quickly build applications.
Step 1: Prepare the Environment
To perform the operations described in this section, ensure that you have the FunctionGraph FullAccess permissions, that is, all permissions for FunctionGraph. For more information, see section "Permissions Management".
Step 2: Create a Function
- Log in to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
- Click Create Function in the upper right corner and choose Select template.
- Select the template shown in Figure 1 and click Configure.
- Set Function Name to context, select any agency from the Agency drop-down list, retain default values for other parameters, and click Create Function.
Step 3: Test the Function
- On the function details page, click Test. In the displayed dialog box, create a test event.
- Select blank-template, set Event Name to test, and click Create.
Step 4: View the Execution Result
Click Test and view the execution result on the right.
- Function Output: displays the return result of the function.
- Log Output: displays the execution logs of the function.
- Summary: displays key information of the logs.
Step 5: View Monitoring Metrics
On the function details page, click the Monitoring tab.
- On the Monitoring tab page, choose Metrics, and select a time range (such as 5 minutes, 15 minutes, or 1 hour) to query the function.
- The following metrics are displayed: invocations, errors, duration (including the maximum, average, and minimum durations), and throttles.
Step 6: Delete a Function
- On the function details page, choose Operation > Delete Function in the upper right corner.
- In the confirmation dialog box, enter DELETE and click OK to release resources in a timely manner.
Parent topic: Getting Started