All Products
Search
Document Center

:CreateHaVip

最終更新日:Aug 16, 2023

Creates a high-availability virtual IP address (HAVIP).

Usage notes

CreateHaVip is an asynchronous operation. After you send the request, the system returns a request ID and runs the task in the background. You can call the DescribeHaVips operation to query the status of the task:

  • If the HAVIP is in the Creating state, the HAVIP is being created.
  • If the HAVIP is in the Available state, the HAVIP is created.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Name String No test

The name of the HAVIP.

The name must be 1 to 128 characters in length and cannot start with http:// or https://.

Action String Yes CreateHaVip

The operation that you want to perform. Set the value to CreateHaVip.

ClientToken String No 0c593ea1-3bea-11e9-b96b-88e9fe637760

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
RegionId String Yes cn-hangzhou

The region ID of the HAVIP. You can call the DescribeRegions operation to query the most recent region list.

VSwitchId String Yes vsw-asdfjlnaue4g****

The ID of the vSwitch to which the HAVIP belongs.

IpAddress String No 192.XX.XX.10

The IP address of the HAVIP.

The specified IP address must be an idle IP address that falls within the CIDR block of the vSwitch. If this parameter is not set, an idle IP address from the CIDR block of the vSwitch is randomly assigned to the HAVIP.

Description String No This is my HaVip.

The description of the HAVIP.

The description must be 1 to 256 characters in length, and cannot start with http:// or https://.

ResourceGroupId String No rg-acfmxazb4ph6aiy****

The ID of the resource group to which the HAVIP belongs.

Tag.N.Key String No FinanceDept

The key of tag N to add to the resource. You can specify at most 20 tag keys. The tag key cannot be an empty string.

A tag key can be at most 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

Tag.N.Value String No FinanceJoshua

The value of tag N to add to the resource. You can specify at most 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length, and cannot contain http:// or https://. The tag value cannot start with aliyun or acs:.

Response parameters

Parameter Type Example Description
RequestId String C44F62BE-9CE7-4277-B117-69243F3988BF

The request ID.

IpAddress String 192.XX.XX.10

The IP address of the HAVIP.

HaVipId String havip-2zeo05qre24nhrqpy****

The ID of the HAVIP.

Examples

Sample requests

http(s)://[Endpoint]/?Name=test
&Action=CreateHaVip
&ClientToken=0c593ea1-3bea-11e9-b96b-88e9fe637760
&RegionId=cn-hangzhou
&VSwitchId=vsw-asdfjlnaue4g****
&IpAddress=192.XX.XX.10
&Description=This is my HaVip.
&ResourceGroupId=rg-acfmxazb4ph6aiy****
&Tag=[{"Key":"FinanceDept","Value":"FinanceJoshua"}]
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateHaVipResponse>
    <RequestId>C44F62BE-9CE7-4277-B117-69243F3988BF</RequestId>
    <IpAddress>192.XX.XX.10</IpAddress>
    <HaVipId>havip-2zeo05qre24nhrqpy****</HaVipId>
</CreateHaVipResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "C44F62BE-9CE7-4277-B117-69243F3988BF",
  "IpAddress" : "192.XX.XX.10",
  "HaVipId" : "havip-2zeo05qre24nhrqpy****"
}

Error codes

HttpCode Error code Error message Description
400 InvalidDescription.Malformed The specified Description is wrongly formed. Description is set to an invalid value.
400 InvalidIPAddress.OutOfRange The specified IPAddress is out of VSwitch CIDR. The private IP address does not fall within the vSwitch CIDR block.
400 InvalidIPAddress.NotAvailable The specified IPAddress is not available because it is a system reserved IPAddress. The specified IP address is reserved by the system and cannot be used.
400 InvalidIPAddress.AlreadyUsed The specified IPAddress is already used by other resource. The specified IP address is in use.
400 InvalidIPAddress.Malformed The specified IPAddress is not a valid or strict address. The specified IP address is invalid.
400 InvalidIPAddress.OutOfVswCIDR The specified IPAddress is out of VSwitch CIDR. The specified IP address does not fall within the CIDR block of the vSwitch.
400 InvalidIPAddress.AlreadyInUse The specified IPAddress is already used by other resource. The specified IP address is being used by other resources.
400 UnsupportedFeature.CloudBoxHaVip The HAVIP feature is not supported in cloud box. You cannot create an HAVIP for a cloud box.
400 CountLimitExceed.HaVipInVpc Specified Vpc exceeds the quota of max number of ha-vip count. The number of HAVIPs in the VPC has reached the upper limit.
400 Forbidden.HaVip No permissions to perform operations on HAVIPs. Please apply for privilege--vpc_privilege_allow_buy_havip_instance. You do not have the permissions to manage the HAVIP. Go to the Quota Center page to acquire the permissions.
403 QuotaExceeded.HaVip Living HaVip quota exceeded. The number of active HAVIPs has reached the upper limit.
404 InvalidRegionId.NotFound Specified value of "regionId" is not supported. The value of RegionId is invalid. Check whether the service is available in the specified region.
404 InvalidVSwitchId.NotFound The specified VSwitch does not exist in the specified region. The specified vSwitch does not exist in the specified region.

For a list of error codes, see Service error codes.