调用AllocateEipAddressPro申请指定的弹性公网IP(Elastic IP Address,简称EIP)。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
RegionId | string | 是 | 要指定申请的EIP所在的地域ID。 您可以通过调用DescribeRegions接口获取地域ID。 | cn-hangzhou |
IpAddress | string | 否 | 要指定申请的EIP的IP地址。 IpAddress和InstanceId参数仅需传入一个,如果都不传,系统会随机申请EIP。 | 192.0.XX.XX |
InstanceId | string | 否 | 要指定申请的EIP的实例ID。 IpAddress和InstanceId参数仅需传入一个,如果都不传,系统会随机申请EIP。 | eip-25877c70gddh**** |
Bandwidth | string | 否 | 要指定申请的EIP的带宽峰值,单位:Mbps。
默认值:5 Mbps。 | 5 |
Period | integer | 否 | 购买时长。
如果InstanceChargeType参数的值为PrePaid时,该参数必选。 如果InstanceChargeType参数的值为PostPaid时,该参数不填。 | 1 |
ISP | string | 否 | 线路类型。取值:
关于BGP(多线)线路和BGP(多线)_精品线路的更多信息,请参见EIP线路类型。
| BGP |
Netmode | string | 否 | 网络类型,仅取值为public(默认值),表示公网。 | public |
AutoPay | boolean | 否 | 是否自动付费,取值:
当InstanceChargeType参数的值为PrePaid时,该参数必选;当InstanceChargeType参数的值为PostPaid时,该参数可不填。 | true |
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。 | PayByBandwidth |
ResourceGroupId | string | 否 | 要指定申请的EIP所属的资源组ID。 | rg-resourcegroup**** |
ClientToken | string | 否 | 客户端Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken只支持ASCII字符。 说明
若您未指定,则系统自动使用API请求的RequestId作为ClientToken标识。每次API请求的RequestId不一样。
| 0c593ea1-3bea-11e9-b96b-88e9fe6**** |
SecurityProtectionTypes | array | 否 | 安全防护级别。
您最多可以为10个EIP设置安全防护级别。 | |
string | 否 | 安全防护级别。
您最多可以为10个EIP设置安全防护级别。 | AntiDDoS_Enhanced | |
PublicIpAddressPoolId | string | 否 | pippool-2vc0kxcedhquybdsz**** |
返回参数
示例
正常返回示例
JSON
格式
{
"RequestId": "4EC47282-1B74-4534-BD0E-403F3EE64CAF",
"OrderId": 20190000,
"ResourceGroupId": "rg-resourcegroup****",
"EipAddress": "192.0.XX.XX",
"AllocationId": "eip-25877c70gddh****"
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | FrequentPurchase.EIP | eip frequent purchase | - |
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 | InvalidParameter | Specified value of "Bandwidth" is not valid. | 该带宽不合法。 |
400 | InsufficientBalance | Your account does not have enough balance. | 账户余额不足,请先充值再操作。 |
400 | QuotaExceeded.Eip | Elastic IP address quota exceeded. | 弹性公网IP的个数超过额度限制,如果您有更多额度的需求,建议您考虑使用NAT网关。 |
400 | ReserveIpFail | Reserve eip failed. | EIP预留失败。 |
400 | InvalidRegion.NotSupport | The specified region does not support. | 该 RegionId 不支持此操作。 |
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 | SYSTEM.UNKNOWN.ERROR | The Account failed to create order. | - |
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 | Invalid.Reserve.Ip | The reserve ip is invalid. | - |
400 | Ip.Allocated | The reserve ip has been allocated. | 已分配保留ip。 |
400 | Ip.Keeped | The reserve ip been keeped in an hour. | - |
400 | OperationFailed.AllocateUnfamiliarIp | The operation failed because only IP addresses used within the last seven days can be allocated. | 指定EIP申请只允许申请7天内使用过的IP |
400 | INVALID_INSTANCE_STATUS | The instance status is invalid. | - |
400 | OperationFailed.InstanceNotExist | Eip instanceId does not exist. | - |
400 | InvalidStatus.ValueNotSupported | The specified status is not supported. | - |
400 | OperationFailed.RiskControl | Risk control check failed. | 我们检测到您的付款方式存在安全风险。请通过电子邮件或控制台消息中的链接继续验证,并在验证后重新提交订单。 |
400 | OrderError.EIP | The Account failed to create order. | 下单失败 |
400 | ResourceNotEnough.PublicIpAddressPool | The specified resource of PublicIpAddressPool is not enough. | - |
400 | Mismatch.IpAndPublicIpAddressPool | The Ip and PublicIpAddressPool are mismatched. | - |
400 | ResourceNotFound.PublicIpAddressPool | The specified resource of PublicIpAddressPool is not found. | - |
400 | ResourceNotFound.Ip | The specified ip is not found. | 找不到指定的ip。 |
400 | OperationDenied.IpBelongToOtherUser | The operation is not allowed because of ip belong to other user. | 申请失败,该IP归属其他用户 |
400 | IncorrectStatus.Ip | The status of ip is incorrect. | ip的状态不正确。 |
400 | OperationFailed.IpIsLocked | The operation is failed because of ip is locked. | 申请失败,IP已经被锁定 |
400 | Mismatch.IpAndIsp | The specified IP address does not match the ISP. | 申请指定IP失败,ISP和IP参数不匹配. |
400 | IncorrectStatus.PublicIpAddressPool | The status of PublicIpAddressPool is incorrect. | 地址池实例未处于稳态,不允许分配EIP。 |
400 | IllegalParam.IpAddress | The specified IpAddress (%s) is illegal. | IpAddress参数不合法 |
403 | Forbidden | User not authorized to operate on the specified resource. | 您没有权限操作指定资源,请申请权限后再操作。 |
404 | InvalidRegionId.NotFound | Specified value of "RegionId" is not supported. | 指定的 RegionId 不存在,请您检查此产品在该地域是否可用。 |
404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | 指定的RegionId不存在。请检查该参数是否正确。 |
404 | FUWU_BIZ_COMMODITY_VERIFY_FAIL | ????????, ????????PD. | - |
500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | 内部错误 |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
2023-07-06 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||
| ||||||||||||
2023-05-15 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||
| ||||||||||||
2022-12-02 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||
|