Membuat instans Network Load Balancer (NLB) di wilayah tertentu.
Deskripsi operasi
-
When you create an NLB instance, the service-linked role AliyunServiceRoleForNlb is automatically created and assigned to you.
-
CreateLoadBalancer is an asynchronous operation. After you send a request, the system returns an instance ID and runs the task in the background. You can call GetLoadBalancerAttribute to query the status of an NLB instance.
-
If an NLB instance is in the Provisioning state, the NLB instance is being created.
-
If an NLB instance is in the Active state, the NLB instance is created.
-
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
nlb:CreateLoadBalancer |
create |
*LoadBalancer
*VSwitch
EipAddress
*VPC
|
|
None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| LoadBalancerType |
string |
No |
Tipe instans Server Load Balancer (SLB). Atur nilainya menjadi network, yang menunjukkan instans NLB. |
network |
| LoadBalancerName |
string |
No |
Nama instans NLB. Panjangnya harus 2 hingga 128 karakter, dapat berisi huruf, angka, titik (.), garis bawah (_), dan tanda hubung (-), serta harus diawali dengan huruf. |
NLB1 |
| AddressType |
string |
Yes |
Tipe alamat IPv4 yang digunakan untuk instans NLB. Nilai valid:
Catatan
Untuk mengaktifkan alamat IPv6 publik pada instans NLB dual-stack, panggil operasi EnableLoadBalancerIpv6Internet. |
Internet |
| AddressIpVersion |
string |
No |
Versi alamat IP yang digunakan untuk instans NLB. Nilai valid:
|
ipv4 |
| VpcId |
string |
Yes |
ID VPC tempat Anda ingin membuat instans NLB. |
vpc-bp1b49rqrybk45nio**** |
| ZoneMappings |
array<object> |
Yes |
Pemetaan antara zona dan vSwitch. Instans NLB dapat diterapkan di hingga 10 zona. Jika wilayah mendukung dua zona atau lebih, tentukan setidaknya dua zona. |
|
|
object |
No |
The mapping between the zone and the vSwitch. An NLB instance can be deployed in up to 10 zones. If the region supports two or more zones, you must specify at least two zones. |
||
| VSwitchId |
string |
Yes |
The ID of the vSwitch in the zone. You can specify only one vSwitch (subnet) in each zone of an NLB instance. An NLB instance can be deployed in up to 10 zones. If the region supports two or more zones, you must specify at least two zones. |
vsw-sersdf**** |
| ZoneId |
string |
Yes |
The ID of the zone where the NLB instance is deployed. An NLB instance can be deployed in up to 10 zones. If the region supports two or more zones, specify at least two zones. You can call the DescribeZones operation to query the most recent zone list. |
cn-hangzhou-a |
| PrivateIPv4Address |
string |
No |
The private virtual IP address (VIP) of the IPv4 version. The private IPv4 address that the NLB instance uses to provide external services. |
192.168.10.1 |
| AllocationId |
string |
No |
The ID of the elastic IP address (EIP) that is associated with the Internet-facing NLB instance. Each zone is assigned one EIP. An NLB instance can be deployed in up to 10 zones. If the region supports two or more zones, specify at least two zones. |
eip-bp1aedxso6u80u0qf**** |
| Ipv6Address |
string |
No |
The VIP of the IPv6 version. The IPv6 address that the NLB instance uses to provide external services. |
2408:400a:d5:3080:b409:840a:ca:e8e5 |
| Ipv4LocalAddresses |
array |
No |
The local IPv4 addresses. The IP addresses that the NLB instance uses to communicate with the backend servers. The number of IP addresses must be an even number, which must be at least 2 and at most 8. |
|
|
string |
No |
The local IPv4 address. |
192.168.10.2 |
|
| Ipv6LocalAddresses |
array |
No |
The local IPv6 addresses. The IP addresses that the NLB instance uses to communicate with the backend servers. The number of IP addresses must be an even number, which must be at least 2 and at most 8. |
|
|
string |
No |
The local IPv6 address. |
2408:400a:d5:3080:b409:840a:ca:e8e6 |
|
| BandwidthPackageId |
string |
No |
ID instans Internet Shared Bandwidth yang terkait dengan instans NLB yang terhubung ke Internet. |
cbwp-bp1vevu8h3ieh**** |
| LoadBalancerBillingConfig |
object |
No |
Pengaturan penagihan instans NLB. |
|
| PayType |
string |
No |
The billing method of the NLB instance. Set the value to PostPay, which specifies the pay-as-you-go billing method. |
PostPay |
| ResourceGroupId |
string |
No |
ID kelompok sumber daya tempat instans berada. |
rg-atstuj3rtop**** |
| DryRun |
boolean |
No |
Apakah akan menjalankan dry run tanpa benar-benar membuat permintaan. Nilai valid:
|
false |
| ClientToken |
string |
No |
Token klien yang digunakan untuk memastikan idempotensi permintaan. Anda dapat menggunakan klien untuk menghasilkan token. Pastikan token unik di antara permintaan yang berbeda. Hanya karakter ASCII yang diizinkan. Catatan
Jika Anda tidak menentukan parameter ini, nilai RequestId akan digunakan. Nilai RequestId berbeda untuk setiap permintaan. |
123e4567-e89b-12d3-a456-426655440000 |
| RegionId |
string |
No |
ID wilayah tempat instans NLB diterapkan. Anda dapat memanggil operasi DescribeRegions untuk mengkueri daftar wilayah terbaru. |
cn-hangzhou |
| DeletionProtectionConfig |
object |
No |
Konfigurasi fitur perlindungan penghapusan. |
|
| Enabled |
boolean |
No |
Specifies whether to enable the deletion protection feature. Valid values:
|
false |
| Reason |
string |
No |
The reason why the deletion protection feature is enabled or disabled. The reason must be 2 to 128 characters in length, can contain letters, digits, periods (.), underscores (_), and hyphens (-), and must start with a letter. |
Instance is running |
| ModificationProtectionConfig |
object |
No |
Konfigurasi mode baca-saja konfigurasi. |
|
| Status |
string |
No |
Specifies whether to enable the configuration read-only mode. Valid values:
Catatan
If the parameter is set to ConsoleProtection, the configuration read-only mode is enabled. You cannot modify the configurations of the NLB instance in the NLB console. However, you can call API operations to modify the configurations of the NLB instance. |
ConsoleProtection |
| Reason |
string |
No |
The reason for enabling the configuration read-only mode. The reason must be 2 to 128 characters in length, can contain letters, digits, periods (.), underscores (_), and hyphens (-), and must start with a letter. Catatan
This parameter takes effect only when Status is set to ConsoleProtection. |
Business protection period |
| Tag |
array<object> |
No |
Tag. |
|
|
object |
No |
The tag. |
||
| Key |
string |
No |
The key of the tag. The tag key can be up to 64 characters in length, cannot start with You can specify up to 20 tags in each call. |
env |
| Value |
string |
No |
The value of the tag. The tag value can be up to 128 characters in length, cannot start with You can specify up to 20 tags in each call. |
product |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
response |
||
| RequestId |
string |
The ID of the request. |
CEF72CEB-54B6-4AE8-B225-F876FF7BA984 |
| LoadbalancerId |
string |
The ID of the NLB instance. |
nlb-83ckzc8d4xlp8o**** |
| OrderId |
integer |
The ID of the order for the NLB instance. |
20230000 |
Contoh
Respons sukses
JSONformat
{
"RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984",
"LoadbalancerId": "nlb-83ckzc8d4xlp8o****",
"OrderId": 20230000
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | OperationDenied.OnlyPayByTrafficSupported | The operation is not allowed because of OnlyPayByTrafficSupported. | |
| 400 | OperationFailed.%s | The operation failed because of %s. | |
| 400 | Mismatch.ZoneIdAndVswitchId | The ZoneIdAndVswitchId is mismatched for %s and %s. | |
| 400 | QuotaExceeded.%s | The quota of %s is exceeded, usage %s/%s. | |
| 400 | DryRunOperation | Request validation has been passed with DryRun flag set. | |
| 400 | OperationDenied.OnlyPostPaidSupported | The operation is not allowed because of OnlyPostPaidSupported. | |
| 400 | OperationFailed.DuplicateZones. | The operation failed because of Can not Specify duplicate zones. | |
| 400 | ResourceNotEnough.VSwitchIp | The specified resource of VSwitchIp is not enough. | |
| 400 | DuplicatedParam.AllocationId | The param of AllocationId is duplicated. | |
| 400 | ResourceInConfiguring.VswitchId | The specified resource of VswitchId is being configured, please try again later. | |
| 400 | IllegalParam | The param of %s is illegal. | |
| 400 | OperationFailed.UnpaidBill | The operation failed because of UnpaidBill. | |
| 400 | OperationDenied.ServiceLinkedRoleNotExist | The operation is not allowed because of ServiceLinkedRoleNotExist. | |
| 400 | ResourceAlreadyAssociated.AllocationId | The specified resource of %s is already associated. | |
| 400 | OperationFailed.vSwitchNotSupportIpv6 | The operation failed because of vSwitchNotSupportIpv6. | |
| 400 | InvalidZones | The current zone list is illegal. | |
| 400 | QuotaExceeded.QuotaInsufficient | The quota of %s is exceeded, usage %s/%s. | |
| 400 | ResourceInUse.IP | The specified resource of IP is in use. | |
| 400 | OperationFailed.CreateOrderError | Operation failed because CreateOrderError. | |
| 400 | OperationFailed.NotExist.ResourceGroup | Operation failed because ResourceGroup not exist. | |
| 400 | IllegalParam.loadBalancerName | Param loadBalancerName is illegal. | |
| 400 | SystemBusy | System is busy, please try again later. | |
| 400 | MissingParam.%s | The parameter of %s is missing. | |
| 400 | IllegalParam.DeletionProtectionConfig | DeletionProtectionConfig reason is illegal. | |
| 400 | IllegalParam.ModificationProtectionConfig | ModificationProtectionConfig reason is illegal. | |
| 400 | Throttling.User | Request was denied due to api flow control. | |
| 403 | UnauthorizedZone | The specified zone of %s is not authorized. | |
| 403 | Forbidden.NoPermission | Authentication is failed for NoPermission. | |
| 403 | UnauthorizedRegion | The specified region of %s is not authorized. | |
| 404 | ResourceNotFound.VSwitch | The specified resource of vSwitch is not found. | |
| 404 | ResourceNotFound.Vpc | The specified resource of Vpc is not found. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.