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

负载均衡

复制全文
下载 pdf
NLB实例
CreateNetworkLoadBalancer - 创建NLB实例
复制全文
下载 pdf
CreateNetworkLoadBalancer - 创建NLB实例
调用 CreateNetworkLoadBalancer 接口,创建一个NLB实例。​
使用说明​
通过控制台创建的NLB实例状态变化为:Creating > Active,通过API创建的NLB实例状态变化为:Provisioning > Creating > Active。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下表中,ZoneMappings.N.a 类型参数中的“N”表示可用区及其对应子网、IP地址或公网IP的序号,取值范围为1~n,n取决于地域的可用区数量,详情可参见地域与可用区。多个资源之间使用&分隔。​
Action String 必选 示例值:CreateNetworkLoadBalancer​
要执行的操作,取值为 CreateNetworkLoadBalancer。​
​
Version String 必选 示例值:2020-04-01​
API版本信息,当前版本为 2020-04-01。​
​
RegionId String 必选 示例值:cn-beijing​
请求的地域。​
​
NetworkType String 可选 示例值:intranet​
NLB实例的IPv4网络类型。取值如下:​
  • internet:公网类型。​
  • intranet:私网类型。​
​
LoadBalancerName String 可选 示例值:nlb-test​
NLB实例的名称。​
  • 必须以字母、数字或中文开头,可包含以下特殊字符:点(.)、下划线(_)和中划线(-)。​
  • 长度限制为1 ~ 128个字符。​
  • 该参数不传入,则默认为实例ID。​
​
Description String 可选 示例值:This is an NLB.​
NLB实例的描述。​
  • 必须以字母、数字或中文开头,可包含以下特殊字符:英文逗号(,)、点(.)、下划线(_)、空格( )、等号(=)、中划线(-)、中文逗号(,)、中文句号(。)。​
  • 长度限制为0 ~ 255个字符。​
  • 该参数不传入,则默认为空字符串。​
​
IpAddressVersion String 可选 示例值:ipv4​
NLB实例的IP地址类型。取值如下:​
  • ipv4(默认值):表示该NLB实例为IPv4类型,仅支持转发IPv4请求。​
  • dualstack:表示该NLB实例为双栈类型,支持转发IPv4和IPv6请求。​
说明​
NLB的IPv6功能正在邀测中,如需使用,请联系客户经理。​
​
Ipv4BandwidthPackageId String 可选 示例值:bwp-wedfvcrt56hnm****​
IPv4类型的共享带宽包 ID。​
说明​
当参数NetworkType 传入intranet时,不可传入本参数。​
​
VpcId String 必选 示例值:vpc-bp1aevy8sofi8mh1****​
NLB实例所属的VPC ID。您可以调用DescribeVpcs接口获取VPC ID。​
​
CrossZoneEnabled Boolean 可选 示例值:true​
NLB实例是否开启跨可用区转发能力。​
请严格按照以下枚举值的大小写输入,不要传入其他取值。​
  • true(默认值):开启。​
  • false:关闭。​
​
ZoneMappings.N.ZoneId String 必选 示例值:cn-beijing-a​
NLB实例支持的可用区的ID。您可以调用DescribeNLBZones接口获取可用区ID。​
请至少指定2个可用区。​
​
ZoneMappings.N.SubnetId String 必选 示例值:subnet-bp12mw1f8k3jgy****​
NLB实例支持的可用区内的子网ID。您可以调用DescribeSubnets接口获取子网ID。​
与可用区对应,每个可用区内指定一个子网。​
​
ZoneMappings.N.Ipv4Address String 可选 示例值:192.XX.XX.6​
NLB实例的私网IPv4 VIP地址。​
该参数不传入,则系统自动从子网中分配一个可用的IPv4地址。​
​
ZoneMappings.N.EipId String 可选 示例值:eip-3ciyamhu46c6rrswwusg****​
公网NLB实例关联的公网IP的ID。​
  • 参数NetworkType 为“internet”时:​
  • 传入已有公网IP。​
  • 不传则表示新购公网IP。​
  • 参数NetworkType 为“intranet”时,不允许传入该参数。​
