All Products
Search
Document Center

Edge Security Acceleration:CreateLoadBalancer

Last Updated:Mar 21, 2026

Buat instance Server Load Balancer baru. API ini mendukung fitur-fitur lanjutan seperti routing kustom, persistensi sesi, dan konfigurasi pemeriksaan kesehatan.

Deskripsi operasi

Gunakan API ini untuk mengonfigurasi layanan Server Load Balancer sesuai kebutuhan bisnis Anda. Anda dapat menyiapkan routing otomatis, round-robin berbobot, pencocokan aturan, pemeriksaan kesehatan, dan fitur lainnya guna mengelola serta mengoptimalkan lalu lintas secara efektif.

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

Tidak ada otorisasi untuk operasi ini. Jika Anda mengalami masalah saat menjalankan operasi ini, hubungi dukungan teknis.

Parameter permintaan

Parameter

Type

Required

Description

Example

Name

string

Yes

Nama Server Load Balancer. Harus mengikuti aturan format nama domain dan merupakan subdomain dari situs.

lb.example.com

Enabled

boolean

No

Apakah Server Load Balancer diaktifkan.

  • true: Diaktifkan.

  • false: Dinonaktifkan.

Valid values:

  • true :

    true

  • false :

    false

true

SiteId

integer

Yes

ID situs. Panggil API ListSites untuk mendapatkan nilai ini.

123456789****

AdaptiveRouting

object

No

Konfigurasi back-to-origin lintas kolam alamat.

true

FailoverAcrossPools

boolean

No

Apakah akan melakukan routing back-to-origin lintas kolam alamat.

  • true: Ya.

  • false: Tidak.

true

DefaultPools

array

Yes

Daftar kolam alamat default.

123

integer

No

ID kolam alamat default. Harus berupa bilangan bulat.

95223818027****

FallbackPool

integer

Yes

ID kolam alamat fallback. Trafik dialihkan ke sini ketika semua kolam lain tidak tersedia.

123

RandomSteering

object

No

Konfigurasi round-robin berbobot. Mengontrol cara distribusi trafik di seluruh kolam alamat.

123

DefaultWeight

integer

No

Bobot default untuk round-robin. Berlaku untuk semua kolam alamat yang tidak memiliki bobot spesifik. Nilai valid: bilangan bulat dari 0 hingga 100.

50

PoolWeights

object

No

Pengaturan bobot untuk setiap kolam server backend. Kunci adalah ID kolam. Nilai adalah koefisien bobot. Koefisien menentukan distribusi trafik relatif.

integer

No

Bobot untuk satu kolam origin. Harus berupa bilangan bulat dari 0 hingga 100. Nilai 0 berarti tidak ada trafik yang dikirim ke kolam tersebut.

50

Rules

array<object>

No

Informasi aturan.

{ "ENAM": [ 12345678**** ], "WNAM": [ 23456789****, 23456789**** ] }

array<object>

No

Struktur aturan.

RuleName

string

No

Nama aturan. Jangan atur parameter ini saat menambahkan konfigurasi global.

rule_1

Rule

string

No

Konten aturan. Menggunakan ekspresi kondisional untuk mencocokkan permintaan pengguna. Jangan atur parameter ini saat menambahkan konfigurasi global. Dua kasus penggunaan:

  • Cocokkan semua permintaan masuk: Atur ke true.

  • Cocokkan permintaan tertentu: Atur ke ekspresi kustom. Contoh: (http.host eq "video.example.com").

(http.request.method eq "GET" and http.request.version eq "HTTP/1.0") or (ip.geoip.country eq "CN") or (http.host eq "www.example.com")

RuleEnable

string

No

Status aturan. Jangan atur parameter ini saat menambahkan konfigurasi global. Nilai valid:

  • on: Diaktifkan.

  • off: Dinonaktifkan.

on

FixedResponse

object

No

Konten respons yang dikembalikan ketika permintaan cocok dengan aturan.

{"content_type": "application/json", "location": "www.example.com", "message_body": "Testing Hello", "status_code": 0}

ContentType

string

No

Bidang header Content-Type dalam respons HTTP.

application/octet-stream

Location

string

No

Bidang header Location dalam respons HTTP.

http://www.example.com/index.html

MessageBody

string

No

Konten badan respons.

Hello World!

StatusCode

integer

No

Kode status HTTP untuk respons.

200

Overrides

any

No

