Queries the information about a function.
Request headers
This operation uses only common request headers. For more information, see Common parameters.
Request syntax
GET /services/{serviceName.qualifier}/functions/{functionName}
Request parameters
Parameter | Type | Position | Required | Example | Description |
---|---|---|---|---|---|
serviceName | String | Path | Yes | service_name |
The name of the service. |
qualifier | String | Path | No | test |
The version or alias of the service. |
functionName | String | Path | Yes | function_name |
The name of the function. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
ETag | String | function_name |
The value used to ensure that the modified function is consistent with the function to be modified. |
codeChecksum | String | 2825179536350**** |
The CRC-64 value of the function code package. |
codeSize | Long | 421 |
The size of the function code package. Unit: byte. |
createdTime | String | 2020-04-01T08:15:27Z |
The time when the function was created. |
description | String | test_description |
The description of the function. |
environmentVariables | Map |
The environment variables configured for the function. The values of the environment variables are obtained from the function. For more information, see Introduction. |
|
functionId | String | aa715851-1c20-4b89-a8fb-*** |
The ID generated by the system for the function. Each function ID is unique in Function Compute. |
functionName | String | function_name |
The name of the function. |
handler | String | index.handler |
The handler of the function. For more information, see the "Function entry point" section of the Terms topic. |
lastModifiedTime | Long | 2020-04-01T08:15:27Z |
The last time when the function was updated. |
memorySize | Integer | 256 |
The memory size for the function. Unit: MB. The memory size must be a multiple of 64 MB. Different types of instances are allocated different memory sizes. For more information, see the "Instance specifications" section of the Instance specifications and usage modes topic. |
runtime | String | python3 |
The runtime environment of the function. Valid values: nodejs4.4, nodejs6, nodejs8, nodejs10, nodejs12, python2.7, python3, java8, java11, php7.2, dotnetcore2.1, custom, and custom-container. |
timeout | Integer | 60 |
The timeout period for the execution of the function. Unit: seconds. Default value: 60. Valid values: 1 to 600. When this period expires, the execution of the function is terminated. |
initializationTimeout | Integer | 60 |
The timeout period for the execution of the initializer function. Unit: seconds. Default value: 3. Valid values: 1 to 300. When this period expires, the execution of the initializer function is terminated. |
initializer | String | index.handler |
The handler of the initializer function. The format is determined by the programming language. For more information, see the "Initializer function" section of the Terms topic. |
caPort | Integer | 9000 |
The port on which the HTTP server listens for the custom runtime or custom container runtime. |
customContainerConfig | CustomContainerConfigInfo |
The configuration of the custom container runtime. After you configure the custom container runtime, you can use custom container images to execute functions. |
Examples
Sample requests
GET /2016-08-15/services/service_name/functions/function_name HTTP/1.1
Common request headers
Sample success responses
JSON
format
HTTP/1.1 200
ETag:function_name
Content-Type:application/json
HTTP/1.1 200 OK
Common response headers
{
"functionId": "aa715851-1c20-4b89-a8fb-***",
"functionName": "function_name",
"description": "test_description",
"runtime": "python3",
"handler": "index.handler",
"timeout": 60,
"cAPort": 9000,
"initializer": "index.handler",
"initializationTimeout": 60,
"codeSize": 421,
"codeChecksum": "2825179536350****",
"memorySize": 256,
"customContainerConfig": {
"image": "registry-vpc.cn-hangzhou.aliyuncs.com/fc-demo/helloworld:v1beta1,
"command": "["/code/myserver"]",
"args": "["-arg1", "value1"]",
"accelerationType": Default
},
"environmentVariables": {
"testKey": "TEST_KEY"
},
"createdTime": "2020-04-01T08:15:27Z",
"lastModifiedTime": "2020-04-01T08:15:27Z",
"instanceConcurrency": 1
}