You need to enable JavaScript to run this app.
导航

AssociateHaVip

最近更新时间2024.01.10 10:41:30

首次发布时间2022.03.01 09:03:59

调用 AssociateHaVip 接口,将高可用虚拟IP(HAVIP)与云服务器实例或网卡绑定。

说明

高可用虚拟IP功能正在邀测中,如需使用该接口,请提交工单或联系客户经理申请。

调用说明

  • 一个高可用虚拟IP最多支持绑定10台云服务器实例或10张网卡,同一个高可用虚拟IP不能既绑定云服务器实例又绑定网卡。
  • 需确保待绑定云服务器实例或网卡,与高可用虚拟IP在同一子网。
  • 如果高可用虚拟IP要绑定公网IP,可调用AssociateEipAddress进行绑定,其中InstanceType值为HaVip

调试

请求参数

参数名称
类型
是否必选
示例值
描述
ActionStringAssociateHaVip要执行的操作,取值:AssociateHaVip。
VersionString2020-04-01API版本信息,取值为:2020-04-01。

HaVipId

String

havip-2zeo05qre24nhrqpy****

要绑定的高可用虚拟IP的ID。
您可以调用 DescribeHaVips 接口,查询高可用虚拟IP的ID。

InstanceType

String

EcsInstance

绑定高可用虚拟IP的实例的类型。取值如下:

  • EcsInstance(默认):云服务器实例
  • NetworkInterface:网卡

InstanceId

String

i-faf344422ffsfad****

绑定高可用虚拟IP的实例的ID。
您可以调用 DescribeInstancesDescribeNetworkInterfaces 接口,查询云服务器实例的ID或网卡的ID。

说明

如果未指定InstanceType,此参数需传入云服务器实例的ID;如果指定了InstanceType,此参数需传入对应类型实例的ID。

ClientToken

String

123e4567-e89b-12d3-a456-42665544****

客户端Token,用于保证请求幂等性。

  • 由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。
  • 仅支持ASCII字符,且不能超过64个字符。
  • 若不传入ClientToken,则此次API调用不进行幂等校验。

返回数据

参数名称
类型
示例值
描述
RequestIdStringF3CD6886-D8D0-4FEE-B93E-1B732396****请求ID。

请求示例

GET /?Action=AssociateHaVip&Version=2020-04-01&HaVipId=havip-2zeo05qre24nhrqpy****&InstanceId=i-faf344422ffsfad****&InstanceType=EcsInstance HTTP/1.1
Host: open.volcengineapi.com
Service: vpc
Region: cn-beijing

返回示例

{
    "ResponseMetadata": {
        "RequestId": "F3CD6886-D8D0-4FEE-B93E-1B732396****",
        "Action": "AssociateHaVip",
        "Version": "2020-04-01",
        "Service": "vpc",
        "Region": "cn-beijing"
    },
    "Result": {
        "RequestId": "F3CD6886-D8D0-4FEE-B93E-1B732396****"
    }
}

错误码

此处仅展示当前API的错误码,更多错误码请参见公共错误码

HttpCode
错误码
错误信息
描述
400IdempotentParameterMismatchArguments on this idempotent request are inconsistent with arguments used in previous request(s).此幂等请求的参数与前一个请求中使用的参数不一致。
400InvalidHaVip.InvalidStatusThe specified HaVip is not in the correct status for the request.指定的高可用虚拟IP所处状态无法响应该请求。
400InvalidHaVip.NotSupportThe specified HaVip does not support this operation指定的高可用虚拟IP不支持此操作。
400InvalidInstance.HaVipMismatchThe specified instance and HaVip are in different subnets.指定的实例和高可用虚拟IP不在同一个子网内。
400InvalidInstance.InvalidStatusThe specified instance is not in the correct status for the request.指定的ECS实例所处的状态无法响应该请求。
400InvalidInstanceType.MalformedThe specified instance type is malformed.指定的实例类型不合法。
400InvalidParameter.ClientTokenMalformedThe specified parameter ClientToken is malformed.指定的参数ClientToken格式不合法,长度不能超过64个ASCII字符。
400LimitExceeded.HaVipsPerInstanceYou've reached the limit on the number of HaVips that you can associate with an instance.已达到每个实例可绑定的高可用虚拟IP数量上限。
400LimitExceeded.InstancesPerHaVipYou've reached the limit on the number of instances that you can associate with a HaVip.已达到每个高可用虚拟IP可绑定的实例数量上限。
403ForbiddenYou are not authorized to perform operations on the specified elastic network interface. The specified elastic network interface is not attached to ECS.无权限对指定弹性网卡进行操作。指定的弹性网卡绑定的类型不是ECS。
403ForbiddenYou are not authorized to perform operations on the specified HaVip. Cannot bind HaVip to multiple instance types.无权限对指定高可用虚拟IP进行操作。指定的高可用虚拟IP不能同时绑定ECS和弹性网卡。
403ForbiddenYou are not authorized to perform operations on the specified elastic network interface. Cannot associate HaVip with two elastic network interface in the same ECS instance.无权限对指定弹性网卡进行操作。不允许将高可用虚拟IP绑定到同一台ECS上的两张网卡。
403ForbiddenYou are not authorized to perform operations on the specified elastic network interface. The specified elastic network interface is a service-managed elastic network interface.无权限对指定弹性网卡进行操作。指定的弹性网卡为云产品托管的弹性网卡。
403ForbiddenYou are not authorized to perform operations on the specified instance. The specified instance is associated with a HaVip.无权限对指定实例进行操作。指定的实例已经绑定了高可用虚拟IP。
404InvalidEniId.NotFoundThe specified elastic network interface does not exist.指定的弹性网卡不存在。
404InvalidHaVip.NotFoundThe specified HaVip does not exist.指定的高可用虚拟IP不存在。
404InvalidInstance.NotFoundThe specified instance does not exist.指定的ECS实例不存在。
412IdempotentProcessingThe request uses the same client token as a previous one that is still in process.幂等请求处理中。