All Products
Search
Document Center

Function Compute:GetProvisionConfig

Last Updated:Aug 20, 2025

Queries a provisioned configuration.

Background information

The provisioned mode allows you to reserve instances to respond to function invocation requests. This helps reduce the occurrences of cold starts and accelerates the response for online latency-sensitive services. You can perform scheduled or metric-based scaling to make better use of provisioned instances. For more information, see Configure auto scaling instances (including provisioned instances).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only common request headers. For more information, see Common parameters.

Request syntax

GET /services/{serviceName.[qualifier]}/functions/{functionName}/provision-config HTTP/1.1

Request parameters

ParameterTypePositionRequiredExampleDescription
serviceNameStringPathYesservice_name

The name of the service.

qualifierStringPathYestest

The version or alias of the service.

functionNameStringPathYesfunction_name

The name of the function.

ObjectBodyYes

The definition of the function.

targetLongBodyYes1

The number of provisioned instances.

Response parameters

ParameterTypeExampleDescription
ETagStringprovisionconfig

The value used to ensure that the modified configuration is consistent with the configuration to be modified.

resourceString198611443057****#service_name#test#function_name

The description of the resource.

targetLong15

The number of provisioned instances.

currentLong1

The actual number of provisioned instances.

scheduledActionsArray

Details about the scheduled scaling policy. You can use the scheduled scaling policy to flexibly configure provisioned instances. You can specify the number of provisioned instances to the desired value at the scheduled time. This way, the number of provisioned instances can meet the concurrency requirements of your business.

nameStringdemoScheduler

The name of the scheduled task.

startTimeString2020-10-10T10:10:10Z

The time when the scheduled scaling policy starts to take effect.

endTimeString2020-12-10T10:10:10Z

The time when the scheduled scaling policy expires.

targetLong10

The number of provisioned instances.

scheduleExpressionStringcron(0 30 8 * * *)

The scheduling expression. Two formats are supported. For more information, see Parameters.

targetTrackingPoliciesArray

Details about the metric-based scaling policy. Provisioned instances are scaled every minute based on the concurrency usage rate of provisioned instances.

  • When the metric value exceeds the value of the metricTarget parameter, the system scales out provisioned instances based on a progressive policy to make the metric value near the value of the metricTarget parameter.
  • When the metric value is smaller than the value of the metricTarget parameter, the system scales in provisioned instances based on a conservative policy to make the metric value near the value of the metricTarget parameter.

If you specify the maximum and minimum numbers of provisioned instances, the system scales provisioned instances within the range. If the number of provisioned instances reaches the specified maximum or minimum number, scaling stops.

nameStringdemoTargetTracking

The name of the scheduled task.

startTimeString2020-10-10T10:10:10Z

The time when the metric-based scaling policy starts to take effect.

endTimeString2020-12-10T10:10:10Z

The time when the metric-based scaling policy expires.

metricTypeStringProvisionedConcurrencyUtilization

The type of the metric that is tracked.

metricTargetdouble0.6

The value of the metric.

minCapacityLong10

The minimum number of provisioned instances for scale-in.

maxCapacityLong100

The maximum number of provisioned instances for scale-out.

Examples

Sample requests

GET /2016-08-15/services/service_name.test/functions/function_name/provision-config HTTP/1.1 
Common request headers

Sample success responses

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "resource" : "198611443057****#service_name#test#function_name",
  "target" : 15,
  "current" : 1,
  "scheduledActions" : [ {
    "name" : "demoScheduler",
    "startTime" : "2020-10-10T10:10:10Z",
    "endTime" : "2020-12-10T10:10:10Z",
    "target" : 10,
    "scheduleExpression" : "cron(0 30 8 * * *)"
  } ],
  "targetTrackingPolicies" : [ {
    "name" : "demoTargetTracking",
    "startTime" : "2020-10-10T10:10:10Z",
    "endTime" : "2020-12-10T10:10:10Z",
    "metricType" : "ProvisionedConcurrencyUtilization",
    "metricTarget" : 0.6,
    "minCapacity" : 10,
    "maxCapacity" : 100
  } ]
}

Error codes

For a list of error codes, visit the API Error Center.