All Products
Search
Document Center

Virtual Private Cloud:AddIpamPoolCidr

Last Updated:Apr 07, 2025

Provisions a CIDR block to an IP Address Manager (IPAM) pool.

Operation description

  • Before you provision a CIDR block, make sure that an IPAM pool is created. You can call the CreateIpamPool operation to create an IPAM pool.
  • If no CIDR block is provisioned to a parent pool, you cannot provision CIDR blocks to its subpools.
  • If a CIDR block is provisioned to a parent pool, you can provision CIDR blocks to its subpools and the CIDR blocks must be subsets of the CIDR block provisioned to the parent pool.
  • If a CIDR block is provisioned to a parent pool and allocations are created, CIDR blocks provisioned to its subpools cannot overlap with existing allocated CIDR blocks.
  • You can provision CIDR blocks to a pool only in the region where the IPAM is hosted.
  • CIDR blocks provisioned to an IPAM pool cannot overlap with the CIDR blocks provisioned to other pools in the same scope.
  • You can provision at most 50 CIDR blocks to each pool.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:AddIpamPoolCidrupdate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The ID of the region where the IPAM instance is hosted.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
IpamPoolIdstringYes

The ID of the IPAM pool.

ipam-pool-6rcq3tobayc20t****
CidrstringYes

The CIDR block that you want to provision.

Note Only IPv4 CIDR blocks are supported.
192.168.1.0/24
DryRunbooleanNo

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service 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 performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
false
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The client token can contain only ASCII characters.

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
123e4567-e89b-12d3-a456-426655440000

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

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

Examples

Sample success responses

JSONformat

{
  "RequestId": "558BC336-8B88-53B0-B4AD-980EE900AB01"
}

Error codes

HTTP status codeError codeError messageDescription
400IllegalParam.IpVersionThe specified IpVersion is illegal.Invalid IpVersion.
400UnsupportedFeature.PublicIpamScopeTypeThe feature of PublicIpamScopeType is not supported.The IPAM you specified does not support the creation of public scope.
400IllegalParam.IpamPoolThe specified IPAM pool cannot be empty.The IPAM pool cannot be empty.
400OperationDenied.PoolRegionNotSupportAddPoolCidrThe 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.
400OperationDenied.CidrConflictWithTopCidrsThe 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.
400OperationDenied.SourceCidrIsNullThe operation is not allowed because the source CIDR is null.The parent pool does not have a CIDR block.
400OperationDenied.CidrNotInSourceCidrThe 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.
400ResourceNotFound.SourceIpamPoolThe dependent source IPAM pool is not found.The dependent resource source IPAM Pool does not exist.
400OperationDenied.CidrConflictWithExistAllocationThe operation is not allowed because the input CIDR conflicts with the existing allocation.The specified CIDR block conflicts with an existing CIDR block.
400DryRunOperationRequest validation has been passed with DryRun flag set.-
400IllegalParam.CidrThe specified CIDR is illegal.The CIDR block is invalid.
400QuotaExceeded.IpamCidrQuotaPerIpamPoolThe quota of ipamCidrQuotaPerIpamPool count is exceeded.The number of CIDR blocks in the IPAM pool exceeds the upper limit.
400OperationDenied.OperateShareResourceThe operation is not allowed because the instance is a shared resource.The operation is not allowed because the instance is a shared resource.
400IncorrectStatus.IpamPoolThe status of the IPAM pool is incorrect.The status of the IPAM pool is incorrect.
404ResourceNotFound.IpamPoolThe dependent IPAM pool is not found.The IPAM pool does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2025-02-27The Error code has changedView Change Details
2024-09-12The Error code has changedView Change Details