全部產品
Search
文件中心

ENS:AssociateHaVip - 將HaVip綁定到ENS執行個體上

更新時間:Mar 20, 2026

調用AssociateHaVip介面將HaVip綁定到ENS執行個體或ENS彈性網卡上。

介面說明

在調用本介面綁定高可用虛擬 IP 時,請注意:

  • HaVip 綁定後,無需重啟 ENS 執行個體,但需要將 HaVip 配置到 ENS 執行個體的彈性網卡上。

  • HaVip 和要綁定的 ENS 執行個體必須同屬於一個交換器。

  • 要綁定的 ENS 執行個體的狀態必須為運行中或已停止。

  • HaVip 執行個體的狀態必須為 Available 或 InUse。

  • AssociateHaVip 介面屬於非同步介面,即系統返回一個請求 ID,但該 HaVip 並未綁定完成,系統背景綁定任務仍在進行。您可以調用 DescribeHaVips 查詢 HaVip 的綁定狀態:
    • 當 HaVip 處於 Associating 狀態時,表示 HaVip 正在綁定中。

    • 當 HaVip 處於 InUse 狀態時,表示 HaVip 綁定完成。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

ens:AssociateHaVip

update

*HaVip

acs:ens::{#accountId}:havip/{#HaVipId}

請求參數

名稱

類型

必填

描述

樣本值

HaVipId

string

要綁定的 HaVip 執行個體 ID。

havip-5p14t****

InstanceId

string

執行個體 ID。

i-50c4****

InstanceType

string

要綁定 HaVip 的執行個體類型,取值:

  • EnsInstance:雲端服務器 ENS 執行個體(預設)。

  • NetworkInterface:彈性網卡執行個體,當綁定 HaVip 的執行個體為彈性網卡,該參數必須填寫。

EnsInstance

返回參數

名稱

類型

描述

樣本值

object

Schema of Response

RequestId

string

請求 ID。

CEF72CEB-54B6-4AE8-B225-F876FF7BA984

樣本

正常返回樣本

JSON格式

{
  "RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 InstanceNotFound The input parameter instancdId that is not found.
400 Invalid%s The specified parameter %s is invalid.
400 Missing%s You must specify the parameter %s.
400 HaVipNotFound The input parameter haVipId that is not found. 指定的HaVip不存在。
400 IncorrectHaVipStatus The status of the haVip is invalid. HaVip的狀態不正確
400 SystemError Interface call error, please re-match, or contact the product. 介面調用錯誤,請重新選配
400 InstanceAlreadyAssociated The instance is already bound. 執行個體已綁定。
400 IncorrectNetworkInterfaceStatus The operation could not be completed because the status of the specified network interface is invalid for this action. 指定的網卡狀態不支援當前操作。
400 NetworkInterfaceNotFound The specified network interface does not exist. 指定的網卡不存在。
400 NetworkInterfaceTypeNotSupported This network interface type cannot be used with the current operation. 網卡類型不支援當前操作
400 IncorrectInstanceVSwitch The binding instance must be under the same VSwitch. 綁定執行個體需要在同一個交換器下。
400 IncorrectInstanceStatus The current status of the instance does not support this operation. 當前執行個體狀態不支援此操作。
400 CountLimitExceed.HaVipOnInstance The amount of HaVip associated with the specified Instance reach its limits. 超過執行個體的HaVip限額。
400 CountLimitExceed.InstanceOnHaVip The number of instances bound to HaVip has reached the limit. HaVip上綁定的執行個體數已達限額
400 NoPermission Permission denied.
400 InvalidParameter.%s The specified field %s invalid. Please check it again.

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

變更歷史

更多資訊,參考變更詳情