All Products
Search
Document Center

Virtual Private Cloud:AddIpamPoolCidr

Last Updated:Jun 24, 2026

Provisions a CIDR block for an IPAM pool.

Operation description

  • Before provisioning a CIDR block, make sure that you have created an IPAM pool. You can call CreateIpamPool to create an IPAM pool.

  • If the parent pool does not have a provisioned CIDR block, the subpool does not support CIDR block provisioning.

  • If the parent pool has a provisioned CIDR block, the subpool can have a provisioned CIDR block, and the provisioned CIDR block must be a subset of the parent pool's provisioned CIDR block.

  • If the parent pool has a provisioned CIDR block and also has CIDR allocations, the CIDR block provisioned for the subpool must not conflict with the existing CIDR allocations.

  • The request to provision a CIDR block for an IPAM pool must be initiated from the IPAM hosted region.

  • The CIDR block provisioned for an IPAM pool must not conflict with CIDR blocks provisioned for other pools within the same scope.

  • The number of CIDR blocks that can be provisioned for a pool is limited. The default maximum for a public IPv6 top-level pool is 1. The default maximum for other types of pools is 50.

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

RegionId

string

Yes

The ID of the IPAM hosted region.

You can call DescribeRegions to obtain the region ID.

cn-hangzhou

IpamPoolId

string

Yes

The instance ID of the IPAM pool.

ipam-pool-6rcq3tobayc20t****

Cidr

string

No

The CIDR block to provision.

Note

Private top-level pools support provisioning only by specifying a CIDR block.

192.168.1.0/24

NetmaskLength

integer

No

Provisions a CIDR block by specifying a netmask length.

Note

Public IPv6 top-level pools support provisioning only by specifying a netmask length.

24

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run without provisioning a CIDR block for the IPAM pool. The system checks the required parameters, request format, and business limits. If the check fails, the corresponding error is returned. If the check succeeds, the error code DryRunOperation is returned.

  • false (default): sends the request. After the check succeeds, an HTTP 2xx status code is returned and the operation is performed.

false

ClientToken

string

No

The client token that is used to ensure the idempotence of the request. A client-generated value that is unique across different requests. ClientToken supports only ASCII characters.

Note

If you do not specify this parameter, the system uses the RequestId of the API request as the ClientToken. The RequestId is different for each API request.

123e4567-e89b-12d3-a456-426655440000

Response elements

Element

Type

Description

Example

object

BaseResult

RequestId

string

The request ID.

558BC336-8B88-53B0-B4AD-980EE900AB01

Cidr

string

The CIDR block that is successfully provisioned for the IPAM pool.

192.168.1.0/24

Examples

Success response

JSON format

{
  "RequestId": "558BC336-8B88-53B0-B4AD-980EE900AB01",
  "Cidr": "192.168.1.0/24"
}

Error codes

HTTP status code

Error code

Error message

Description

