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).

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

Parameter Type Position Required Example Description
serviceName String Path Yes service_name

The name of the service.

qualifier String Path Yes test

The version or alias of the service.

functionName String Path Yes function_name

The name of the function.

Object Body Yes

The definition of the function.

target Long Body Yes 1

The number of provisioned instances.

Response parameters

Parameter Type Example Description
ETag String provisionconfig

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

resource String 198611443057****#service_name#test#function_name

The description of the resource.

target Long 15

The number of provisioned instances.

current Long 1

The actual number of provisioned instances.

scheduledActions Array

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.

name String demoScheduler

The name of the scheduled task.

startTime String 2020-10-10T10:10:10Z

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

endTime String 2020-12-10T10:10:10Z

The time when the scheduled scaling policy expires.

target Long 10

The number of provisioned instances.

scheduleExpression String cron(0 30 8 * * *)

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

targetTrackingPolicies Array

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 is beyond the range, scaling stops.

name String demoTargetTracking

The name of the scheduled task.

startTime String 2020-10-10T10:10:10Z

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

endTime String 2020-12-10T10:10:10Z

The time when the metric-based scaling policy expires.

metricType String ProvisionedConcurrencyUtilization

The type of the metric that is tracked.

metricTarget double 0.6

The value of the metric.

minCapacity Long 10

The minimum number of provisioned instances for scale-in.

maxCapacity Long 100

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
  } ]
}