All Products
Search
Document Center

Virtual Private Cloud:AddIpamPoolCidr

Last Updated:Nov 14, 2025

Provisions a CIDR block for an IPAM pool.

Operation description

  • Before you provision a CIDR block, you must create an IPAM pool by calling the CreateIpamPool operation.

  • You cannot provision a CIDR block for a child pool if its parent pool does not have a provisioned CIDR block.

  • If a parent pool has a provisioned CIDR block, you can provision a CIDR block for its child pool. The CIDR block of the child pool must be a subset of the CIDR block of the parent pool.

  • If a parent pool has a provisioned CIDR block and a CIDR allocation, the CIDR block that you provision for a child pool cannot conflict with the existing CIDR allocation.

  • Requests to provision a CIDR block for an IPAM pool must be sent from the managed region of the IPAM.

  • The CIDR block that you provision for an IPAM pool cannot conflict with the CIDR blocks provisioned for other pools that have the same applicable scope.

  • The number of provisioned CIDR blocks for an IPAM pool is limited. By default, a top-level public IPv6 pool can have a maximum of one provisioned CIDR block. Other types of pools can have a maximum of 50 provisioned CIDR blocks.

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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:AddIpamPoolCidr

update

*All Resource

*

None

None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the hosted region of the IPAM.

Call DescribeRegions to get 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

Provision a CIDR block for a top-level private pool only by entering a CIDR block.

192.168.1.0/24

NetmaskLength

integer

No

The subnet mask of the CIDR block.

Note

Provision a CIDR block for a top-level public IPv6 pool only by entering a mask.

24

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run but does not provision the CIDR block. The system prechecks the required parameters, request syntax, and limits. If the request passes the dry run, the DryRunOperation error code is returned.

  • false (default): sends the request. If the request passes the check, a 2xx HTTP status code is returned and the operation is performed.

false

ClientToken

string

No

A client token that is used to ensure the idempotence of the request. Use the client to generate the token, but make sure that the token is unique among requests. The token can contain only ASCII characters.

Note

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

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.

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.