AllocateEipAddress - 申請Elastic IP Address(EIP)

更新時間:
Copy as MD

申請Elastic IP Address(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:AllocateEipAddress

create

*Address

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

請求參數

名稱

類型

必填

描述

樣本值

RegionId

string

彈性公網 IP 所在的地區 ID。

您可以通過調用 DescribeRegions 介面擷取地區 ID。

枚舉值:

  • cn-beijing :

    cn-beijing

cn-hangzhou

Bandwidth

string

EIP 的頻寬峰值。單位:Mbps。

  • InstanceChargeType 取值為 PostPaid,且 InternetChargeType 取值為 PayByBandwidth 時,Bandwidth 取值範圍為 1~500

  • InstanceChargeType 取值為 PostPaid,且 InternetChargeType 取值為 PayByTraffic 時,Bandwidth 取值範圍為 1~200

  • InstanceChargeType 取值為 PrePaid 時,Bandwidth 取值範圍為 1~1000

預設值:5 Mbps。

5

Period

integer

購買時間長度。

PricingCycle 取值 Month 時,Period 取值範圍為 1~9

PricingCycle 取值 Year 時,Period 取值範圍為 1~5

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

ActivityId

integer

特殊活動 ID,無需配置此參數。

123456

Netmode

string

網路類型,僅取值為 public(預設值),表示公網。

public

AutoPay

boolean

是否自動付費,取值:

  • false(預設值):不開啟自動付費,產生訂單後需要到訂單中心完成支付。

  • true:開啟自動付費,自動支付訂單。

InstanceChargeType 參數的值為 PrePaid 時,該參數必選;當 InstanceChargeType 參數的值為 PostPaid 時,該參數可不填。

false

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

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 個字元,不能以http://https://開頭。

說明

建立預付費的 EIP 執行個體時,不支援設定該參數。

EIP1

Description

string

EIP 執行個體的描述。

長度為 0-256 個字元,不能以http://https://開頭。

說明

建立預付費的 EIP 執行個體時,不支援設定該參數。

test

SecurityProtectionTypes

array

安全防護層級。

  • 配置為空白時,預設為 DDoS 防護(基礎版)。

  • 配置為AntiDDoS_Enhanced時,表示 DDoS 防護(增強版)。

您最多隻能設定 1 個安全防護層級。

AntiDDoS_Enhanced

string

安全防護層級。

  • 配置為空白時,預設為 DDoS 防護(基礎版)。

  • 配置為AntiDDoS_Enhanced時,表示 DDoS 防護(增強版)。

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 位址。

IpAddressInstanceId 參數僅需傳入一個,如果都不傳,系統會隨機申請 EIP。

192.0.XX.XX

InstanceId

string

要指定申請的 EIP 的執行個體 ID。

IpAddressInstanceId 參數僅需傳入一個,如果都不傳,系統會隨機申請 EIP。

eip-25877c70gddh****

Tag

array<object>

資源的標籤。

object

Key

string

資源的標籤鍵。最多支援輸入 20 個標籤鍵。如需傳入該值,則不能輸入Null 字元串。

一個標籤鍵最多支援 128 個字元,不能以aliyunacs:開頭,不能包含http://或者https://

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 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.AccountMoneyInvalid Account money is invalid.
400 OperationFailed.QueryCredtiInfo Failed to query credit info.
400 FrequentPurchase.EIP eip frequent purchase
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. 不允許同時傳入參數ZonePublicIpAddressPoolId
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. 指定的入參ZoneIpAddressInstanceId存在衝突
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. 請求衝突,請稍後重試。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情