Pengaturan override untuk konfigurasi load balancer ketika permintaan cocok dengan aturan. Pengaturan ini menggantikan bidang yang sesuai dalam konfigurasi utama load balancer.

{ "adaptive_routing": { "failover_across_pools": true }, "sub_region_pools": { "AL,AT": [ 92298024898****, 92304347804**** ], "BG,BY": [ 92298024898**** ] }, "default_pools": [ 92298024898****, 92304347804**** ], "fallback_pool": 92298024898****, "location_strategy": { "mode": "resolver_ip", "prefer_ecs": "always" }, "random_steering": { "default_weight": 0.3, "pool_weights": { "92298024898****": 0.7, "92304347804****": 0.8 } }, "region_pools": { "CN,SEAS": [ 92298024898****, 92304347804**** ], "SAF,SAS": [ 92304347804**** ] }, "session_affinity": "ip", "steering_policy": "geo", "ttl": 30 }

Sequence

integer

No

Urutan eksekusi aturan. Biarkan kosong untuk menggunakan urutan daftar. Jika diatur, harus berupa bilangan bulat positif. Angka yang lebih besar dijalankan terlebih dahulu.

1

Terminates

boolean

No

Apakah pemrosesan aturan berikutnya dihentikan setelah aturan ini dijalankan.

  • true: Ya.

  • false: Tidak. Nilai default.

true

SessionAffinity

string

No

Metode persistensi sesi. Nilai valid:

  • off: Dinonaktifkan.

  • ip: Gunakan alamat IP klien.

  • cookie: Gunakan cookie.

ip

SteeringPolicy

string

Yes

Kebijakan steering trafik. Nilai valid:

  • geo: Routing geografis.

  • random: Round-robin berbobot.

  • order: Primary/standby.

order

Description

string

No

Deskripsi detail Server Load Balancer. Membantu dalam manajemen dan identifikasi.

测试负载均衡器描述

Ttl

integer

No

Waktu hidup (TTL) rekaman DNS dalam detik. Default adalah 30. Rentang valid: 10 hingga 600.

300

Monitor

object

Yes

Konfigurasi monitor pemeriksaan kesehatan.

order

Type

string

No

Jenis protokol untuk pemeriksaan kesehatan. Nilai valid: TCP, UDP, SMTP, HTTPS, HTTP, ICMP Ping, off. Saat diatur ke off, pemeriksaan kesehatan dinonaktifkan.

  • TCP

  • UDP

  • SMTP

  • HTTPS

  • HTTP

  • ICMP Ping

  • off

HTTP

Method

string

No

Metode HTTP yang digunakan untuk pemeriksaan kesehatan. Contoh: GET.

GET

Port

integer

No

Port server origin.

1921

Path

string

No

Jalur pemeriksaan kesehatan. Contoh: /healthcheck. Harus berupa jalur permintaan HTTP yang valid.

/health

Interval

integer

No

Interval pemeriksaan kesehatan dalam detik. Menentukan seberapa sering pemeriksaan dijalankan.

60

Timeout

integer

No

Timeout pemeriksaan kesehatan dalam detik. Rentang valid: 1 hingga 10.

5

ExpectedCodes

string

No

Kode status HTTP yang diharapkan untuk pemeriksaan kesehatan yang berhasil. Contoh: 200,202.

200

FollowRedirects

boolean

No

Apakah akan mengikuti pengalihan HTTP selama pemeriksaan kesehatan.

  • true: Ya.

  • false: Tidak.

true

ConsecutiveUp

integer

No

Jumlah pemeriksaan sukses berturut-turut yang diperlukan sebelum menandai server sebagai sehat. Contoh: 3.

3

ConsecutiveDown

integer

No

Jumlah pemeriksaan gagal berturut-turut yang diperlukan sebelum menandai server sebagai tidak sehat. Contoh: 5.

5

Header

any

No

Header HTTP yang dikirim bersama permintaan pemeriksaan kesehatan.

{ "host": [ "example1.com", "example2.com" ] }

MonitoringRegion

string

No

Wilayah tempat probe pemeriksaan kesehatan dijalankan. Default adalah Global.

  • Global: Seluruh dunia.

  • ChineseMainland: Tiongkok daratan.

  • OutsideChineseMainland: Seluruh dunia, kecuali Tiongkok daratan.

Valid values:

  • OutsideChineseMainland :

    OutsideChineseMainland

  • ChineseMainland :

    ChineseMainland

  • Global :

    Global

Global

SubRegionPools

any

No

