You need to enable JavaScript to run this app.
导航
CreateLoadBalancer
最近更新时间:2024.06.25 11:49:42首次发布时间:2021.08.31 10:37:27

调用 CreateLoadBalancer 接口,创建一个负载均衡实例。

调试

请求参数

名称
类型
是否必选
示例值
描述
ActionStringCreateLoadBalancer要执行的操作,取值为CreateLoadBalancer。
VersionString2020-04-01API版本信息,当前版本为:2020-04-01。

ExclusiveClusterId

String

ec-bp1o94dp5i6ea****

CLB实例所属独占集群的ID。

  • 您可以调用DescribeExclusiveClusters接口,查询独占集群的ID。
  • 仅创建独占集群类型的CLB实例时,传入本参数。

说明

独占集群功能正在邀测中,如需试用,请联系客户经理。

RegionIdStringcn-shanghai请求的Region。

ZoneType

String

active-standby

CLB实例的可用区类型。

  • single:单可用区。
  • active-standby:主备可用区。
  • 不填时,若指定地域为单可用区部署,则默认为“single”;若指定地域为多可用区部署,则默认为“active-standby”。

说明

负载均衡支持单可用区部署的功能正在邀测中,如需试用,请联系客户经理。

MasterZoneId

String

cn-shanghai-a

CLB实例的主可用区ID。各地域当前支持的可用区信息可参见地域与可用区

  • 取值不能与SlaveZoneId参数取值相同。
  • 不填则默认分配子网所在可用区为主可用区。

SlaveZoneId

String

cn-beijing-b

CLB实例的备可用区ID。

  • 如果传入该参数,则参数MasterZoneId必须传入,且取值不能与MasterZoneId参数相同。
  • 不填则情况如下:
    • 若指定地域为单可用区部署,则本参数为空,创建单可用区CLB实例。
    • 若指定地域为多可用区部署,且ZoneType配置为“single”,则本参数为空,创建单可用区CLB实例。
    • 若指定地域为多可用区部署,且ZoneType配置为“active-standby”,则根据指定地域支持的可用区随机分配备可用区。

LoadBalancerName

String

clb-test

CLB实例的名称。

  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:点(.)、下划线(_)和中划线(-)。
  • 长度限制为1 ~ 128个字符。
  • 不填则默认为实例ID。

Description

String

This is a LB.

CLB实例的描述。

  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:英文逗号(,)、点(.)、下划线(_)、空格( )、等号(=)、中划线(-)、中文逗号(,)、中文句号(。)。
  • 长度限制为0 ~ 255个字符。
  • 不填则默认值为空字符串

LoadBalancerBillingType

Integer

2

CLB实例计费方式。取值如下:

  • 1:包年包月
  • 2(默认值):按量计费-按规格计费
  • 3:按量计费-按使用量计费

说明

按使用量计费正在邀测中,如需试用,请联系客户经理。

PeriodUnit

String

Month

购买包年包月CLB实例的时长单位。
LoadBalancerBillingType取1时,本参数有效。取值如下:

  • Month (默认值):月
  • Year:年

Period

Integer

1

购买包年包月CLB实例的时长。默认为“1”。

  • PeriodUnit配置为Month时,取值范围为1~9,12,24和36。
  • PeriodUnit配置为Year时,取值范围为1~3。

LoadBalancerSpec

String

small_1

CLB实例的规格,不同规格提供的转发能力不同,更多信息请参见产品类型与规格

  • small_1:小型I
  • small_2:小型II
  • medium_1:中型I
  • medium_2:中型II
  • large_1:大型I
  • large_2:大型II

说明

参数LoadBalancerBillingType传入3时,该参数无需传入,默认为clb_lcu(表示单实例默认最大提供100万并发连接、10万新建连接、10Gbps出入带宽和10万QPS)。

Type

String

private

CLB实例的类型。取值如下:

  • public:公网类型。创建一个公网类型CLB实例,系统会分配一个公网IP地址,用于转发公网请求。
  • private:私网类型。创建一个私网类型CLB实例,您需要为其绑定公网IP后,才能转发公网请求。

AddressIpVersion

String

ipv4

CLB实例的IP地址类型。取值如下:

  • ipv4(默认值):表示该负载均衡为IPv4类型,仅支持转发IPv4请求。
  • DualStack:表示该负载均衡为双栈类型,支持转发IPv4和IPv6请求。仅参数Type取private时,才可传入DualStack。

说明

双栈负载均衡功能正在邀测中,如需试用,请联系客户经理。

VpcId

String

vpc-bp1aevy8sofi8mh1****

CLB实例所属的VPC ID。

  • 您可以调用 DescribeVpcs接口,查询VPC的ID。
  • 不传默认为子网所属的VPC ID。

SubnetId

String

subnet-bp12mw1f8k3jgy****

