All Products
Search
Document Center

:CreateLayerVersion

Last Updated:Jun 11, 2026

Melepaskan versi lapisan.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

fc:CreateLayerVersion

create

*LayerVersion

acs:fc:{#regionId}:{#accountId}:layers/{#layerName}/versions/*

None None

Sintaks permintaan

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

Path Parameters

Parameter

Type

Required

Description

Example

layerName

string

Yes

Nama lapisan. Nama dapat memiliki panjang hingga 128 karakter.

MyLayer

Parameter permintaan

Parameter

Type

Required

Description

Example

body

object

No

Informasi tentang lapisan.

description

string

No

The layer description. The description can be up to 256 characters in length.

test

compatibleRuntime

array

No

The runtimes that are supported by the layer.

string

No

The runtime. 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 layer code.

X-Fc-Account-Id

string

No

ID akun Alibaba Cloud Anda.

188077086902****

X-Fc-Date

string

No

Waktu saat fungsi dipanggil. Nilai dalam format EEE, d MMM yyyy HH:mm:ss GMT.

Wed, 11 May 2022 09:00:00 GMT

X-Fc-Trace-Id

string

No

ID jejak permintaan pemanggilan Function Compute.

r4isu4sls****

Elemen respons

Element

Type

Description

Example

object

The details of the layer.

layerName

string

The layer name.

MyLayer

version

integer

The layer version.

1

description

string

The description of the layer version.

the first layer

code OutputCodeLocation

The information about the layer code package.

codesize

integer

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

421

codeChecksum

string

The CRC-64 value of the layer code package. The value is calculated based on the ECMA-182 standard.

2825179536350****

createTime

string

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

2022-01-01T11:08:00Z

acl

integer

The access mode of the layer. A value of 0 indicates that the layer is private, and a value of 1 indicates that the layer is public. By default, official layers are public. Custom layers can be set to private or public.

0

compatibleRuntime

array

The runtimes that are supported by the layer.

string

The runtime. 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.

xxxxxxxx#Layer-name#1

Contoh

Respons sukses

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

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.