All Products
Search
Document Center

Virtual Private Cloud:CreateHaVip

Last Updated:Nov 13, 2024

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

Operation description

CreateHaVip is an asynchronous operation. After a request is sent, 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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:CreateHaVipcreate
  • HaVip
    acs:vpc:{#regionId}:{#accountId}:havip/*
  • VSwitch
    acs:vpc:{#regionId}:{#accountId}:vswitch/{#VSwitchId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
NamestringNo

The name of the HAVIP.

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

test
ClientTokenstringNo

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

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

Note If you do not specify this parameter, ClientToken is set to the value of RequestId. The value of RequestId for each API request may be different.
0c593ea1-3bea-11e9-b96b-88e9fe637760
RegionIdstringYes

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

cn-hangzhou
VSwitchIdstringYes

The ID of the vSwitch to which the HAVIP belongs.

vsw-asdfjlnaue4g****
IpAddressstringNo

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.

192.XX.XX.10
DescriptionstringNo

The description of the HAVIP.

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

This is my HaVip.
ResourceGroupIdstringNo

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

rg-acfmxazb4ph6aiy****
Tagarray<object>No

The tag of the resource.

objectNo
KeystringNo

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

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

FinanceDept
ValuestringNo

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

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

FinanceJoshua

Response parameters

ParameterTypeDescriptionExample
object

The returned information.

RequestIdstring

The ID of the request.

C44F62BE-9CE7-4277-B117-69243F3988BF
IpAddressstring

The IP address of the HAVIP.

192.XX.XX.10
HaVipIdstring

The ID of the HAVIP.

havip-2zeo05qre24nhrqpy****

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400InvalidDescription.MalformedThe specified Description is wrongly formed.The error message returned because the Description parameter is set to an invalid value.
400InvalidIPAddress.OutOfRangeThe specified IPAddress is out of VSwitch CIDR.The private IP address does not fall within the vSwitch CIDR block.
400InvalidIPAddress.NotAvailableThe 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.
400InvalidIPAddress.AlreadyUsedThe specified IPAddress is already used by other resource.The specified IP address is in use.
400InvalidIPAddress.MalformedThe specified IPAddress is not a valid or strict address.The specified IP address is invalid.
400Abs.Vpc.InvalidName.MalformedThe specified Name is not valid.-
400InvalidIPAddress.OutOfVswCIDRThe specified IPAddress is out of VSwitch CIDR.The IP address does not fall within the CIDR block of the vSwitch.
400InvalidIPAddress.AlreadyInUseThe specified IPAddress is already used by other resource.The IP address is being used by other resources.
400UnsupportedFeature.CloudBoxHaVipThe HAVIP feature is not supported in cloud box.-
400CountLimitExceed.HaVipInVpcSpecified Vpc exceeds the quota of max number of ha-vip count.The number of HAVIPs in the VPC has reached the upper limit.
400Forbidden.HaVipNo permissions to perform operations on HAVIPs. Please apply for privilege--vpc_privilege_allow_buy_havip_instance.The error message returned because you do not have the permissions to manage the HAVIP. Go to the Quota Center page to acquire the permissions.
403QuotaExceeded.HaVipLiving HaVip quota exceeded.The number of active HAVIPs exceeds the upper limit.
404InvalidRegionId.NotFoundSpecified value of "regionId" is not supported.RegionId is set to an invalid value. Check whether the service is available in the specified region and try again.
404InvalidVSwitchId.NotFoundThe specified VSwitch does not exist in the specified region.The vSwitch does not exist in the specified region.
404IllegalParam.ResourceGroupIdInvalid ResourceGroupld value.The specified resource group is invalid or does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-09-06The Error code has changedView Change Details
2023-07-05The Error code has changed. The request parameters of the API has changedView Change Details