CLB实例所属VPC内的子网ID。

  • CLB实例的私网IP地址将从该子网网段中分配。
  • 您可以调用 DescribeSubnets 接口,查询子网ID。

EniAddress

String

192.XX.XX.06

CLB实例的私网IPv4地址。

  • 从子网中指定一个空闲的IPv4地址。
  • 不填则自动从子网中分配一个空闲的IPv4地址。

EniAddressNum

Integer

2

CLB实例的私网IPv4地址数量。从子网自动分配指定数量的空闲的IPv4地址。

  • 仅参数Type取private且EniAddress未传入时,本参数有效。
  • 取值范围:1~5,默认为1。
  • 本参数正在邀测中,如需试用,请联系客户经理。

EniIpv6Address

String

2408:4005:XX:XX:200

CLB实例的私网IPv6地址。

  • 参数AddressIpVersion取DualStack时,本参数有效。
  • 从子网中指定一个空闲的私网IPv6地址。
  • 不填自动从子网中分配一个空闲的私网IPv6地址。

EipBillingConfig.ISP

String

BGP

公网IP线路类型。
仅参数Type取public,本参数有效。取值如下:

  • BGP(默认值):BGP多线
  • ChinaMobile:中国移动静态单线
  • ChinaTelecom:中国电信静态单线
  • ChinaUnicom:中国联通静态单线
  • SingleLine_BGP:BGP单线
  • Static_BGP:静态BGP

说明

除BGP(多线)外,其他线路类型均在邀测中,如需试用,请联系客户经理。

EipBillingConfig.EipBillingType

Integer

2

公网IP的计费方式。
仅参数Type取public,本参数有效。

  • 参数LoadBalancerBillingType取1时,本参数必填且为1,表示包年包月。
  • 参数LoadBalancerBillingType取2或3时:
    • 2:按量计费-按带宽上限计费。
    • 3:按量计费-按实际流量计费。
    • 不填则默认为2。

EipBillingConfig.Bandwidth

Integer

10

公网IP的带宽上限,默认值为1,单位为Mbps。

  • 参数EipBillingConfig.EipBillingType取值为2时,带宽取值范围为1~500。
  • 参数EipBillingConfig.EipBillingType取值为3时,带宽取值范围为1~200。

EipBillingConfig.BandwidthPackageId

String

bwp-2zeo05qre24nhrqpy****

公网IP待加入的共享带宽包ID。

  • 仅当参数EipBillingConfig.EipBillingType配置为2或3时,本参数有效。
  • 您可以调用 DescribeBandwidthPackages 接口,查询共享带宽包ID。

EipBillingConfig.SecurityProtectionTypes.N

String

EipBillingConfig.SecurityProtectionTypes.1=AntiDDoS_Enhanced

公网IP的安全防护类型。
仅当参数EipBillingConfig.EipBillingType配置为2或3时,本参数有效。取值如下:

  • AntiDDoS_Enhanced:增强防护类型,该类型的公网IP可以加入到DDoS原生防护(企业版)实例。
  • 不填则表示公网IP为基础防护类型。

参数 - N:表示安全防护类型的序列,当前仅支持取1。

说明

公网IP的增强防护功能正在邀测中,如需试用,请联系客户经理。

EipBillingConfig.SecurityProtectionInstanceId

Integer

20

DDoS原生防护(企业版)实例的ID。

  • 参数EipBillingConfig.SecurityProtectionTypes.N取AntiDDoS_Enhanced时,本参数有效且必填。
  • 您可以调用 DescInstanceList 接口,查询DDos原生防护(企业版)实例的ID。

ModificationProtectionStatus

String

ConsoleProtection

CLB实例是否开启控制台上修改保护。开启后,禁止通过控制台修改实例或删除实例。取值如下:

  • NonProtection:不开启。
  • ConsoleProtection:开启。
  • 不填默认为空,表示不开启。

ModificationProtectionReason

String

托管实例

设置控制台修改保护的原因。
仅参数ModificationProtectionStatus取ConsoleProtection时,本参数有效。

  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:半角句号(.)、下划线(_)和中划线(-)。
  • 长度限制为1 ~ 80个字符。
ProjectNameStringdefaultCLB实例所属项目的名称。不填则默认加入default项目。

Tags.N.Key

String

Tags.1.Key=key1&Tags.2.Key=key2

用户标签的标签键。

  • 参数 - N:表示标签键的序号,取值范围:1~20。
  • 多个标签键之间用&分隔。
  • 不能以 volc:sys:开头,包括任意大小写形式。
  • 长度取值范围为1~128字符,允许输入各国语言文字、数字、空格( )、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、中划线(-)和@(@)。
  • 若标签键开头或结尾存在空格,系统会自动为其去除。

说明

同一资源的标签键不允许重复。

Tags.N.Value

String

