All Products
Search
Document Center

Server Load Balancer:UpdateRulesAttribute

Last Updated:Jun 10, 2026

Memperbarui properti beberapa aturan pengalihan secara batch.

Deskripsi operasi

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

  • If multiple forwarding rules are in the Configuring state, their properties are being updated in a batch.

  • If multiple forwarding rules are in the Available state, their properties are updated.

  • A forwarding rule supports the following maximum number of conditions (RuleConditions) and actions (RuleActions):

    • Conditions: 5 for a Basic Edition instance, 10 for a Standard Edition instance, and 10 for a WAF-enabled instance.

    • Actions: 3 for a Basic Edition instance, 5 for a Standard Edition instance, and 5 for a WAF-enabled instance.

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

update

*LoadBalancer

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

*ServerGroup

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

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

ClientToken

string

No

Token klien yang digunakan untuk memastikan idempotensi permintaan.

Pastikan token klien unik di antara permintaan yang berbeda. Token klien hanya dapat berisi karakter ASCII.

Catatan

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

123e4567-e89b-12d3-a456-42665544***

Rules

array<object>

Yes

Daftar aturan pengalihan.

array<object>

Yes

A forwarding rule.

Priority

integer

No

The priority of the forwarding rule.

80

RuleName

string

No

The name of the forwarding rule.

rule_111

RuleActions

array<object>

No

The list of forwarding rule actions.

array<object>

Yes

A forwarding rule action.

FixedResponseConfig

object

No

The configuration of the action to return a fixed response.

Content

string

No

The content.

dssacav

ContentType

string

No

The content type.

text/plain

HttpCode

string

No

The HTTP status code.

200

ForwardGroupConfig

object

No

The configuration of the action to forward requests to server groups.

ServerGroupTuples

array<object>

No

The list of destination server groups.

object

No

A destination server group.

ServerGroupId

string

No

The server group ID.

sgp-3kbj35ay7cvi******

Weight

integer

No

The weight.

100

ServerGroupStickySession

object

No

Session persistence between server groups.

Enabled

boolean

No

Specifies whether to enable session persistence.

true

Timeout

integer

No

The timeout period.

100

InsertHeaderConfig

object

No

The configuration of the action to insert a header.

CoverEnabled

boolean

No

Specifies whether to overwrite the value of a request header.

False

Key

string

No

The HTTP header.

key

Value

string

No

The content of the HTTP header.

value

ValueType

string

No

The value type.

SystemDefined

Order

integer

Yes

The priority.

1

RedirectConfig

object

No

The configuration of the redirection action.

Host

string

No

The destination host to which requests are redirected.

test.alb.com

HttpCode

string

No

The redirection method.

301

Path

string

No

The destination path to which requests are redirected.

/

Port

string

No

The destination port to which requests are redirected.

443

Protocol

string

No

The destination protocol to which requests are redirected.

HTTPS

Query

string

No

The destination query string to which requests are redirected.

${query}

RewriteConfig

object

No

The configuration of the rewrite action.

Host

string

No

The hostname.

${host}

Path

string

No

The path.

/

Query

string

No

The query.

${query}

Type

string

Yes

The type of the forwarding rule action.

ForwardGroup

TrafficLimitConfig

object

No

The throttling configuration.

QPS

integer

No

The number of queries per second (QPS).

1000

PerIpQps

integer

No

The number of QPS for a single IP address.

100

TrafficMirrorConfig

object

No

The traffic mirroring configuration.

TargetType

string

No

The type of the mirror destination.

ForwardGroupMirror

MirrorGroupConfig

object

No

The server groups to which traffic is mirrored.

ServerGroupTuples

array<object>

No

The server groups to which traffic is mirrored.

object

No

A server group to which traffic is mirrored.

ServerGroupId

string

No

The server group ID.

sgp-vlnjo1rhw0vc******

RemoveHeaderConfig

object

No

The configuration for removing a specific HTTP header.

Key

string

No

The key of the HTTP header.

key

CorsConfig

object

No

The cross-origin resource sharing (CORS) configuration.

AllowOrigin

array

No

The allowed origins.

string

No

An allowed origin.

*

AllowMethods

array

No

The allowed HTTP methods for cross-origin requests.

string

No

The allowed HTTP method for cross-origin requests. Valid values:

  • GET

  • POST

  • PUT

  • DELETE

  • HEAD

  • OPTIONS

  • PATCH

GET

AllowHeaders

array

No

The list of headers that are allowed for cross-origin requests.

string

No

A header that is allowed for cross-origin requests.

test

ExposeHeaders

array

No

The list of headers that can be exposed to the client.

string

No

A header that can be exposed to the client.

test

AllowCredentials

string

No

Specifies whether to allow credentials in cross-origin requests.

off

