Creates a Classic Load Balancer (CLB) instance.
Operation description
- Before you create a CLB instance, call the DescribeAvailableResource operation to query the resources available for purchase in the region where you want to create the CLB instance.
- After a CLB instance is created, you are charged for using the CLB instance.
- The pay-as-you-go billing method supports the pay-by-specification and pay-by-LCU metering methods.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
slb:CreateLoadBalancer | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the CLB instance. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
AddressType | string | No | The network type of the CLB instance. Valid values:
| internet |
InternetChargeType | string | No | The metering method of the Internet-facing CLB instance. Valid values:
Note
If you set PayType to PayOnDemand and InstanceChargeType to PayByCLCU, the only valid value for InternetChargeType is paybytraffic.
| paybytraffic |
Bandwidth | integer | No | The maximum bandwidth of the listener. Unit: Mbit/s. Valid values: 1 to 5120. For a pay-by-bandwidth Internet-facing CLB instance, you can specify a maximum bandwidth for each listener. The sum of the maximum bandwidth of all listeners cannot exceed the maximum bandwidth of the CLB instance. | 10 |
ClientToken | string | No | The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. Note
If you do not specify this parameter, the system uses the request ID as the client token. The request ID may be different for each request.
| 593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3 |
LoadBalancerName | string | No | The CLB instance name. The name must be 1 to 80 characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. If you do not specify this parameter, the system automatically assigns a name to the CLB instance. | lb-bp1o94dp5i6ea**** |
VpcId | string | No | The ID of the virtual private cloud (VPC) to which the CLB instance belongs. | vpc-bp1aevy8sofi8mh1**** |
VSwitchId | string | No | The ID of the vSwitch to which the CLB instance belongs. If you want to deploy the CLB instance in a VPC, this parameter is required. If this parameter is specified, AddessType is set to intranet by default. | vsw-bp12mw1f8k3jgy**** |
MasterZoneId | string | No | The ID of the primary zone to which the CLB instance belongs. You can call the DescribeZone operation to query the primary and secondary zones in the region where you want to create the CLB instance. | cn-hangzhou-b |
SlaveZoneId | string | No | The ID of the secondary zone to which the CLB instance belongs. You can call the DescribeZone operation to query the primary and secondary zones in the region where you want to create the CLB instance. | cn-hangzhou-d |
LoadBalancerSpec | string | No | The specification of the CLB instance. Valid values:
Note
If you do not specify this parameter, a shared-resource CLB instance is created. Shared-resource CLB instances are no longer available for purchase. Therefore, you must specify this parameter.
If InstanceChargeType is set to PayByCLCU, this parameter is invalid and you do not need to specify this parameter. | slb.s1.small |
ResourceGroupId | string | No | The ID of the resource group. | rg-atstuj3rtopt**** |
PayType | string | No | The billing method of the CLB instance. Valid values: PayOnDemand: pay-as-you-go. Note
The Alibaba Cloud International site supports only pay-as-you-go CLB instances.
| PayOnDemand |
PricingCycle | string | No | The billing cycle of the subscription Internet-facing CLB instance. Valid values:
Note
This parameter is supported only by subscription instances created on the Alibaba Cloud China site.
| month |
Duration | integer | No | The subscription duration of the Internet-facing CLB instance. Valid values:
Note
This parameter is supported only by subscription instances created on the Alibaba Cloud China site.
| 1 |
AutoPay | boolean | No | Specifies whether to automatically pay the subscription fee of the Internet-facing CLB instance. Valid values:
Note
This parameter takes effect only for subscription CLB instances created on the Alibaba Cloud China site.
| true |
AddressIPVersion | string | No | The IP version of the CLB instance. Valid values: ipv4 and ipv6. | ipv4 |
Address | string | No | The private IP address of the CLB instance. The private IP address must belong to the destination CIDR block of the vSwitch. | 192.168.XX.XX |
Tag | array<object> | No | The tags. | |
object | No | The tags. | ||
Key | string | No | The tag key of the bastion host. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be at most 64 characters in length, and cannot contain | test |
Value | string | No | The tag value. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with | value |
DeleteProtection | string | No | Specifies whether to enable deletion protection for the CLB instance. Valid values:
| on |
ModificationProtectionStatus | string | No | Specifies whether to enable the configuration read-only mode. Valid values:
Note
If you set this parameter to ConsoleProtection, you cannot modify instance configurations in the CLB console. However, you can modify instance configurations by calling API operations.
| ConsoleProtection |
ModificationProtectionReason | string | No | The reason for enabling the configuration read-only mode. The reason must be 1 to 80 characters in length. It must start with a letter and can contain letters, digits, periods (.), underscores (_), and hyphens (-). Note
This parameter takes effect only when ModificationProtectionStatus is set to ConsoleProtection.
| Managed instance |
InstanceChargeType | string | No | The metering method of the CLB instance. Valid values:
Note
This parameter is supported only by instances created on the Alibaba Cloud China site and only when PayType is set to PayOnDemand.
| PayBySpec |
Response parameters
Examples
Sample success responses
JSON
format
{
"VpcId": "vpc-25dvzy9****",
"AddressIPVersion": "ipv4",
"VSwitchId": "vsw-255ecr****",
"RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
"LoadBalancerName": "lb-bp1o94dp5i6ea****",
"LoadBalancerId": "lb-hddhfjg****",
"ResourceGroupId": "rg-atstuj3rto****",
"Address": "42.XX.XX.6",
"NetworkType": "classic",
"OrderId": 0
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | OperationFailed.ZoneResourceLimit | The operation failed because of resource limit of the specified zone. | - |
400 | CloudBoxNotSupportIpv6 | The cloudBox instance does not support ipv6. | - |
400 | CloudBoxNotSupportInternet | The cloudBox instance does not support internet. | - |
400 | OperationFailed.RegionResourceLimit | The operation failed because of resource limit of the specified region. | - |
400 | Operation.NotAllowed | Operation Denied. The charge type of internet prepay instance can only be paybybandwidth. | - |
400 | Operation.NotAllowed | Operation Denied. The charge type of intranet prepay instance can only be paybytraffic. | - |
400 | OperationFailed.UnpaidBillsExist | The account has unpaid bills. Please pay your overdue bill first. | - |
400 | RegionOrZonesNotSupportIpv6 | The specified region or master/slave zones does not support ipv6. | - |
400 | InvalidParameter.Mismatch | AddressType and IpVersion is conflict, IPv6 does not support intranet instance. | - |
400 | PAYFOR.CREDIT_PAY_INSUFFICIENT_BALANCE | Your account does not have enough balance. | - |
400 | HighRiskOperationDenied | The operation is denied because of high risk. | - |
400 | VSwitchAvailableIpNotExist | The specified VSwitch has no availabe ip. | - |
400 | VSwitchNotExist | The specified VSwitch does not exist. | - |
400 | InvalidParameter | Illegal parameter. The IP address is not in subnet. | - |
400 | Instance.ShareSlbNotSupportPay95 | Illegal parameter. The share instance not support PayBy95 or PayByOld95. | - |
400 | Instance.Pay95RateInvalid | Illegal parameter. The rate is illegal. | - |
400 | Instance.Pay95BandwidthIllegal | Illegal parameter. The bandwidth is illegal. | - |
400 | Instance.InternetChargeTypeNotAllowed | Illegal parameter. The specified InternetChargeType not allowed. | - |
400 | OperationFailed.TokenIsProcessing | The operation is failed, because the Client Token is processing. | - |
400 | InsufficientBalance | Your account does not have enough balance. | Your account balance is insufficient. Top up your account and try again. |
400 | MissingParam.VSwitchId | The parameter VSwitchId is required. | - |
400 | InvalidVpcId.NotExist | The specified VPC not exist. | - |
400 | PAY.MAYI_WITHHOLDING_AGREEMENT_ILLEGAL | Your account did not sign a withholding agreement or no coupons in Alipay. | - |
400 | InvalidParameter.CloudType | The specified CloudType is invalid. | - |
400 | OperationFailed.InvalidAccount | The account information is incomplete. | - |
400 | RegionOrZonesNotSupportCEN | The specified region or master/slave zones does not support cloudType of hybrid_cen. | - |
400 | MissingParam.LoadBalancerSpec | The param LoadBalancerSpec is required. | - |
400 | InvalidParameter.Bandwidth | The param Bandwidth is invalid. | - |
400 | OperationForbidden.AccountRiskReject | The operation failed because of account risk reject. | - |
400 | OperationForbidden.QuotaLimit | The operation failed because of quota limit of shared loadbalancers. | - |
400 | InvalidParam.ModificationProtectionStatus | The param ModificationProtectionStatus is invalid. | - |
400 | InvalidParam.ModificationProtectionReason | The param ModificationProtectionReason is invalid. | - |
400 | InvalidParam.ModificationProtectionReason | %s. | - |
400 | ShareSlbHaltSales | The share instance has been discontinued. | - |
400 | OperationFailed.CashBookInsufficient | No payment method is specified for your account, We recommend that you add a payment method or maintain a prepayment balance. | - |
400 | OperationFailed.OnlyInnerCommoditySupportToPurchase | AliCroup2Cloud user only can buy inner commodity. | - |
400 | OperationFailed.InvokeLingXiaoFailed | Failed to invoke lingxiao service. | - |
400 | AllocateVpcInstanceFailed | Failed to allocate vpc instance. | - |
400 | QueryCreditCtrlInfoFailed | Failed to query credit ctrl info. | - |
400 | QueryCommodityCenterFailed | Failed to query commodity center. | - |
400 | RegionNotSupportParameter | Current region does not support the param of %s. | - |
400 | QueryAccountBookInfoFailed | Failed to invoke account book info. | - |
400 | RateAccountFailed | Failed to rate account for pricing. | - |
400 | TradeWaitDistributorAudit | The trade needs distributor to audit. | - |
400 | OperationFailed.InvokeProxyFailed | Failed to invoke proxy. | - |
400 | QueryAccountCompleteProgressFailed | Failed to query account progress. | - |
400 | QueryVoucherInfoFailed | Failed to query voucher info. | - |
400 | InvalidVSwitchId.NotFound | The specified vSwitch instance is invalid. | The current specified vswitch instance is illegal. |
400 | IllegalParam.SpecType | The param of SpecType is illegal. | - |
400 | MissingParam.SpecType | The param of SpecType is missing. | - |
400 | UnsupportedRegion | The feature is not supported in current region. | - |
400 | PayInsufficientBalance | Your account balance is insufficient. | - |
400 | IllegalParam.InstanceChargeType | The parameter InstanceChargeType is illegal. | - |
400 | SystemBusy | The system is busy. | The service is unavailable. Please try again later. |
400 | PRODUCT.NOT_AVAILABLE_IZ | The Instance zone id doesn t support | - |
400 | PRICE.INQUIRY_FAILED | The instance pricing inquiry is failed. | - |
400 | AssociateIpFail | The instance associating ip is failed. | - |
400 | SDK.ServerUnreachable | Service is unreachable. | - |
400 | OverQuota | The Total is over the quota | Total amount has reach the limit. Reduce the quantity and try again. |
400 | InvalidParam.TagValue | %s. | - |
400 | InvalidParam.TagKey | %s. | - |
400 | SizeLimitExceeded.Tag | %s. | - |
400 | MissingParam.TagKey | The param MissingParam.TagKey is missing. | - |
400 | SubnetIpExhaust | No subnet IP addresses are available. | No subnet IP address is available. |
400 | BeforePayRuleBatchValidateError | The pre-payment rule center instance rule validation failed. Please check if the instance limit has been reached. | - |
400 | TradeSyncCreateSubError | Subscription transfer failed. | - |
400 | QueryOrderError | Failed to query the order. Please try again later. | - |
400 | CreateOrderTimeout | Order creation timed out. Please try again later. | - |
400 | MultiGrayKeyResourceInconsist | The identifier for the gray resource is set incorrectly. | - |
400 | InsufficientAvailableQuota | Your account available balance is less than 0. Please recharge before attempting to make a purchase. | - |
400 | Forbidden.AliGroupForbiddenRegion | Thre region is forbidden for aligroup user. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-01-26 | The Error code has changed | View Change Details |
2023-09-26 | The Error code has changed | View Change Details |
2023-09-08 | The Error code has changed | View Change Details |
2023-06-06 | The Error code has changed | View Change Details |
2023-06-06 | The Error code has changed | View Change Details |
2023-06-02 | The Error code has changed | View Change Details |