Tags.1.Value=value1&Tags.2.Value=value2

用户标签的标签值。

  • 参数 - N:表示标签值的序号,取值范围:1~20。
  • 多个标签值之间用&分隔。
  • 长度取值范围为0~256字符,不填默认为空。
  • 允许输入各国语言文字、数字、空格( )、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、中划线(-)和@(@)。
  • 大小写敏感。
  • 若标签值开头或结尾存在空格,系统会自动为其去除。

说明

若传入该参数,则必须先传入Tags.N.Key

ClientToken

String

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

客户端Token,用于保证请求的幂等性。

  • 该参数值由客户端自动生成,确保不同请求的取值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。
  • 取值仅支持ASCII字符,最大不超过64个字符。
  • 未指定该参数值时,不进行幂等校验。

返回参数

名称
类型
示例值
描述
LoadBalancerIdStringclb-bp1o94dp5i6ea****CLB实例ID。
RequestIdString20210811152539010225146063030****请求ID。

OrderId

String

Order705261343570982****

订单ID。

说明

仅在参数LoadBalancerBillingType配置为1时,返回该参数。

请求示例

GET /?Action=CreateLoadBalancer&Version=2020-04-01&Type=private&LoadBalancerName=clb-test&VpcId=vpc-bp1aevy8sofi8mh1****&SubnetId=subnet-bp12mw1f8k3jgy****&LoadBalancerSpec=small_1&LoadBalancerBillingType=2 HTTP/1.1
Host: open.volcengineapi.com
Region: cn-shanghai
Service: clb

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20210811152539010225146063030****",
        "Action": "CreateLoadBalancer",
        "Version": "2020-04-01",
        "Service": "clb",
        "Region": "cn-shanghai"
    }, 
    "Result": {
        "RequestId": "20210811152539010225146063030****",
        "LoadBalancerId": "clb-bp1o94dp5i6ea****",
        "OrderId": "Order705261343570982****"
    }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

HttpCode
错误码
错误信息
描述

400

MissingParameter

The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, the 'XXX'.

该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如XXX

说明

其中,XXX表示缺少的参数名称。

