Obtient la liste des fonctions.
Description de l'opération
L'appel de ListFunctions ne renvoie qu'un sous-ensemble des champs de propriété de la fonction. Pour récupérer davantage de champs de propriété pour une fonction spécifique, notamment state, stateReasonCode, stateReason, lastUpdateStatus, lastUpdateStatusReasonCode et lastUpdateStatusReason, utilisez GetFunction.
Testez maintenant
Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.
Test
Autorisation RAM
|
fc:ListFunctions |
list |
*Toutes les ressources.
|
Aucune | Aucune |
Syntaxe de la requête
GET /2023-03-30/functions HTTP/1.1
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| prefix |
string |
Non |
Le préfixe du nom de la fonction. |
my-func |
| nextToken |
string |
Non |
Le jeton de pagination. |
MTIzNCNhYmM= |
| limit |
integer |
Non |
Le nombre de fonctions à renvoyer. Valeurs valides : de 1 à 100. |
10 |
| fcVersion |
string |
Non |
La version de Function Compute. Valeurs valides :
Si vous laissez ce paramètre vide, les fonctions de Function Compute 3.0 et de Function Compute 2.0 sont toutes répertoriées. |
v3 |
| tags |
array |
Non |
Les balises de fonction utilisées pour le filtrage. |
|
| Tag |
Non |
Les balises associées à la fonction. |
||
| runtime |
string |
Non |
L'environnement d'exécution de la fonction utilisé pour le filtrage. |
python3.10 |
| gpuType |
string |
Non |
Le type de GPU utilisé pour le filtrage. |
fc.gpu.tesla.1 |
| description |
string |
Non |
La description de la fonction utilisée pour le filtrage. |
test_description |
| functionName |
string |
Non |
Le nom de la fonction. |
|
| resourceGroupId |
string |
Non |
L'identifiant du groupe de ressources. |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
| ListFunctionsOutput |
La liste des fonctions. |
Exemples
JSON format
{
"functions": [
{
"codeChecksum": "2825179536350****",
"codeSize": 412,
"cpu": 1,
"createdTime": "2023-04-01T08:15:27Z",
"customContainerConfig": {
"accelerationInfo": {
"status": "Ready"
},
"accelerationType": "default",
"acrInstanceId": "cri-xxxxxxxxxx",
"command": [
"arg1"
],
"entrypoint": [
"/code/bootstrap"
],
"healthCheckConfig": {
"failureThreshold": 1,
"httpGetUrl": "/ready",
"initialDelaySeconds": 1,
"periodSeconds": 1,
"successThreshold": 2,
"timeoutSeconds": 2
},
"image": "registry-vpc.cn-hangzhou.aliyuncs.com/fc-demo/helloworld:v1beta1",
"port": 9000,
"registryConfig": {
"authConfig": {
"password": "abc***",
"userName": "admin"
},
"certConfig": {
"insecure": false,
"rootCaCertBase64": "cm9vdF9jYV9jZXJ0"
},
"networkConfig": {
"securityGroupId": "sg-xxxxxxxxxxxxxx",
"vSwitchId": "vsw-xxxxxxxxxxxxxx",
"vpcId": "vpc-xxxxxxxxxxxxxx"
}
},
"resolvedImageUri": "stand-sh-registry-vpc.cn-shanghai.cr.aliyuncs.com/fc-demo2/springboot-helloworld@sha256:68d1****0d64d6"
},
"customDNS": {
"dnsOptions": [
{
"name": "ndots",
"value": "2"
}
],
"nameServers": [
"8.8.x.x"
],
"searches": [
"ns1.svc.cluster-domain.example"
]
},
"customRuntimeConfig": {
"args": [
"arg1"
],
"command": [
"/code/bootstrap"
],
"healthCheckConfig": {
"failureThreshold": 1,
"httpGetUrl": "/ready",
"initialDelaySeconds": 1,
"periodSeconds": 1,
"successThreshold": 2,
"timeoutSeconds": 2
},
"port": 9000
},
"description": "ma fonction",
"diskSize": 512,
"environmentVariables": {
"key": "valeur1"
},
"functionArn": "acs:fc:cn-shanghai:123:functions/functionName",
"functionId": "aa715851-1c20-4b89-a8fb-***",
"functionName": "my-function-1",
"gpuConfig": {
"gpuMemorySize": 2048,
"gpuType": "fc.gpu.ampere.1"
},
"handler": "index.handler",
"instanceConcurrency": 1,
"instanceLifecycleConfig": {
"initializer": {
"handler": "index.initializer",
"timeout": 10,
"command": [
"curl -X POST 'http://localhost:9000/preWarm"
]
},
"preStop": {
"handler": "index.initializer",
"timeout": 10,
"command": [
"curl -X POST 'http://localhost:9000/preWarm"
]
}
},
"internetAccess": true,
"lastModifiedTime": "2023-05-01T08:15:27Z",
"lastUpdateStatus": "InProgress",
"lastUpdateStatusReason": "Le système traite actuellement l'optimisation de l'accélération pour l'image",
"lastUpdateStatusReasonCode": "ImageOptimizing",
"layers": [
{
"arn": "acs:fc:cn-beijing:186824xxxxxx:layers/fc_layer/versions/1",
"size": 421
}
],
"logConfig": {
"enableInstanceMetrics": true,
"enableRequestMetrics": true,
"logBeginRule": "DefaultRegex",
"logstore": "test-logstore",
"project": "test-project",
"enableLlmMetrics": false
},
"memorySize": 512,
"nasConfig": {
"groupId": 100,
"mountPoints": [
{
"enableTLS": true,
"mountDir": "/home/test",
"serverAddr": "***-uni85.cn-hangzhou.nas.com:/"
}
],
"userId": 100
},
"ossMountConfig": {
"mountPoints": [
{
"bucketName": "my-bucket",
"bucketPath": "/my-dir",
"endpoint": "http://oss-cn-shanghai.aliyuncs.com",
"mountDir": "/mnt/dir",
"readOnly": true
}
]
},
"role": "acs:ram::188077086902****:role/fc-test",
"runtime": "python3.10",
"state": "Pending",
"stateReason": "Function creating",
"stateReasonCode": "Creating",
"timeout": 60,
"tracingConfig": {
"params": {
"key": "http://tracing-analysis-dc-hz.aliyuncs.com/adapt_xxx/api/otlp/traces"
},
"type": "Jaeger"
},
"vpcConfig": {
"securityGroupId": "sg-bp18hj1wtxgy3b0***",
"vSwitchIds": [
"vsw-bp1ozpcrdc6r****"
],
"vpcId": "vpc-***",
"role": "acs:ram::188077086902****:role/fc-test"
},
"tags": [
{
"Key": "k1",
"Value": "v1"
}
],
"disableOndemand": false,
"invocationRestriction": {
"reason": "",
"lastModifiedTime": "",
"disable": false
},
"sessionAffinity": "MCP_SSE",
"enableLongLiving": false,
"resourceGroupId": "",
"instanceIsolationMode": "",
"sessionAffinityConfig": "{\"sseEndpointPath\":\"/sse\", \"sessionConcurrencyPerInstance\":20}",
"idleTimeout": 100,
"disableInjectCredentials": "Env",
"polarFsConfig": {
"groupId": 0,
"userId": 0,
"mountPoints": [
{
"extraOptions": "--skip-delete-rows-check=false --skip-dir-nlink=0 ",
"instanceId": "pfs-xxx",
"mountDir": "/mnt/polarfs",
"readOnly": false,
"remoteDir": "/share"
}
]
},
"lockInfo": {
"lockedBy": "AgentRun",
"lockedAt": "2025-04-05T10:00:00Z",
"lockedResources": [
""
]
},
"juiceFsConfig": {
"mountPoints": [
{
"volumeName": "",
"mountDir": "",
"remoteDir": "",
"token": "",
"args": [
""
]
}
],
"envs": {
"key": ""
}
},
"microSandboxConfig": {
"acrInstanceId": "",
"image": "",
"osType": "",
"readyCommand": "",
"registryConfig": {
"authConfig": {
"password": "abc***",
"userName": "admin"
},
"certConfig": {
"insecure": false,
"rootCaCertBase64": "cm9vdF9jYV9jZXJ0"
},
"networkConfig": {
"securityGroupId": "sg-xxxxxxxxxxxxxx",
"vSwitchId": "vsw-xxxxxxxxxxxxxx",
"vpcId": "vpc-xxxxxxxxxxxxxx"
}
},
"startCommand": "",
"steps": [
{
"args": [
"[\"root\"]"
],
"type": "USER, WORKDIR, ENV, RUN"
}
]
}
}
],
"nextToken": "next_function_name"
}
Codes d'erreur
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.