400 IllegalParam.IpVersion The specified IpVersion is illegal. Invalid IpVersion.
400 UnsupportedFeature.PublicIpamScopeType The feature of PublicIpamScopeType is not supported. The IPAM you specified does not support the creation of public scope.
400 IllegalParam.IpamPool The specified IPAM pool cannot be empty. The IPAM pool cannot be empty.
400 OperationDenied.PoolRegionNotSupportAddPoolCidr The operation is not allowed because pool region does not support adding CIDR. The operation was not allowed because the operation to add CIDR could not be performed in the region.
400 OperationDenied.CidrConflictWithTopCidrs The operation is not allowed because the input CIDR conflicts with existing top CIDRs. The operation is not allowed because the input CIDR conflicts with existing top CIDRs.
400 OperationDenied.SourceCidrIsNull The operation is not allowed because the source CIDR is null. The parent pool does not have a CIDR block.
400 OperationDenied.CidrNotInSourceCidr The operation is not allowed because the input CIDR is not in source CIDR. The specified CIDR block does not fall within the CIDR range of the parent pool.
400 ResourceNotFound.SourceIpamPool The dependent source IPAM pool is not found. The dependent resource source IPAM Pool does not exist.
400 OperationDenied.CidrConflictWithExistAllocation The operation is not allowed because the input CIDR conflicts with the existing allocation. The specified CIDR block conflicts with an existing CIDR block.
400 DryRunOperation Request validation has been passed with DryRun flag set.
400 IllegalParam.Cidr The specified CIDR is illegal. The CIDR block is invalid.
400 QuotaExceeded.IpamCidrQuotaPerIpamPool The quota of ipamCidrQuotaPerIpamPool count is exceeded. The number of CIDR blocks in the IPAM pool exceeds the upper limit.
400 OperationDenied.OperateShareResource The operation is not allowed because the instance is a shared resource. The operation is not allowed because the instance is a shared resource.
400 IncorrectStatus.IpamPool The status of the IPAM pool is incorrect. The status of the IPAM pool is incorrect.
400 MissingParam.CidrOrNetmaskLength The Cidr or NetmaskLength must be input. The Cidr or NetmaskLength must be input.
400 Mismatch.CidrAndPoolIpVersion The ip verion of input Cidr is inconsistent with that of the input IPAM pool. The ip verion of input Cidr is inconsistent with that of the input IPAM pool.
400 Mismatch.CidrAndNetmaskLength The mask of the input Cidr is inconsistent with the input NetmaskLength. The mask of the input Cidr is inconsistent with the input NetmaskLength.
400 MissingParam.Cidr The Cidr must be input when adding CIDR for IPAM private top pool. The Cidr must be input when adding CIDR for IPAM private top pool.
400 UnsupportedFeature.AddCidrForIpamPrivateIpv6Pool Adding CIDR for IPAM private IPv6 pool is not supported for this user. Adding CIDR for IPAM private IPv6 pool is not supported for this user.
400 UnsupportedFeature.AddUlaCidrForIpamPublicIpv6Pool Adding ULA CIDR for IPAM public IPv6 pool is not supported. Adding ULA CIDR for IPAM public IPv6 pool is not supported.
400 IllegalParam.NetmaskLength The specified NetmaskLength is illegal. The specified NetmaskLength is illegal.
400 OperationDenied.CidrConflictWithOfficialGuaCidrs The operation is not allowed because the input CIDR conflicts with official GUA CIDRs. The operation is not allowed because the input CIDR conflicts with official GUA CIDRs.
400 OperationDenied.CidrUnavailableInPool The operation is not allowed because the CIDR is unavailable in the IPAM pool. The operation is not allowed because the CIDR is unavailable in the IPAM pool.
400 OperationDenied.AvailableCidrInsufficient The operation is not allowed because available CIDR is insufficient. The operation is not allowed because available CIDR is insufficient.
400 OperationDenied.OfficialCidrInsufficient The operation is not allowed because the official CIDR is insufficient. The operation is not allowed because the official CIDR is insufficient.
400 OperationDenied.OfficialCidrUnavailable The operation is not allowed because the official CIDR is unavailable. The operation is not allowed because the official CIDR is unavailable.
400 OperationDenied.OfficialCidrTmpUnavailable The operation is not allowed because the official CIDR is temporarily unavailable. The operation is not allowed because the official CIDR is temporarily unavailable.
400 UnsupportedFeature.AddUlaCidrForIpamPrivateIpv6Pool Adding ULA CIDR for IPAM private IPv6 pool is not supported for this user.
400 UnsupportedFeature.AddByoipCidrForIpamPrivateIpv6Pool Adding BYOIP CIDR for IPAM private IPv6 pool is not supported for this user.
400 OperationDenied.CidrMaskTooSmall The operation is not allowed because the CIDR mask length %s is smaller than the minimum allowed %s. The CIDR mask length %s is smaller than the minimum allowed value %s.
400 OperationDenied.CidrMaskTooLarge The operation is not allowed because the CIDR mask length %s is larger than the maximum allowed %s. The CIDR mask length %s is larger than the maximum allowed value %s.
404 ResourceNotFound.IpamPool The dependent IPAM pool is not found. The IPAM pool does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.