You need to enable JavaScript to run this app.
文档中心
负载均衡

负载均衡

复制全文
下载 pdf
实例
CreateLoadBalancer - 创建 ALB 实例
复制全文
下载 pdf
CreateLoadBalancer - 创建 ALB 实例
调用 CreateLoadBalancer 接口,创建 ALB 实例。​
使用说明​
每秒最多提交 10 个 API 请求。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:CreateLoadBalancer​
要执行的操作,取值:CreateLoadBalancer。​
​
Version string 必选 示例值:2020-04-01​
API的版本,取值:2020-04-01。​
​
ModificationProtectionReason string 可选 示例值:This is modification protection​
启用实例修改保护的原因。​
  • 必须以字母或中文开头,可包含数字、英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。​
  • 长度限制为 0~128 个字符。​
说明​
  • 仅当 ModificationProtectionStatus 参数的值为 ConsoleProtection时,ModificationProtectionReason 参数的值有效且合法。​
​
ModificationProtectionStatus string 可选 示例值:NonProtection​
是否启用实例修改保护功能。取值如下:​
  • NonProtection(默认值):不启用实例修改保护。​
  • ConsoleProtection:启用实例修改保护。启用后,您无法通过 ALB 控制台修改实例配置,只能够调用 API 修改实例配置。​
​
LoadBalancerEdition string 可选 示例值:Standard​
ALB 实例的版本。不同版本有不同功能限制和计费策略。取值:​
  • Basic(默认值):基础版。​
  • Standard:标准版。​
​
ClientToken string 可选 示例值:123e4567-e89b-12d3-a456-42665544****​
客户端 Token,用于保证请求的幂等性。客户端 Token 可避免以下问题:当API 调用超时或服务器内部错误时,客户端多次重试导致重复创建资源。​
  • 该参数值由客户端生成。应确保不同请求中的取值唯一。​
  • 取值仅支持 ASCII 字符,最大不超过 64 个字符。​
  • 未指定该参数值时,系统不进行幂等校验。​
​
AddressIpVersion string 可选 示例值:DualStack​
ALB 实例的 IP 类型。取值如下:​
  • IPv4(默认值):IPv4 类型。​
  • DualStack:IPv4&IPv6 双栈类型。​
说明​
如需将 AddressIpVersion 参数指定为 DualStack,请联系客户经理。​
​
ZoneMappings.N.ZoneId string[] 可选 示例值:ZoneMappings.1.ZoneId=cn-beijing-a&ZoneMappings.2.ZoneId=cn-beijing-b​
ALB 实例的可用区ID。​
  • 您可通过调用 DescribeZones 接口,获取可用区ID。​
  • SubnetId与ZoneId需要匹配。​
说明​
参数SubnetId即将下线,请使用ZoneMappings.N.SubnetId和ZoneMappings.N.ZoneId字段接入服务,指定需要部署的可用区和子网信息。​
​
VpcId string 可选 示例值:vpc-bp1aevy8sofi8mh1****​
ALB 实例所属的 VPC ID。​
不传默认为子网所属的 VPC ID。​
​
Ipv6EipBillingConfig.Bandwidth integer 可选 示例值:200​
公网ALB 实例的 IPv6 公网带宽的带宽上限。默认值为1,单位为 Mbps。当创建 IPv4&IPv6 双栈类型的公网 ALB 实例时,该参数必填。取值范围:​
  • Ipv6Address.BillingType 参数的值为 2 时:取值范围是 1 ~ 500。​
  • Ipv6Address.BillingType 参数的值为 3 时:取值范围是 1 ~ 200。​
​
EipBillingConfig.SecurityProtectionTypes string 可选 示例值:AntiDDoS_Enhanced​
创建 ALB 公网实例时,ALB 允许购买多个公网IP防护资源。公网 IP 防护资源的具体规则如下:​
  • 多个防护资源之间用半角逗号(,)分隔。​
  • 防护资源的取值如下:​
  • AntiDDoS_Enhanced:您申请的是增强防护类型的公网 IP,可以将此 IP 加入到 DDoS 原生防护实例。​
  • 不填:您申请的是基础防护类型的公网 IP 。​
  • 当前购买公网 IP 防护资源仅支持白名单用户使用,如有业务需求,请您联系客户经理。​
