All Products
Search
Document Center

Function Compute:ListLayers

Last Updated:Aug 20, 2025

Queries information about layers.

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 /layers HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
prefix String Query No prefix-layer

The name prefix of the layer. The names of the returned layers must contain the prefix. If the name prefix is a, the names of the returned layers must start with a.

startKey String Query No layer-name

The name of the start layer. The returned layers are sorted in alphabetical order, and the layers that include and follow the layer specified by the startKey parameter are returned.

nextToken String Query No next-layer-name

The token used to obtain more results. If the number of layers exceeds the limit, the nextToken parameter is returned. You can include the parameter in subsequent calls to obtain more results. You do not need to provide this parameter in the first call.

limit Integer Query No 20

The maximum number of layers to be returned. Default value: 20. The value cannot exceed 100. The number of returned layers is less than or equal to the specified number.

Response parameters

Parameter Type Example Description
layers Array of Layer

The information about layers.

nextToken String next-layer-name

The token used to obtain more results.

Note If this parameter is not returned, all the layers are returned.

Examples

Sample requests

GET /layers?prefix=prefix-layer&startKey=layer-name&nextToken=next-layer-name&limit=20 HTTP/1.1
Host:fc-ram.aliyuncs.com
Content-Type:application/json

Common request headers

Sample success responses

JSON format

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

{
  "layers" : [ {
    "layerName" : "prefix_mylayername",
    "version" : 1,
    "description" : "used for test",
    "code" : {
      "repositoryType" : "OSS",
      "location" : "https://xyz.oss-cnxxx.aliyuncs.com/xxx/xxx/xxx"
    },
    "codeSize" : 12345,
    "codeChecksum" : "XYX123",
    "createTime" : "2020-11-11T11:08:00Z",
    "acl" : 0,
    "compatibleRuntime" : [ "python3" ],
    "arn" : "XYZ#prefix_mylayername#1"
  } ],
  "nextToken" : "next-layer-name"
}

Error codes

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