Last updated: 2021-01-05 14:27:12

1. API Description

Domain name for API request:

This API is used to obtain function details, such as name, code, handler, associated trigger, and timeout.

A maximum of 20 requests can be initiated per second for this API.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example:

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: GetFunction.
Version Yes String Common parameter. The value used for this API: 2018-04-16.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
FunctionName Yes String Name of the function to obtain details
Qualifier No String Function version number
Namespace No String Function namespace
ShowCode No String It indicates whether to display the code. TRUE means displaying the code, and FALSE means hiding the code. The code will not be displayed for entry files exceeding 1 MB.

3. Output Parameters

Parameter Name Type Description
ModTime Timestamp Latest modification time of the function
CodeInfo String Function code
Description String Function description
Triggers Array of Trigger Function trigger list
Handler String Function entry
CodeSize Integer Function code size
Timeout Integer Function timeout
FunctionVersion String Function version
MemorySize Integer Maximum available memory of the function
Runtime String Function running environment
FunctionName String Function name
VpcConfig VpcConfig Function VPC
UseGpu String Whether to use GPU
Environment Environment Function environment variable
CodeResult String Whether the code is correct
CodeError String Code error information
ErrNo Integer Error code
Namespace String Function namespace
Role String Role bound to the function
InstallDependency String Whether to install dependencies automatically
Status String Function status. For valid values and status change process, please see here
StatusDesc String Status description
ClsLogsetId String CLS logset to which logs are shipped
ClsTopicId String CLS Topic to which logs are shipped
FunctionId String Function ID
Tags Array of Tag Function tag list
EipConfig EipOutConfig EipConfig configuration
AccessInfo AccessInfo Domain name information
Type String Function type. The value is HTTP or Event.
L5Enable String Whether to enable L5
Layers Array of LayerVersionInfo Version information of a layer associated with a function
DeadLetterConfig DeadLetterConfig Information of a dead letter queue associated with a function
AddTime Timestamp Function creation time
PublicNetConfig PublicNetConfigOut Public network access configuration
Note: This field may return null, indicating that no valid values can be obtained.
OnsEnable String Whether Ons is enabled
Note: This field may return null, indicating that no valid value was found.
CfsConfig CfsConfig File system configuration parameter, which is used for the function to mount the file system
Note: this field may return null, indicating that no valid values can be obtained.
AvailableStatus String Function billing status. For valid values, please see here
Note: this field may return null, indicating that no valid values can be obtained.
Qualifier String Function version
Note: this field may return null, indicating that no valid values can be obtained.
InitTimeout Integer Timeout period for function initialization
StatusReasons Array of StatusReason Cause of function failure
Note: this field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Getting function details

This example shows you how to get the information of a function with the specified version and namespace.

Input Example
&<Common request parameters>

Output Example

  "Response": {
    "ModTime": "2018-06-07 09:52:23",
    "Environment": {
      "Variables": []
    "CodeError": "",
    "Description": "",
    "VpcConfig": {
      "SubnetId": "",
      "VpcId": ""
    "Triggers": [],
    "ErrNo": 0,
    "UseGpu": "FALSE",
    "CodeSize": 0,
    "MemorySize": 128,
    "Namespace": "default",
    "FunctionVersion": "$LATEST",
    "Timeout": 3,
    "RequestId": "a1ffbba5-5489-45bc-89c5-453e50d5386e",
    "CodeResult": "failed",
    "Handler": "scfredis.main_handler",
    "Runtime": "Python2.7",
    "FunctionName": "ledDummyAPITest",
    "CodeInfo": "",
    "Role": "",
    "Qualifier": "$LATEST",
    "AvailableStatus": "Available",
    "CfsConfig": {
      "CfsInsList": [
          "LocalMountDir": "",
          "RemoteMountDir": "",
          "MountInsId": "",
          "UserId": 0,
          "UserGroupId": 0,
          "CfsId": "",
          "IpAddress": "",
          "MountVpcId": "",
          "MountSubnetId": ""

5. Developer Resources


TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InternalError Internal error.
InternalError.Exception Internal service error
InternalError.System Internal system error.
InvalidParameter.Payload Invalid request parameter.
InvalidParameterValue Incorrect parameter value.
InvalidParameterValue.CodeSecret CodeSecret error.
InvalidParameterValue.FunctionName The function does not exist.
InvalidParameterValue.Namespace Namespace error.
InvalidParameterValue.Qualifier Unsupported function version.
ResourceNotFound.Function The function does not exist.
ResourceNotFound.FunctionName The function does not exist.
ResourceNotFound.Namespace Namespace does not exist.
ResourceNotFound.Version The version does not exist.
UnauthorizedOperation Unauthorized operation.
UnauthorizedOperation.CAM CAM authentication failed.
UnauthorizedOperation.CodeSecret You do not have permissions to access the code.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback