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

CreateHaVip

最近更新时间2024.04.11 14:29:32

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

调用 CreateHaVip 接口,创建一个高可用虚拟IP(HAVIP)。

说明

高可用虚拟IP功能正在邀测中,如需试用,请联系客户经理。

调用说明

  • 单个账号单个地域最多可创建高可用虚拟IP的数量为20个。
  • 单个VPC内最多可创建高可用虚拟IP的数量为5个。

调试

请求参数

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

SubnetId

String

subnet-bp1s5fn4gn2tws03****

高可用虚拟IP所属子网的ID,该子网将为高可用虚拟IP提供IP地址。
您可以调用 DescribeSubnets 接口,查询子网的ID。

IpAddress

String

192.XX.XX.10

高可用虚拟IP的IP地址。

  • 若填写该参数,则输入的IP地址必须为SubnetId网段中未被占用的IP地址。
  • 若不填该参数,平台会自动从SubnetId网段中随机分配一个未被占用的IP地址。

HaVipName

String

havip-1

高可用虚拟IP的名称。

  • 长度限制为1 ~ 128个字符。
  • 需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短横线(-)。
  • 不填默认为高可用虚拟IP的ID。

Description

String

This is my HaVip.

高可用虚拟IP的描述信息。

  • 长度限制为0~ 255个字符。
  • 需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
  • 不填默认为空字符串。

ClientToken

String

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

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

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

返回数据

参数名称
类型
示例值
描述
HaVipIdStringhavip-2zeo05qre24nhrqpy****新创建高可用虚拟IP的ID。
IpAddressString192.XX.XX.10新创建高可用虚拟IP的IP地址。
RequestIdStringC44F62BE-9CE7-4277-B117-69243F39****请求ID。

请求示例

GET /?Action=CreateHaVip&Version=2020-04-01&SubnetId=subnet-ina9r9xnfpc08gbs****&IpAddress=192.XX.XX.10&HaVipName=havip-1 HTTP/1.1
Host: open.volcengineapi.com 
Service: vpc
Region: cn-beijing

返回示例

{
    "ResponseMetadata": {
        "RequestId": "202201271634510102251100110614****",
        "Action": "CreateHaVip",
        "Version": "2020-04-01",
        "Service": "vpc",
        "Region": "cn-beijing"
    },
    "Result": {
        "RequestId": "202201271634510102251100110614****",
        "HaVipId": "havip-12awu7gcpmdxc17q7y23q****",
        "IpAddress": "192.XX.XX.10"
    }
}

错误码

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

HttpCode
错误码
错误信息
描述
400IdempotentParameterMismatchArguments on this idempotent request are inconsistent with arguments used in previous request(s).此幂等请求的参数与前一个请求中使用的参数不一致。
400InsufficientIpInSubnetThe specified subnet does not contain enough free private IP addresses to fulfill your request.指定子网下可用IP不足。
400InvalidDescription.MalformedThe specified description is malformed.指定的描述格式不合法。请修复描述格式后重试。
400InvalidDescription.MalformedThe specified description is malformed. Ensure the maximum length of description is 255.指定的描述格式不合法。描述长度不能超过255个字符。
400InvalidIpAddress.MalformedThe specified IP address is malformed. Ensure that the IP address of the HaVip is in the range of the CIDR block of the subnet.指定高可用虚拟IP的IP地址不合法。请确保高可用虚拟IP的IP地址必须从属于所在子网的网段。
400InvalidName.MalformedThe specified name is malformed.指定的名称格式不合法。请修复名称格式后重试。
400InvalidName.MalformedThe specified name is malformed. Ensure the maximum length of name is 128.指定的名称格式不合法。名称长度不能超过128个字符。
400InvalidParameter.ClientTokenMalformedThe specified parameter ClientToken is malformed.指定的参数ClientToken格式不合法,长度不能超过64个ASCII字符。
400InvalidPrivateIp.MalformedThe specified private ip is malformed.指定的私网IP不合法。
400QuotaExceeded.HaVipHaVip number exceeded quota.当前账户在一个地域下已达到可创建高可用虚拟IP的数量上限。
400QuotaExceeded.HaVipHaVip number of VPC exceeded quota.当前私有网络已达到可创建高可用虚拟IP的数量上限。
403ForbiddenYou are not authorized to create HaVip.您无权限创建高可用虚拟IP。
404InvalidSubnet.NotFoundThe specified subnet does not exist.指定的子网不存在。
409InvalidIpAddress.InUseThe specified IP address is in use.指定的IP地址已被占用。
412IdempotentProcessingThe request uses the same client token as a previous one that is still in process.幂等请求处理中。