400UnsupportedOperation.AccountArrearsThe request on the specified instance is denied due to the account in arrears status.因账户处于欠费状态,对于该实例的操作请求被拒绝。
400UnsupportedOperation.AccountArrearsThe request on the specified instance is denied due to the account balance and available vouchers are less than 100 yuan in total.因账户余额及可用代金券共不足100元,对于该实例的操作请求被拒绝。
400InvalidBillingType.MalformedThe specified billing type is malformed.指定的计费类型不支持。安全防护EIP只支持按带宽上限计费和按流量计费。
400InvalidBandwidth.MalformedThe specified Bandwidth is malformed.指定的 Bandwidth 参数格式不合法。
400InvalidEipBillingType.MalformedThe specified EipBillingType is malformed.指定的 EipBillingType 参数格式不合法。
400InvalidISP.MalformedThe specified ISP is malformed.指定的 ISP 参数格式不合法。
400QuotaExceed.InstanceNumberYou've reached the limit on the number of instance that you can create.已达到可创建负载均衡实例数量的配额上限。
400QuotaExceed.EipYou've reached the limit on the number of EIP that you can create.已达到可创建公网IP实例数量的配额上限。
400QuotaExceed.EniYou've reached the limit on the number of ENI that you can create.已达到可创建网卡数量的配额上限。
400OrderError.PreOrderFailed to create an order.下单失败。
400OrderError.OrderPayFailed to create order and pay.下单支付失败。
400IdempotentParameterMismatchArguments on this idempotent request are inconsistent with arguments used in previous request(s).此幂等请求的参数与前一个请求中使用的参数不一致。
400InvalidTagKey.MalformedThe specified TagKey is invalid.指定的 TagKey 参数格式不合法。
400InvalidTagValue.MalformedThe specified TagValue is invalid.指定的 TagValue 参数格式不合法。
400InvalidAddressIpVersion.MalformedThe specified AddressIpVersion is malformed.指定的 AddressIpVersion 参数格式不合法。
400LimitExceeded.ServiceManagedTagYou've reached the limit on the number of service managed tags that you can create.已达到单次可创建受管资源标签键值数量的上限。
400LimitExceeded.TagOperationYou've reached the limit on the number of tags that you can operate at a time.已达到单次可操作标签数量的上限。
400InvalidIncorrectOrder.MalformedThe specified index order is malformed.指定的索引顺序参数格式不合法。
400InvalidEniAddress.MalformedThe specified EniAddress is malformed.指定的 EniAddress 参数格式不合法。
400InvalidCount.MalformedThe specified Count is malformed.指定的 Count 参数格式不合法。
400InvalidClientToken.MalformedThe specified ClientToken is malformed.指定的 ClientToken 参数格式不合法。
400InvalidLoadBalancerBillingType.MalformedThe specified LoadBalancerBillingType is malformed.指定的 LoadBalancerBillingType 参数格式不合法。
400InvalidLoadBalancerDescription.MalformedThe specified LoadBalancerDescription is malformed.指定的 LoadBalancerDescription 参数格式不合法。
400InvalidLoadBalancerName.MalformedThe specified LoadBalancerName is malformed.指定的 LoadBalancerName 参数格式不合法。
400InvalidLoadBalancerSpec.MalformedThe specified LoadBalancerSpec is malformed.指定的 LoadBalancerSpec 参数格式不合法。
400InvalidMasterZoneId.MalformedThe specified MasterZoneId is malformed.指定的 MasterZoneId 参数格式不合法。
400InvalidModificationProtectionReason.MalformedThe specified ModificationProtectionReason is malformed.指定的 ModificationProtectionReason 参数格式不合法。
400InvalidModificationProtectionStatus.MalformedThe specified ModificationProtectionStatus is malformed.指定的 ModificationProtectionStatus 参数格式不合法。
400InvalidPeriod.MalformedThe specified Period is malformed.指定的 Period 参数格式不合法。
400InvalidPeriodUnit.MalformedThe specified PeriodUnit is malformed.指定的 PeriodUnit 参数格式不合法。
400InvalidRegionId.MalformedThe specified RegionId is malformed.指定的 RegionId 参数格式不合法。
400InvalidSlaveZoneId.MalformedThe specified SlaveZoneId is malformed.指定的 SlaveZoneId 参数格式不合法。
400InvalidType.MalformedThe specified Type is malformed.指定的 Type 参数格式不合法。
400InvalidEniIpv6Address.MalformedThe specified EniIpv6Address is malformed.指定的 EniIpv6Address 参数格式不合法。
400InvalidAddressIpVersion.MalformedThe specified AddressIpVersion is malformed.指定的 AddressIpVersion 参数格式不合法。
400InvalidSubnetIPv6Cidr.NotSupportThe specified subnet does not support ipv6 cidr.指定子网不支持IPv6网段。
400UnSupportedOperation.AssociatedByPrivateLinkThe specified LoadBalancer associated by PrivateLink.指定的负载均衡被私网连接绑定。
400InvalidProject.MalformedThe specified Project is malformed.指定的 Project 参数格式不合法。
400QuotaExceed.ExclusiveClusterInstanceNumberYou've reached the limit on the number of exclusive cluster instance that you can create.已达到独占集群可创建负载均衡实例数量的配额上限。
400InvalidExclusiveCluster.UnSupportActionThe specified ResourceType does not support this action.指定的独占集群不支持当前操作。
400InvalidEniAddressNum.MalformedThe specified EniAddressNum is malformed.指定的 EniAddressNum 参数格式不合法。
400InvalidParameter.EniAddressNumConflictsTypeThe specified EniAddressNum and Type conflict.指定的 EniAddressNum 和 Type 参数冲突。
400InvalidParameter.EniAddressConflictsEniAddressNumThe specified EniAddress and EniAddressNum conflict.指定的 EniAddress 和 EniAddressNum 参数冲突。
400UnsupportedOperationThe request on the specified instance is denied due to the account in arrears status.因账户处于欠费状态,对于该实例的操作请求被拒绝。
400UnsupportedOperationThe request on the specified instance is denied due to the account balance and available vouchers are less than 100 yuan in total.因账户余额及可用代金券共不足100元,对于该实例的操作请求被拒绝。
403ForbiddenYou are not authorized to perform operations on the service managed tag.无权限对指定资源打上受管标签。
403ForbiddenYou are not authorized to perform operations on the specified service; for example, the 'EniAddressNum'.无权限对指定服务进行操作,比如 EniAddressNum。
404InvalidProject.NotFoundThe specified Project does not exist.指定的项目不存在。
404InvalidVPC.NotFoundThe specified VPC does not exist.指定的 VPC 不存在。
404InvalidSubnet.NotFoundThe specified Subnet does not exist.指定的子网不存在。
404InvalidEipBillingType.NotFoundThe specified EipBillingType does not exist.指定的公网 IP 计费方式不存在。
404InvalidZone.NotFoundThe specified Zone mapping does not exist.指定主备可用区关系不存在。
404InvalidExclusiveCluster.NotFoundThe specified ExclusiveCluster does not exist.指定的独占集群不存在。
412InvalidExclusiveCluster.ExpiredThe specified ExclusiveCluster has expired.指定的独占集群已过期。
412InvalidExclusiveCluster.UnPurchasedThe specified ExclusiveCluster is not purchased.指定的独占集群未购买。
412IdempotentProcessingThe request uses the same client token as a previous one that is still in process.幂等请求处理中。