You need to enable JavaScript to run this app.
导航

AllocateEipAddress

最近更新时间2024.03.22 08:29:01

首次发布时间2021.07.31 07:47:46

调用 AllocateEipAddress 接口,申请公网IP。

调用说明

前提条件

使用限制

  • 单个账号单个地域下默认最多可创建的公网IP为20个。若默认配额无法满足需求,请前往 配额中心 ,申请提升配额。

  • 单个账号单个地域下每日最多调用本接口的次数为可申请公网IP数量的2倍。

  • 标签的其他操作请参考 TagResourcesUntagResourcesListTagsForResources

请求参数

参数名称
类型
是否必选
示例值
描述
ActionStringAllocateEipAddress要执行的操作,取值:AllocateEipAddress。
VersionString2020-04-01API的版本信息,当前版本为2020-04-01。

Name

String

eip-1

公网IP的名称。

  • 长度限制为1 ~ 128个字符。
  • 需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。
  • 不填默认是公网IP的ID。

Description

String

This is an eip

公网IP的描述。

  • 长度限制为0~ 255个字符。
  • 不填默认为空字符串。
  • 需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。

ISP

String

BGP

线路类型,默认为BGP。

  • BGP:BGP(多线)。
  • 若您的账号已申请并开通了静态单线权限,则可传入如下取值:
    • ChinaMobile:中国移动静态单线。
    • ChinaTelecom:中国电信静态单线。
    • ChinaUnicom:中国联通静态单线。
  • 若您的账号已申请并开通了BGP单线权限,则可传入SingleLine_BGP。
  • 若您的账号已申请并开通了融合BGP权限,则可传入Fusion_BGP。
  • 若您的账号已申请并开通了惠选型静态单线权限,则可传入如下取值:
    • ChinaMobile_Value:中国移动惠选型静态单线。
    • ChinaUnicom_Value:中国联通惠选型静态单线。
    • ChinaTelecom_Value:中国电信惠选型静态单线。

BillingType

Integer

2

公网IP的计费方式。取值如下:

  • 1:包年包月。
  • 2:按量计费-按带宽上限计费。
  • 3:按量计费-按实际流量计费。

PeriodUnit

Integer

1

购买包年包月公网IP时长的单位。取值如下:

  • 1(默认值):月。
  • 2 :年。

Period

Integer

1

购买包年包月公网IP的时长,默认为“1”。

  • PeriodUnit传入1,Period取值范围:1~9、12、24、36、48、60。
  • PeriodUnit传入2,Period取值范围:1~5。

BandwidthPackageId

String

共享带宽包的ID,表示将公网IP加入到共享带宽包。
您可以调用 DescribeBandwidthPackages 接口,查询共享带宽包的ID。
公网IP加入到共享带宽包必须同时满足如下条件:

  • 二者的安全防护类型相同。
  • 二者的地域相同。
  • 公网IP的计费方式必须是按量计费。
  • 共享带宽包为IPv4类型。

Bandwidth

Integer

1

公网IP的带宽上限,默认为“1”,单位:Mbps。

  • BillingType传入1:取值范围1 ~ 500。
  • BillingType传入2:取值范围1 ~ 500。
  • BillingType传入3:取值范围1 ~ 200。

SecurityProtectionTypes.N

String

SecurityProtectionTypes.1
=AntiDDoS_Enhanced

公网IP的安全防护类型。

  • 参数 - N:表示安全防护类型的序号,当前仅支持取1。
  • 取值:
    • AntiDDoS_Enhanced:申请增强防护类型的公网IP,可加入到DDoS原生防护(企业版)实例。

      说明

      • SecurityProtectionTypes.N传入AntiDDoS_Enhanced,则BillingType必须传入2或3,且ISP必须传入BGP。
      • 增强防护类型公网IP正在邀测中,如需试用,请 提交工单 或联系客户经理。
    • 不填则表示申请默认防护类型的公网IP。

SecurityProtectionInstanceId

Integer

20

DDoS原生防护(企业版)ID。
您可以调用 DescInstanceList 接口,查询DDoS原生防护(企业版)的ID。
SecurityProtectionTypes传入AntiDDoS_Enhanced时,此参数必须传入。

RenewType

Interger

1

包年包月公网IP续费的方式。取值如下:

  • 1(默认值):手动续费。
  • 2:自动续费。
  • 3:到期不续费。

RenewPeriodTimes

Interger

1

自动续费的时长,取值范围1、2、3、6、12,单位:月。

RenewType传入2,则必须传入RenewPeriodTimes

ProjectNameStringProject_1公网IP所属项目的名称。不填默认加入default项目。