Kolam alamat yang dipetakan ke wilayah sekunder. Saat beberapa wilayah sekunder berbagi kolam alamat yang sama, gabungkan kode wilayahnya dengan koma untuk membentuk kunci.

{"AL,MO": [92298024898****],"CN-SH,CN-SX,CN-SC":[92304347804****,92843536908****]}

RegionPools

any

No

Kolam alamat yang dipetakan ke wilayah primer.

{ "ENAM": [ 12345678**** ], "WNAM": [ 23456789****, 23456789**** ] }

Elemen respons

Element

Type

Description

Example

object

Skema Respons

RequestId

string

ID Permintaan.

EEEBE525-F576-1196-8DAF-2D70CA3F4D2F

Id

integer

ID Server Load Balancer.

99867648760****

Contoh

Respons sukses

JSONformat

{
  "RequestId": "EEEBE525-F576-1196-8DAF-2D70CA3F4D2F\n",
  "Id": 0
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 InvalidParameter The specified parameter is invalid.
400 LoadBalancerQuotaCheckFailed Load balancer enable quota check failed.
400 LoadBalancerNumberExceedQuotaLimit The number of load balancers you have added has reached the limit of the plan quota. Please delete the unused load balancers or upgrade the plan and try again.
400 LoadBalancerRuleQuotaCheckFailed Your current plan does not support configuring load balancer custom rules, or the load balancer rules you have added exceed the plan quota limit. Please upgrade the plan or delete the rules that are no longer in use and try again.
400 LoadBalancerPolicyCheckFailed Your current plan does not support the load balancer scheduling policy. Upgrade the plan and try again.
400 LoadBalancerHealthDetectionQuotaCheckFailed Your current plan does not allow you to configure the load balancer's health detection. Upgrade the plan and try again.
400 LoadBalancerHealthDetectionIntervalCheckFailed The configured load balancer health detection interval exceeds the quota range allowed by the plan. Please revise the interval within the range or upgrade the plan and try again.
400 InternalException Failed to call the service. Try again later or contact technical support.
400 Instance.NotOnline Your plan is unavailable due to an overdue payment. Complete the payment first.
400 MonitorExpectedBodyInvalid Invalid response body. Specify a response body that does not exceed 102,400 characters in length in your custom rule.
400 MonitorExpectedCodesInvalid Invalid expected status code for the probe.Make sure that you specify no more than 10 status codes in the probe settings, and each status code must be 3 to 4 characters in length.Examples: 200, 301, 3xx, 8000, and 88xx.
400 MonitorHeaderInvalid Invalid request header for the probe. You can add up to 10 request headers, each with 1 to 9 values. The combined length of all headers and values cannot exceed 6,000 characters. You cannot configure the User-Agent header.
400 MonitorMethodNotSupport Invalid HTTP method for the probe request. Valid values are GET and HEAD.
400 MonitorPathNotSupport Invalid probe URL path.If you set the probe protocol to HTTP or HTTPS, make sure you specify a probe URL path that does not exceed 1,024 characters in length.
400 MonitorPortNotSupport Invalid probe port. Specify a valid port from 1 to 65535 for the probe request. Then, try again.
400 MonitorRetriesInvalid Invalid number of probe retries. Specify an integer from 0 to 5. Then, try again.
400 MonitorTimeoutInvalid Invalid timeout for the probe. Valid values are 1 to 10.
400 MonitorTypeNotSupport Invalid protocol. Valid values are off, HTTP, HTTPS, TCP, UDP, ICMP Ping, and SMTP.
400 OriginPoolNotExist The specified origin pool does not exist or does not belong to your account or website. Check and try again.
400 LoadBalancerNameConflict The load balancer name or the hostname for the origin pool already exists. Try again with a unique name.
400 LockFailed The system is handling requests you previously submitted. Try again later.
400 SourceCircleExist The host record of the resource to be operated on is already the source station of another resource, or the source station of the current resource has been added as a host record. To avoid loopback, modify the host record or source station and retry.
400 LoadBalancer.NameInvalid The name of the Server Load Balancer instance is a valid domain name or belongs to the site. Check that it is correct and try again.
400 CompileRuleError Rule compilation failed, please check the rule information passed in to ensure that the rule is written according to the syntax described in the document.
400 InstanceNotExist The instance does not exist. Check whether the specified instance ID is correct or whether the instance belongs to your account.
403 QuotaExceeded The quota is exceeded.
404 SiteNotFound The website does not exist or does not belong to you.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.