​
SecurityGroupIds.N String 必选 示例值:sg-bp67acfmxazb4p****​
NLB实例关联的安全组的ID。​
  • N:表示安全组的序号,取值范围为 1~4。​
  • 多个安全组 ID 间使用&分隔。​
​
ModificationProtectionStatus String 可选 示例值:ConsoleProtection​
NLB实例是否开启控制台修改保护。取值如下:​
  • NonProtection(默认值):关闭,允许通过控制台修改或删除实例。​
  • ConsoleProtection:开启,禁止通过控制台修改或删除实例。​
​
ProjectName String 可选 示例值:default​
NLB实例所属项目的名称。​
该参数不传入,则默认为default。​
​
Tags.N.Key String 可选 示例值:k1​
用户标签的标签键。​
N:表示标签信息的序号,需按照数字顺序从1开始填写,取值范围 1~20。多个标签键之间使用&分隔。​
  • 长度限制为1~128个字符。​
  • 大小写敏感,不能以volc:或sys:的任意大小写组合开头。​
  • 不能以空格开头或结尾。​
  • 允许包含字母、数字、空格()、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、减号(-)和@。​
说明​
同一资源的标签键不允许重复。​
​
Tags.N.Value String 可选 示例值:v1​
用户标签的标签值。​
N:表示标签信息的序号,需按照数字顺序从1开始填写,取值范围 1~20。多个标签值之间使用&分隔。每个标签键对应一个标签值。​
  • 长度限制为0~255个字符。​
  • 大小写敏感,不能以空格开头或结尾。​
  • 允许包含字母、数字、空格()、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、减号(-)和@。​
说明​
如果传入该参数,则必须先传入Tags.N.Key。​
​
ClientToken String 可选 示例值:123e4567-e89b-12d3-a456-42665544****​
客户端Token,用于保证请求的幂等性。​
  • 该参数值由客户端自动生成,确保不同请求的取值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
  • 取值仅支持ASCII字符,最大不超过64个字符。​
  • 未指定该参数值时,不进行幂等校验。​
​
DNSAffinity Boolean 可选 示例值:true​
是否开启 DNS 可用区亲和性。​
  • true:私网客户端优先解析至同可用区(AZ)的 NLB 节点 IP,流量不跨 AZ;当同 AZ 节点故障时,自动返回所有非故障 AZ 的 IP。​
  • false(默认值):DNS 返回实例全部 AZ 的节点 IP,由客户端随机或轮询选择,可能产生跨 AZ 访问。​
