You need to enable JavaScript to run this app.
导航

CreateLoadBalancer

最近更新时间2024.02.29 14:48:16

首次发布时间2022.05.20 21:30:19

API 说明

API 名称:CreateLoadBalancer
API 域名:open.volcengineapi.com 。
API 描述:创建 ALB 实例。

使用限制

节流限制:每秒最多提交 40 个 API 请求。

快速调试

URI 参数

在使用该部分 API 提交请求时必须包含以下 URI 参数。

除了 URI 参数,该 API 请求还需要包含签名参数。关于更多签名参数的信息,参见公共请求参数

名称类型是否必选格式说明
Action
string
[a-zA-Z]+
API 名称,如 CreateLoadBalancer 。
VersionstringYYYY-MM-DDAPI 版本信息。该参数的取值是 2020-04-01 。
X-Expiresint900表示签名的有效时间,单位是秒,默认值是900。

请求正文

在使用该 API 提交请求时,请求正文中可以包含的参数如下。

参数类型是否必选参数说明示例
RegionId
String
请求的Region。
cn-beijing

AddressIpVersion

String

ALB 实例的 IP 类型。默认为IPv4,表示 IPv4 类型。支持取值:

  • IPv4:IPv4 类型(默认)。

  • DualStack:IPv4&IPv6 双栈类型。

DualStack

Type

String

ALB 实例的类型。取值是 public 或 private 。

  • public:表示创建一个公网负载均衡实例,系统会分配一个公网IP地址和一个私网IP地址,可用于转发公网请求和私网请求。
  • private:表示创建一个私网负载均衡实例,系统会分配一个私网IP地址,仅用于转发私网请求。

private

LoadBalancerName

String

ALB 实例的名称。

  • 必须以字母或中文开头,可包含数字、点号(.)、下划线(_)和短横线(-)。
  • 长度限制为1 ~ 128个字符。
  • 不传入该参数或该参数不传入数值时,默认为实例ID。

alb-bp1o94dp5i6ea****

Description

String

ALB 实例的描述。

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

This is an ALB instance.

VpcIdStringALB 实例所属的 VPC ID。 不传入该参数或该参数不传入数值时,默认为子网所属的 VPC ID。vpc-bp1aevy8sofi8mh1****
SubnetId (即将下线)
StringALB 实例所属 VPC 内的子网 ID。ALB 实例的私网 IP 地址将从该子网网段中分配。subnet-bp12mw1f8k3jgy****

LoadBalancerBillingType

Integer

ALB 的计费方式,当前支持按量付费,取值为:
1:LCU(默认值)性能容量单元。

1

EipBillingConfig.ISP

String

公网ALB 实例的 IPv4 公网IP线路类型。支持选择如下:

  • BGP:BGP多线(默认值)。

BGP

EipBillingConfig.EipBillingType

Integer

公网ALB 实例的 IPv4公网IP的计费方式。取值如下:

  • 2,按量计费-按带宽上限计费(默认值)。
  • 3,按量计费-按实际流量计费。

2

EipBillingConfig.Bandwidth

Integer

公网ALB 实例的 IPv4 公网 IP 的带宽峰值,默认值为1,单位为 Mbps。

10

EipBillingConfig.SecurityProtectionTypes

String

创建 ALB 公网实例时,ALB 允许购买多个公网IP防护资源。公网 IP 防护资源的具体规则如下:

  • 多个防护资源之间用半角逗号(,)分隔。

  • 防护资源的取值如下:

    • AntiDDoS_Enhanced:您申请的是增强防护类型的公网 IP,可以将此 IP 加入到 DDoS 原生防护实例。

    • 不填:您申请的是基础防护类型的公网 IP 。

  • 当前购买公网 IP 防护资源仅支持白名单用户使用,如有业务需求,请您联系客户经理。

AntiDDoS_Enhanced

Ipv6EipBillingConfig.ISP

String

