All Products
Search
Document Center

Function Compute:CreateLayerVersion

Last Updated:Jun 02, 2023

Releases a layer version.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /2021-04-06/layers/{layerName}/versions

Request parameters

ParameterTypeRequiredDescriptionExample
layerNamestringYes

The name of the runtime. Valid values: nodejs14, nodejs12, nodejs10, nodejs8, nodejs6, python3.9, python3, python2.7, java11, java8, php7.2, go1, dotnetcore2.1 and custom.

MyLayer
bodyobjectNo

The description of the layer version.

descriptionstringNo

The name of the layer.

test
compatibleRuntimearrayNo

The name of the runtime. Valid values: nodejs14, nodejs12, nodejs10, nodejs8, nodejs6, python3.9, python3, python2.7, java11, java8, php7.2, go1, dotnetcore2.1 and custom.

stringNo

The version of the layer.

python3
CodeCodeYes

The name of the layer.

X-Fc-Account-IdstringNo

The description of the layer.

188077086902****
X-Fc-DatestringNo

The checksum of the layer code package.

Wed, 11 May 2022 09:00:00 GMT
X-Fc-Trace-IdstringNo

The information about the layer code package.

r4isu4sls****

Response parameters

ParameterTypeDescriptionExample
headersobject
ETagstring

The information about the layer.

xxx
object

The trace ID of the invocation request of Function Compute.

layerNamestring

The list of runtime environments that are supported by the layer.

MyLayer
versioninteger

The time when the layer version was created. The time follows the yyyy-MM-ddTHH:mm:ssZ format.

1
descriptionstring

The name of the layer.

the first layer
codeOutputCodeLocation

The access mode of the layer.

codesizelong

The size of the layer code package. Unit: Byte.

421
codeChecksumstring

Example 1

2825179536350****
createTimestring

Creates a layer version.

2022-01-01T11:08:00Z
aclinteger

Creates a layer version.

0
compatibleRuntimearray

Luoni

string
python3

Examples

Sample success responses

JSONformat

{
  "layerName": "MyLayer",
  "version": 1,
  "description": "the first layer",
  "code": {
    "repositoryType": "OSS",
    "location": "https://xyz.oss-cnxxx.aliyuncs.com/xxx/xxx/xxx"
  },
  "codesize": 421,
  "codeChecksum": "2825179536350****",
  "createTime": "2022-01-01T11:08:00Z",
  "acl": 0,
  "compatibleRuntime": [
    "python3"
  ],
  "arn": "xxxxxxxx#Layer-name#1"
}

Error codes

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

Change history

Change timeSummary of changesOperation
2022-12-16The internal configurations of the API operation change but you can still call the operation.
Change itemChange content
The internal configurations of the API operation change but you can still call the operation.
2021-06-30The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: X-Fc-Account-Id
    Added Input Parameters: X-Fc-Code-Checksum
    Added Input Parameters: X-Fc-Log-Type
    Added Input Parameters: X-Fc-Invocation-Type
    Added Input Parameters: X-Fc-Date
    Added Input Parameters: X-Fc-Trace-Id
2021-06-30The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: X-Fc-Account-Id
2021-06-30The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    delete Input Parameters: X-Fc-Account-Id