Publishes a layer version.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
fc:CreateLayerVersion |
create |
*LayerVersion
|
None | None |
Request syntax
POST /2021-04-06/layers/{layerName}/versions HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| layerName |
string |
Yes |
The name of the layer. Maximum length: 128 characters. |
MyLayer |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The layer information. |
|
| description |
string |
No |
The description of the layer. Maximum length: 256 characters. |
test |
| compatibleRuntime |
array |
No |
The list of runtime environments supported by the layer. |
|
|
string |
No |
The runtime name. Valid values: nodejs20, nodejs18, nodejs16, nodejs14, nodejs12, nodejs10, nodejs8, nodejs6, python3.10, python3.9, python3, python2.7, java11, java8, php7.2, go1, dotnetcore3.1, dotnetcore2.1, custom.debian10, and custom. |
python3 |
|
| Code | Code |
Yes |
The code of the layer. |
|
| X-Fc-Account-Id |
string |
No |
Your Alibaba Cloud account ID. |
188077086902**** |
| X-Fc-Date |
string |
No |
The start date when the function is invoked. The format is EEE,d MMM yyyy HH:mm:ss GMT. |
Wed, 11 May 2022 09:00:00 GMT |
| X-Fc-Trace-Id |
string |
No |
The trace ID of the Function Compute invocation request. |
r4isu4sls**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The details of the layer. |
||
| layerName |
string |
The name of the layer. |
MyLayer |
| version |
integer |
The version of the layer. |
1 |
| description |
string |
The description of the version. |
the first layer |
| code | OutputCodeLocation |
The code package information of the layer. |
|
| codesize |
integer |
The size of the code package of the layer. Unit: bytes. |
421 |
| codeChecksum |
string |
The CRC-64 checksum of the layer code package, calculated based on the ECMA-182 standard. |
2825179536350**** |
| createTime |
string |
The time when the layer version was created. Format: yyyy-MM-ddTHH:mm:ssZ. |
2022-01-01T11:08:00Z |
| acl |
integer |
The access mode of the layer. A value of 0 indicates private, and a value of 1 indicates public. Official public layers are public by default. Custom layers can be set to private or public. |
0 |
| compatibleRuntime |
array |
The list of runtime environments supported by the layer. |
|
|
string |
The runtime name. Valid values: nodejs20, nodejs18, nodejs16, nodejs14, nodejs12, nodejs10, nodejs8, nodejs6, python3.10, python3.9, python3, python2.7, java11, java8, php7.2, go1, dotnetcore3.1, dotnetcore2.1, custom.debian10, and custom. |
python3 |
|
| arn |
string |
The Alibaba Cloud Resource Name (ARN) of the layer resource. |
xxxxxxxx#Layer-name#1 |
Examples
Success response
JSON format
{
"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
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.