All Products
Search
Document Center

Server Load Balancer:UpdateListenerAttribute

Last Updated:Jun 10, 2026

Memperbarui atribut Pendengar, seperti nama Pendengar dan aksi default.

Deskripsi operasi

UpdateListenerAttribute is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. The listener configuration is not updated immediately. You can call the operation to query the update status of the listener:

  • If a listener is in the Configuring state, it is being updated.

  • If a listener is in the Running state, it has been updated.

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

alb:UpdateListenerAttribute

update

*LoadBalancer

acs:alb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId}

*SecurityPolicy

acs:alb:{#regionId}:{#accountId}:securitypolicy/{#securitypolicyId}

*ServerGroup

acs:alb:{#regionId}:{#accountId}:servergroup/{#servergroupId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

ListenerId

string

Yes

ID Pendengar Application Load Balancer (ALB).

lsn-o4u54y73wq7b******

ClientToken

string

No

Token klien yang digunakan untuk memastikan idempotensi permintaan.

Token harus unik di antara permintaan dan hanya boleh berisi karakter ASCII.

Catatan

Jika Anda tidak menentukan parameter ini, sistem menggunakan RequestId permintaan sebagai ClientToken. RequestId setiap permintaan API mungkin berbeda.

5A2CFF0E-5718-45B5-9D4D-70B******

DryRun

boolean

No

Apakah akan menjalankan dry run. Nilai valid:

  • true: Menjalankan dry run. Sistem memeriksa parameter yang diperlukan, format permintaan, dan batasan layanan. Jika permintaan gagal dalam dry run, Paket kesalahan dikembalikan. Jika permintaan lolos dry run, sistem mengembalikan kode kesalahan DryRunOperation.

  • false (default): Menjalankan permintaan normal. Jika permintaan lolos pemeriksaan, sistem mengembalikan kode status HTTP 2xx dan menjalankan operasi.

false

ListenerDescription

string

No

Nama Pendengar.

Nama harus terdiri dari 2 hingga 256 karakter dan dapat berisi huruf, angka, karakter Tiongkok, koma (,), titik (.), titik koma (;), garis miring (/), tanda at (@), garis bawah (_), dan tanda hubung (-).

HTTP_80

RequestTimeout

integer

No

periode waktu tunggu permintaan. Unit: detik. Nilai valid: 1 hingga 180.

Jika tidak ada tanggapan yang diterima dari server backend selama periode waktu tunggu, ALB mengirimkan kode kesalahan HTTP 504 ke Klien.

3

IdleTimeout

integer

No

Periode waktu tunggu idle. Unit: detik. Nilai valid: 1 hingga 60.

Jika tidak ada permintaan yang diterima selama periode waktu tunggu, ALB menutup koneksi saat ini. Ketika permintaan baru diterima, ALB membuat koneksi baru.

15

GzipEnabled

boolean

No

Apakah akan mengaktifkan kompresi Gzip untuk mengompresi tipe file tertentu. Nilai valid:

  • true

  • false.

true

Http2Enabled

boolean

No

Apakah akan mengaktifkan HTTP/2. Nilai valid:

  • true

  • false

Catatan

Parameter ini hanya tersedia untuk Pendengar HTTPS.

true

SecurityPolicyId

string

No

Kebijakan keamanan. Kebijakan keamanan sistem dan kebijakan keamanan kustom didukung.

Catatan

Parameter ini hanya tersedia untuk Pendengar HTTPS.

tls_cipher_policy_1_0

CaEnabled

boolean

No

Apakah akan mengaktifkan Otentikasi timbal balik. Nilai valid:

  • true

  • false.

false

XForwardedForConfig

object

No

Konfigurasi header X-Forwarded-For.

XForwardedForClientCertClientVerifyAlias

string

No

The name of the custom header. This parameter takes effect only when XForwardedForClientCertClientVerifyEnabled is set to true.

The name must be 1 to 40 characters in length and can contain letters, digits, underscores (_), and hyphens (-).

Catatan

This parameter is available only for HTTPS listeners.

test_client-verify-alias_123456

XForwardedForClientCertClientVerifyEnabled

boolean

No

Specifies whether to use the X-Forwarded-Clientcert-Clientverify header to retrieve the verification result of the client certificate. Valid values:

  • true

  • false

Catatan

This parameter is available only for HTTPS listeners.

false

XForwardedForClientCertFingerprintAlias

string

No

The name of the custom header. This parameter takes effect only when XForwardedForClientCertFingerprintEnabled is set to true.

The name must be 1 to 40 characters in length and can contain letters, digits, underscores (_), and hyphens (-).

Catatan

This parameter is available only for HTTPS listeners.

test_finger-print-alias_123456

XForwardedForClientCertFingerprintEnabled

boolean

No

Specifies whether to use the X-Forwarded-Clientcert-Fingerprint header to retrieve the fingerprint of the client certificate. Valid values:

  • true

  • false

Catatan

This parameter is available only for HTTPS listeners.

false

XForwardedForClientCertIssuerDNAlias

string

No

The name of the custom header. This parameter takes effect only when XForwardedForClientCertIssuerDNEnabled is set to true.

The name must be 1 to 40 characters in length and can contain letters, digits, underscores (_), and hyphens (-).

Catatan

This parameter is available only for HTTPS listeners.

test_issue-dn-alias_123456

XForwardedForClientCertIssuerDNEnabled

boolean

No

Specifies whether to use the X-Forwarded-Clientcert-Issuerdn header to retrieve information about the issuer of the client certificate. Valid values:

  • true

  • false

Catatan

This parameter is available only for HTTPS listeners.

false

XForwardedForClientCertSubjectDNAlias

string

No

The name of the custom header. This parameter takes effect only when XForwardedForClientCertSubjectDNEnabled is set to true.

The name must be 1 to 40 characters in length and can contain letters, digits, underscores (_), and hyphens (-).

Catatan

This parameter is available only for HTTPS listeners.

test_subject-dn-alias_123456

XForwardedForClientCertSubjectDNEnabled

boolean

No

Specifies whether to use the X-Forwarded-Clientcert-Subjectdn header to retrieve information about the owner of the client certificate. Valid values:

  • true

  • false

Catatan

This parameter is available only for HTTPS listeners.

false

XForwardedForClientSrcPortEnabled

boolean

No

Specifies whether to use the X-Forwarded-Client-Srcport header to retrieve the client port. Valid values:

  • true

  • false

Catatan

This parameter is available for HTTP and HTTPS listeners.

false

XForwardedForEnabled

boolean

No

Specifies whether to use the X-Forwarded-For header to retrieve the client's real IP address. Valid values:

  • true (default)

  • false

Catatan
  1. If you set this parameter to true, the default value of XForwardedForProcessingMode is append. You can change the value to remove.

  2. If you set this parameter to false, the X-Forwarded-For header is preserved before the request is sent to the backend service. No extra processing is performed.

  3. This parameter is available for HTTP and HTTPS listeners.

true

XForwardedForProcessingMode

string

No

The processing mode of the X-Forwarded-For header. This parameter takes effect only when XForwardedForEnabled is set to true. Valid values:

  • append (default): appends an IP address.

  • remove: deletes an IP address.

Catatan
  1. If you set this parameter to append, the IP address of the last hop is added to the X-Forwarded-For header before the request is sent to the backend service.

  2. If you set this parameter to remove, the X-Forwarded-For header is deleted before the request is sent to the backend service, regardless of whether the request contains the X-Forwarded-For header.

  3. This parameter is available for HTTP and HTTPS listeners.

append

XForwardedForProtoEnabled

boolean

No

Specifies whether to use the X-Forwarded-Proto header to retrieve the listener protocol of the ALB instance. Valid values:

  • true

  • false

Catatan

This parameter is available for HTTP, HTTPS, and QUIC listeners.

false

XForwardedForSLBIdEnabled

boolean

No

Specifies whether to use the SLB-ID header to retrieve the ID of the ALB instance. Valid values:

  • true

  • false

Catatan

This parameter is available for HTTP, HTTPS, and QUIC listeners.

false

XForwardedForSLBPortEnabled

boolean

No

Specifies whether to use the X-Forwarded-Port header to retrieve the listener port of the ALB instance. Valid values:

  • true

  • false

Catatan

This parameter is available for HTTP, HTTPS, and QUIC listeners.

false

XForwardedForClientSourceIpsEnabled

boolean

No

Specifies whether to allow ALB to find the client's real IP address from the `X-Forwarded-For` header. Valid values:

  • true

  • false

Catatan

This parameter is available for HTTP and HTTPS listeners.

false

XForwardedForClientSourceIpsTrusted

string

No

The trusted proxy IP address.

ALB traverses the X-Forwarded-For header from the end to the beginning. ALB selects the first IP address that is not in the trusted IP address list as the client's real IP address. This IP address is used for throttling.

10.1.1.0/24

XForwardedForHostEnabled

boolean

No

Specifies whether to use the X-Forwarded-Host header to retrieve the domain name that the client used to access the ALB instance. Valid values:

  • true

  • false (default)

Catatan

This parameter is available for HTTP, HTTPS, and QUIC listeners.

false

QuicConfig

object

No

Konfigurasi asosiasi Pendengar QUIC.

QuicListenerId

string

No

The ID of the QUIC listener to associate. This parameter is required if QuicUpgradeEnabled is set to true. This parameter is available only for HTTPS listeners.

Catatan

The original listener and the associated QUIC listener must belong to the same ALB instance. The QUIC listener must not be associated with another listener.

lsn-333

QuicUpgradeEnabled

boolean

No

Specifies whether to enable QUIC upgrade. Valid values:

  • true

  • false

Catatan

This parameter is available only for HTTPS listeners.

false

Certificates

array<object>

No

Sertifikat.

object

No

The certificate.

CertificateId

string

No

The ID of the default certificate. You can add only one default server certificate.

Catatan
  • This parameter is required if the listener protocol is HTTPS or QUIC.

  • To add more server certificates, call the operation after you create the listener.

123157******

CaCertificates

array<object>

No

Sertifikat CA. Anda hanya dapat menentukan satu Sertifikat CA.

object

No

The CA certificate.

CertificateId

string

No

The ID of the CA certificate.

Catatan

This parameter is required if CaEnabled is set to true.

123359******

DefaultActions

array<object>

No

Aksi default untuk aturan pengalihan.

array<object>

No

The default action.

ForwardGroupConfig

object

No

The configuration of the forwarding action. This parameter is required and takes effect if Type is set to ForwardGroup. You can specify a maximum of 20 forwarding actions.

ServerGroupTuples

array<object>

Yes

The server group to which requests are forwarded.

object

No

The server group.

ServerGroupId

string

Yes

The ID of the server group to which requests are forwarded.

sgp-i5qt20******

Type

string

Yes

The action type. You can specify only one action type.

Set the value to ForwardGroup. This forwards requests to multiple server groups.

ForwardGroup

Elemen respons

Element

Type

Description

Example

object

The response.

JobId

string

The ID of the asynchronous task.

72dcd26b-f12d-4c27-b3af-18f6aed5****

RequestId

string

The request ID.

365F4154-92F6-4AE4-92F8-7FF******

Contoh

Respons sukses

JSONformat

{
  "JobId": "72dcd26b-f12d-4c27-b3af-18f6aed5****",
  "RequestId": "365F4154-92F6-4AE4-92F8-7FF******"
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 IncorrectStatus.LoadBalancer The status of %s [%s] is incorrect.
400 IncorrectBusinessStatus.LoadBalancer The business status of %s [%s]  is incorrect.
400 IncorrectStatus.Listener The status of %s [%s] is incorrect.
400 OperationDenied.CrossLoadBalancerQUICListener The operation is not allowed because of %s.
400 ResourceAlreadyAssociated.Listener The specified resource %s is already associated.
400 OperationDenied.GRPCServerGroup The operation is not allowed because of %s.
400 ResourceAlreadyAssociated.Certificate The specified resource %s is already associated.
400 ResourceQuotaExceeded.SecurityPolicyAttachedNum The quota of %s is exceeded for resource %s, usage %s/%s.
400 ResourceQuotaExceeded.ServerGroupAttachedNum The quota of %s is exceeded for resource %s, usage %s/%s.
400 ResourceQuotaExceeded.LoadBalancerServersNum The quota of %s is exceeded for resource %s, usage %s/%s.
400 ResourceQuotaExceeded.ServerAddedNum The quota of %s is exceeded for resource %s, usage %s/%s.
400 OperationDenied.ServerGroupProtocolNotSupport The operation is not allowed because of ServerGroupProtocolNotSupport.
400 UnsupportedFeature.FullTraceHttps The feature of FullTraceHttps is not supported for current instance.
400 ResourceInConfiguring.Listener The specified resource of %s is being configured, please try again later.
400 Mismatch.VpcId The %s is mismatched for %s and %s.
400 InvalidParameter Invalid parameter, please check the parameter input.
400 OperationDenied.CACertificateCorrupted The CA certificate is corrupted.
403 Forbidden.LoadBalancer Authentication is failed for %s.
404 ResourceNotFound.Listener The specified resource %s is not found.
404 ResourceNotFound.ServerGroup The specified resource %s is not found.
404 ResourceNotFound.SecurityPolicy The specified resource %s is not found.
404 ResourceNotFound.Certificate The specified resource %s is not found.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.