All Products
Search
Document Center

Function Compute:GetFunction

更新时间:Aug 20, 2025

Queries the information about a function.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only common request headers. For more information, see Common parameters.

Request syntax

GET /services/{serviceName.qualifier}/functions/{functionName} HTTP/1.1

Request parameters

NameTypePositionRequiredExampleDescription
serviceNameStringPathYesservice_name

The name of the service.

qualifierStringPathNotest

The version or alias of the service.

functionNameStringPathYesfunction_name

The name of the function.

Response parameters

NameTypeExampleDescription
ETagStringe19d5cd5af0378da05f63f891c74****

The value that is used to ensure that the modified function is consistent with the function that is expected to be modified.

codeChecksumString2825179536350****

The CRC-64 value of the function code package.

codeSizeLong421

The size of the function code package. Unit: byte.

createdTimeString2020-04-01T08:15:27Z

The time when the function was created.

descriptionStringtest_description

The description of the function.

environmentVariablesMap

The environment variables that you configured for the function. You can obtain the values of the environment variables from the function. For more information, see Overview.

functionIdStringaa715851-1c20-4b89-a8fb-***

The ID that is generated by the system for the function. Each function ID is unique in Function Compute.

functionNameStringfunction_name

The name of the function.

handlerStringindex.handler

The handler of the function. For more information, see Function handler.

lastModifiedTimeLong2020-04-01T08:15:27Z

The time when the function was last updated.

memorySizeInteger256

The memory size for the function. Unit: MB. The memory size is a multiple of 64 MB. The memory size that is available for an instance varies based on the instance type. For more information, see Instance specifications.

runtimeStringpython3

The runtime environment of the function. For more information about the runtime environments that are supported by Function Compute, see Supported function runtime environments.

timeoutInteger60

The timeout period for the execution of the function. Unit: seconds. Default value: 60. Valid values: 1 to 86400. When this period ends, the execution of the function is terminated.

initializationTimeoutInteger60

The timeout period for the execution of the initializer function. Unit: seconds. Default value: 3. Valid values: 1 to 300. When this period ends, the execution of the initializer function is terminated.

initializerStringindex.handler

The handler of the initializer function. The format of the value varies based on the programming language that you use. For more information, see Initializer function.

caPortInteger9000

The port on which the HTTP server listens for the custom runtime or custom container runtime.

customContainerConfigCustomContainerConfigInfo

The configurations of the custom container runtime. After you configure the custom container runtime, you can use custom container images to execute functions.

layersArray of String02f81d283888f5ec63442a88fe82b260#Layer-name#1

The name of the layer.

Examples

Sample requests

GET /services/{serviceName.qualifier}/functions/function_name HTTP/1.1
Host:fc-ram.aliyuncs.com
Content-Type:application/json

Sample success responses

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "codeChecksum" : "2825179536350****",
  "codeSize" : 421,
  "createdTime" : "2020-04-01T08:15:27Z",
  "description" : "test_description",
  "functionId" : "aa715851-1c20-4b89-a8fb-***",
  "functionName" : "function_name",
  "handler" : "index.handler",
  "memorySize" : 256,
  "runtime" : "python3",
  "timeout" : 60,
  "initializationTimeout" : 60,
  "initializer" : "index.handler",
  "caPort" : 9000,
  "customContainerConfig" : {
    "args" : "[\"-arg1\", \"value1\"]",
    "command" : "[\"/code/myserver\"]",
    "image" : "registry-vpc.cn-hangzhou.aliyuncs.com/fc-demo/helloworld:v1beta1",
    "accelerationType" : "Default",
    "accelerationInfo" : {
      "status" : "Preparing"
    },
    "instanceID" : "cri-xxxxxx"
  },
  "layers" : [ "02f81d283888f5ec63442a88fe82b260#Layer-name#1" ]
}

Error codes

For a list of error codes, visit the API Error Center.