公网ALB 实例的 IPv6 公网带宽的线路类型。支持选择如下:

  • BGP:BGP多线(默认值)。

BGP

Ipv6EipBillingConfig.BillingType

Integer

公网ALB 实例的 IPv6 公网带宽的计费类型。取值如下:

  • 2:按量计费-按带宽上限计费。

  • 3:按量计费-按实际流量计费(默认值)。

2

Ipv6EipBillingConfig.Bandwidth

Integer

公网ALB 实例的 IPv6 公网带宽的带宽上限,单位为Mbps。如您需要提升带宽上限,请联系 IPv6 网关的客户经理。当创建 IPv4&IPv6 双栈类型的公网 ALB 实例时,该参数必填。带宽取值范围如下:

  • 参数 Ipv6Address.BillingType 取值为2时:默认取值范围1 ~ 500。

  • 参数 Ipv6Address.BillingType 取值为3时:默认取值范围1 ~ 200。

200

DeleteProtection

String

是否开启 ALB 实例的删除保护功能,默认不开启,取值如下:

  • off:关闭删除保护功能。

  • on:开启删除保护功能。

off

ZoneMappingsArray可用区及子网映射列表,具体参见下表 ZoneMappings-
BandwidthPackageIdString创建 ALB 公网实例时,指定公网 IP 要加入的共享带宽包 ID。bwp-6248cim0mayon3gd5tv****
ProjectNameString实例所属项目名称。default
TagsArray实例所属标签,具体参见下表 Tags-

说明

SubnetId 字段即将下线,请使用 ZoneMappings 字段接入服务,指定需要部署的可用区和子网信息。

ZoneMappings

参数类型是否必选参数说明示例
ZoneMappings.N.SubnetId
String子网ID。ALB 实例在此可用区下的私网 IP 地址将从此子网网段中分配。
ZoneMappings.1.SubnetId=subnet-bp12mw1f8k3jgy****&ZoneMappings.2.SubnetId=subnet-bp0ohf1f8k3jgy****

ZoneMappings.N.ZoneId

String

ALB 实例的可用区ID。

  • ALB允许通过调用 DescribeZones 接口获取可用区ID对应的可用区的信息。

  • SubnetId与ZoneId需要匹配。

ZoneMappings.1.ZoneId=cn-beijing-a&ZoneMappings.2.ZoneId=cn-beijing-b

Tags

参数类型是否必选参数说明示例

Tags.N.Key

String

用户标签的标签键。具体规则如下:

  • 长度限制为1~128个字符。

  • 大小写敏感。

  • 不能以volc:的任意大小写组合开头。

  • 不能以空格开头或结尾。

  • 允许包含各国语言文字、数字、空格()、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、减号(-)和@。

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

Tags.1.Key=k1&Tags.2.Key=k2

Tags.N.Value

String

用户标签的标签值。如果传入该参数,则必须先传入Tags.N.Key。具体规则如下:

  • 长度限制为0~256个字符。

  • 大小写敏感。

  • 不能以空格开头或结尾。

  • 允许包含各国语言文字、数字、空格()、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、减号(-)和@。

Tags.1.Value=v1&Tags.2.Value=v2

响应正文

参数类型参数说明示例值
LoadBalancerId
String
ALB 实例 ID。
alb-bp1o94dp5i6ea****
RequestIdString请求ID。20210811152539010225146063030****

示例

请求示例

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: open.volcengineapi.com
Region: cn-beijing
ServiceName: alb

响应示例

{
    "ResponseMetadata": {
        "RequestId": "20210816110638****2514606306AF947C",
        "Action": "CreateLoadBalancer",
        "Version": "2020-04-01",
        "Service": "alb",
        "Region": "cn-beijing"
    }, 
    "Result": {
        "RequestId": "20210811152539010225146063030****",
        "LoadBalancerId": "alb-bp1o94dp5i6ea****"
    }
}

错误码

如果响应正文包含 Error 字段,则表示 API 请求失败。此处仅展示当前 API 的错误码,更多错误码请参见公共错误码

