AllocateEipAddressPro - 申请指定的EIP

更新时间:
复制 MD 格式

调用AllocateEipAddressPro申请指定的EIP,可用于特定的网络配置需求。

调试

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

调试

授权信息

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

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

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

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

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

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

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

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

操作

访问级别

资源类型

条件关键字

关联操作

vpc:AllocateEipAddressPro

create

*Address

acs:vpc:{#regionId}:{#accountId}:eip/*

请求参数

名称

类型

必填

描述

示例值

RegionId

string

要指定申请的 EIP 所在的地域 ID。

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

cn-hangzhou

IpAddress

string

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

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

192.0.XX.XX

InstanceId

string

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

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

eip-25877c70gddh****

Bandwidth

string

要指定申请的 EIP 的带宽峰值,单位:Mbps。

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

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

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

默认值:5Mbps。

5

Period

integer

购买时长。

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

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

如果 InstanceChargeType 参数的值为 PrePaid 时,该参数必选。

如果 InstanceChargeType 参数的值为 PostPaid 时,该参数不填。

1

ISP

string

线路类型。取值:

  • 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

Netmode

string

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

public

AutoPay

boolean

是否自动付费,取值:

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

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

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

true

PricingCycle

string

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

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

  • Year:按年付费。

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

Month

InstanceChargeType

string

要指定申请的 EIP 的计费方式,取值:

  • PrePaid:包年包月。

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

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

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

PostPaid

InternetChargeType

string

要指定申请的 EIP 的计量方式,取值:

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

  • PayByTraffic:按流量计费。

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

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

PayByBandwidth

ResourceGroupId

string

要指定申请的 EIP 所属的资源组 ID。

rg-resourcegroup****

Tag

array<object>

object

Key

string

Value

string

ClientToken

string

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

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

说明

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

0c593ea1-3bea-11e9-b96b-88e9fe6****

SecurityProtectionTypes

array

安全防护级别。

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

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

string

安全防护级别。

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

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

PublicIpAddressPoolId

string

IP 地址池 ID。

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

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

pippool-2vc0kxcedhquybdsz****

返回参数

名称

类型

描述

示例值

object

返回信息列表。

RequestId

string

请求 ID。

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

OrderId

integer

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

20190000

ResourceGroupId

string

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

rg-resourcegroup****

EipAddress

string

您指定申请的 EIP 被分配到的 IP 地址。仅 InstanceChargeType 取值为 PostPaid 时返回。

192.0.XX.XX

AllocationId

string

EIP 的 ID。

eip-25877c70gddh****

示例

正常返回示例

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 QuotaExceeded.Eip Elastic IP address quota exceeded
400 InvalidParameter Specified value of "InternetChargeType" is not valid
400 ReserveIpFail Reserve eip failed.
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 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 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失败,ISPIP参数不匹配.
400 IncorrectStatus.PublicIpAddressPool The status of PublicIpAddressPool is incorrect. 地址池实例未处于稳态,不允许分配EIP。
400 IllegalParam.IpAddress The specified IpAddress (%s) is illegal. IpAddress参数不合法
400 OperationFailed.ResourceNotEnough The resources you have applied for are insufficient. 您申请的资源不足,如仍需申请,请提工单处理
400 Mismatch.EipSecurityProtectionTypeAndPoolSecurityProtectionType The EipSecurityProtectionType and PoolSecurityProtectionType are mismatched. EIP安全防护类型与地址池安全防护类型不匹配。
400 IllegalParam.Isp The param of Isp [%s] is illegal. 参数 Isp 不合法,请根据请求参数规定重新输入。
500 InternalError The request processing has failed due to some unknown error, exception or failure. 内部错误
403 Forbidden User not authorized to operate on the specified resource. 您没有权限操作指定资源,请申请权限后再操作。

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

变更历史

更多信息,参考变更详情