AllocateIpv6Address
Invokes the AllocateIpv6Address operation to allocate a free IPv6 address or IPv6 prefix CIDR block. The address is not associated with any resource instance (such as an elastic network interface (ENI) or Network Load Balancer (NLB) instance) and exists as an independent IPv6 address in a virtual private cloud (VPC).
Operation description
Scenarios: After you enable Internet bandwidth for a free IPv6 address, configure an inbound routing rule in the IPv6 gateway route table to direct public IPv6 traffic to an Internet Data Center (IDC) through an Express Connect circuit. This way, IDC resources can provide services over the Internet by using an Alibaba Cloud IPv6 address.
To allocate an IPv6 address to an elastic network interface (ENI) of an ECS instance, invoke the AssignIpv6Addresses operation of ECS.
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 |
The IPv6 address to allocate. The specified IPv6 address must be an idle 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 instance. 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 instance. 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 resource group ID. 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 tag of the resource. |
||
| Key |
string |
No |
The tag key of the resource. You can specify up to 20 tag keys. Do not pass in 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. You can pass in an empty string. The tag value can be up to 128 characters in length and cannot start with aliyun or acs:, or contain http:// or https://. |
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 token, but make sure that the token is unique among different requests. The ClientToken value can contain only ASCII characters. Note
If you do not specify this parameter, the system uses the RequestId of the API request as the ClientToken. The RequestId may be different for each API request. |
02fb3da4-130e-11e9-8e44-0016e04**** |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run. Valid values:
|
false |
| RegionId |
string |
Yes |
地域 ID。 |
cn-hangzhou |
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 resource group ID. |
rg-acfmxazdjdhd**** |
| RequestId |
string |
The request ID. |
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. | 指定的IPv6地址已被分配 |
| 400 | OperationFailed.AddressNotInVSwitchCidr | The operation is failed because of %s. | 指定的IP地址不在vSwitch的网段内,请按API文档参数说明修改后重试。 |
| 400 | IllegalParam.IpAddress | The param of %s is illegal. | 指定的IP地址格式非法,请按API文档参数说明修改后再重试 |
| 400 | OperationFailed.IPv6Disabled | Operation failed because IPv6 is not enabled for the vSwitch. | 指定操作失败,因为IPv6功能未打开。 |
| 400 | OperationFailed.IpPrefixMustInVSwitchCidrReservation | The specified ip prefix must in reserved segment the VSwitch. | 指定的前缀网段必须位于交换机预留网段内 |
| 400 | Forbidden.OperateShareResource | You cannot operate shared resources. | 来自共享的资源不允许操作。 |
| 400 | QuotaExceeded.IPv6PrefixMask | The quota of specifed ipv6 prefix mask is exceeded. | 指定的IPv6前缀掩码超出配额。 |
| 400 | OperationUnsupported.Ipv6Feature | The IPv6 feature is not supported in the region. | 当前地域不支持Ipv6特性。 |
| 400 | IllegalParam.Ipv6Prefix | The param of Ipv6Prefix is illegal. | 指定的入参Ipv6Prefix非法 |
| 400 | OperationFailed.ExistIPv6Used | The operation is failed because of some ipv6 in the ipv6 prefix is already in use. | 由于IPv6前缀中存在IPv6已被使用,操作失败 |
| 400 | OperationUnsupported.UnboundIpv6PrefixFeature | The region does not support creating IPv6 prefix that are not bound to any resources. | 该地域不支持创建未绑定资源的IPv6前缀网段。 |
| 400 | OperationUnsupported.UnboundIpv6Feature | The region does not support creating IPv6 addresses that are not bound to any resources. | 该地域不支持创建未绑定资源的IPv6地址实例。 |
| 400 | OperationUnsupported.FreePrivateIpv6 | This operation does not support free private IPv6 addresses. | 当前不支持分配游离态私网IPv6地址。 |
| 404 | ResourceNotFound.VSwitch | The specified resource of %s is not found. | 指定的vSwitch不存在,请检查您的输入是否正确 |
| 404 | ResourceNotFound.VSwitchCidrReservation | The dependent vswitch cidr reservation is not found. | 依赖资源vSwitchCidrReservation不存在 |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.