All Products
Search
Document Center

Elastic IP Address:AddPublicIpAddressPoolCidrBlock

Last Updated:Aug 28, 2026

Adds a CIDR block to an IP address pool.

Operation description

Before you call this operation, note 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.

  • AddPublicIpAddressPoolCidrBlock is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. Call ListPublicIpAddressPoolCidrBlocks to query the task status.

    • If the CIDR block is in the Modifying state, it is being added. You can only query the CIDR block in this state.

    • If the CIDR block is in the Created state, it has been added.

  • Do not call AddPublicIpAddressPoolCidrBlock repeatedly within the specified period of time.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

PublicIpAddressPoolId

string

Yes

The ID of the IP address pool.

pippool-6wetvn6fumkgycssx****

CidrBlock

string

No

The CIDR block.

Note

You can specify only one of CidrBlock and CidrMask.

47.0.XX.XX/24

ClientToken

string

No

The client token that ensures the idempotence of the request.

You can use the client to generate the token, but it must be unique across requests. The token can contain only ASCII characters.

Note

If you do not specify this parameter, the system uses the request ID as the client token. The request ID may differ for each request.

02fb3da4-130e-11****

DryRun

boolean

No

Specifies whether to perform only a dry run. Valid values:

  • true: performs a dry run without executing the operation. The system checks for missing parameters, syntax errors, and service limits. If the check fails, an error message is returned. If the check passes, the DryRunOperation error code is returned.

  • false (default): performs a dry run and then executes the operation. If the dry run passes, a 2xx HTTP status code is returned.

false

RegionId

string

Yes

The region ID of the IP address pool.

cn-chengdu

CidrMask

integer

No

The subnet mask of the CIDR block. The system automatically allocates IP addresses based on this mask.

Valid values: 24 to 28.

Note

You can specify only one of CidrBlock and CidrMask.

24

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

4EC47282-1B74-4534-BD0E-403F3EE64CAF

CidrBlock

string

The CIDR block.

47.0.XX.XX/28

Examples

Success response

JSON format

{
  "RequestId": "4EC47282-1B74-4534-BD0E-403F3EE64CAF",
  "CidrBlock": "47.0.XX.XX/28"
}

Error codes

HTTP status code

Error code

Error message

Description

400 IllegalParam.CidrBlock The param of CidrBlock [%s] is illegal. The CidrBlock parameter is set to an invalid value.
400 IllegalParam.CidrBlockMask The param of CidrBlock Mask [%s] is illegal. The subnet mask of the CIDR block is invalid.
400 IncorrectStatus.PublicIpAddressPool The status of PublicIpAddressPool [%s] is incorrect.
400 OperationDenied.CidrBlockBelongToOtherUser The operation is not allowed because of CidrBlock belong to other user.
400 ResourceNotFound.PublicIpAddressPool The specified resource ofPublicIpAddressPool [%s] is not found.
400 QuotaExceeded.PoolIpQuantity The quota of PoolIpQuantity is exceeded. The IP address pool has reached its maximum IP address count.
400 OperationDenied.OperateSharedResource The operation is not allowed because of the PublicIpAddressPool is a shared resource. Shared IP address pools cannot be modified.
400 MissingParam.CidrBlockOrCidrMask CidrBlock or CidrMask is not specified. CidrBlock or CidrMask must be specified to add a CIDR block to the pool.
400 DuplicatedParam.CidrBlockAndCidrMask CidrBlock and CidrMask cannot be specified at the same time. CidrBlock and CidrMask cannot both be specified.
400 Forbidden.FinancialLocked The instance is locked due to outstanding payments. The instance is locked due to overdue payments.
400 ResourceNotEnough.CidrBlock The specified resource is not enough. The specified resource is not enough.
400 MissingParam.PublicIpAddressPoolId The parameter PublicIpAddressPoolId is missing. The parameter PublicIpAddressPoolId is missing.
400 OperationFailed.ResourceNotEnough Insufficient resources. Insufficient resources. Submit a ticket to request more.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.