All Products
Search
Document Center

Function Compute:ListInstances

Last Updated:Sep 19, 2024

Query a list of available instances of a function.

Operation description

The ListInstances operation allows you to query available instances of a function.

Available instances are instances that are processing requests or can be scheduled to process requests. Available instances queried by the ListInstances operation are the same as the active instances queried by using the InvokeFunction operation if values of ServiceName, FunctionName, and Qualifier are the same.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
fc:ListInstancesget
  • All Resources
    *
    none
none

Request syntax

GET /2021-04-06/services/{serviceName}/functions/{functionName}/instances

Request parameters

ParameterTypeRequiredDescriptionExample
serviceNamestringYes

The name of the service.

demoService
functionNamestringYes

The name of the function.

demoFunction
qualifierstringNo

The version or alias.

dev
instanceIdsarrayNo

The instance ID.

stringNo

The instance ID.

["1ef6b6ff-7f7b-485e-ab49-501ac681****", "04db0821-c6d2-4c10-970b-93e36f1a****"]
limitintegerNo

The maximum number of resources to return. Valid values: [0,1000].

The number of returned resources is less than or equal to the specified number.

20
X-Fc-Account-IdstringNo

The ID of your Alibaba Cloud account.

188077086902****

Response parameters

ParameterTypeDescriptionExample
object

The information about instances.

instancesarray<object>

The information about instances.

object

The instances that are queried.

instanceIdstring

The instance ID.

1ef6b6ff-7f7b-485e-ab49-501ac681****
versionIdstring

The version of service to which the instance belongs. If the instance belongs to the LATEST alias, 0 is returned as the version.

1

Examples

Sample success responses

JSONformat

{
  "instances": [
    {
      "instanceId": "1ef6b6ff-7f7b-485e-ab49-501ac681****",
      "versionId": "1"
    }
  ]
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-03-27The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-02-19The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-06-15Add OperationView Change Details