Lists 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 |
Service name. |
demoService |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| qualifier |
string |
No |
Version ID or alias of the service. |
LATEST |
| limit |
integer |
No |
Maximum number of resources to return. Default is 20. Maximum is 100. The actual number returned may be less than this value, but never more. |
20 |
| nextToken |
string |
No |
Token for returning additional results. Do not provide this parameter for the first request. Get the token from the response of each previous request. |
8bj81uI8n**** |
| prefix |
string |
No |
Only return resources whose names start with this prefix. |
demoFunctionsPrefix |
| startKey |
string |
No |
Return results starting from the first function name that is alphabetically equal to or greater than this value. |
demoStartKey |
| X-Fc-Account-Id |
string |
No |
Your Alibaba Cloud account ID. |
188077086902**** |
| X-Fc-Date |
string |
No |
Request date in EEE, d MMM yyyy HH:mm:ss GMT format. |
Wed, 11 May 2022 09:00:00 GMT |
| X-Fc-Trace-Id |
string |
No |
Custom request ID. |
rid281s****** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Response body for ListFunctions. |
||
| functions |
array<object> |
List of functions. |
|
|
array<object> |
Function definition. |
||
| codeChecksum |
string |
CRC-64 checksum of the function code package. |
5434025278388143772 |
| codeSize |
integer |
Size of the function code package, in bytes. |
1024 |
| createdTime |
string |
Time when the function was created. |
2016-08-15T15:00:00.000+0000 |
| customContainerConfig | CustomContainerConfig |
Configuration for custom container runtime. |
|
| description |
string |
Function description. |
This is a demo hello world function |
| environmentVariables |
object |
Environment variables set for the function. Your function code can read these values. |
|
|
string |
Environment variable configuration. |
{"key":"value"} |
|
| functionId |
string |
Unique ID assigned to the function by the system. |
2d28e0e9-9ba5-4eed-8b1a-d3d9cd24**** |
| functionName |
string |
Function name. |
demo-function |
| handler |
string |
Function entry point. |
index.handler |
| lastModifiedTime |
string |
Time when the function was last modified. |
2016-08-15T17:00:00.000+0000 |
| memorySize |
integer |
Memory size allocated to the function, in MB. |
512 |
| runtime |
string |
Runtime environment for the function. Supported values include 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 runtimes. |
python3.9 |
| timeout |
integer |
Maximum execution time for the function, in seconds. Default is 60 seconds. Minimum is 1 second. Maximum is 10 minutes. If the function runs longer than this limit, it stops automatically. |
10 |
| initializationTimeout |
integer |
Maximum execution time for the initializer function, in seconds. Default is 3 seconds. Minimum is 1 second. Maximum is 5 minutes. If the initializer runs longer than this limit, it stops automatically. |
60 |
| initializer |
string |
Entry point for the initializer function. Format depends on the programming language. For more information, see Initializer functions. |
index.handler |
| caPort |
integer |
Listening port for the HTTP server in custom or custom container runtimes. |
9000 |
| instanceConcurrency |
integer |
Maximum concurrency per function instance. |
10 |
| instanceSoftConcurrency |
integer |
Soft concurrency limit for graceful scaling. When concurrent requests on an instance exceed this value, the system starts new instances. Use this setting if your function has a slow startup time. Value must be less than or equal to instanceConcurrency. |
5 |
| instanceType |
string |
Instance type for the function. Valid values:
|
e1 |
| layers |
array |
List of layers. Note
Layers merge in descending order of array index. Files with the same name in lower-index layers overwrite those in higher-index layers. |
|
|
string |
Name of the layer resource. |
02f81d283888f5ec63442a88fe82b260#Layer-name#1 |
|
| layersArnV2 |
array |
List of layer ARNs. |
|
|
string |
acs:fc:cn-hangzhou:official:layers/Python310/versions/2 |
||
| instanceLifecycleConfig |
InstanceLifecycleConfig |
Instance lifecycle configuration. |
|
| customDNS | CustomDNS |
Custom DNS configuration for the function. |
|
| customRuntimeConfig | CustomRuntimeConfig |
Detailed configuration for Custom Runtime functions. |
|
| customHealthCheckConfig | CustomHealthCheckConfig |
Custom health check configuration for Custom Runtime and Custom Container functions. |
|
| cpu |
number |
CPU allocation for the function, in vCPUs. Must be a multiple of 0.05 vCPU. |
1.5 |
| diskSize |
integer |
Disk size for the function, in MB. Valid values are 512 MB or 10240 MB. |
512 |
| gpuMemorySize |
integer |
GPU memory size for the function, in MB. Must be a multiple of 1024 MB. |
2048 |
| nextToken |
string |
Token for returning additional results. If this field is absent, 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.