AssociateEipAddress - 將EIP綁定到雲產品執行個體
調用AssociateEipAddress將Elastic IP Address(EIP)綁定到同地區的雲產品執行個體上。
介面說明
-
EIP 執行個體可綁定到同地區的專用網路類型的 ECS 執行個體、專用網路類型的 CLB 執行個體、輔助彈性網卡、NAT Gateway和高可用虛擬 IP 上。
-
AssociateEipAddress 介面屬於非同步介面,即系統會先返回一個請求 ID,但 EIP 執行個體與雲產品執行個體並未綁定完成,系統背景綁定任務仍在進行。您可以調用 DescribeEipAddresses 查詢 EIP 執行個體的狀態:
當 EIP 執行個體處於 Associating 狀態時,表示 EIP 執行個體正在綁定中,在該狀態下,您只能執行查詢操作,不能執行其他動作。
當 EIP 執行個體處於 InUse 狀態時,表示 EIP 執行個體綁定完成。
-
AssociateEipAddress 介面不支援同一個 EIP 執行個體並發綁定雲產品執行個體。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
否 |
要綁定雲產品執行個體的 EIP 所在的地區 ID。 您可以通過調用 DescribeRegions 介面擷取地區 ID。 |
cn-hangzhou |
| AllocationId |
string |
是 |
綁定雲產品執行個體的 EIP 的 ID。 |
eip-2zeerraiwb7ujsxdc**** |
| InstanceId |
string |
是 |
要綁定 EIP 的執行個體 ID。 支援輸入 NAT Gateway執行個體 ID、傳統型負載平衡 CLB 執行個體 ID、Elastic Compute Service 執行個體 ID、輔助彈性網卡執行個體 ID、高可用虛擬 IP 執行個體 ID、IP 位址。 |
i-2zebb08phyczzawe**** |
| InstanceType |
string |
否 |
要綁定 EIP 的執行個體的類型,取值:
說明
預設要綁定 EIP 的執行個體類型為 EcsInstance,如果您需要綁定 EIP 的執行個體類型不為 EcsInstance,則該值必填。 |
EcsInstance |
| InstanceRegionId |
string |
否 |
要綁定 EIP 的執行個體所屬地區的 ID。 說明
僅在 EIP 加入到頻寬共用型Global Acceleration執行個體後,才需要填寫該參數。 |
cn-hangzhou |
| PrivateIpAddress |
string |
否 |
交換器網段內的一個 IP 位址。 如果不輸入該參數,系統根據 VPC ID 和交換器 ID 自動分配一個私網 IP 位址。 說明
當 InstanceType 配置為 NetworkInterface 時,該參數必填,需輸入要綁定的私網 IP。 |
192.168.XX.XX |
| Mode |
string |
否 |
繫結模式,取值:
說明
僅 InstanceType 配置為 NetworkInterface 時,才需要配置該參數。 |
NAT |
| VpcId |
string |
否 |
開通了 IPv4 網關功能且與 EIP 同地區的 VPC ID。 EIP 綁定 IP 位址時,系統可以根據該 VPC 的路由配置,使綁定的 IP 位址具備公網訪問能力。 說明
InstanceType 取值為 IpAddress 時,即要綁定 EIP 的執行個體類型為 IP 位址時,該參數必填。 |
vpc-257gqcdfvx6n**** |
| ClientToken |
string |
否 |
用戶端 Token,用於保證請求的等冪性。 從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元。 說明
若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 標識。每次 API 請求的 RequestId 不一樣。 |
0c593ea1-3bea-11e9-b96b-88e9fe63**** |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
返回資訊列表。 |
||
| RequestId |
string |
請求 ID。 |
0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
樣本
正常返回樣本
JSON格式
{
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidAssociation.Duplicated | Specified instance already is associated. | |
| 400 | OperationDenied | Specified instance is not in VPC. | |
| 400 | InvalidParameter.Mismatch | Specified elastic IP address and ECS instance are not in the same region. | |
| 400 | IncorrectEipStatus | Current elastic IP status does not support this operation | |
| 400 | IncorrectInstanceStatus | Current instance status does not support this operation. | |
| 400 | InvalidInstanceType.ValueNotSupported | The specified value of InstanceType is not supported. | |
| 400 | IncorrectHaVipStatus | HaVip can be operated by this action only when it's status is Available or InUse. | Havip執行個體為Available或InUse才允許操作 |
| 400 | InvalidParameter | The specified parameter is not valid. | |
| 400 | TaskConflict | The eip operate too frequent, TaskConflict. | 操作過於頻繁,任務衝突。 |
| 400 | InvalidBindingStatus | The eip binding status invalid. | |
| 400 | BIND_INSTANCE_HAVE_PORTMAP_OR_BIND_EIP | The instance may have portMap or already bind eip. | ECS 執行個體已經存在連接埠轉寄規則(DNAT),請刪除相應的連接埠轉寄規則再進行操作。 |
| 400 | EIP_CAN_NOT_ASSOCIATE_WITH_PUBLIC_IP | instance already bind natpublicip,cannot bind eip. | |
| 400 | BIND_INSTANCE_OWENER_ERROR | Cannot operate the eip. | |
| 400 | NATGATEWAY_FINANCIALLOCKED | The NatGateway has expire, cannot do bind operation. | |
| 400 | InvalidParameter.InstanceTypeNotSupport | The specified instance type is not support. | |
| 400 | QuotaExceeded.NumberOfTrafficEip | The number of traffic eip on natgw exceed limitation. | |
| 400 | QuotaExceeded.NumberOfEip | Binded eip Quota exceed on this NatGw. | 此NAT Gateway上,綁定的EIP數量已經超出配額限制 |
| 400 | Forbidden.EipCanNotBindGatgw | Eip can not bind on natgw. | |
| 400 | InvalidAction.Denied | Action is denied due to unfinished Eip configuration modification. | 由於未完成Eip配置修改,操作被拒絕。 |
| 400 | InstanceType.NotSupport | The instance type is invalid. | |
| 400 | InvalidParams.NotFound | instance not found | |
| 400 | BindInstance.NotSupported | bind instance type %s is not supported. | |
| 400 | Forbidden.InstanceBandwidthNotZero | Eip can not bind with instance when it's bandwidth is not zero. | |
| 400 | INSTANCE_TYPE_NOT_SUPPORT | The instance type is invalid. | |
| 400 | ServerRegion.Invalid | Eip bind remote server region invalid. | |
| 400 | Eni.Attached | The eni should be detached from ecs when associating with direct eip. | 當ENI綁定直通EIP時,需要ENI與ECS解除綁定 |
| 400 | Eni.HasSubIp | Eni has sub ip can not bind direct eip. | |
| 400 | Invalid.DirectEip.BindType | The direct eip can be only associated with eni. | |
| 400 | InvalidStatus.EcsStatusNotSupport | The special instance status is not support operate | |
| 400 | Invalid.Function.NotSupported | Multi-IP function is under test, the region or uid is not supported. | |
| 400 | InvalidStatus.EniStatusNotSupport | %s | |
| 400 | InvalidParameter.EniInstanceId | %s | |
| 400 | InvalidNexthop.DirectEni | The direct Eni cannot be nexthop. | 直通Eni不能作為下一跳 |
| 400 | Mode.Conflict | The eni can bind only one mode of eip. | |
| 400 | Mode.NotSupport | The user cannot use multi direct eip. | |
| 400 | QuotaExceed.MultiBindedEip | The number of multi binded eip is over limit. | 可以綁定的多直通模式eip數目超過限制。 |
| 400 | InvalidEIPStatus.BizDisabled | The EIP has been locked. | EIP執行個體被鎖定 |
| 400 | OperationFailed.EniSubIp | Eni has sub ip can not bind direct eip. | |
| 400 | InvalidEip.EipQuotaExceeded | The specified eni assigned eip is more than privateIp. | |
| 400 | OperationFailed.QueryCommodityInfo | Operation failed because quey commodity info error. | |
| 400 | OperationUnsupported.MultiIp | Multi ip function is not support. | |
| 400 | InvalidNicOrVm.NotFound | Bind nic or vm not exist. | 指定綁定的網卡或VM不存在。 |
| 400 | OperationUnsupported.EipBindModel | The instance type of ecs does not support MULTI_BINDED model Eip. | |
| 400 | IncorrectStatus.NatGateway | %s | |
| 400 | EipBindRemote.BackendRegionMustBeSingle | eip bind remote instance, backend region must be single | |
| 400 | InvalidParameter.BindingInstanceRegion | The specified BindingInstanceRegion is not supported. | |
| 400 | OperationFailed.HavipBoundPortmap | %s | |
| 400 | IllegalParam.Mode | %s | |
| 400 | InvalidStatus.NotAllow | Bind instance status invalid | 綁定執行個體狀態無效 |
| 400 | InvalidInstance.NotExist | Bind instance data not exist | |
| 400 | InvalidBandwidthPackageId.NotFound | The specified BandwidthPackageId not exist. | |
| 400 | ResourceQueryError | The specified resource is queried error. | 查詢指定的資源時出錯。 |
| 400 | InvalidStatus.InstanceHasBandWidth | The specified instance bandwidth invalid. | |
| 400 | OperationDenied.CloudBoxResourceExist | The operation is not allowed because there are resources related to the cloud box in VPC. | 指定操作被禁止,因為VPC中存在雲盒相關的資源。 |
| 400 | OperationDenied.CloudBoxVSwitchExist | The operation is not allowed because a cloud box type vSwitch exists in VPC. | 指定操作被禁止,因為VPC中存在雲盒類型的虛擬交換器。 |
| 400 | OperationDenied.NoAvailablePrivateIp | The operation is failed because of vSwitch has not availalbe private ip | 當前虛擬交換器下的可用私網IP不足 |
| 400 | UnsupportedRegion | %s | |
| 400 | ResourceAlreadyAssociated.IpAddress | %s | |
| 400 | OperationFailed.Ipv4GatewayNotOpenedInVpc | The operation is failed because Ipv4Gateway is not opened in Vpc. | EIP綁定IP失敗,因為該VPC未開啟IPv4網關. |
| 400 | OperationFailed.Ipv4GatewayNotActivatedInVpc | The operation is failed because Ipv4Gateway is not activated in Vpc. | |
| 400 | OperationDenied.L2EipBindIpAddress | %s | |
| 400 | Forbidden | The eip instance owner error | EIP 不屬於當前調用者,請您檢查該 EIP 是否可被您調用。 |
| 400 | Forbidden.FinancialLocked | The ip business status is invalid. | 該執行個體已欠費鎖定,無法操作 |
| 400 | UnsupportedFeature.EipBindIpAddress | The feature of EipBindIpAddress is not supported. | Eip綁定IpAddress特性不支援。 |
| 400 | OperationFailed.InstanceNotExist | The ECS instance does not exist, or is not a VPC VM. | ECS綁定EIP失敗,因為ECS執行個體不存在或不是VPC虛擬機器. |
| 400 | OperationDenied.Ipv4GatewayExist | The operation is not allowed because of Ipv4GatewayExist. | |
| 400 | OperationFailed.EipBindModeConflict | Eips can not bind Eni with NAT mode and MULTI_BINDED mode at the same time. | |
| 400 | OperationFailed.EcsMigrating | The operation is failed because of ECS is migrating. | |
| 400 | OperationFailed.IpPrefixConflict | The operation failed due to the IP prefix of the ENI. | 當前操作與彈性網卡的IP Prefix衝突。 |
| 400 | UnsupportedFeature.EipBindPrefixIp | The feature of EipBindPrefixIp is not supported. | 當前地區不支援EIP綁定PrefixIp |
| 400 | OperationDenied.UnsupportedEipBindMode | The operation is not supported for the NAT gateway due to its EIP binding mode. | 此NAT Gateway的EIP綁定類型不支援此操作。 |
| 400 | OperationDenied.Unauthorized | The operation is not allowed because the user is not in the whitelist. | 此操作不被允許,使用者不在白名單。 |
| 400 | OperationFailed.SystemBusy | Operation failed because system is busy. | 系統繁忙,請稍後重試 |
| 400 | OperationFailed.PrivateIpAddressNotExist | The operation failed because the PrivateIpAddress is not found. | 您傳入的私網IP地址不存在。 |
| 400 | IllegalParamFormat.%s | The param format of %s is illegal. | 參數模式非法 |
| 400 | MissingParam.InstanceId | The param of InstanceId can't be null or empty. | InstanceId不可以為空白 |
| 400 | InvalidEniType.SlaveEni | The eni type cannot be slave eni. | 網卡類型不能是Slave網卡。 |
| 400 | IllegalParam.PrivateIpAddress | The specified PrivateIpAddress is illegal. | 指定的PrivateIpAddress無效。請檢查參數約束,並在修改後重試。 |
| 400 | OperationFailed.Ipv4GatewayNotAssociatedWithGatewayRouteTable | The operation failed because the specified IPv4 gateway of the VPC is not associated with any gateway route table. | EIP 綁定的 IP 位址對應的 VPC IPv4 網關未綁定任何網關路由表。 |
| 404 | InvalidAllocationId.NotFound | Specified allocation ID is not found. | |
| 404 | InvalidInstanId.NotFound | Specified instance does not exist. | |
| 404 | InvalidRegionId.NotFound | Specified value of InstanceRegionId is not supported. | |
| 404 | Forbidden.RegionNotFound | Specified instance is not found during access authentication. | 當前Region不支援 |
| 404 | OperationDenied.VpcIpv4GatewayEnabled | The operation is not allowed because of the VPC of the NAT gateway has opened IPv4 Gateway. | 不允許操作,因為NAT Gateway的VPC已經開啟IPv4網關 |
| 503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。