AllocateIpv6Address
Invokes the AllocateIpv6Address operation to allocate an unassociated IPv6 address or an IPv6 prefix. The address is not associated with any resource instances, such as elastic network interfaces (ENIs) or Network Load Balancers (NLBs), and exists only as an independent IPv6 address in a virtual private cloud (VPC).
Operation description
Scenarios: After you enable Internet bandwidth for an unassociated IPv6 address, you can configure inbound routing in the IPv6 gateway route table to route Internet IPv6 traffic to the data center through an Express Connect circuit. This allows resources in the data center to provide services to the Internet by using Alibaba Cloud IPv6 addresses.
To allocate an IPv6 address to the elastic network interface (ENI) of an Elastic Compute Service (ECS) instance, call the ECS AssignIpv6Addresses operation.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:AllocateIpv6Address |
create |
*Ipv6Address
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. |
cn-hangzhou |
| VSwitchId |
string |
Yes |
The ID of the vSwitch to which the IPv6 address belongs. |
vsw-asdfjlnaue4g**** |
| Ipv6Address |
string |
No |
Specifies the IPv6 address to be applied for. The specified IPv6 address must be an available IP address within the CIDR block of the vSwitch. |
2408:XXXX:153:3921:851c:c435:7b12:1c5f |
| Ipv6AddressName |
string |
No |
The name of the IPv6 address. The name must be 0 to 128 characters in length and cannot start with |
ipv6-name |
| Ipv6AddressDescription |
string |
No |
The description of the IPv6 address. The description must be 0 to 256 characters in length and cannot start with |
ipv6-description |
| AddressType |
string |
No |
The type of the IPv6 address. Valid values:
|
IPv6Address |
| ResourceGroupId |
string |
No |
The ID of the resource group. For more information about resource groups, see What is a resource group?. |
rg-bp67acfmxazb4ph**** |
| Tag |
array<object> |
No |
The list of tags for the resource. |
|
|
object |
No |
The tags of the resource. |
||
| Key |
string |
No |
The tag key of the resource. You can specify up to 20 tag keys. If you specify this parameter, do not enter an empty string. A tag key can be up to 128 characters in length and cannot start with |
FinanceDept |
| Value |
string |
No |
The tag value of the resource. You can specify up to 20 tag values. If you specify this parameter, you can enter an empty string. A tag value can be up to 128 characters in length and cannot start with |
FinanceJoshua |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, and you must ensure that the value is unique among different requests. The client token can contain only ASCII characters. Note
If you do not specify this parameter, the system automatically uses the RequestId of the API request as the ClientToken. The RequestId of each API request is unique. |
02fb3da4-130e-11e9-8e44-0016e04**** |
| DryRun |
boolean |
No |
Specifies whether to only precheck the request. Valid values:
|
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Ipv6AddressId |
string |
The instance ID of the IPv6 address. |
ipv6-2zen5j4axcp5l5qyy**** |
| Ipv6Address |
string |
The IPv6 address. |
2408:XXXX:153:3921:851c:c435:7b12:1c5f |
| ResourceGroupId |
string |
The ID of the resource group. |
rg-acfmxazdjdhd**** |
| RequestId |
string |
The ID of the request. |
54B48E3D-DF70-471B-AA93-08E683A1B45 |
Examples
Success response
JSON format
{
"Ipv6AddressId": "ipv6-2zen5j4axcp5l5qyy****",
"Ipv6Address": "2408:XXXX:153:3921:851c:c435:7b12:1c5f",
"ResourceGroupId": "rg-acfmxazdjdhd****",
"RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | OperationFailed.IPv6AddressAlreadyAllocated | The operation is failed because of the ipv6 address specified was allocated. | The specified IPv6 address is already allocated |
| 400 | OperationFailed.AddressNotInVSwitchCidr | The operation is failed because of %s. | The specified IP address is not in the vSwitch CIDR block. Please modify it as described in the API document and try again. |
| 400 | IllegalParam.IpAddress | The param of %s is illegal. | The IP address format is invalid. See the API reference and specify a valid IP address. |
| 400 | OperationFailed.IPv6Disabled | Operation failed because IPv6 is not enabled for the vSwitch. | The IPv6 feature is disabled. |
| 400 | OperationFailed.IpPrefixMustInVSwitchCidrReservation | The specified ip prefix must in reserved segment the VSwitch. | The specified prefix network segment must be within the reserved network segment of the switch |
| 400 | Forbidden.OperateShareResource | You cannot operate shared resources. | Shared resources do not support this operation. |
| 400 | QuotaExceeded.IPv6PrefixMask | The quota of specifed ipv6 prefix mask is exceeded. | The specified IPv6 prefix mask exceeds the quota. |
| 400 | OperationUnsupported.Ipv6Feature | The IPv6 feature is not supported in the region. | This region does not support IPv6. |
| 400 | IllegalParam.Ipv6Prefix | The param of Ipv6Prefix is illegal. | The specified input Ipv6Prefix is illegal. |
| 400 | OperationFailed.ExistIPv6Used | The operation is failed because of some ipv6 in the ipv6 prefix is already in use. | The operation failed because IPv6 is already in use in the IPv6 prefix |
| 400 | OperationUnsupported.UnboundIpv6PrefixFeature | The region does not support creating IPv6 prefix that are not bound to any resources. | This region does not support creating IPv6 prefix CIDR blocks that are not bound to resources. |
| 400 | OperationUnsupported.UnboundIpv6Feature | The region does not support creating IPv6 addresses that are not bound to any resources. | The region does not support creating IPv6 address instances that are not bound to resources. |
| 400 | OperationUnsupported.FreePrivateIpv6 | This operation does not support free private IPv6 addresses. | This operation does not support free private IPv6 addresses. |
| 404 | ResourceNotFound.VSwitch | The specified resource of %s is not found. | The specified vSwitch does not exist, please check your input is correct |
| 404 | ResourceNotFound.VSwitchCidrReservation | The dependent vswitch cidr reservation is not found. | Dependent resource vSwitchCidrReservation does not exist |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.