All Products
Search
Document Center

:UpdateAlias

Last Updated:Jun 11, 2026

Memperbarui alias.

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:UpdateAlias

update

*All Resource

*

None None

Sintaks permintaan

PUT /2021-04-06/services/{serviceName}/aliases/{aliasName} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

serviceName

string

Yes

Nama layanan.

demo-service

aliasName

string

Yes

Nama alias.

alias_test

Parameter permintaan

Parameter

Type

Required

Description

Example

body

object

No

Konfigurasi alias.

additionalVersionWeight

object

No

The canary release version to which the alias points, and the weight assigned to that version.

  • The canary release version takes effect only when the function is invoked.

  • The value consists of a version number and its corresponding weight. For example, 2:0.05 indicates that Version 2 is the canary release version and 5% of the traffic is routed to it when the function is invoked. The remaining 95% of the traffic is routed to the main version.

number

No

The traffic weight. Valid values: 0 to 1.

1

description

string

No

The description of the alias.

test_description

versionId

string

No

The ID of the version to which the alias points.

1

resolvePolicy

string

No

The canary release mode. Default value: off. Valid values:

  • Random: random canary release.

  • Content: rule-based canary release.

Random

routePolicy RoutePolicy

No

The canary release rule. Traffic that matches the canary release rule is routed to the canary release instance.

If-Match

string

No

Jika ETag yang ditentukan di permintaan cocok dengan nilai ETag objek, objek akan dikembalikan bersama dengan tanggapan 200 OK. Jika tidak, tanggapan 412 Precondition Failed akan dikembalikan.

Nilai ETag objek digunakan untuk memverifikasi integritas data objek. Parameter ini kosong secara default.

e19d5cd5af0378da05f63f891c7467af

X-Fc-Account-Id

string

No

ID akun Alibaba Cloud Anda.

188077086902****

X-Fc-Date

string

No

Waktu saat fungsi dipanggil. Nilai harus 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.

rid281s******

Elemen respons

Element

Type

Description

Example

object

The configuration of the alias.

additionalVersionWeight

object

The additional version to which the alias points, and the weight assigned to that version.

  • The additional version takes effect only when the function is invoked.

  • The value consists of a version number and its corresponding weight. For example, 2:0.05 indicates that when the function is invoked, Version 2 is the canary release version, 5% of the traffic is routed to the canary release version, and 95% of the traffic is routed to the main version.

number

The traffic weight. Valid values: 0 to 1.

1

aliasName

string

The name of the alias.

test

createdTime

string

The time when the alias was created.

2016-08-15T16:06:05.000+0000

description

string

The description of the alias.

test_description

lastModifiedTime

string

The time when the alias was last modified.

2016-08-15T16:06:05.000+0000

versionId

string

The ID of the version to which the alias points.

1

resolvePolicy

string

The canary release mode. Default value: off. Valid values:

  • Random: random canary release.

  • Content: rule-based canary release.

Random

routePolicy RoutePolicy

The canary release rule. Traffic that matches the canary release rule is routed to the canary release instances.

Contoh

Respons sukses

JSONformat

{
  "additionalVersionWeight": {
    "key": 1
  },
  "aliasName": "test",
  "createdTime": "2016-08-15T16:06:05.000+0000",
  "description": "test_description",
  "lastModifiedTime": "2016-08-15T16:06:05.000+0000",
  "versionId": "1",
  "resolvePolicy": "Random",
  "routePolicy": {
    "condition": "AND",
    "policyItems": [
      {
        "type": "Header",
        "key": "x-test-uid",
        "value": "11111",
        "operator": "="
      }
    ]
  }
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.