Compute > Cloud Functions > Console User Guide

This document describes how to create and manage functions in Cloud Functions console.

Manage functions

You can create, edit, delete, and copy functions.

Create functions

Configure the function, write your code, and build it. Then, click Create to deploy the function using the latest built package.

console-guide-07 console-guide-08

Function settings

Category No. Item Description
Basic Information 1. Name Name of the function
Duplicate function names are not allowed.
Used as the function endpoint URL.
2. Description Description of the function, up to 250 characters
Function settings 3. Endpoint URL Function call HTTP endpoint URL
It changes automatically as you enter the function name.
4. Type Pool Manager
New Deployment
5. Resource Select function behavior environment resources
If it’s Pool Manager type, only the specified resources can be selected
New Deployment type allows you to enter custom resources
6. Execution timeout Specify how long the function will run (Time out). If the function runs and exceeds the specified time, the function is forced to abort and responds with an error
7. (Pool Manager) Concurrent execution settings Specify the number of concurrent executions of the function. When concurrent function calls occur, instances are executed concurrently as many times as the number of calls, and the maximum number of instances is limited.
8. (New Deployment) Minimum number of instances Specify the minimum number of instances to retain.
9. (New Deployment) Maximum number of instances Specify the maximum number of instances that can scale up automatically.
Log settings 10. Integrate with log service Choose to integrate using Log & Crash Search service
The logs of the function are available directly from Log & Crash Search service.
Logs are sent in 10-line units.

[Note]
(Pool Manager) Concurrent execution settings

console-guide-05


[Note]
(New Deployment) Number of instances - Depending on resource usage, the specified number of instances might not be created.


Code writing

console-guide-09 console-guide-10 console-guide-11

Category No. Item Description
Source code 1. Runtime Environment Select the function's runtime environment
2. Entry Point Specify the entry point for the function, such as function name
It is automatically completed to match the template in the runtime environment.
It must match the entry point in the source code that you wrote when you modified randomly.
If you entered it incorrectly, you cannot check it with build, but you can check it with with the log during testing.
Code 3. Code editor The template files in the runtime environment are loaded, and you modify them to write the function.
You cannot add directories on the code editor. To edit the directory structure, you must download the template file, edit it locally, and then upload the ZIP file.
4. User’s local environment Write function code in the local environment and upload as a ZIP file
5. Build Build a package from the code you have written or uploaded.
The built packages are used for testing. When creating or updating a function, the latest built package is automatically integrated into the function version
Test 6. Test events Create a JSON Body to send to the function
7. Test Test the function by sending the JSON Body you created to the event. (This must be built first.)
You can verify function behavior with logs.
Call with the GET method.
8. Creation Use the Generate button to generate a function based on the function settings and the function you created.


[Note]
Packages generated via Build button are linked to the function version during creation or updates. You must perform at least one build before creating a function

Modify functions

To modify the function settings and code of an existing function, click Modify button to modify the function.

Non-modifiable item

  • Name, runtime environment
    • You can edit everything except the item.

Source code

  • If you're using the code editor, the existing code is loaded.
  • If you created a function by uploading a ZIP file from the local environment, when you switch to the code editor, it loads the default template code without showing the ZIP file.

Delete a function

console-guide-14 Select an existing function to delete it. You can delete multiple functions at once.

Copy a function

console-guide-13 Copy a function that is identical to an existing function. The name cannot be duplicated, so you can rewrite the name before copying. - Triggers are not copied. (HTTP triggers are provided by default). - Only the currently applied version will be copied.

About functions

List of functions

console-guide-01 - You can see a list of functions that users have created. - Build status shows the build status of the current version.

Basic information of functions

console-guide-02 - You can see basic information about the function. - Click Log & Crash Search in the Log Management section to view your logs in the Log & Crash Search service.

Function versioning

console-guide-15 - You can manage function versions. - You can view version history and rollback to any previous version.

Versioning overview

Build your code by clicking Build in the function creation or modification screen to generate a package. - When you create or update a function, the latest built package is integrated into the function version. - Each version is managed independently, allowing you to apply a tested version directly to your function. - At least one build is required to enable function creation.

Version information

No. Item Description
1. Version List You can check the full version history of the function.
This list displays information such as the version name, runtime, source code, and build status.
2. Currently applied version It diplays the version currently applied to the function.
3. Download source code You can download the source code of the selected version as a ZIP file.
4. Check logs You can check the selected version's build logs.
This is the same as the feature to check build logs in the Basic Information tab.

Deploy versions

  • Select a version from the list and click Deploy Version to update the function to the version.
  • The currently applied version cannot be selected for deployment.
  • Only one version can be deployed at a time; multiple selection is not supported.
  • Versions with a failed build status can still be deployed.

[Note]
A confirmation popup will appear upon deployment. Once the deployment is successful, the version list will refresh automatically.

Delete versions

  • To delete a version, select it from the list and click Delete Version.
  • The currently applied version cannot be deleted.
  • You can select and delete multiple versions at once.
  • Deleting a version also removes its associated source code.

[Note]
A confirmation popup will appear when deleting a version. Please note that deleted versions cannot be recovered.

Constraints

  • Canceling function creation or modification will prevent the built package from being integrated into a function version.
  • Deleting a function will permanently remove all integrated versions.
  • When copying a function, only the currently active version is copied. The full version history will not be copied.
  • While multiple runtimes are available during function creation, you can only build using the initially selected runtime when modifying the function.

Manage function triggers

You can manage triggers that can perform functions. - HTTP triggers are built-in when creating a function. - You can set whether to use through the Enable/Disable features.

console-guid-12

  • You can execute the function you created via a given HTTP trigger.
    • Example: https://{userdomain}/{function name}
    • Method : GET, POST

Create/edit triggers

  • Timer
    • Value: Enter the cycle as a Cron string.
    • API Gateway
    • You can add HTTP Endpoint by using the API Gateway service.

Delete triggers

  • You can select multiple triggers to delete. You can't delete the HTTP trigger, which is the default trigger.

Monitor functions

console-guide-06 - You can check the usage of a function. - Provide metrics for the number of function calls, number of call rejections, number of errors, success rate, and function execution time. - Provide metrics within a set time. - If logs are integrated, you can navigate to the Log & Crash Search service using the Log & Crash Search button.

Item Description
Number of function calls Total number of function calls (per second)
Number of call rejections Number of function calls that failed as instances were not created (per second)
Number of errors Number of responses with a non-200 response code (per second)
Success rate Ratio of successful calls to the total number of function calls
Function execution time Response time for function calls

[Note]
The number of call rejections is only relevant if the type is Pool Manager.
The number of function calls, call rejections, and errors are displayed as an average number of times per second within the range of the metric step. For example, if the step is 15 seconds and 1 event occurred within the time period, it is displayed as 0.0667 (1÷15).
The average of the function execution time is the overall cumulative average, and the maximum is the maximum execution time during the period.

TOP