CreateLoadBalancer - 创建传统型负载均衡实例

创建负载均衡实例。

接口说明

说明

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

slb:CreateLoadBalancer

create

*LoadBalancer

acs:slb:{#regionId}:{#accountId}:loadbalancer/*

slb:AddressType

请求参数

名称

类型

必填

描述

示例值

RegionId

string

传统型负载均衡实例的地域 ID。

您可以通过调用 DescribeRegions 接口查询地域 ID。

cn-hangzhou

AddressType

string

传统型负载均衡实例的网络类型。取值:

  • internet:创建公网负载均衡实例后,系统会分配一个公网 IP 地址,可以转发公网请求。

  • intranet:创建专有网络类型的负载均衡实例后,系统会分配一个内网 IP 地址,仅可转发内网请求。

internet

InternetChargeType

string

公网类型实例的付费方式。取值:

  • paybytraffic(默认值):按使用流量计费。

  • paybybandwidth:按固定带宽计费。

说明
  • PayType 取值 PayOnDemandInstanceChargeType 取值 PayByCLCU 时,该参数仅支持取值 paybytraffic

  • 如果选择了 paybytraffic,无需设置 Bandwidth 的值;如您设置了 Bandwidth 值,该值也不会生效。

paybytraffic

Bandwidth

integer

实例的带宽峰值,单位:Mbps。

取值范围:15000

说明

AddressType 取值为 internet,且 InternetChargeType 取值为 paybybandwidth 时,该参数生效。

10

ClientToken

string

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

由客户端生成该参数值,要保证在不同请求间唯一。

说明

若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 不一样。

593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3

LoadBalancerName

string

传统型负载均衡实例的名称。

长度为 1~80 个英文或中文字符,必须以大小写字母或中文开头,可包含数字、半角句号(.)、下划线(_)和短划线(-)。

不指定该参数时,默认由系统分配一个实例名称。

lb-bp1o94dp5i6ea****

VpcId

string

传统型负载均衡实例的所属的 VPC ID。

vpc-bp1aevy8sofi8mh1****

VSwitchId

string

专有网络实例的所属的交换机 ID。

创建专有网络类型的负载均衡实例,必须指定该参数。如果指定了该参数,AddressType 参数的值会默认被设置为 intranet

说明

请确保该 VSwitchId 所在可用区与主可用区一致。

vsw-bp12mw1f8k3jgy****

MasterZoneId

string

传统型负载均衡实例的主可用区 ID。

您可以通过调用 DescribeZone 接口可查到相应地域下的主备可用区信息。

说明

请确保该主可用区与 VSwitchId 所在可用区一致。

cn-hangzhou-b

SlaveZoneId

string

传统型负载均衡实例的备可用区 ID。

您可以通过调用 DescribeZone 接口查询相应地域下的主备可用区信息。

cn-hangzhou-d

LoadBalancerSpec

string

传统型负载均衡实例的规格。取值:

  • slb.s1.small

  • slb.s2.small

  • slb.s2.medium

  • slb.s3.small

  • slb.s3.medium

  • slb.s3.large

说明
  • InstanceChargeType 取值为 PayByCLCU,该参数不生效,您无需配置该参数。

  • 若不指定规格,则创建性能共享型实例。目前,共享型实例已停止售卖,请指定实例规格。

slb.s1.small

ResourceGroupId

string

企业资源组 ID。

rg-atstuj3rtopt****

PayType deprecated

string

实例的计费类型,取值:

  • PayOnDemand:按量付费。

PayOnDemand

PricingCycle deprecated

string

预付费公网实例的计费周期,取值:

  • month:月。

  • year:年。

说明

该参数仅适用于中国站且仅对包年包月实例有效。

month

Duration deprecated

integer

预付费公网实例的购买时长,取值:

  • 如果 PricingCyclemonth,取值为1~9

  • 如果 PricingCycleyear,取值为1~5

说明

该参数仅适用于中国站且仅对包年包月实例有效。

1

AutoPay deprecated

boolean

是否是自动支付预付费公网实例的账单。取值:

  • true:自动支付。调用 API 后,立即生成 SLB 实例。

  • false(默认值):调用 API 后 SLB 的订单创建成功,但是未支付。您可以在控制台看到未支付订单。由于订单未支付,SLB 实例不会被创建出来。

说明

该参数仅适用于中国站且仅对包年包月实例有效。

true

AddressIPVersion

string

传统型负载均衡实例的 IP 版本,取值:ipv4ipv6

ipv4

Address

string

指定实例的私网 IP 地址,该地址必须包含在交换机的目标网段下。

192.168.XX.XX

Tag

array<object>

标签列表。

object

标签列表。

Key

string

实例的标签键。N 的取值范围:1~20。一旦输入该值,则不允许为空字符串。

最多支持 64 个字符,不能以aliyunacs:开头,不能包含http://或者https://

test

Value

string

实例的标签值。N 的取值范围:1~20。一旦输入该值,可以为空字符串。 最多支持 128 个字符,不能以aliyunacs:开头,不能包含http://或者https://

value

DeleteProtection

string

是否开启实例删除保护。取值:

  • on:是。

  • off:否。

on

ModificationProtectionStatus

string

传统型负载均衡修改保护状态:

  • NonProtection:不限制修改保护,设置后会清空之前设置的 ModificationProtectionReason

  • ConsoleProtection:实例控制台修改保护状态。

说明

当取值为 ConsoleProtection,即开启修改保护后,用户不能通过负载均衡控制台修改实例配置,但可以通过调用 API 修改实例配置。

ConsoleProtection

ModificationProtectionReason

string

设置修改保护状态的原因,长度为 1~80 个字符,必须以字母或中文开头,支持数字、半角句号(.)、下划线(_)和短划线(-)。

说明

仅在 ModificationProtectionStatusConsoleProtection 时有效。

Managed instance

InstanceChargeType

string

实例计费方式。取值:

  • PayBySpec(默认值):按规格计费。

  • PayByCLCU:按使用量计费。

说明

仅当 PayType(实例付费模式)取值为 PayOnDemand(按量付费)时,该参数生效。

PayBySpec

返回参数

名称

类型

描述

示例值

object

VpcId

string

传统型负载均衡实例的所属专有网络的 ID。

vpc-25dvzy9****

AddressIPVersion

string

传统型负载均衡实例的 IP 地址类型。

ipv4

VSwitchId

string

传统型负载均衡实例的所属交换机的 ID。

vsw-255ecr****

RequestId

string

请求 ID。

365F4154-92F6-4AE4-92F8-7FF34B540710

LoadBalancerName

string

传统型负载均衡实例的名称。

lb-bp1o94dp5i6ea****

LoadBalancerId

string

传统型负载均衡实例的 ID。

lb-hddhfjg****

ResourceGroupId

string

资源组 ID。

rg-atstuj3rto****

Address

string

分配的负载均衡实例的 IP 地址。

42.XX.XX.6

NetworkType

string

传统型负载均衡实例的网络类型,取值:

  • vpc:专有网络类型。

  • classic:经典网络类型。

classic

OrderId

integer

预付费实例的订单 ID。

20212961978****

示例

正常返回示例

JSON格式

{
  "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
}

错误码

HTTP status code

错误码

错误信息

描述

400 OperationFailed.ZoneResourceLimit The operation failed because of resource limit of the specified zone. 操作失败,原因是当前可用区资源不足。
400 CloudBoxNotSupportIpv6 The cloudBox instance does not support ipv6. 云盒实例不支持ipv6
400 CloudBoxNotSupportInternet The cloudBox instance does not support internet. 云盒实例不支持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 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. 指定地域或主备可用区不支持Ipv6。
400 InvalidParameter.Mismatch AddressType and IpVersion is conflict, IPv6 does not support intranet instance. 网络类型和IP版本冲突,私网实例不支持IPv6。
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. 指定的交换机没有可用的Ip。
400 VSwitchNotExist The specified VSwitch does not exist. 指定的交换机不存在。
400 InvalidParameter Illegal parameter. The IP address is not in subnet. 参数非法,IP地址不在子网中。
400 Instance.ShareSlbNotSupportPay95 Illegal parameter. The share instance not support PayBy95 or PayByOld95. 共享型实例不支持PayBy95PayByOld95。
400 Instance.Pay95RateInvalid Illegal parameter. The rate is illegal. 指定的Rate无效。请检查参数约束,并在修改后重试。
400 Instance.Pay95BandwidthIllegal Illegal parameter. The bandwidth is illegal. 指定的Bandwidth无效。请检查参数约束,并在修改后重试。
400 Instance.InternetChargeTypeNotAllowed Illegal parameter. The specified InternetChargeType not allowed. 参数非法,指定的InternetChargeType不支持。
400 OperationFailed.TokenIsProcessing The operation is failed, because the Client Token is processing. 操作失败,原因是当前请求正在处理中。
400 InsufficientBalance Your account does not have enough balance. 账户余额不足,请先充值再操作。
400 MissingParam.VSwitchId The parameter VSwitchId is required. 参数VSwitchId缺失。
400 InvalidVpcId.NotExist The specified VPC not exist. 指定的VPC不存在。
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. 指定的CloudType无效。请检查参数约束,并在修改后重试。
400 OperationFailed.InvalidAccount The account information is incomplete. 操作失败,原因是账户信息不完整。
400 RegionOrZonesNotSupportCEN The specified region or master/slave zones does not support cloudType of hybrid_cen. 指定的地域或主备可用区不支持CEN。
400 MissingParam.LoadBalancerSpec The param LoadBalancerSpec is required. 参数LoadBalancerSpec缺失。
400 InvalidParameter.Bandwidth The param Bandwidth is invalid. 指定的Bandwidth无效。请检查参数约束,并在修改后重试。
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. 指定的ModificationProtectionStatus无效。请检查参数约束,并在修改后重试。
400 InvalidParam.ModificationProtectionReason The param ModificationProtectionReason is invalid. 指定的ModificationProtectionReason无效。请检查参数约束,并在修改后重试。
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. 分配VPC实例失败。
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. 非法的vswitch实例。
400 IllegalParam.SpecType The param of SpecType is illegal. 指定的SpecType无效。请检查参数约束,并在修改后重试。
400 MissingParam.SpecType The param of SpecType is missing. 参数SpecType缺失。
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. 系统繁忙
400 PRODUCT.NOT_AVAILABLE_IZ The Instance zone id doesn t support 实例可用区ID不支持。
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 总数超过了限额,请您减少数量后再重试。
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. 没有可用的子网ip
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. 您的账户可用额度小于0,请先充值后再尝试购买。
400 Forbidden.AliGroupForbiddenRegion Thre region is forbidden for aligroup user.
403 SecurityRisk.AuthVerification We have detected a security risk with your payment method. Please proceed with verification via the link in your email or console message and re-submit your order after verification. 系统检测到您的支付方式存在风险,请通过邮件或站内信中的链接完成验证。验证完成后重新下单。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情