Tags.N.Key

String

Tags.1.Key=key1&Tags.2.Key=key2

用户标签的标签键。

  • 参数 - N:表示标签键的序号,取值范围:1~50。
  • 多个标签键之间用&分隔。
  • 不能以 volc:sys:开头,包括任意大小写形式。
  • 长度取值范围为1~128字符,允许输入各国语言文字、数字、空格( )、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、中划线(-)和@(@)。
  • 若标签键开头或结尾存在空格,系统会自动为其去除。

说明

同一资源的标签键不允许重复。

Tags.N.Value

String

Tags.1.Value=value1&Tags.2.Value=value2

用户标签的标签值。

  • 参数 - N:表示标签值的序号,取值范围:1~50。
  • 多个标签值之间用&分隔。
  • 长度取值范围为0~256字符,不填默认为空。
  • 允许输入各国语言文字、数字、空格( )、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、中划线(-)和@(@)。
  • 大小写敏感。
  • 若标签值开头或结尾存在空格,系统会自动为其去除。

说明

若传入该参数,则必须先传入Tags.N.Key

ClientToken

String

123e4567-e89b-12d3-a456-42665544****

保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。取值:

  • 仅支持ASCII字符,且不能超过64个字符。

返回数据

参数名称
类型
示例值
描述
RequestIdString2021062415303301022514515207C4****请求ID。
EipAddressString12.XX.XX.89公网IP地址。
AllocationIdStringeip-2ziwb7ujxscd****公网IP的ID。

请求示例

GET /?Action=AllocateEipAddress&Version=2020-04-01&Name=eip-1&ISP=BGP&BillingType=2&Bandwidth=10 HTTP/1.1
Host: open.volcengineapi.com
Service: vpc
Region: cn-beijing

返回示例

{
    "ResponseMetadata": {
        "RequestId": "2021110417394001022514606307D7****",
        "Action": "AllocateEipAddress",
        "Version": "2020-04-01",
        "Service": "vpc",
        "Region": "cn-beijing"
    },
    "Result":{
				"AllocationId": "eip-2ziwb7ujxscd****",
        "EipAddress": "12.XX.XX.89",
        "RequestId": "2021062415303301022514515207C4****"
     }
}

错误码

公共错误码,请参见 公共错误码 。

HttpCode
错误码
错误信息
描述
400IdempotentParameterMismatchArguments on this idempotent request are inconsistent with arguments used in previous request(s).此幂等请求的参数与前一个请求中使用的参数不一致。
400InsufficientIspEipThe specified ISP does not contain enough free elastic IP addresses to fulfill your request.指定ISP下的EIP资源不足。
400InvalidBandwidth.MalformedThe specified bandwidth is malformed.Ensure that bandwidth is not smaller than 1.指定的带宽不合法。如果指定带宽,请确保不小于1。
400InvalidBandwidthPackage.InvalidStatusThe specified bandwidth package is not in the correct status for the request. The specified bandwidth package is in freeze.指定的共享带宽包所处的状态无法响应该请求。当前共享带宽包被冻结。
400InvalidBillingType.MalformedThe specified billing type is malformed. AntiDDoS enhanced eip billing type only support 2 and 3.指定的计费类型不支持。增强防护EIP只支持按带宽上限计费和按流量计费类型。
400InvalidBillingType.MalformedThe specified billing type of EIP is malformed.指定的EIP计费类型不合法。
400InvalidBillingType.MalformedThe specified billing type is malformed.指定的计费类型不合法。
400InvalidDescription.MalformedThe specified description is malformed.指定的描述格式不合法。请修复描述格式后重试。
400InvalidDescription.MalformedThe specified description is malformed. Ensure the maximum length of description is 255.指定的描述格式不合法。描述长度不能超过255个字符。

400

InvalidMonthPeriod.Malformed

The specified monthly period is malformed. Monthly period only supports 1~9, 12, 24, 36, 48, 60.

指定的预付费按月购买时长不合法。预付费按月购买时长只支持1~9, 12, 24, 36, 48, 60月。