说明​
仅私网解析,公网DNS不受影响。​
​
​
​
返回参数​
RequestId String 示例值:2024092952539010225146063030****​
请求ID。​
​
LoadBalancerId String 示例值:nlb-bp1o94dp5i6ea****​
NLB实例的ID。​
​
​
​
请求示例​
​
GET /?Action=CreateNetworkLoadBalancer&Version=2020-04-01&RegionId=cn-beijing&NetworkType=intranet&LoadBalancerName=nlb-test&Description=This is an NLB.&IpAddressVersion=ipv4&Ipv4BandwidthPackageId=bwp-wedfvcrt56hnm****&VpcId=vpc-bp1aevy8sofi8mh1****&CrossZoneEnabled=true&ZoneMappings.1.ZoneId=cn-beijing-a&ZoneMappings.1.SubnetId=subnet-bp12mw1f8k3jgy****&ZoneMappings.1.Ipv4Address=192.XX.XX.6&ZoneMappings.1.EipId=eip-3ciyamhu46c6rrswwusg****&SecurityGroupIds.1=sg-bp67acfmxazb4p****&ModificationProtectionStatus=ConsoleProtection&ProjectName=default&Tags.1.Key=k1&Tags.1.Value=v1&ClientToken=123e4567-e89b-12d3-a456-42665544**** HTTP/1.1​
Host: clb.cn-beijing.volcengineapi.com​
Date: 20260310T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/clb/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20230604110420****100232280022D31",​
"Action": "CreateNetworkLoadBalancer",​
"Version": "2020-04-01",​
"Service": "clb",​
"Region": "cn-beijing"​
},​
"Result": {​
"LoadBalancerId": "nlb-bp1o94dp5i6ea****",​
"RequestId": "2024092952539010225146063030****"​
}​
}​
​
错误码​
此处仅展示当前API的错误码,更多错误码请参见公共错误码。​
​
状态码​
错误码​
错误信息​
说明​
400​
DryRunOperation​
Exception raised to indicate a successfully authorized action when the DryRun flag is set to true.​
该请求设置为DryRun操作,操作授权已获得许可,但未被实际执行。​
400​
IdempotentParameterMismatch​
Arguments on this idempotent request are inconsistent with arguments used in previous request(s).​
此幂等请求的参数与前一个请求中使用的参数不一致。​
400​
InsufficientIpInSubnet​
The specified subnet does not contain enough free private IP addresses to fulfill your request.​
指定子网下可用 IP 不足。​
400​
InvalidBandwidthPackage.InvalidBusinessStatus​
The specified bandwidth package is not in the correct business status for the request.​
指定的共享带宽包所处计费状态无法响应该请求。​
400​
InvalidClientToken.Malformed​
The specified ClientToken is malformed.​
指定的 ClientToken 参数格式不合法。​
400​
InvalidCrossZoneEnabled.Malformed​
The specified CrossZoneEnabled is malformed.​
指定的 CrossZoneEnabled 参数格式不合法。​
400​
InvalidDescription.Malformed​
The specified Description is malformed.​
指定的 Description 参数格式不合法。​
400​
InvalidEip.InvalidBusinessStatus​
The specified Eip is not in the correct business status for the request.​
指定的 Eip 所处计费状态无法响应该请求。​
400​
InvalidEip.InvalidStatus​
The specified Eip is not in the correct status for the request.​
指定的 Eip 所处状态无法响应该请求。​
400​
InvalidEipBillingType.NotSupport​
The specified billing type of Eip dose not support this action.​
指定的 Eip 计费类型不支持当前操作。​
400​
InvalidEipISP.NotSupport​
The specified isp of Eip dose not support this action.​
指定的 Eip 线路类型不支持当前操作。​
400​
InvalidEipSecurityProtectionTypes.NotSupport​
The specified security types protection of Eip dose not support this action.​
指定的 Eip 安全防护类型不支持当前操作。​
400​
InvalidEipSpecificEgress.NotSupport​
The specified specific egress of Eip dose not support this action.​
指定的 Eip 公网出口不支持当前操作。​
400​
InvalidISP.Mismatch​
The isp of the bandwidth package does not match with the Eip.​
共享带宽包与 Eip 的线路类型不一致。​
400​
InvalidIncorrectOrder.Malformed​
The specified index order is malformed.​
指定的索引顺序参数格式不合法。​
400​
InvalidIpAddressVersion.Malformed​
The specified IpAddressVersion is malformed.​
指定的 IpAddressVersion 参数格式不合法。​
400​
InvalidIpv4BandwidthPackageId.Malformed​
The specified Ipv4BandwidthPackageId is malformed.​
指定的 Ipv4BandwidthPackageId 参数格式不合法。​
400​
InvalidLoadBalancerName.Malformed​
The specified LoadBalancerName is malformed.​
指定的 LoadBalancerName 参数格式不合法。​
400​
InvalidModificationProtectionStatus.Malformed​
The specified ModificationProtectionStatus is malformed.​
指定的 ModificationProtectionStatus 参数格式不合法。​
400​
InvalidNetworkType.Malformed​
The specified NetworkType is malformed.​
指定的 NetworkType 参数格式不合法。​
400​
InvalidNetworkType.UnSupportAction​
The specified NetworkType does not support this action in this region.​
指定的网络类型在当前地域不支持当前操作。​
400​
InvalidProtocol.Mismatch​
The protocol of the bandwidth package does not match with the Eip.​
共享带宽包与 Eip 的协议类型不匹配。​
400​
InvalidQuotaCode.Malformed​
The specified QuotaCode is malformed.​
指定的 QuotaCode 参数格式不合法。​
400​
InvalidRegionId.Malformed​
The specified RegionId is malformed.​
指定的 RegionId 参数格式不合法。​
400​
InvalidSecurityGroup.InvalidStatus​
The specified SecurityGroup is not in the correct status for the request.​
指定的安全组所处状态无法响应该请求。​
400​
InvalidSecurityProtectionTypes.Mismatch​
The specified security protection types of the bandwidth package does not match with the Eip.​
共享带宽包与 Eip 的安全防护类型不一致。​
400​
InvalidSpecificEgress.Mismatch​
The specific egress of the bandwidth package does not match with the Eip.​
共享带宽包与 Eip 的指定出口不匹配。​
400​
InvalidSubnetIPv4Cidr.NotSupport​
The specified subnet does not support ipv4 cidr.​
指定子网不支持IPv4网段。​
400​
InvalidSubnetIPv6Cidr.NotSupport​
The specified subnet does not support ipv6 cidr.​
指定子网不支持IPv6网段。​
400​
InvalidSubnetIPv6CidrISP.Mismatch​
The ipv6 cidr isp of the subnets is not same.​
多个子网 IPv6 网段的线路类型不一致。​
400​
InvalidSubnetIPv6CidrSpecificEgress.Mismatch​
The ipv6 cidr specific egress of the subnets is not same.​
多个子网 IPv6 网段的公网出口不一致。​
400​
InvalidTagKey.Malformed​
The specified TagKey is malformed.​
指定的 TagKey 参数格式不合法。​
400​
InvalidTagValue.Malformed​
The specified TagValue is malformed.​
指定的 TagValue 参数格式不合法。​
400​
InvalidZoneMapping.SubnetAndZoneMismatch​
The specified subnet and zone is mismatched.​
指定的子网和可用区不匹配。​
400​
InvalidZoneMappingCount​
The specified number of zone mappings is less than the minimum number of zones.​
指定的可用区数小于最小可用区数量。​
400​
InvalidZoneMappings.EipId.Malformed​
The specified ZoneMappings.EipId is malformed.​
指定的 ZoneMappings.EipId 参数格式不合法。​
400​
InvalidZoneMappings.EipIsp.Malformed​
The specified ZoneMappings.EipIsp is malformed.​
指定的 ZoneMappings.EipIsp 参数格式不合法。​
400​
InvalidZoneMappings.EipSpecificEgress.Malformed​
The specified ZoneMappings.EipSpecificEgress is malformed.​
指定的 ZoneMappings.EipSpecificEgress 参数格式不合法。​
400​
InvalidZoneMappings.Ipv4Address.Malformed​
The specified ZoneMappings.Ipv4Address is malformed.​
指定的 ZoneMappings.Ipv4Address 参数格式不合法。​
400​
InvalidZoneMappings.SubnetId.Malformed​
The specified ZoneMappings.SubnetId is malformed.​
指定的 ZoneMappings.SubnetId 参数格式不合法。​
400​
InvalidZoneMappings.UnSupportAction增​
The specified ZoneMappings does not support this action, due to local zone only support single zone.​
指定的可用区映射不合法,LocalZone 仅支持单可用区。​
400​
InvalidZoneMappings.ZoneId.Malformed​
The specified ZoneMappings.ZoneId is malformed.​
指定的 ZoneMappings.ZoneId 参数格式不合法。​
400​
LimitExceeded.ServiceManagedTag​
You've reached the limit on the number of service managed tags that you can create.​
已达到单次可创建受管资源标签键值数量的上限。​
400​
LimitExceeded.TagOperation​
You've reached the limit on the number of tags that you can operate at a time.​
已达到单次可操作的标签条目数量上限。​
400​
MissingParameter​
The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, the 'VpcId'.​
该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如 VpcId。​
400​
OrderError.OrderPay​
Failed to create order and pay.​
下单支付失败。​
400​
OrderError.PreOrder​
Failed to create a preorder.​
下单失败。​
400​
QuotaExceed.Eni​
You've reached the limit on the number of ENI that you can create.​
已达到可创建的弹性网卡数量的配额上限。​
400​
QuotaExceed.InstanceNumber​
You've reached the limit on the number of instances that you can create.​
已达到可创建负载均衡实例数量的配额上限。​
400​
QuotaExceeded.BandwidthPackage​
You've reached the limit on the EIP number of that you can add to bandwidth package.​
已达到共享带宽包可加入公网 IP 的数量上限。​
400​
QuotaExceeded.EniSecurityGroup​
You've reached the limit on the number of elastic network interfaces that a security group can associate.​
已达到安全组可关联的弹性网卡数量上限。​
400​
QuotaExceeded.SecurityGroup​
You've reached the limit on the number of security groups that you can create.​
已达到可创建的安全组数量的配额上限。​
400​
UnsupportedOperation.AccountArrears​
The request on the specified instance is denied due to the account in arrears status.​
因账户处于欠费状态,对于该实例的操作请求被拒绝。​
400​
UnsupportedOperation.BalanceNotEnough​
The request on the specified instance is denied due to the account balance and available vouchers are less than 100 yuan in total.​
因账户余额及可用代金券共不足100元,对于该实例的操作请求被拒绝。​
403​
Forbidden​
You are not authorized to perform operations on the system tag.​
无权限对指定资源打上系统标签。​
403​
Forbidden​
You are not authorized to perform operations on the service managed tag.​
无权限对指定资源打上受管标签。​
403​
Forbidden​
You are not authorized to perform operations on the specified service.​
无权限对指定服务进行操作。​
403​
Forbidden​
You are not authorized to perform operations on the specified Region.​
无权限对指定地域进行操作。​
403​
Forbidden​
You are not authorized to perform operations on the specified Zone.​
无权限对指定可用区进行操作。​
403​
InvalidSecurityGroup.ServiceManaged​
The specified SecurityGroup is managed by a service.​
指定的安全组是服务托管资源。​
404​
InvalidBandwidthPackage.NotFound​
The specified bandwidth package does not exist.​
指定的共享带宽包不存在。​
404​
InvalidEip.NotFound​
The specified Eip does not exist.​
指定的 Eip 不存在。​
404​
InvalidSecurityGroup.NotFound​
The specified SecurityGroup does not exist.​
指定的安全组不存在。​
404​
InvalidSharedVPC.UnSupportAction​
The specified shared VPC does not support this action.​
指定的共享 VPC 不支持当前操作。​
404​
InvalidSubnet.NotFound​
The specified Subnet does not exist.​
指定的子网不存在。​
404​
InvalidVPC.NotFound​
The specified VPC does not exist.​
指定的 VPC 不存在。​
404​
InvalidZone.NotFound​
The specified Zone mapping does not exist.​
指定的可用区不存在。​
404​
ServiceRoleForLoadBalancer.NotFound​
ServiceRoleForLoadBalancer does not exist.​
负载均衡服务关联角色不存在。​
409​
InvalidEip.Conflict​
The specified Eip conflicts with that of another Eip in your bandwidth package.​
指定的 Eip 已经在共享带宽包里。​
409​
InvalidEipServiceManage.Conflict​
The specified Eip already another service manage.​
指定的 Eip 已经被托管。​
409​
InvalidOperation.Conflict​
The specified resource operation conflicts.​
指定的资源操作冲突。​
409​
InvalidSecurityGroup.Conflict​
The specified SecurityGroup already exists.​
指定的安全组已存在。​
409​
InvalidZone.Conflict​
The specified zone already exists.​
指定的可用区已存在。​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
幂等请求处理中。​
​
​
最近更新时间:2026.09.18 11:20:51
这个页面对您有帮助吗?
有用
有用
无用
无用