How FunctionGraph Works?
Perform the following procedure to build and execute a function on the FunctionGraph console, as shown in Figure 1:
- Build and deploy an application.
- Create a function on the FunctionGraph console.
- Write service code, package it, and upload it to the function.
- Add event sources to the function, such as Simple Message Notification (SMN), Distributed Message Service (DMS), Data Ingestion Service (DIS), and Object Storage Service (OBS).
When the function is triggered by a specified RESTful API or HUAWEI CLOUD service event, function instances are generated to implement service functions. FunctionGraph schedules resources during the function execution.
- View the logs and metrics of the function.
You pay only for the code execution duration, and there is no charge when your code is not running.
The process is explained as follows:
- Write code in Node.js, Python, Java, Go, C#, or PHP. For details, see the FunctionGraph Developer Guide.
- Alternatively, edit code inline, directly upload a ZIP file or JAR file, or upload a ZIP file from OBS. For details, see Table 3.
- Set an API or cloud service event source to trigger your function. For details, see Using an SMN Trigger, Using a DMS Trigger, Using an APIG Trigger, Using an OBS Trigger, Using a DIS Trigger, and Using a Timer Trigger.
- During function execution, FunctionGraph scales automatically based on the number of requests without the need for configurations. For details about the maximum number of function instances that can be run concurrently, see Usage Restrictions.
- FunctionGraph works with Log Tank Service (LTS), allowing you to query run logs of your function without the need for configurations. For details, see Querying Logs.
- FunctionGraph works with Cloud Eye, allowing you to view graphical monitoring information about your function without the need for configurations. For details, see Viewing Function Metrics.
- After function execution, FunctionGraph bills based on the compute time you consume. The billing is down to the 100 ms range.