MaxAge

integer

No

The maximum cache duration of preflight requests in the browser.

60

RuleConditions

array<object>

No

The list of forwarding rule conditions.

array<object>

Yes

A forwarding rule condition.

CookieConfig

object

No

The configuration of the cookie-based condition.

Values

array<object>

No

The list of cookie key-value pairs.

object

No

A cookie key-value pair.

Key

string

No

The key of the cookie.

key

Value

string

No

The value of the cookie.

value

HeaderConfig

object

No

The configuration of the header-based condition.

Key

string

No

The key of the HTTP header.

key

Values

array

No

The list of HTTP header values.

string

No

An HTTP header value.

value

HostConfig

object

No

The configuration of the host-based condition.

Values

array

No

The list of hostnames.

string

No

A hostname.

www.example.com

MethodConfig

object

No

The configuration of the method-based condition.

Values

array

No

The list of HTTP request methods.

string

No

An HTTP request method.

PUT

PathConfig

object

No

The configuration of the path-based condition.

Values

array

No

The list of path conditions.

string

No

A path condition.

/test

QueryStringConfig

object

No

The configuration of the query string-based condition.

Values

array<object>

No

The list of query string key-value pairs.

object

No

A query string key-value pair.

Key

string

No

The key of the query string.

account

Value

string

No

The value of the query string.

on

ResponseHeaderConfig

object

No

The configuration of the response header-based condition.

Key

string

No

The key of the response header.

test

Values

array

No

The values of the response header.

string

No

A value of the response header.

value

ResponseStatusCodeConfig

object

No

The configuration of the response status code-based condition.

Values

array

No

The response status codes.

string

No

A response status code.

200

Type

string

No

The type of the condition.

Header

SourceIpConfig

object

No

The configuration for matching service traffic based on the source IP address.

Values

array

No

One or more IP addresses or CIDR blocks.

string

No

An IP address or a CIDR block.

192.168.1.1

RuleId

string

Yes

The forwarding rule ID.

rule-n4hfecmmtmfl******

DryRun

boolean

No

Apakah akan menjalankan dry run. Nilai valid:

  • true: Menjalankan dry run. Sistem memeriksa parameter yang diperlukan, format permintaan, dan batas layanan. Jika permintaan gagal dalam dry run, Paket dikembalikan. Jika permintaan lulus dry run, kode kesalahan DryRunOperation dikembalikan. Dalam hal ini, properti aturan pengalihan tidak diperbarui.

  • false (default): Mengirim permintaan normal. Setelah permintaan lulus pemeriksaan, sistem mengembalikan kode status HTTP 2xx dan memulai pembaruan.

false

Elemen respons

Element

Type

Description

Example

object

Response schema

RequestId

string

The request ID.

365F4154-92F6-4AE4-92F8-7FF34B540710

JobId

string

The ID of the asynchronous task.

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

Contoh

Respons sukses

JSONformat

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

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 OperationDenied.IpGroupCanNotUsedForMirrorAction The operation is not allowed because of %s. The operation is not allowed because of %s.
400 IncorrectStatus.Rule The status of %s [%s] is incorrect.
400 OperationDenied.SameGroupForForwardAndMirrorAction The operation is not allowed because of %s. The operation is not allowed because of %s.
400 OperationDenied.GRPCServerGroup The operation is not allowed because of %s.
400 Conflict.Priority There is already %s having the same configuration with %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 QuotaExceeded.RuleWildcardsNum The quota of %s is exceeded, usage %s/%s. The quota of %s is exceeded, usage %s/%s.
400 QuotaExceeded.RuleMatchEvaluationsNum The quota of %s is exceeded, usage %s/%s.
400 QuotaExceeded.RuleActionsNum The quota of %s is exceeded, usage %s/%s. The quota of %s is exceeded. Usage: %s/%s.
400 Mismatch.Protocol The %s is mismatched for %s and %s. The %s is mismatched for %s and %s.
400 Mismatch.VpcId The %s is mismatched for %s and %s. The %s is mismatched for %s and %s.
400 OperationDenied.ServiceManagedResource The operation is not allowed because the current resource of %s is managed resource.
400 OperationDenied.ListenerIdInconsistent The operation is not allowed because of ListenerIdInconsistent.
400 IllegalParam.Priority The param of Priority is illegal.
400 OperationDenied.MirrorActionSupportHttpGroupOnly The operation is not allowed because of MirrorActionSupportHttpGroupOnly.
400 OperationDenied.ProtocolMustSameForForwardGroupAction The operation is not allowed because of ProtocolMustSameForForwardGroupAction.
404 ResourceNotFound.Rule The specified resource %s is not found. The specified resource %s is not found.
404 ResourceNotFound.ServerGroup The specified resource %s is not found.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.