全部產品
Search
文件中心

:GetProvisionConfig - 擷取函數預留資訊

更新時間:Feb 26, 2026

擷取預留配置。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

fc:GetProvisionConfig

get

*全部資源

*

請求文法

GET /2021-04-06/services/{serviceName}/functions/{functionName}/provision-config HTTP/1.1

路徑參數

名稱

類型

必填

描述

樣本值

serviceName

string

服務名稱。

demoService

functionName

string

函數名稱。

demoFunction

請求參數

名稱

類型

必填

描述

樣本值

qualifier

string

別名名稱。

prod

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

Function Compute調用請求的調用鏈 ID。

rid281s******

返回參數

名稱

類型

描述

樣本值

object

函數預留配置。

resource

string

資源描述。

12345#servierName#qualifier#functionName

target

integer

目標資源個數。

5

current

integer

實際資源個數。

1

scheduledActions

array

定時策略配置。

ScheduledActions

定時伸縮策略:通過定時伸縮策略您可以更加靈活地配置預留的函數執行個體,在指定時間將預留的函數執行個體量設定成需要的值,使函數執行個體量更好地貼合業務的並發量。

[ { "Name":"action_1", "StartTime":"2020-11-01T10:00:00Z", "EndTime":"2020-11-30T10:00:00Z", "TargetValue":50, "ScheduleExpression":"cron(0 0 20 * * *)" }, { "Name":"action_2", "StartTime":"2020-11-01T10:00:00Z", "EndTime":"2020-11-30T10:00:00Z", "TargetValue":10, "ScheduleExpression":"cron(0 0 22 * * *)" } ]

targetTrackingPolicies

array

指標追蹤伸縮策略配置。

TargetTrackingPolicies

指標伸縮策略:根據函數執行個體並發利用率的情況每分鐘對預留資源進行一次伸縮。

  • 當指標超過追蹤值 metricTarget 時,開始以積極的策略擴容預留模式的函數執行個體量,以使得指標值恢複到追蹤值 metricTarget 附近。

  • 當指標低於追蹤值 metricTarget 時,開始以保守的策略縮容預留模式的函數執行個體量,以使得指標值逐漸恢複到追蹤值 metricTarget 附近。

當您在系統中設定了伸縮最大值和最小值,此時預留的函數執行個體量會在最大值與最小值之間進行伸縮,超出最大值時將停止擴容,低於最小值時將停止縮容。

[ { "Name": "action_1", "StartTime": "2020-11-01T10:00:00Z", "EndTime": "2020-11-30T10:00:00Z", "MetricType": "ProvisionedConcurrencyUtilization", "MetricTarget": 0.6, "MinCapacity": 10, "MaxCapacity": 100 } ]

currentError

string

預留執行個體建立失敗時的錯誤資訊。

image not found

alwaysAllocateCPU

boolean

是否始終分配 CPU 給函數執行個體。

true

樣本

正常返回樣本

JSON格式

{
  "resource": "12345#servierName#qualifier#functionName",
  "target": 5,
  "current": 1,
  "scheduledActions": [
    {
      "name": "name",
      "startTime": "2020-10-10T10:10:10Z",
      "endTime": "2021-10-10T10:10:10Z",
      "target": 50,
      "scheduleExpression": "cron(0/30 * * * *)"
    }
  ],
  "targetTrackingPolicies": [
    {
      "name": "test_1",
      "startTime": "2020-10-10T10:10:10Z",
      "endTime": "2020-10-10T10:10:10Z",
      "metricType": "CPUUtilization",
      "metricTarget": 0.6,
      "minCapacity": 10,
      "maxCapacity": 100
    }
  ],
  "currentError": "image not found",
  "alwaysAllocateCPU": true
}

錯誤碼

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情