400InvalidName.MalformedThe specified name is malformed.指定的名称格式不合法。请修复名称格式后重试。
400InvalidName.MalformedThe specified name is malformed. Ensure the maximum length of name is 128.指定的名称格式不合法。名称长度不能超过128个字符。
400InvalidParameter.ClientTokenMalformedThe specified parameter ClientToken is malformed.指定的参数ClientToken格式不合法,长度不能超过64个ASCII字符。
400InvalidPeriodUnit.MalformedThe specified period unit is malformed. Pre billing period unit can only be 1 or 2.指定的包年包月类型时长单位不合法。包年包月类型时长单位只能为1或2。
400InvalidProtocol.MalformedThe specified protocol is malformed.指定的协议类型不合法。
400InvalidProtocol.MismatchThe protocol of the bandwidth package does not match with the EIP.共享带宽包与EIP的协议类型不匹配。
400InvalidSecurityProtectionInstance.InvalidStatusThe specified security protection instance is not in the correct status for the request.指定的安全防护实例所处的状态无法响应该请求。
400InvalidSecurityProtectionInstance.RegionMismatchThe specified security protection instance is not in the specified region.指定的安全防护实例不属于指定地域。
400InvalidSecurityProtectionInstance.SpecificationsMismatchThe specified security protection instance and EIP are in different specifications.指定的安全防护实例和EIP规格不匹配。
400InvalidSecurityProtectionTypes.MalformedThe specified security protection type is malformed. Security protection type only support AntiDDoS_Enhanced.指定的安全防护级别不支持。安全防护级别当前仅支持AntiDDoS_Enhanced。
400InvalidTag.DisorderThe specified index order of tag is malformed.指定标签的索引顺序参数格式不合法。
400InvalidTagKey.MalformedThe specified parameter tag key is invalid.标签键不合法。
400InvalidTagValue.MalformedThe specified parameter tag value is invalid.标签值不合法。
400InvalidYearPeriod.MalformedThe specified yearly period is malformed. Yearly period only supports 1~5.指定的预付费按年购买时长不合法。预付费按年购买时长只支持1~5年。
400LimitExceeded.BandwidthPerEipYou've reached the limit on the bandwidth of elastic ip that you can create.已达到EIP带宽上限。
400LimitExceeded.SecurityProtectionTypesYou've reached the limit on the number of security protection types.已达到安全防护类型的上限。
400LimitExceeded.TagsYou've reached the limit on the number of tags that you can operate at one time.已达到单次可操作标签数量的上限。
400QuotaExceeded.BandwidthPackageYou've reached the limit on the EIP number of that you can add to bandwidth package.已达到共享带宽包可加入公网IP的数量上限。
400QuotaExceeded.EipEIP number exceeded quota.已达到可申请公网IP数量上限。
400QuotaExceeded.SecurityProtectionInstanceYou've reached the limit on the number of security protection instance that you can add.已达到安全防护实例可加入的数量上限。
400UnsupportedOperationThe request on the specified instance is denied due to the account balance and available vouchers are less than 100 yuan in total.因账户余额及可用代金券共不足100元,对于该实例的操作请求被拒绝。
400UnsupportedOperationThe request on the specified instance is denied due to the account in arrears status.因账户处于欠费状态,对于该实例的操作请求被拒绝。
403ForbiddenYou are not authorized to create fusion BGP elastic IP address.无权限创建融合BGP类型EIP地址。
403ForbiddenYou are not authorized to perform operations on the specified bandwidth package. Because of SecurityProtectionTypesInconsistent.无权限对指定的共享带宽包操作。指定EIP和共享带宽包的安全防护级别不一致。
403ForbiddenYou are not authorized to create Static BGP elastic IP address.无权限创建静态BGP类型EIP地址。
403ForbiddenYou are not authorized to create Anti DDos elastic IP address.无权限申请增强防护类型的公网IP。
403ForbiddenYou are not authorized to perform operations on the specified bandwidth package. The ISP of EIP and bandwidth package is not same.EIP和共享带宽包的ISP不一致。
403ForbiddenYou are not authorized to create single-line elastic IP address.无权限创建静态单线类型EIP地址。
403ForbiddenYou are not authorized to create BGP SingleLine elastic IP address.无权限创建BGP单线类型EIP地址。
403ForbiddenYou are not authorized to create an elastic IP address with the specified billing type.无权限创建指定计费类型的EIP地址。
403ForbiddenYou are not authorized to create single-line value elastic IP address.无权限创建静态单线惠选型类型EIP地址。
403Forbidden.PurchaseLimitedThe account is not authorized to purchase the resource.此账户无权限购买资源。
404InvalidBandwidthPackage.NotFoundThe specified bandwidth package does not exist.指定的共享带宽包不存在。
404InvalidISP.NotFoundThe specified ISP does not exist.指定的ISP不存在。
404InvalidProject.NotFoundThe specified Project does not exist.指定的项目不存在。
404InvalidSecurityProtectionInstance.NotFoundThe specified security protection instance does not exist.指定的安全防护实例不存在。
412IdempotentProcessingThe request uses the same client token as a previous one that is still in process.幂等请求处理中。