申请弹性公网IP(Elastic IP Address,简称EIP)。
接口说明
请确保在使用本接口前,您已充分了解 EIP 的收费方式和价格。更多信息,请参见计费概述。
调用本接口后将在指定的地域内随机获取一个状态为 Available 的弹性公网 IP。弹性公网 IP 在传输层目前只支持解析 ICMP、TCP 和 UDP 协议内容,不支持解析 IGMP 和 SCTP 等协议内容。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
是 |
弹性公网 IP 所在的地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。 枚举值:
|
cn-hangzhou |
| Bandwidth |
string |
否 |
EIP 的带宽峰值。单位:Mbps。
默认值:5 Mbps。 |
5 |
| Period |
integer |
否 |
购买时长。 当 PricingCycle 取值 Month 时,Period 取值范围为 1~9。 当 PricingCycle 取值 Year 时,Period 取值范围为 1~5。 当 InstanceChargeType 参数的值为 PrePaid 时,该参数必选,当 InstanceChargeType 参数的值为 PostPaid 时,该参数不填。 |
1 |
| ISP |
string |
否 |
线路类型。取值:
关于 BGP(多线)线路和 BGP(多线)_精品线路的更多信息,请参见 EIP 线路类型。
|
BGP |
| ActivityId |
integer |
否 |
特殊活动 ID,无需配置此参数。 |
123456 |
| Netmode |
string |
否 |
网络类型,仅取值为 public(默认值),表示公网。 |
public |
| AutoPay |
boolean |
否 |
是否自动付费,取值:
当 InstanceChargeType 参数的值为 PrePaid 时,该参数必选;当 InstanceChargeType 参数的值为 PostPaid 时,该参数可不填。 |
false |
| PricingCycle |
string |
否 |
包年包月的计费周期,取值:
当 InstanceChargeType 参数的值为 PrePaid 时,该参数必选;当 InstanceChargeType 参数的值为 PostPaid 时,该参数可不填。 |
Month |
| InstanceChargeType |
string |
否 |
EIP 的计费方式,取值:
当 InstanceChargeType 取值为 PrePaid 时,InternetChargeType 必须取值 PayByBandwidth;当 InstanceChargeType 取值为 PostPaid 时,InternetChargeType 可取值 PayByBandwidth 或 PayByTraffic。 |
PostPaid |
| InternetChargeType |
string |
否 |
EIP 的计量方式,取值:
当 InstanceChargeType 取值为 PrePaid 时,InternetChargeType 必须取值 PayByBandwidth。 当 InstanceChargeType 取值为 PostPaid 时,InternetChargeType 可取值 PayByBandwidth 或 PayByTraffic。 |
PayByTraffic |
| ResourceGroupId |
string |
否 |
资源组 ID。 |
rg-acfmxazffggds**** |
| ClientToken |
string |
否 |
客户端 Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。 说明
若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 不一样。 |
0c593ea1-3bea-11e9-b96b-88e9fe637760 |
| Name |
string |
否 |
EIP 实例的名称。 长度为 0-128 个字符,不能以 说明
创建预付费的 EIP 实例时,不支持设置该参数。 |
EIP1 |
| Description |
string |
否 |
EIP 实例的描述。 长度为 0-256 个字符,不能以 说明
创建预付费的 EIP 实例时,不支持设置该参数。 |
test |
| SecurityProtectionTypes |
array |
否 |
安全防护级别。
您最多只能设置 1 个安全防护级别。 |
AntiDDoS_Enhanced |
|
string |
否 |
安全防护级别。
|
AntiDDoS_Enhanced |
|
| PublicIpAddressPoolId |
string |
否 |
IP 地址池 ID。 EIP 将从该 IP 地址池中分配。 IP 地址池功能默认不开放。如需使用,请在配额中心申请 IP 地址池功能权益配额。具体操作,请参见通过配额中心提升配额。 |
pippool-2vc0kxcedhquybdsz**** |
| Zone |
string |
否 |
EIP 的可用区。 当 PublicIpAddressPoolId 中指定的 IP 地址池为云盒业务类型时,该参数默认与 IP 地址池的可用区一致。 如何查看 IP 地址池业务类型,请参见 ListPublicIpAddressPools |
ap-southeast-1-lzdvn-cb |
| IpAddress |
string |
否 |
要指定申请的 EIP 的 IP 地址。 IpAddress 和 InstanceId 参数仅需传入一个,如果都不传,系统会随机申请 EIP。 |
192.0.XX.XX |
| InstanceId |
string |
否 |
要指定申请的 EIP 的实例 ID。 IpAddress 和 InstanceId 参数仅需传入一个,如果都不传,系统会随机申请 EIP。 |
eip-25877c70gddh**** |
| Tag |
array<object> |
否 |
资源的标签。 |
|
|
object |
否 |
|||
| Key |
string |
否 |
资源的标签键。最多支持输入 20 个标签键。如需传入该值,则不能输入空字符串。 一个标签键最多支持 128 个字符,不能以 |
TestKey |
| Value |
string |
否 |
标签值。API 调用时使用 Tag.N.Value 的形式,N 的取值范围:1~20。一旦传入该值,则不允许为空字符串。最多支持 128 个字符,不能以 aliyun 或 acs:开头,不能包含 http://或 https://。 |
FinanceJoshua |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回信息列表。 |
||
| RequestId |
string |
请求 ID。 |
4EC47282-1B74-4534-BD0E-403F3EE64CAF |
| OrderId |
integer |
订单 ID。当 InstanceChargeType(EIP 的计费方式)取值为 PrePaid(包年包月)时,返回该参数。如果 AutoPay(自动付费)未打开,即未开启自动支付账单时,请前往订单中心完成支付。 |
10 |
| ResourceGroupId |
string |
资源组 ID。仅 InstanceChargeType 取值为 PostPaid 时返回。 |
rg-acfmxazfdgdg**** |
| EipAddress |
string |
分配的 EIP。仅 InstanceChargeType 取值为 PostPaid 时返回。 |
192.0.XX.XX |
| AllocationId |
string |
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 |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | COMMODITY_NO_EXIST | commodity is not exist | |
| 400 | QuotaExceeded.Eip | Elastic IP address quota exceeded | |
| 400 | InvalidParameter | Specified value of "InternetChargeType" is not valid | |
| 400 | InsufficientBalance | Your account does not have enough balance. | |
| 400 | ReserveIpFail | Reserve eip failed. | |
| 400 | InvalidRegion.NotSupport | The specified region does not support. | |
| 400 | InvalidBandwidth.Malformed | The specified Bandwidth is invalid. | |
| 400 | INSTANCE_TYPE_NOT_SUPPORT | The instance type is invalid. | |
| 400 | QueryParameter.Illegal | query parameter illegal | |
| 400 | TokenVerfiy.Failed | token verify failed. | |
| 400 | OrderFailed | The Account failed to create order. | |
| 400 | QuotaExceeded.LargeSpecEip | Elastic IP address with large spec quota exceeded. | |
| 400 | InvalidResourceGroupId | The specified ResourceGroupId does not exist. | 资源组ID不存在。 |
| 400 | PAYFOR.CREDIT_PAY_INSUFFICIENT_BALANCE | Your account does not have enough balance. | |
| 400 | SYSTEM.SALE_VALIDATE_UNEXPECTED_ERROR | You have arrears and do not meet the purchase conditions. | |
| 400 | Trade_Sync_Create_Sub_ERROR | SyncOrderToSub error. | |
| 400 | InvalidComponent.EipBandwidthMax | The eip_bandwidth_max component is invalid. | |
| 400 | OperationFailed.RiskControl | Risk control check failed. | 我们检测到您的付款方式存在安全风险。请通过电子邮件或控制台消息中的链接继续验证,并在验证后重新提交订单。 |
| 400 | OperationFailed.SaleValidate | Validate sale condition with subArticle failed. | 使用子项目验证销售条件失败。 |
| 400 | IllegalParam.OrderParamComponent | Product order param has invalid component. | |
| 400 | OperationFailed.SaleExpression | Get the sales expression exception attached to the item. | |
| 400 | OperationFailed.CompleteUserInfo | Complete user info failed. | |
| 400 | OperationFailed.QueryPrice | Query price failed when create order. | 创建订单时查询价格失败。 |
| 400 | OperationFailed.InsufficientEIP | Eip resource is not enough. | |
| 400 | OperationFailed.InvokeInnerApi | Failed to invoke inner api. | |
| 400 | OperationFailed.AccountMoneyInvalid | Account money is invalid. | |
| 400 | OperationFailed.QueryCredtiInfo | Failed to query credit info. | |
| 400 | FrequentPurchase.EIP | eip frequent purchase | |
| 400 | OperationFailed.QueryUserLabel | Failed to query user label info. | |
| 400 | PAY.INSUFFICIENT_BALANCE | Your account does not have enough balance. | 账号余额不足 |
| 400 | PAY.MAYI_WITHHOLDING_AGREEMENT_ILLEGAL | User withhoding argeement is illegal. | |
| 400 | OrderError.EIP | FThe Account failed to create order. | |
| 400 | IellgalParameter.OwnerAccount | The specified parameter OwnerAccount is not valid. | 指定参数 OwnerAccount 不合法 |
| 400 | ResourceNotFound.PublicIpAddressPool | The specified resource of PublicIpAddressPool is not found. | |
| 400 | ResourceNotEnough.PublicIpAddressPool | The specified resource of PublicIpAddressPool is not enough. | |
| 400 | Mismatch.IpAndPublicIpAddressPool | The Ip and PublicIpAddressPool are mismatched. | |
| 400 | CreditPayInsufficientBalance | The balance is insufficient, please contact your channel partner to increase the balance | 额度不足,请联系您的渠道合作伙伴提升额度。 |
| 400 | OperationDenied.NotOpenDdosOriginProtectService | The operation is not allowed because of you do not open Ddos Origin Protection Service | 无法创建DDoS防护(增强版)Eip,因为没有购买DDoS原生防护服务 |
| 400 | IncorrectStatus.PublicIpAddressPool | The status of PublicIpAddressPool is incorrect. | 地址池实例未处于稳态,不允许分配EIP。 |
| 400 | IllegalParam.Isp | The param of %s is illegal. | 无法分配EIP,因为ISP参数非法 |
| 400 | AccountMoneyValidateError | The available amount of the account is insufficient. | 账号可用金额不足 |
| 400 | OrderFailed.ConcurrentOperate | Failed to create the order due to concurrent operations. | 创建订单失败,因为并发操作。 |
| 400 | OperationFailed.BasicInfoUncompleted | Your information is incomplete. Complete your information before the operation. | |
| 400 | OperationFailed.QuotaNotEnough | Your quota is insufficient. Please contact your channel partner to increase your quota | 您当前quota配额不足,请您可以联系渠道伙伴为您增加额度 |
| 400 | ExclusiveParam.ZoneAndPublicIpAddressPoolId | The Zone and PublicIpAddressPoolId parameters are mutually exclusive. | 不允许同时传入参数Zone和PublicIpAddressPoolId |
| 400 | IllegalParam.Zone | The specified zone is invalid. | 参数Zone非法 |
| 400 | OperationFailed.AllocateUnfamiliarIp | The operation failed because only IP addresses used within the last seven days can be allocated. | 指定EIP申请只允许申请7天内使用过的IP |
| 400 | Ip.Allocated | The reserve ip has been allocated. | 已分配保留ip。 |
| 400 | IncorrectStatus.Ip | The status of ip is incorrect. | IP的状态不正确。 |
| 400 | UnsupportedFeature.AllocateEipAddressWithZone | The feature of AllocateEipAddressWithZone is not supported. | 当前地域不支持指定Zone创建实例 |
| 400 | ResourceNotFound.Ip | The specified ip is not found. | 找不到指定的IP。 |
| 400 | OperationFailed.CreditPayInsufficientBalance | Your account does not have enough balance. | 您的账户可用额度小于0,请先充值后再尝试购买。 |
| 400 | OperationFailed.ResourceNotEnough | The resources you have applied for are insufficient. | 您申请的资源不足,如仍需申请,请提工单处理 |
| 400 | IllegalParam.Bandwidth | The param of bandwidth is illegal. | Bandwidth参数非法 |
| 400 | OperationFailed.IpIsLocked | The operation is failed because of ip is locked. | 申请失败,IP已经被锁定 |
| 400 | Mismatch.EipSecurityProtectionTypeAndPoolSecurityProtectionType | The EipSecurityProtectionType and PoolSecurityProtectionType are mismatched. | EIP安全防护类型与地址池安全防护类型不匹配。 |
| 400 | IllegalParam.SecurityProtectionTypes | The param of securityProtectionTypes is illegal. | 传入的SecurityProtectionTypes参数非法 |
| 400 | IllegalParam.ServiceLocation | The param of serviceLocation is illegal. | ServiceLocation参数非法。 |
| 400 | UnsupportedFeature.Isp | The feature of Isp is not supported. | 您指定的Isp暂未支持 |
| 400 | ExclusiveParam.ZoneAndIpAddress | The specified param Zone and IpAddress or InstanceId are mutually exclusive. | 指定的入参Zone和IpAddress或InstanceId存在冲突 |
| 400 | InvalidDescription.Malformed | The Description is illeagl. | 指定的资源描述格式不合法。长度为2~256个字符,不能以http://和https://开头。 |
| 400 | InvalidName.Malformed | The attribute name is illegal. | 该名称格式不合法。 |
| 400 | OperationFailed.UpgradeCdtServiceFirst | The operation is failed because of cdt is not upgraded. | 您当前指定购买的实例类型需升级CDT计费,请升级CDT后重试 |
| 400 | OperationFailed.TokenExpired | The operation is failed because of TokenExpired. | 指定的eip分配token已过期 |
| 500 | OrderError.EIP | The Account failed to create order. | |
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | 内部错误 |
| 500 | OperationFailed.SystemBusy | Operation failed because system is busy. | |
| 403 | Forbidden | User not authorized to operate on the specified resource. | 您没有权限操作指定资源,请申请权限后再操作。 |
| 404 | InvalidRegionId.NotFound | Specified value of "RegionId" is not supported. | |
| 404 | FUWU_BIZ_COMMODITY_VERIFY_FAIL | ????????, ????????PD. | |
| 409 | OperationConflict | Request was denied due to conflict with a previous request. | 请求冲突,请稍后重试。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。