All Products
Search
Document Center

:AllocateVpcIpv6Cidr

最終更新日:Aug 25, 2023

Reserves an IPv6 CIDR block.

Usage notes

The following section describes how to allocate an IPv6 CIDR block to a virtual private cloud (VPC):

1. Call the AllocateVpcIpv6Cidr operation to reserve an IPv6 CIDR block.

2. If you want to reserve an IPv6 CIDR block for an existing VPC, call AssociateVpcCidrBlock, and specify RegionId and VpcId. Set IPv6CidrBlock to the IPv6 CIDR block and set IpVersion to ipv6. If you want to reserve an IPv6 CIDR block for a new VPC, call CreateVpc and specify RegionId. Set Ipv6CidrBlock to the IPv6 CIDR block and set EnableIpv6to true.

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
RegionId String Yes cn-hangzhou

The ID of the region to which the VPC belongs.

You can call the DescribeRegions operation to query the most recent region list.

ClientToken String No 123e4567-e89b-12d3-a456-426655440000

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.
Ipv6Isp String No BGP

The type of the IPv6 CIDR block. Valid values:

  • BGP (default)
  • ChinaMobile
  • ChinaUnicom
  • ChinaTelecom
Note
  • If you are allowed to use single-ISP bandwidth, you can set the value to ChinaTelecom, ChinaUnicom, and ChinaMobile.
  • You can reserve only one IPv6 CIDR block of each type. After a reserved IPv6 CIDR block of a type is allocated to a VPC, you can reserve another IPv6 CIDR of the type.
Action String Yes AllocateVpcIpv6Cidr

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

AddressPoolType String No custom

The types of IPv6 CIDR blocks. Valid values:

  • aliyun (default)
  • custom
Ipv6CidrBlock String No 2408:XXXX:0:a600::/56

The IPv6 CIDR block that you want to reserve.

Response parameters

Parameter Type Example Description
Ipv6CidrBlock String 2408:XXXX:0:a600::/56

The IPv6 CIDR block that is reserved.

RequestId String D20C13EA-2584-53BC-8393-69DE6D98EFF1

The request ID.

Examples

Sample requests

http(s)://[Endpoint]/?RegionId=cn-hangzhou
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&Ipv6Isp=BGP
&Action=AllocateVpcIpv6Cidr
&AddressPoolType=custom
&Ipv6CidrBlock=2408:XXXX:0:a600::/56
&Common request parameters

Sample success responses

XML format

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

<AllocateVpcIpv6CidrResponse>
    <Ipv6CidrBlock>2408:XXXX:0:a600::/56</Ipv6CidrBlock>
    <RequestId>D20C13EA-2584-53BC-8393-69DE6D98EFF1</RequestId>
</AllocateVpcIpv6CidrResponse>

JSON format

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

{
  "Ipv6CidrBlock" : "2408:XXXX:0:a600::/56",
  "RequestId" : "D20C13EA-2584-53BC-8393-69DE6D98EFF1"
}

Error codes

HttpCode Error code Error message Description
400 OperationUnsupported.Ipv6Feature The IPv6 feature is not supported in the region. This region does not support IPv6.
400 UnsupportedFeature.Ipv6Isp The Ipv6Isp feature is not supported. The specified IPv6 ISP is not supported.
400 IllegalParam.AddressPoolType The specified addressPoolType is invalid. The specified address pool type is invalid.
400 ResourceNotEnough.Ipv6Cidr The specified resource ipv6 cidr is not enough. Insufficient IPv6 CIDR block resources.
400 IllegalParam.Ipv6Cidr The specified Ipv6CidrBlock is invalid. Ipv6CidrBlock is set to an invalid value.
400 Unavailable.Ipv6Cidr The specified resource ipv6 cidr is not available. The specified IPv6 CIDR block is unavailable.

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