文档

AllocateEipAddress - 申请弹性公网IP(EIP)

更新时间:

调用AllocateEipAddress接口申请弹性公网IP(Elastic IP Address,简称EIP)。

接口说明

请确保在使用本接口前,您已充分了解 EIP 的收费方式和价格。更多信息,请参见计费概述

调用本接口后将在指定的地域内随机获取一个状态为 Available 的弹性公网 IP。弹性公网 IP 在传输层目前只支持解析 ICMP、TCP 和 UDP 协议内容,不支持解析 IGMP 和 SCTP 等协议内容。

调试

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

授权信息

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

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
vpc:AllocateEipAddressWrite
  • Address
    acs:vpc:{#regionId}:{#accountId}:eip/*

请求参数

名称类型必填描述示例值
RegionIdstring

弹性公网 IP 所在的地域 ID。

您可以通过调用 DescribeRegions 接口获取地域 ID。

cn-hangzhou
Bandwidthstring

EIP 的带宽峰值。单位:Mbps。

  • InstanceChargeType 取值为 PostPaid,且 InternetChargeType 取值为 PayByBandwidth 时,Bandwidth 取值范围为 1~500

  • InstanceChargeType 取值为 PostPaid,且 InternetChargeType 取值为 PayByTraffic 时,Bandwidth 取值范围为 1~200

  • InstanceChargeType 取值为 PrePaid 时,Bandwidth 取值范围为 1~1000

默认值:5 Mbps。

5
Periodinteger

购买时长。

PricingCycle 取值 Month 时,Period 取值范围为 1~9

PricingCycle 取值 Year 时,Period 取值范围为 1~5

InstanceChargeType 参数的值为 PrePaid 时,该参数必选,当 InstanceChargeType 参数的值为 PostPaid 时,该参数不填。

1
ISPstring

线路类型。取值:

  • BGP(默认值):BGP(多线)线路。目前全部地域都支持 BGP(多线)线路 EIP。
  • BGP_PRO:BGP(多线)_精品线路。目前仅中国香港、新加坡、日本(东京)、马来西亚(吉隆坡)、菲律宾(马尼拉)、印度尼西亚(雅加达)和泰国(曼谷)地域支持 BGP(多线)_精品线路 EIP。

关于 BGP(多线)线路和 BGP(多线)_精品线路的更多信息,请参见 EIP 线路类型

  • 如果您是单线带宽的白名单用户,您还可以选择以下类型:
    • ChinaTelecom:中国电信
    • ChinaUnicom:中国联通
    • ChinaMobile:中国移动
    • ChinaTelecom_L2:中国电信 L2
    • ChinaUnicom_L2:中国联通 L2
    • ChinaMobile_L2:中国移动 L2
  • 如果您是杭州金融云用户,该字段必填,取值:BGP_FinanceCloud
BGP
ActivityIdlong

特殊活动 ID,无需配置此参数。

123456
Netmodestring

网络类型,仅取值为 public(默认值),表示公网。

public
AutoPayboolean

是否自动付费,取值:

  • false(默认值):不开启自动付费,生成订单后需要到订单中心完成支付。

  • true:开启自动付费,自动支付订单。

InstanceChargeType 参数的值为 PrePaid 时,该参数必选;当 InstanceChargeType 参数的值为 PostPaid 时,该参数可不填。

false
PricingCyclestring

包年包月的计费周期,取值:

  • Month(默认值):按月付费。
  • Year:按年付费。

InstanceChargeType 参数的值为 PrePaid 时,该参数必选;当 InstanceChargeType 参数的值为 PostPaid 时,该参数可不填。

Month
InstanceChargeTypestring

EIP 的计费方式,取值:

  • PrePaid:包年包月。

  • PostPaid(默认值):按量计费。

InstanceChargeType 取值为 PrePaid 时,InternetChargeType 必须取值 PayByBandwidth;当 InstanceChargeType 取值为 PostPaid 时,InternetChargeType 可取值 PayByBandwidthPayByTraffic

PostPaid
InternetChargeTypestring

EIP 的计量方式,取值:

  • PayByBandwidth(默认值):按带宽计费。

  • PayByTraffic:按流量计费。

InstanceChargeType 取值为 PrePaid 时,InternetChargeType 必须取值 PayByBandwidth

InstanceChargeType 取值为 PostPaid 时,InternetChargeType 可取值 PayByBandwidthPayByTraffic

PayByTraffic
ResourceGroupIdstring

资源组 ID。

rg-acfmxazffggds****
ClientTokenstring

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

从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。

说明 若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 不一样。
0c593ea1-3bea-11e9-b96b-88e9fe637760
Namestring

EIP 实例的名称。

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

说明 创建预付费的 EIP 实例时,不支持设置该参数。
EIP1
Descriptionstring

EIP 实例的描述。

长度为 2~256 个字符,必须以字母或中文开头,但不能以http://https://开头。

说明 创建预付费的 EIP 实例时,不支持设置该参数。
test
SecurityProtectionTypesarray

安全防护级别。

  • 配置为空时,默认为 DDoS 防护(基础版)。

  • 配置为AntiDDoS_Enhanced时,表示 DDoS 防护(增强版)。

您最多可以设置 10 个安全防护级别。

string

安全防护级别。

  • 配置为空时,默认为 DDoS 防护(基础版)。

  • 配置为AntiDDoS_Enhanced时,表示 DDoS 防护(增强版)。

您最多可以设置 10 个安全防护级别。

AntiDDoS_Enhanced
PublicIpAddressPoolIdstring

IP 地址池 ID。

EIP 将从该 IP 地址池中分配。

IP 地址池功能默认不开放。如需使用,请在配额中心申请 IP 地址池功能权益配额。具体操作,请参见通过配额中心提升配额

pippool-2vc0kxcedhquybdsz****
Zonestring

EIP 的可用区。

PublicIpAddressPoolId 中指定的 IP 地址池为云盒业务类型时,该参数默认与 IP 地址池的可用区一致。

如何查看 IP 地址池业务类型,请参见 ListPublicIpAddressPools

ap-southeast-1-lzdvn-cb
IpAddressstring

要指定申请的 EIP 的 IP 地址。

IpAddressInstanceId 参数仅需传入一个,如果都不传,系统会随机申请 EIP。

192.0.XX.XX
InstanceIdstring

要指定申请的 EIP 的实例 ID。

IpAddressInstanceId 参数仅需传入一个,如果都不传,系统会随机申请 EIP。

eip-25877c70gddh****

返回参数

名称类型描述示例值
object

返回信息列表。

RequestIdstring

请求 ID。

4EC47282-1B74-4534-BD0E-403F3EE64CAF
OrderIdlong

订单 ID。当 InstanceChargeType(EIP 的计费方式)取值为 PrePaid(包年包月)时,返回该参数。如果 AutoPay(自动付费)未打开,即未开启自动支付账单时,请前往订单中心完成支付。

10
ResourceGroupIdstring

资源组 ID。仅 InstanceChargeType 取值为 PostPaid 时返回。

rg-acfmxazfdgdg****
EipAddressstring

分配的 EIP。仅 InstanceChargeType 取值为 PostPaid 时返回。

192.0.XX.XX
AllocationIdstring

EIP 实例的 ID。

eip-25877c70gddh****

示例

正常返回示例

JSON格式

{
  "RequestId": "4EC47282-1B74-4534-BD0E-403F3EE64CAF",
  "OrderId": 10,
  "ResourceGroupId": "rg-acfmxazfdgdg****",
  "EipAddress": "192.0.XX.XX",
  "AllocationId": "eip-25877c70gddh****"
}

错误码

HTTP status code错误码错误信息描述
400COMMODITY_NO_EXISTcommodity is not exist-
400QuotaExceeded.EipElastic IP address quota exceeded-
400InvalidParameterSpecified value of "InternetChargeType" is not valid-
400InvalidParameterSpecified value of "Bandwidth" is not valid.该带宽不合法。
400InsufficientBalanceYour account does not have enough balance.账户余额不足,请先充值再操作。
400QuotaExceeded.EipElastic IP address quota exceeded.弹性公网IP的个数超过额度限制,如果您有更多额度的需求,建议您考虑使用NAT网关。
400ReserveIpFailReserve eip failed.EIP预留失败。
400InvalidRegion.NotSupportThe specified region does not support.该 RegionId 不支持此操作。
400InvalidBandwidth.MalformedThe specified Bandwidth is invalid.-
400INSTANCE_TYPE_NOT_SUPPORTThe instance type is invalid.-
400QueryParameter.Illegalquery parameter illegal-
400TokenVerfiy.Failedtoken verify failed.-
400OrderFailedThe Account failed to create order.-
400QuotaExceeded.LargeSpecEipElastic IP address with large spec quota exceeded.-
400InvalidResourceGroupIdThe specified ResourceGroupId does not exist.资源组ID不存在。
400PAYFOR.CREDIT_PAY_INSUFFICIENT_BALANCEYour account does not have enough balance.-
400SYSTEM.SALE_VALIDATE_UNEXPECTED_ERRORYou have arrears and do not meet the purchase conditions.-
400Trade_Sync_Create_Sub_ERRORSyncOrderToSub error.-
400InvalidComponent.EipBandwidthMaxThe eip_bandwidth_max component is invalid.-
400OperationFailed.RiskControlRisk control check failed.我们检测到您的付款方式存在安全风险。请通过电子邮件或控制台消息中的链接继续验证,并在验证后重新提交订单。
400OperationFailed.SaleValidateValidate sale condition with subArticle failed.使用子项目验证销售条件失败。
400IllegalParam.OrderParamComponentProduct order param has invalid component.-
400OperationFailed.SaleExpressionGet the sales expression exception attached to the item.-
400OperationFailed.CompleteUserInfoComplete user info failed.-
400OperationFailed.QueryPriceQuery price failed when create order.创建订单时查询价格失败。
400OperationFailed.InsufficientEIPEip resource is not enough.-
400OperationFailed.InvokeInnerApiFailed to invoke inner api.-
400OperationFailed.AccountMoneyInvalidAccount money is invalid.-
400OperationFailed.QueryCredtiInfoFailed to query credit info.-
400FrequentPurchase.EIPeip frequent purchase-
400OperationFailed.QueryUserLabelFailed to query user label info.-
400PAY.INSUFFICIENT_BALANCEYour account does not have enough balance.-
400ORDER.QUANTITY_INVALIDUser quota has exceeded the limit.您当前保有的EIP数量已达上限,可前往配额管理提升EIP数量配额
400PAY.MAYI_WITHHOLDING_AGREEMENT_ILLEGALUser withhoding argeement is illegal.-
400OrderError.EIPFThe Account failed to create order.-
400IellgalParameter.OwnerAccountThe specified parameter OwnerAccount is not valid.-
400OrderError.EIPThe Account failed to create order.下单失败
400ResourceNotFound.PublicIpAddressPoolThe specified resource of PublicIpAddressPool is not found.-
400ResourceNotEnough.PublicIpAddressPoolThe specified resource of PublicIpAddressPool is not enough.-
400Mismatch.IpAndPublicIpAddressPoolThe Ip and PublicIpAddressPool are mismatched.-
400CreditPayInsufficientBalanceThe balance is insufficient, please contact your channel partner to increase the balance额度不足,请联系您的渠道合作伙伴提升额度。
400OperationDenied.NotOpenDdosOriginProtectServiceThe operation is not allowed because of you do not open Ddos Origin Protection Service无法创建DDoS防护(增强版)Eip,因为没有购买DDoS原生防护服务
400IncorrectStatus.PublicIpAddressPoolThe status of PublicIpAddressPool is incorrect.地址池实例未处于稳态,不允许分配EIP。
400IncorrectStatus.PublicIpAddressPoolThe status of %s [%s] is incorrect.无法分配EIP,因为IP地址池状态不对
400IllegalParam.IspThe param of %s is illegal.无法分配EIP,因为ISP参数非法
400AccountMoneyValidateErrorThe available amount of the account is insufficient.账号可用金额不足
400OrderFailed.ConcurrentOperateFailed to create the order due to concurrent operations.创建订单失败,因为并发操作。
400OperationFailed.BasicInfoUncompletedYour information is incomplete. Complete your information before the operation.您的基本信息尚未完成,请先完成信息填写。
400OperationFailed.QuotaNotEnoughYour quota is insufficient. Please contact your channel partner to increase your quota您当前quota配额不足,请您可以联系渠道伙伴为您增加额度
400ExclusiveParam.ZoneAndPublicIpAddressPoolIdThe Zone and PublicIpAddressPoolId parameters are mutually exclusive.不允许同时传入参数Zone和PublicIpAddressPoolId
400IllegalParam.ZoneThe specified zone is invalid.参数Zone非法
400OperationFailed.AllocateUnfamiliarIpThe operation failed because only IP addresses used within the last seven days can be allocated.指定EIP申请只允许申请7天内使用过的IP
400Ip.AllocatedThe reserve ip has been allocated.已分配保留ip。
400IncorrectStatus.IpThe status of ip is incorrect.IP的状态不正确。
400UnsupportedFeature.AllocateEipAddressWithZoneThe feature of AllocateEipAddressWithZone is not supported.当前地域不支持指定Zone创建实例
400ResourceNotFound.IpThe specified ip is not found.找不到指定的IP。
400OperationFailed.CreditPayInsufficientBalanceYour account does not have enough balance.您的账户可用额度小于0,请先充值后再尝试购买。
400OperationFailed.ResourceNotEnoughThe resources you have applied for are insufficient.您申请的资源不足,如仍需申请,请提工单处理
400IllegalParam.BandwidthThe param of bandwidth is illegal.Bandwidth参数非法
400OperationFailed.IpIsLockedThe operation is failed because of ip is locked.申请失败,IP已经被锁定
400Mismatch.EipSecurityProtectionTypeAndPoolSecurityProtectionTypeThe EipSecurityProtectionType and PoolSecurityProtectionType are mismatched.EIP安全防护类型与地址池安全防护类型不匹配。
400IllegalParam.SecurityProtectionTypesThe param of securityProtectionTypes is illegal.传入的SecurityProtectionTypes参数非法
400IllegalParam.ServiceLocationThe param of serviceLocation is illegal.ServiceLocation参数非法。
403ForbiddenUser not authorized to operate on the specified resource.您没有权限操作指定资源,请申请权限后再操作。
404InvalidRegionId.NotFoundSpecified value of "RegionId" is not supported.指定的 RegionId 不存在,请您检查此产品在该地域是否可用。
404InvalidRegionId.NotFoundThe RegionId provided does not exist in our records.指定的RegionId不存在。请检查该参数是否正确。
404FUWU_BIZ_COMMODITY_VERIFY_FAIL????????, ????????PD.-
409OperationConflictRequest was denied due to conflict with a previous request.请求冲突,请稍后重试。
500InternalErrorThe request processing has failed due to some unknown error, exception or failure.内部错误
500OperationFailed.SystemBusyOperation failed because system is busy.系统繁忙,请稍后重试

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

变更历史

变更时间变更内容概要操作
2024-02-02OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
    删除错误码:409
    删除错误码:500
2024-01-22OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
    删除错误码:409
    删除错误码:500
2023-12-13OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
    删除错误码:409
    删除错误码:500
2023-10-19OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
    删除错误码:409
    删除错误码:500
2023-08-29OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    错误码 500 变更
    删除错误码:403
    删除错误码:404
    删除错误码:409
2023-07-26OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
    删除错误码:409
    删除错误码:500
2023-07-24OpenAPI 描述信息更新、OpenAPI 错误码发生变更看变更集
变更项变更内容
API 描述OpenAPI 描述信息更新
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
    删除错误码:409
    删除错误码:500
2023-07-08OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
    删除错误码:409
    删除错误码:500
2023-07-06OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
    删除错误码:409
    删除错误码:500
2023-06-26OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
    删除错误码:409
    删除错误码:500
2023-06-19OpenAPI 错误码发生变更、OpenAPI 入参发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    删除错误码:400
    删除错误码:403
    删除错误码:404
    删除错误码:409
    删除错误码:500
入参OpenAPI 入参发生变更
    新增入参:IpAddress
    新增入参:InstanceId
2023-04-20OpenAPI 错误码发生变更、OpenAPI 入参发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    删除错误码:400
    删除错误码:403
    删除错误码:404
    删除错误码:409
    删除错误码:500
入参OpenAPI 入参发生变更
    新增入参:Zone
2023-03-09OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    错误码 500 变更
    删除错误码:403
    删除错误码:404
    删除错误码:409
2022-12-02OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
    删除错误码:409
    删除错误码:500
  • 本页导读 (1)
文档反馈