全部产品
Search
文档中心

边缘节点服务ENS:AssociateHaVip - 将HaVip绑定到ENS实例上

更新时间:Aug 27, 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.

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

变更历史

更多信息,参考变更详情。