擷取函數列表。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
fc:ListFunctions |
get |
*全部資源
|
無 | 無 |
請求文法
GET /2021-04-06/services/{serviceName}/functions HTTP/1.1
路徑參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| serviceName |
string |
是 |
服務名稱。 |
demoService |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| qualifier |
string |
否 |
服務的版本 ID 或者別名。 |
LATEST |
| limit |
integer |
否 |
限定此次返回資源的數量。如果不設定,預設返回 20,最大不能超過 100。返回結果可能小於指定的數量,但不會多於指定的數量。 |
20 |
| nextToken |
string |
否 |
用來返回更多結果。第一次查詢不需要提供這個參數,後續查詢的 Token 從返回結果中擷取。 |
8bj81uI8n**** |
| prefix |
string |
否 |
限定返回的資源名稱必須以 prefix 作為首碼。 |
demoFunctionsPrefix |
| startKey |
string |
否 |
設定結果從 startKey 之後(包括 startKey)按字母排序的第一個開始返回。 |
demoStartKey |
| X-Fc-Account-Id |
string |
否 |
您的阿里雲帳號(主帳號)ID。 |
188077086902**** |
| X-Fc-Date |
string |
否 |
調用開始日期,格式為EEE,d MMM yyyy HH:mm:ss GMT。 |
Wed, 11 May 2022 09:00:00 GMT |
| X-Fc-Trace-Id |
string |
否 |
自訂請求 ID。 |
rid281s****** |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
擷取函數列表傳回值。 |
||
| functions |
array<object> |
函數列表。 |
|
|
array<object> |
函數的定義。 |
||
| codeChecksum |
string |
函數程式碼封裝的 CRC64 值。 |
5434025278388143772 |
| codeSize |
integer |
系統返回的函數程式碼封裝的大小,單位為 Byte。 |
1024 |
| createdTime |
string |
函數建立時間。 |
2016-08-15T15:00:00.000+0000 |
| customContainerConfig | CustomContainerConfig |
Custom Container 啟動並執行相關配置。 |
|
| description |
string |
函數描述。 |
This is a demo hello world function |
| environmentVariables |
object |
為函數設定的環境變數,可以在函數中擷取環境變數的值。 |
|
|
string |
環境變數配置。 |
{"key":"value"} |
|
| functionId |
string |
系統為每個函數產生的唯一 ID。 |
2d28e0e9-9ba5-4eed-8b1a-d3d9cd24**** |
| functionName |
string |
函數名稱。 |
demo-function |
| handler |
string |
函數的執行入口。 |
index.handler |
| lastModifiedTime |
string |
函數上次修改時間。 |
2016-08-15T17:00:00.000+0000 |
| memorySize |
integer |
函數設定的記憶體大小,單位為 MB。 |
512 |
| runtime |
string |
函數啟動並執行語言環境。目前支援 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 和custom-container。更多資訊,請參見支援的函數運行環境列表。 |
python3.9 |
| timeout |
integer |
函數啟動並執行逾時時間,單位為秒,預設 60 秒。最小 1 秒,最長 10 分鐘。如果函數運行超過設定的時間,函數運行將被終止。 |
10 |
| initializationTimeout |
integer |
初始化函數啟動並執行逾時時間,單位為秒,預設 3 秒。最小 1 秒,最長 5 分鐘。初始化函數超過這個時間後會被終止執行。 |
60 |
| initializer |
string |
初始化函數執行的入口,具體格式與語言相關,更多資訊,請參見 Initializer 函數。 |
index.handler |
| caPort |
integer |
自訂、自訂容器運行時 HTTP Server 的監聽連接埠。 |
9000 |
| instanceConcurrency |
integer |
單個函數執行個體的並發度。 |
10 |
| instanceSoftConcurrency |
integer |
執行個體軟並發度,用於優雅擴容。當執行個體上的並發數超過軟並發度時,會觸發執行個體擴容。例如,您的執行個體啟動較慢,可以通過設定合適的軟執行個體並發度,提前啟動執行個體。 取值小於或等於 instanceConcurrency。 |
5 |
| instanceType |
string |
函數的執行個體類型,取值如下:
|
e1 |
| layers |
array |
層的列表。 說明
多個層會按照數組下標從大到小的順序進行合并,下標小的層的內容會覆蓋下標大的層的同名檔案。 |
|
|
string |
層資源的名稱。 |
02f81d283888f5ec63442a88fe82b260#Layer-name#1 |
|
| layersArnV2 |
array |
層的 arn 列表 |
|
|
string |
acs:fc:cn-hangzhou:official:layers/Python310/versions/2 |
||
| instanceLifecycleConfig |
InstanceLifecycleConfig |
執行個體生命週期配置。 |
|
| customDNS | CustomDNS |
函數自訂 DNS 配置 |
|
| customRuntimeConfig | CustomRuntimeConfig |
Custom Runtime 函數詳細配置 |
|
| customHealthCheckConfig | CustomHealthCheckConfig |
函數自訂健全狀態檢查配置,僅適用於 Custom Runtime 和 Custom Container。 |
|
| cpu |
number |
函數的 CPU 規格,單位為 vCPU,為 0.05 vCPU 的倍數。 |
1.5 |
| diskSize |
integer |
函數的磁碟規格,單位為 MB,可選值為 512 MB 或 10240 MB。 |
512 |
| gpuMemorySize |
integer |
function 的 GPU 顯存規格,單位為 MB,為 1024MB 的倍數 |
2048 |
| nextToken |
string |
用來返回更多的查詢結果。如果這個值沒有返回,則說明沒有更多結果。 |
8bj81uI8n**** |
樣本
正常返回樣本
JSON格式
{
"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****"
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。