Adds a CIDR block to an IP address pool.

Usage notes

Before you call this operation, take note of the following limits:

  • The CIDR block and the IP address pool must belong to the same region.
  • The CIDR block and the IP address pool must use the same line type.
  • The AddPublicIpAddressPoolCidrBlock operation is asynchronous. After you send the request, the system returns a request ID. However, the operation is still being performed in the system background. You can call the ListPublicIpAddressPoolCidrBlocks operation to query the status of a CIDR block in an IP address pool:
    • If the CIDR block is in the Modifying state, the CIDR block is being added. In this state, you can only query the CIDR block and cannot perform other operations.
    • If the CIDR block is in the Created state, the CIDR block is added.
  • You cannot repeatedly call the AddPublicIpAddressPoolCidrBlock operation to add a CIDR block to an IP address pool within the specified period of time.

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
Action String Yes AddPublicIpAddressPoolCidrBlock

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

PublicIpAddressPoolId String Yes pippool-6wetvn6fumkgycssx****

The ID of the IP address pool.

CidrBlock String No 47.0.XX.XX/24

The CIDR block.

Note You cannot set the CidrBlock and CidrMask parameters at the same time.
ClientToken String No 02fb3da4-130e-11****

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among all requests. The token can contain only ASCII characters.

DryRun Boolean No false

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run. The system checks the required parameters, request syntax, and limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
  • false (default): performs a dry run and sends the request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
RegionId String Yes cn-chengdu

The region ID of the IP address pool to which you want to add the CIDR block.

CidrMask Integer No 24

The subnet mask of the CIDR block.

After you enter the subnet mask, the system automatically allocates IP addresses.

Valid values: 24 to 30.

Note You cannot set the CidrBlock and CidrMask parameters at the same time. Set one of them.

Response parameters

Parameter Type Example Description
RequestId String 4EC47282-1B74-4534-BD0E-403F3EE64CAF

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=AddPublicIpAddressPoolCidrBlock
&PublicIpAddressPoolId=pippool-6wetvn6fumkgycssx****
&CidrBlock=47.0.XX.XX/24
&ClientToken=02fb3da4-130e-11****
&DryRun=false
&RegionId=cn-chengdu
&CidrMask=24
&Common request parameters

Sample success responses

XML format

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

<AddPublicIpAddressPoolCidrBlockResponse>
    <RequestId>4EC47282-1B74-4534-BD0E-403F3EE64CAF</RequestId>
</AddPublicIpAddressPoolCidrBlockResponse>

JSON format

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

{
  "RequestId" : "4EC47282-1B74-4534-BD0E-403F3EE64CAF"
}

Error codes

HttpCode Error code Error message Description
400 IllegalParam.CidrBlock The param of CidrBlock [%s] is illegal. The error message returned because the CidrBlock parameter is set to an invalid value.
400 IllegalParam.CidrBlockMask The param of CidrBlock Mask [%s] is illegal. The error message returned because the subnet mask of the CIDR block is invalid.
400 ResourceNotFound.CidrBlock The specified resource of CidrBlock is not found. The error message returned because the CIDR block cannot be found.
400 QuotaExceeded.PoolIpQuantity The quota of PoolIpQuantity is exceeded. The error message returned because the number of IP addresses in the pool has reached the upper limit.
400 OperationDenied.OperateSharedResource The operation is not allowed because of the PublicIpAddressPool is a shared resource. The error message returned because the public IP address pool is a shared resource and cannot be modified.
400 MissingParam.CidrBlockOrCidrMask CidrBlock or CidrMask is not specified. The error message returned because the CIDR block or subnet mask is not specified and the system failed to add the CIDR block to the IP address pool.
400 DuplicatedParam.CidrBlockAndCidrMask CidrBlock and CidrMask cannot be specified at the same time. The error message returned because the CIDR block and subnet mask cannot be specified at the same time and the system failed to add the CIDR block to the IP address pool.

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