文档

AssociateHaVip - 将HaVip绑定到ENS实例上

更新时间:

调用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:AssociateHaVipupdate
  • HaVip
    acs:ens::{#accountId}:havip/{#HaVipId}

请求参数

名称类型必填描述示例值
HaVipIdstring

要绑定的 HaVip 实例 ID。

havip-5p14t****
InstanceIdstring

实例 ID。

i-50c4****
InstanceTypestring

要绑定 HaVip 的实例类型,取值:

  • EnsInstance:云服务器 ENS 实例(默认)。
  • NetworkInterface:弹性网卡实例,当绑定 HaVip 的实例为弹性网卡,该参数必须填写。
EnsInstance

返回参数

名称类型描述示例值
object

Schema of Response

RequestIdstring

请求 ID。

CEF72CEB-54B6-4AE8-B225-F876FF7BA984

示例

正常返回示例

JSON格式

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

错误码

HTTP status code错误码错误信息描述
400InstanceNotFoundThe input parameter instancdId that is not found.指定的InstanceId不存在。
400Invalid%sThe specified parameter %s is invalid.参数不正确
400Missing%sYou must specify the parameter %s.参数为必填
400HaVipNotFoundThe input parameter haVipId that is not found.指定的HaVip不存在。
400IncorrectHaVipStatusThe status of the haVip is invalid.HaVip的状态不正确
400SystemErrorInterface call error, please re-match, or contact the product.接口调用错误,请重新选配
400InstanceAlreadyAssociatedThe instance is already bound.实例已绑定。
400IncorrectNetworkInterfaceStatusThe operation could not be completed because the status of the specified network interface is invalid for this action.指定的网卡状态不支持当前操作。
400NetworkInterfaceNotFoundThe specified network interface does not exist.指定的网卡不存在。
400NetworkInterfaceTypeNotSupportedThis network interface type cannot be used with the current operation.网卡类型不支持当前操作
400IncorrectInstanceVSwitchThe binding instance must be under the same VSwitch.绑定实例需要在同一个交换机下。
400IncorrectInstanceStatusThe current status of the instance does not support this operation.当前实例状态不支持此操作。
400CountLimitExceed.HaVipOnInstanceThe amount of HaVip associated with the specified Instance reach its limits.超过实例的HaVip限额。
400CountLimitExceed.InstanceOnHaVipThe number of instances bound to HaVip has reached the limit.HaVip上绑定的实例数已达限额
400NoPermissionPermission denied.没有足够的权限,请联系云账号管理员授予您相应权限。
400InvalidParameter.%sThe specified field %s invalid. Please check it again.-

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