调用CreateHaVip接口创建高可用虚拟IP(HaVip)。
接口说明
CreateHaVip 接口属于异步接口,即系统会返回 HaVip 的 ID,但该 HaVip 尚未创建完成,系统后台的创建任务仍在进行。您可以调用 DescribeHaVips 查询 HaVip 的创建状态:
当 HaVip 处于 Creating 状态时,表示 HaVip 正在创建中。
当 HaVip 处于 Available 状态时,表示 HaVip 创建完成。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
vpc:CreateHaVip |
create |
*HaVip
*VSwitch
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| Name |
string |
否 |
HaVip 的名称。 名称长度为 1~128 个字符,不能以 |
test |
| ClientToken |
string |
否 |
客户端 Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。 说明
若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 不一样。 |
0c593ea1-3bea-11e9-b96b-88e9fe637760 |
| RegionId |
string |
是 |
HaVip 所在的地域。您可以通过调用 DescribeRegions 接口获取地域 ID。 |
cn-hangzhou |
| VSwitchId |
string |
是 |
HaVip 所属的交换机 ID。 |
vsw-asdfjlnaue4g**** |
| IpAddress |
string |
否 |
HaVip 的 IP 地址。 指定的 IP 地址必须为交换机网段中未被占用的 IP 地址。如果不指定,则从指定的交换机中随机分配一个未被占用的 IP 地址。 |
192.XX.XX.10 |
| Description |
string |
否 |
HaVip 的描述信息。 描述长度为 1~255 个字符,不能以 |
This is my HaVip. |
| ResourceGroupId |
string |
否 |
HaVip 所属的资源组 ID。 |
rg-acfmxazb4ph6aiy**** |
| Tag |
array<object> |
否 |
资源的标签。 |
|
|
object |
否 |
标签。 |
||
| Key |
string |
否 |
资源的标签键。最多支持输入 20 个标签键。如需传入该值,则不能输入空字符串。 一个标签键最多支持 128 个字符,不能以 |
FinanceDept |
| Value |
string |
否 |
资源的标签值。最多支持输入 20 个标签值。如需传入该值,可以输入空字符串。 最多支持 128 个字符,不能以 |
FinanceJoshua |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回信息。 |
||
| RequestId |
string |
请求 ID。 |
C44F62BE-9CE7-4277-B117-69243F3988BF |
| IpAddress |
string |
HaVip 的 IP 地址。 |
192.XX.XX.10 |
| HaVipId |
string |
HaVip 的 ID。 |
havip-2zeo05qre24nhrqpy**** |
示例
正常返回示例
JSON格式
{
"RequestId": "C44F62BE-9CE7-4277-B117-69243F3988BF",
"IpAddress": "192.XX.XX.10",
"HaVipId": "havip-2zeo05qre24nhrqpy****"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidDescription.Malformed | The specified Description is wrongly formed. | 入参Description无效 |
| 400 | InvalidIPAddress.OutOfRange | The specified IPAddress is out of VSwitch CIDR. | |
| 400 | InvalidIPAddress.NotAvailable | The specified IPAddress is not available because it is a system reserved IPAddress. | |
| 400 | InvalidIPAddress.AlreadyUsed | The specified IPAddress is already used by other resource. | |
| 400 | InvalidIPAddress.Malformed | The specified IPAddress is not a valid or strict address. | 传入的IP地址不合法。 |
| 400 | Abs.Vpc.InvalidName.Malformed | The specified Name is not valid. | 传入的Name无效 |
| 400 | InvalidIPAddress.OutOfVswCIDR | The specified IPAddress is out of VSwitch CIDR. | 指定的IP地址超出虚拟交换机(VSwitch)的CIDR段 |
| 400 | InvalidIPAddress.AlreadyInUse | The specified IPAddress is already used by other resource. | 指定的IP地址已经被其他资源使用 |
| 400 | UnsupportedFeature.CloudBoxHaVip | The HAVIP feature is not supported in cloud box. | 云盒不支持创建高可用vip。 |
| 400 | CountLimitExceed.HaVipInVpc | Specified Vpc exceeds the quota of max number of ha-vip count. | |
| 400 | Forbidden.HaVip | No permissions to perform operations on HAVIPs. Please apply for privilege--vpc_privilege_allow_buy_havip_instance. | 操作HaVip没有权限,请到配额中心申请权限。 |
| 400 | OperationDenied.InvalidIpReservedByVSwitch | The specified ip address is the reserved address of the switch. | |
| 400 | InvalidRegionId.NotFound | Specified value of "regionId" is not supported. | |
| 400 | IllegalParam.ResourceGroupId | Invalid ResourceGroupld value. | 指定的资源组非法或不存在 |
| 400 | IncorrectStatus.VSwitch | The specified vSwitch status is invalid. | 虚拟交换机状态异常。 |
| 403 | CountLimitExceed.HaVipInVpc | Specified Vpc exceeds the quota of max number of ha-vip count. | |
| 403 | QuotaExceeded.HaVip | Living HaVip quota exceeded. | |
| 404 | InvalidVSwitchId.NotFound | The specified VSwitch does not exist in the specified region. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。