Retrieves a list of functions.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
fc:ListFunctions |
get |
*All Resource
|
None | None |
Request syntax
GET /2021-04-06/services/{serviceName}/functions HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| serviceName |
string |
Yes |
The service name. |
demoService |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| qualifier |
string |
No |
The version ID or alias of the service. |
LATEST |
| limit |
integer |
No |
The maximum number of resources to return. If this parameter is not specified, the default value is 20. The maximum value is 100. The number of returned results may be less than the specified value but never exceeds it. |
20 |
| nextToken |
string |
No |
The token used to retrieve more results. You do not need to provide this parameter for the first query. For subsequent queries, obtain the token from the returned results. |
8bj81uI8n**** |
| prefix |
string |
No |
Limits the returned resource names to those that start with the specified prefix. |
demoFunctionsPrefix |
| startKey |
string |
No |
Specifies that results are returned starting from the first entry that is alphabetically equal to or after startKey. |
demoStartKey |
| X-Fc-Account-Id |
string |
No |
The ID of your Alibaba Cloud account. |
188077086902**** |
| X-Fc-Date |
string |
No |
The start date of the call, in the format of EEE,d MMM yyyy HH:mm:ss GMT. |
Wed, 11 May 2022 09:00:00 GMT |
| X-Fc-Trace-Id |
string |
No |
The custom request ID. |
rid281s****** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response for listing functions. |
||
| functions |
array<object> |
The list of functions. |
|
|
array<object> |
The definition of a function. |
||
| codeChecksum |
string |
The CRC64 value of the function code package. |
5434025278388143772 |
| codeSize |
integer |
The size of the function code package returned by the system, in bytes. |
1024 |
| createdTime |
string |
The time when the function was created. |
2016-08-15T15:00:00.000+0000 |
| customContainerConfig | CustomContainerConfig |
The configuration for Custom Container runtime. |
|
| description |
string |
The description of the function. |
This is a demo hello world function |
| environmentVariables |
object |
The environment variables set for the function. You can retrieve the values of these environment variables within the function. |
|
|
string |
The environment variable configuration. |
{"key":"value"} |
|
| functionId |
string |
The unique ID generated by the system for each function. |
2d28e0e9-9ba5-4eed-8b1a-d3d9cd24**** |
| functionName |
string |
The name of the function. |
demo-function |
| handler |
string |
The execution entry point of the function. |
index.handler |
| lastModifiedTime |
string |
The time when the function was last modified. |
2016-08-15T17:00:00.000+0000 |
| memorySize |
integer |
The memory size configured for the function, in MB. |
512 |
| runtime |
string |
The runtime language environment of the function. Valid values: nodejs16, nodejs14, nodejs12, nodejs10, nodejs8, nodejs6, nodejs4.4, python3.10, python3.9, python3, python2.7, java11, java8, go1, php7.2, dotnetcore3.1, dotnetcore2.1, custom.debian10, custom, and custom-container. For more information, see Supported function runtime environments. |
python3.9 |
| timeout |
integer |
The timeout period for function execution, in seconds. Default value: 60. Minimum value: 1. Maximum value: 600 (10 minutes). If the function runs longer than the specified timeout period, the execution is terminated. |
10 |
| initializationTimeout |
integer |
The timeout period for the initializer function, in seconds. Default value: 3. Minimum value: 1. Maximum value: 300 (5 minutes). If the initializer function exceeds this time limit, the execution is terminated. |
60 |
| initializer |
string |
The entry point for the initializer function. The format varies depending on the language. For more information, see Initializer function. |
index.handler |
| caPort |
integer |
The listening port of the HTTP server for custom or custom container runtime. |
9000 |
| instanceConcurrency |
integer |
The concurrency of a single function instance. |
10 |
| instanceSoftConcurrency |
integer |
The soft concurrency of an instance, used for graceful scaling. When the concurrency on an instance exceeds the soft concurrency, instance scaling is triggered. For example, if your instance takes a long time to start, you can set an appropriate soft concurrency to start instances in advance. The value must be less than or equal to instanceConcurrency. |
5 |
| instanceType |
string |
The instance type of the function. Valid values:
|
e1 |
| layers |
array |
The list of layers. Note
Multiple layers are merged in descending order of array index. Files in a layer with a smaller index overwrite files with the same name in a layer with a larger index. |
|
|
string |
The name of the layer resource. |
02f81d283888f5ec63442a88fe82b260#Layer-name#1 |
|
| layersArnV2 |
array |
The list of layer ARNs. |
|
|
string |
acs:fc:cn-hangzhou:official:layers/Python310/versions/2 |
||
| instanceLifecycleConfig | InstanceLifecycleConfig |
The instance lifetime epoch configuration. |
|
| customDNS | CustomDNS |
The custom DNS configuration for the function. |
|
| customRuntimeConfig | CustomRuntimeConfig |
The detailed configuration for the Custom Runtime function. |
|
| customHealthCheckConfig | CustomHealthCheckConfig |
The custom health check configuration for the function. This applies only to Custom Runtime and Custom Container. |
|
| cpu |
number |
The CPU specification of the function, in vCPU, in multiples of 0.05 vCPU. |
1.5 |
| diskSize |
integer |
The disk specification of the function, in MB. Valid values: 512 MB or 10240 MB. |
512 |
| gpuMemorySize |
integer |
The GPU memory specification of the function, in MB, in multiples of 1024 MB. |
2048 |
| nextToken |
string |
The token used to retrieve more query results. If this value is not returned, no more results are available. |
8bj81uI8n**** |
Examples
Success response
JSON format
{
"functions": [
{
"codeChecksum": "5434025278388143772",
"codeSize": 1024,
"createdTime": "2016-08-15T15:00:00.000+0000",
"customContainerConfig": {
"args": "[\"-arg1\", \"value1\"]",
"command": "[\"/code/myserver\"]",
"image": "registry-vpc.cn-hangzhou.aliyuncs.com/fc-demo/helloworld:v1beta1",
"accelerationType": "Default",
"instanceID": "cri-xxxxxxxxxx",
"webServerMode": true
},
"description": "This is a demo hello world function",
"environmentVariables": {
"key": "{\"key\":\"value\"}"
},
"functionId": "2d28e0e9-9ba5-4eed-8b1a-d3d9cd24****",
"functionName": "demo-function",
"handler": "index.handler",
"lastModifiedTime": "2016-08-15T17:00:00.000+0000",
"memorySize": 512,
"runtime": "python3.9",
"timeout": 10,
"initializationTimeout": 60,
"initializer": "index.handler",
"caPort": 9000,
"instanceConcurrency": 10,
"instanceSoftConcurrency": 5,
"instanceType": "e1",
"layers": [
"02f81d283888f5ec63442a88fe82b260#Layer-name#1"
],
"layersArnV2": [
"acs:fc:cn-hangzhou:official:layers/Python310/versions/2"
],
"instanceLifecycleConfig": {
"preFreeze": {
"handler": "index.preStop",
"timeout": 10
},
"preStop": {
"handler": "index.preStop",
"timeout": 10
}
},
"customDNS": {
"nameServers": [
"8.8.x.x"
],
"searches": [
"ns1.svc.cluster-domain.example"
],
"dnsOptions": [
{
"name": "ndots",
"value": "2"
}
]
},
"customRuntimeConfig": {
"command": [
"/code/myBootstrap"
],
"args": [
"args1"
]
},
"customHealthCheckConfig": {
"httpGetUrl": "/ready",
"initialDelaySeconds": 1,
"periodSeconds": 1,
"timeoutSeconds": 2,
"failureThreshold": 1,
"successThreshold": 2
},
"cpu": 1.5,
"diskSize": 512,
"gpuMemorySize": 2048
}
],
"nextToken": "8bj81uI8n****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.