HTTP Code

错误码

错误信息

错误描述

400

InvalidType.Malformed

The specified Type is malformed.

指定的 Type 参数格式不合法。

400

InvalidAddressIpVersion.Malformed

The specified AddressIpVersion is malformed.

指定的 AddressIpVersion 参数格式不合法。

400InvalidLoadBalancerName.MalformedThe specified LoadBalancerName is malformed.指定的 LoadBalancerName 参数格式不合法。
400InvalidDescription.MalformedThe specified Description is malformed.指定的 Description 参数格式不合法。
400InvalidDeleteProtection.MalformedThe specified DeleteProtection is malformed.指定的 DeleteProtection 参数格式不合法。
400InvalidIndexOrder.MalformedThe specified index order is malformed.指定的索引顺序参数格式不合法。
400OperationDenied.ZoneUnsupportedThe 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 实例支持部署的可用区信息。
400LoadBalancerBillingType.MalformedThe specified LoadBalancerBillingType is malformed.指定的 LoadBalancerBillingType 参数格式不合法。
400InvalidZoneMappings.ZoneId.DuplicatedThe specified ZoneMappings.ZoneId is duplicated.指定的 ZoneMappings.ZoneId 重复。

400

OperationFailed.QueryProject

The request on the specified resource failed due to the query on project failed.

因查询项目失败,对于该资源的操作请求失败。

400InvalidSubnet.ZoneMismatchThe specified subnet and zone do not match.指定的子网和可用区不匹配。
400OperationDenied.Ipv6NotEnabledThe request on the specified LoadBalancer is denied due to subnet is not IPv6 enabled.因子网未启用 IPv6,对于该 ALB 实例的操作请求被拒绝。

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

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

InvalidIpv6EipBillingConfig.BillingType.Malformed

The specified Ipv6EipBillingConfig.BillingType is malformed.

指定的 Ipv6EipBillingConfig.BillingType 参数格式不合法。

400OperationFailed.QueryIAMThe request on the specified resource failed due to the query on IAM failed.因请求 IAM 失败,对于该资源的操作请求失败。
400OperationFailed.QueryIpv6GatewayThe 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

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

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 的数量上限。

400OperationFailed.CreatePreOrderFailedThe request on the specified LoadBalancer failed due to creating a pre order failed.因配置单下单失败,对于该 ALB 实例的操作请求失败。
400OperationFailed.CreatePrivateEniFailedThe request on the specified LoadBalancer failed due to creating private eni failed.因辅助网卡创建失败,对于该 ALB 实例的操作请求失败。
400OperationFailed.CreateOrderFailedThe 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.

已达到单次可操作的标签的数量上限。

400InvalidTags.Key.MalformedThe specified Tags.Key is malformed.指定的 Tags.Key 参数格式不合法。
400InvalidTags.Value.MalformedThe specified Tags.Value is malformed.指定的 Tags.Value 参数格式不合法。
400InvalidTags.Key.DuplicatedThe specified Tags.Key is duplicated.指定的 Tags.Key 重复。
400OperationFailed.AccountBalanceNotEnoughThe request on the specified Resource failed due to the account balance and available vouchers are less than 100 yuan in total.因账户余额及可用代金券共不足 100 元,对于该资源的操作请求失败。请充值后重试。

403

Forbidden

You are not authorized to create dualstack loadbalancer.

您无权限创建双栈类型 ALB 实例。

404InvalidRegion.NotFoundThe specified Region does not exist.指定的 Region 不存在。
404InvalidProject.NotFoundThe specified Project does not exist.指定的项目不存在。
404InvalidSubnet.NotFoundThe specified Subnet does not exist.指定的子网不存在。

404

InvalidVpc.NotFound

The specified VPC does not exist.

指定的 VPC 不存在。

404InvalidBandwidthPackage.NotFoundThe specified BandwidthPackage does not exist.指定的共享带宽包不存在。