​
Ipv6BandwidthPackageId string 可选 示例值:bwp-2d6dcpvaeq9s058****​
创建 ALB 公网实例时,指定 Ipv6公网带宽要加入的共享带宽包 ID。​
​
EipBillingConfig.EipBillingType integer 可选 示例值:2​
公网 ALB 实例的 IPv4 公网 IP 的计费方式。取值如下:​
  • 2(默认值):按量计费-按带宽上限计费。​
  • 3:按量计费-按实际流量计费。​
​
Description string 可选 示例值:This is an ALB instance.​
ALB 实例的描述。​
  • 不传默认为空字符串。​
  • 必须以字母或中文开头,可包含数字、英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)​
  • 长度限制为1 ~ 255个字符。​
​
Type string 必选 示例值:private​
ALB 实例的类型。取值如下:​
  • public:表示创建一个公网负载均衡实例,系统会分配一个公网IP地址和一个私网IP地址,可用于转发公网请求和私网请求。​
  • private:表示创建一个私网负载均衡实例,系统会分配一个私网IP地址,仅用于转发私网请求。​
​
Tags.N.Value string[] 可选 示例值:Tags.1.Value=v1&Tags.2.Value=v2​
用户标签的标签值。如果传入该参数,则必须先传入Tags.N.Key。具体规则如下:​
  • 长度限制为0~256个字符。​
  • 大小写敏感。​
  • 不能以空格开头或结尾。​
  • 允许包含各国语言文字、数字、空格()、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、减号(-)和@。​
​
Tags.N.Key string[] 可选 示例值:Tags.1.Key=k1&Tags.2.Key=k2​
用户标签的标签键。具体规则如下:​
  • 长度限制为1~128个字符。​
  • 大小写敏感。​
  • 不能以volc:的任意大小写组合开头。​
  • 不能以空格开头或结尾。​
  • 允许包含各国语言文字、数字、空格()、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、减号(-)和@。​
  • 同一资源的标签键不允许重复。​
​
RegionId string 必选 示例值:cn-beijing​
请求的Region。​
​
LoadBalancerName string 可选 示例值:alb-bp1o94dp5i6ea****​
ALB 实例的名称。​
  • 必须以字母或中文开头,可包含数字、点号(.)、下划线(_)和短横线(-)。​
  • 长度限制为1 ~ 128个字符。​
  • 不传则默认为实例ID。​
​
LoadBalancerBillingType integer 可选 示例值:1​
ALB 的计费方式。取值如下:​
  • 1(默认值):按LCU计费。​
​
Ipv6EipBillingConfig.ISP string 可选 示例值:BGP​
公网ALB 实例的 IPv6 公网带宽的线路类型。取值如下:​
  • BGP(默认值):BGP多线。​
​
Ipv6EipBillingConfig.BillingType integer 可选 示例值:2​
公网ALB 实例的 IPv6 公网带宽的计费类型。取值如下:​
  • 2:按量计费-按带宽上限计费。​
  • 3(默认值):按量计费-按实际流量计费。​
​
EipBillingConfig.ISP string 可选 示例值:BGP​
公网 ALB 实例的 IPv4公网 IP 线路类型。取值如下:​
  • BGP(默认值):BGP多线。​
​
EipBillingConfig.Bandwidth integer 可选 示例值:10​
公网 ALB 实例的 IPv4 公网 IP 的带宽上限。​
  • 默认值为1,单位为 Mbps。​
  • 取值范围:​
  • 当EipBillingConfig.EipBillingType 参数的值为 2 时,取值范围为1 ~ 500。​
  • 当EipBillingConfig.EipBillingType 参数的值为 3 时,取值范围为1 ~ 200。​
​
DeleteProtection string 可选 示例值:off​
是否开启 ALB 实例的删除保护功能。取值如下:​
  • off(默认值):关闭删除保护功能。​
  • on:开启删除保护功能。​
