Adds secondary CIDR blocks to a virtual private cloud (VPC).
Usage notes
- The following content describes the limits on the secondary CIDR blocks that can be added:
- You can add up to five secondary IPv4 CIDR blocks to each VPC.
- You can add up to three secondary IPv6 CIDR blocks to each VPC.
- You cannot repeatedly call the AssociateVpcCidrBlock operation within a specific period of time.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
RegionId | String | Yes | ch-hangzhou | The region ID of the VPC to which you want to add a secondary CIDR block. You can call the DescribeRegions operation to query the most recent region list. |
VpcId | String | Yes | vpc-o6wrloqsdqc9io3mg**** | The ID of the VPC. |
SecondaryCidrBlock | String | No | 192.168.0.0/16 | The secondary IPv4 CIDR block. Take note of the following requirements:
In addition, the following requirements must be met:
Note You must specify one of SecondaryCidrBlock and Ipv6CidrBlock. |
IPv6CidrBlock | String | No | 2408:XXXX:0:6a::/56 | The IPv6 CIDR block. Note You must specify one of SecondaryCidrBlock and Ipv6CidrBlock. |
Ipv6Isp | String | No | BGP | The type of the IPv6 CIDR block. Valid values:
Note If your Alibaba Cloud account is allowed to use single-ISP bandwidth, valid values are: ChinaTelecom, ChinaUnicom, and ChinaMobile. |
IpVersion | String | No | IPV4 | The IP version. Valid values:
|
IpamPoolId | String | No | ipam-pool-wxfq2iawjyfizg**** | The ID of the IP Address Management (IPAM) address pool. |
Action | String | Yes | AssociateVpcCidrBlock | The operation that you want to perform. Set the value to AssociateVpcCidrBlock. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | C1221A1F-2ACD-4592-8F27-474E02883159 | The request ID. |
Examples
Sample requests
http(s)://[Endpoint]/?RegionId=ch-hangzhou
&VpcId=vpc-o6wrloqsdqc9io3mg****
&SecondaryCidrBlock=192.168.0.0/16
&IPv6CidrBlock=2408:XXXX:0:6a::/56
&Ipv6Isp=BGP
&IpVersion=IPV4
&IpamPoolId=ipam-pool-wxfq2iawjyfizg****
&Action=AssociateVpcCidrBlock
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<AssociateVpcCidrBlockResponse>
<RequestId>C1221A1F-2ACD-4592-8F27-474E02883159</RequestId>
</AssociateVpcCidrBlockResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "C1221A1F-2ACD-4592-8F27-474E02883159"
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | InvalidCidrBlock.Malformed | Specified CIDR block is not valid. | The format of the specified CIDR block is invalid. |
400 | MissingParam.SecondaryCidrBlockOrIpv6CidrBlock | Either SecondaryCidrBlock or Ipv6CidrBlock must be specified. | The secondary CIDR block or the IPv6 CIDR block is not specified. |
400 | MissingParam.VpcId | You must specify VpcId. | VpcId is not specified. |
403 | Forbbiden | User not authorized to operate on the specified resource. | You are unauthorized to perform this operation on the specified resource. Apply for the required permissions and try again. |
500 | OperationFailed.ResourceNotEnough | Insufficient resources. | The resources that you request are insufficient. If you still want to request the resources, submit a ticket. |
For a list of error codes, see Service error codes.