Function Overview

Last updated: 2020-02-26 18:57:41


An SCF function is the basic unit of management and operation, which usually consists of a series of configuration items and executable code/packages.

Function Configuration Attributes

When creating a function, you need to provide the following information:

  • Function name (FunctionName): Required, which is the unique identifier of the function and cannot be modified after creation.
  • Runtime environment (Runtime): Required, which specifies the runtime environment of the function and cannot be modified after creation.
  • Function code (Code): Required, which is the code that the function executes and can be modified after creation.
  • The execution method Handler: is required, and the function handles the method name, usually by the file name. Method name "composition. This varies by runtime environment. For more information, see the descriptions of each programming language.
  • Function description (Description): Optional, which can be used to record information such as the purpose of the function.

In addition to the above, you can also use the Updating the Function Configuration Modify the following to configure more information about the function runtime:

  • Memory size (MemorySize): Optional, which specifies the amount of memory available for the function during execution. The minimum value is 128 MB (default) and increments by 128 MB.
  • Execution timeout (Timeout): Optional, which specifies the maximum execution duration of the function between 1 and 300 seconds (3 seconds by default).
  • Environment variable (Environment): Optional, which can be defined in the configuration and obtained from the environment when the function is executed.
  • VPC (VPCConfig): Optional. After configuring a VPC, you can place the function in the configured VPC for execution.

Executable Operations for a Function

  • Creating a Function Create a new function
    Describes an object whose type is COS Trigger .
  • Updating function configuration: Update the configuration items of the function;
  • Updating function code: Update the execution code of the function;
  • Get details : get the details of function configuration, trigger and code;
  • Test run function According to the need, trigger the function to run by synchronous or asynchronous method;
  • Get log Get the log of the operation and output of the function
  • Deleting a database and table
  • Copy function: copy the function to the specified region, the specified name, the specified configuration.

Function trigger-related operations include:
For details, see Trigger Description .
For details, see Trigger Description .