​
BandwidthPackageId string 可选 示例值:bwp-6248cim0mayon3gd5tv****​
创建 ALB 公网实例时,指定IPv4公网 IP 要加入的共享带宽包 ID。​
​
ProjectName string 可选 示例值:default​
ALB所属项目名称。​
​
SubnetId string 可选 示例值:subnet-bp12mw1f8k3jgy****​
ALB 实例所属 VPC 内的子网 ID。​
ALB 实例的私网 IP 地址将从该子网网段中分配。​
说明​
参数SubnetId即将下线,请使用ZoneMappings.N.SubnetId和ZoneMappings.N.ZoneId字段接入服务,指定需要部署的可用区和子网信息。​
​
ZoneMappings.N.SubnetId string[] 可选 示例值:ZoneMappings.1.SubnetId=subnet-bp12mw1f8k3jgy****&ZoneMappings.1.SubnetId=subnet-bp12mw1f8k3jgy****​
子网ID。ALB 实例在此可用区下的私网 IP 地址将从此子网网段中分配。​
说明​
参数SubnetId即将下线,请使用ZoneMappings.N.SubnetId和ZoneMappings.N.ZoneId字段接入服务,指定需要部署的可用区和子网信息。​
​
EipBillingConfig.SecurityProtectionInstanceId long 可选 示例值:123132​
创建ALB公网实例时,如果使用了IP防护资源,则需要指定一个DDoS原生防护实例的ID。​
​
ArkClawEnabled string 可选 示例值:off​
是否开启 ArkClaw 功能。取值如下:​
  • off(默认值):关闭。​
  • on:开启。​
