Adds a secondary CIDR block to a virtual private cloud (VPC).
Usage notes
- You can add at most five secondary IPv4 CIDR blocks to each VPC.
- You can add at most three secondary IPv6 CIDR blocks to each VPC.
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 IPv4 CIDR block. Take note of the following requirements:
In addition, the following requirements must be met:
|
IPv6CidrBlock | String | No | 2408:XXXX:0:6a::/56 |
The secondary IPv6 CIDR block. |
Ipv6Isp | String | No | BGP |
The type of the IPv6 CIDR block. Valid values:
Note If your Alibaba Cloud account is allowed to activate single-ISP bandwidth, valid values
are: ChinaTelecom, ChinaUnicom, and ChinaMobile.
|
IpVersion | String | No | IPV4 |
The version of the IP address. Valid values:
|
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 ID of the request. |
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
&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\t"
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | InvalidCidrBlock.Malformed | Specified CIDR block is not valid. | The error message returned because the format of the specified CIDR block is invalid. |
400 | MissingParam.SecondaryCidrBlockOrIpv6CidrBlock | Either SecondaryCidrBlock or Ipv6CidrBlock must be specified. | The error message returned because the secondary IPv4 CIDR block or the IPv6 CIDR block is not set. |
400 | MissingParam.VpcId | You must specify VpcId. | The error message returned because VpcId is not set. |
403 | Forbbiden | User not authorized to operate on the specified resource. | The error message returned because you are unauthorized to perform this operation on the specified resource. Apply for the required permissions and try again. |
For a list of error codes, visit the Error Center.