说明​
本参数正在邀测中,如需试用,请联系客户经理。​
​
SpaceNetworkId string 可选 示例值:csn-bpkdt37pq72zv****​
ArkClaw 实例所在 SpaceNetwork 的 ID。仅当 ArkClawEnabled 为 on 时参数有效。​
说明​
本参数正在邀测中,如需试用,请联系客户经理。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
LoadBalancerId string 示例值:alb-bp1o94dp5i6ea****​
ALB 实例 ID。​
​
RequestId string 示例值:20210811152539010225146063030****​
请求ID。​
​
​
​
请求示例​
​
GET /?Action=CreateLoadBalancer&Version=2020-04-01&Type=public&LoadBalancerName=***&VpcId=vpc-2fe624a318b9c5oxruuox***&LoadBalancerBillingType=1&ZoneMappings.1.SubnetId=subnet-2fe6iauhyn3ls5oxruuyf****&ZoneMappings.1.ZoneId=cn-beijing-a&SecurityProtectionTypes=AntiDDoS_Enhanced​
Host: alb.cn-beijing.volcengineapi.com​
X-Date: 20251121T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/alb/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20210816110638****2514606306AF947C",​
"Action": "CreateLoadBalancer",​
"Version": "2020-04-01",​
"Service": "alb",​
"Region": "cn-beijing"​
}, ​
"Result": {​
"RequestId": "20210811152539010225146063030****",​
"LoadBalancerId": "alb-bp1o94dp5i6ea****"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
Invalid%s.Malformed​
MismatchThe specified %s is malformed.​
指定的 %s 参数格式不合法。​
400​
MissingParameter​
The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, '%s'.​
该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如: %s。​
400​
InvalidParameter​
Data unmarshal failed.​
请求解析失败。​
400​
InvalidTags.Key.Malformed​
The specified Tags.Key is malformed.​
指定的 Tags.Key 参数格式不合法。​
400​
OperationFailed.QueryIpv6Gateway​
The request on the specified resource failed due to the query on ipv6 gateway failed.​
因请求 IPv6 网关失败,对于该资源的操作请求失败。​
400​
InvalidIpv6EipBillingConfig.Bandwidth.Malformed​
The specified Ipv6EipBillingConfig.Bandwidth is malformed.​
指定的 Ipv6EipBillingConfig.Bandwidth 参数格式不合法。​
400​
InvalidIpv6Gateway.InvalidStatus​
The specified IPv6Gateway of VPC is not in the correct status for the request.​
指定的 VPC 对应的 IPv6 网关所处状态无法响应该请求。​
400​
QuotaExceed.InstancePerRegion​
You've reached the limit on the number of loadbalancers the current region you can create in, usage xx/xx.​
已达到当前地域可创建的 ALB 实例的数量上限。目前已使用xxx,配额为xxx。​
400​
QuotaExceed.EipInBandwidthPackage​
You've reached the limit on the number of EIP per bandwidth package you can add in.​
已达到共享带宽包内可加入的 EIP 的数量上限。​
400​
OperationFailed.CreatePreOrderFailed​
The request on the specified LoadBalancer failed due to creating a pre order failed.​
因配置单下单失败,对于该 ALB 实例的操作请求失败。​
400​
OperationFailed.CreatePrivateEniFailed​
The request on the specified LoadBalancer failed due to creating private eni failed.​
因辅助网卡创建失败,对于该 ALB 实例的操作请求失败。​
400​
OperationFailed.CreateOrderFailed​
The request on the specified LoadBalancer failed due to creating an order failed.​
因下单支付失败,对于该 ALB 实例的操作请求失败。​
400​
LimitExceed.Tag​
You've reached the limit on the number of tags that you can operate at a time.​
已达到单次可操作的标签的数量上限。​
400​
InvalidAddressIpVersion.Malformed​
The specified AddressIpVersion is malformed.​
指定的 AddressIpVersion 参数格式不合法。​
400​
InvalidTags.Value.Malformed​
The specified Tags.Value is malformed.​
指定的 Tags.Value 参数格式不合法。​
400​
InvalidTags.Key.Duplicated​
The specified Tags.Key is duplicated.​
指定的 Tags.Key 重复。​
400​
OperationFailed.AccountBalanceNotEnough​
The request on the specified Resource failed due to the account balance and available vouchers are less than 100 yuan in total.​
因账户余额及可用代金券共不足 100 元,对于该资源的操作请求失败。请充值后重试。​
400​
InvalidIpv6EipBillingConfig.BillingType.Malformed​
The specified Ipv6EipBillingConfig.BillingType is malformed.​
指定的 Ipv6EipBillingConfig.BillingType 参数格式不合法。​
400​
InvalidType.Malformed​
The specified Type is malformed.​
指定的 Type 参数格式不合法。​
400​
InvalidLoadBalancerName.Malformed​
The specified LoadBalancerName is malformed.​
指定的 LoadBalancerName 参数格式不合法。​
400​
InvalidDescription.Malformed​
The specified Description is malformed.​
指定的 Description 参数格式不合法。​
400​
InvalidDeleteProtection.Malformed​
The specified DeleteProtection is malformed.​
指定的 DeleteProtection 参数格式不合法。​
400​
InvalidIndexOrder.Malformed​
The specified index order is malformed.​
指定的索引顺序参数格式不合法。​
400​
OperationDenied.ZoneUnsupported​
The request on the specified LoadBalancer is denied due to the specified zone is unsupported. DescribeZones will tell you which zones ALB supports.​
因指定的可用区内不支持创建 ALB 实例,对于该 ALB 实例的操作请求被拒绝。通过调用 DescribeZones 接口,可获得 ALB 实例支持部署的可用区信息。​
400​
LoadBalancerBillingType.Malformed​
The specified LoadBalancerBillingType is malformed.​
指定的 LoadBalancerBillingType 参数格式不合法。​
400​
InvalidZoneMappings.ZoneId.Duplicated​
The specified ZoneMappings.ZoneId is duplicated.​
指定的 ZoneMappings.ZoneId 重复。​
400​
OperationFailed.QueryProject​
The request on the specified resource failed due to the query on project failed.​
因查询项目失败,对于该资源的操作请求失败。​
400​
OperationFailed.QueryVpc​
The request on the specified resource failed due to the query on VPC failed.​
因请求 VPC 失败,对于该资源的操作请求失败。​
400​
QuotaExceed.Eip​
You've reached the limit on the number of EIP that you can create.​
已达到可创建的 EIP 的数量上限。​
400​
QuotaExceed.Eni​
You've reached the limit on the number of Eni that you can create.​
已达到创建弹性网卡的数量上限。​
400​
InvalidEipBillingConfig.EipBillingType.Malformed​
The specified EipBillingConfig.EipBillingType is malformed.​
指定的 EipBillingConfig.EipBillingType 参数格式不合法。​
400​
OperationDenied.Ipv6NotEnabled​
The request on the specified LoadBalancer is denied due to the vpc does not have an IPv6 gateway.​
因待创建的 ALB 实例所在的 VPC 未开通 IPv6 网关,对于该 ALB 实例的操作请求被拒绝。​
400​
InvalidISPForEip.BandwidthPackageMismatch​
The specified ISP for EIP and BandwidthPackage do not match.​
指定的 EIP 与共享带宽包的 ISP 不匹配。​
400​
InvalidIpv6EipBillingConfig.ISP.Malformed​
The specified Ipv6EipBillingConfig.ISP is malformed.​
指定的 Ipv6EipBillingConfig.ISP 参数格式不合法。​
400​
OperationFailed.QueryIAM​
The request on the specified resource failed due to the query on IAM failed.​
因请求 IAM 失败,对于该资源的操作请求失败。​
400​
InvalidSubnet.ZoneMismatch​
The specified subnet and zone do not match.​
指定的子网和可用区不匹配。​
400​
OperationDenied.DualStackUnsupported​
The request on the specified LoadBalancer is denied due to IPv6-only subnets can not be used to create the dual stack loadbalancer.​
因子网仅支持 IPv6,无法创建双栈类型 ALB 实例,对于该 ALB 实例的操作请求被拒绝。​
400​
OperationDenied.ZoneTypeConflict​
The request on the specified LoadBalancer is denied due to standard zones and local zones cannot be specified at the same time.​
因标准可用区和本地可用区不能同时存在,对于该 ALB 实例的操作请求被拒绝。​
400​
InsufficientIpInSubnet​
The specified subnet does not contain enough free private IP addresses to fulfill your request.​
指定子网下可用 IP 不足。​
400​
InvalidSubnetId.Malformed​
The specified SubnetId is malformed.​
指定的 SubnetId 参数格式不合法。​
400​
OperationFailed.QueryArkClaw​
The request on the specified resource failed due to the query on ArkClaw failed.​
因请求 ArkClaw 失败,对于该资源的操作请求失败。​
400​
InvalidArkClawEnabled.Malformed​
The specified ArkClawEnabled is malformed.​
指定的 ArkClawEnabled 参数格式不合法。​
400​
InvalidZoneMappings.Malformed​
The specified ZoneMappings is malformed.​
指定的 ZoneMappings 参数格式不合法。​
400​
OperationDenied.ArkClawWithExtensionUnsupported​
The request on the specified LoadBalancer is denied due to the ALB instance extension feature and the ArkClaw feature cannot be enabled simultaneously.​
因 ALB 实例扩展功能和 ArkClaw 功能不能同时开启,对于该 ALB 实例的操作请求被拒绝。​
400​
NotSupportPaypalErr​
You are requested to provide an alternative payment method other than Paypal before enabling the pay-as-you-go products in BytePlus.​
本次下单的后付费商品不支持Paypal支付,请补充其他支付方式。​
400​
MainAccountNotSupportPaypalErr​
You are requested to contact the main account to provide an alternative payment method other than Paypal before enabling the pay-as-you-go products in BytePlus.​
本次下单的后付费商品不支持Paypal支付,请联系主账号补充其他支付方式。​
403​
Forbidden​
You are not authorized to create loadbalancer with ArkClaw.​
您无权限创建 ALB 实例开启 ArkClaw 功能。​
403​
Forbidden​
You are not authorized to create dualstack loadbalancer.​
您无权限创建双栈类型 ALB 实例。​
404​
InvalidRegion.NotFound​
The specified Region does not exist.​
指定的 Region 不存在。​
404​
InvalidProject.NotFound​
The specified Project does not exist.​
指定的项目不存在。​
404​
InvalidSubnet.NotFound​
The specified Subnet does not exist.​
指定的子网不存在。​
404​
InvalidVpc.NotFound​
The specified VPC does not exist.​
指定的 VPC 不存在。​
404​
InvalidBandwidthPackage.NotFound​
The specified BandwidthPackage does not exist.​
指定的共享带宽包不存在。​
404​
InvalidSpaceNetwork.NotFound​
The specified SpaceNetwork does not exist.​
指定的 SpaceNetwork 不存在。​
500​
InternalError​
An internal error has occurred.​
发生内部错误。请稍后重试或联系工程师进一步咨询。​
​
​
最近更新时间:2026.07.06 21:32:18
这个页面对您有帮助吗?
有用
有用
无用
无用