全部產品
Search
文件中心

Virtual Private Cloud:AddIpamPoolCidr

更新時間:Jun 24, 2026

為 IPAM 位址池預置 CIDR 位址段。

介面說明

  • 預置 CIDR 前,請確保您已經建立了 IPAM 位址池。您可以透過呼叫 CreateIpamPool 建立位址池。

  • 若父位址池沒有預置 CIDR,則子位址池不支援預置 CIDR。

  • 若父位址池預置了 CIDR,則子位址池可以預置 CIDR 且預置的 CIDR 必須是父位址池預置 CIDR 的子集。

  • 若父位址池預置了 CIDR 同時也建立了 CIDR 分配,則子位址池預置的 CIDR 不能和已建立的 CIDR 分配衝突。

  • 為位址池預置 CIDR 位址段的請求需要從 IPAM 託管地域發起。

  • 為 IPAM 位址池預置的 CIDR 不能和相同作用範圍內其他位址池預置的 CIDR 衝突。

  • 位址池預置 CIDR 的數量存在限制,公網 IPv6 頂級池預設最多為 1 個,其餘類型的位址池預設最多為 50 個。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

當前API暫無授權資訊透出。

請求參數

名稱

類型

必填

描述

樣本值

RegionId

string

IPAM 託管地域 ID。

您可以透過呼叫 DescribeRegions 介面取得地域 ID。

cn-hangzhou

IpamPoolId

string

IPAM 位址池的執行個體 ID。

ipam-pool-6rcq3tobayc20t****

Cidr

string

要預置的 CIDR 位址段。

說明

私網頂級池僅支援透過輸入 CIDR 位址段的方式進行預置。

192.168.1.0/24

NetmaskLength

integer

透過遮罩的方式預置 CIDR 位址段。

說明

公網 IPv6 頂級池僅支援透過遮罩的方式進行預置。

24

DryRun

boolean

是否只預檢此次請求。取值:

  • true:傳送檢查請求,不會為 IPAM 位址池預置 CIDR 位址段。檢查項包括是否填寫了必需參數、請求格式、業務限制。如果檢查不通過,則返回對應錯誤。如果檢查通過,則返回錯誤碼 DryRunOperation。

  • false(預設值):傳送正常請求,通過檢查後返回 HTTP 2xx 狀態碼並直接進行操作。

false

ClientToken

string

用戶端 Token,用於保證請求的冪等性。從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元。

說明

若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 標識。每次 API 請求的 RequestId 不一樣。

123e4567-e89b-12d3-a456-426655440000

返回參數

名稱

類型

描述

樣本值

object

BaseResult

RequestId

string

請求 ID。

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

Cidr

string

位址池成功預置的 CIDR 位址段。

192.168.1.0/24

樣本

正常返回樣本

JSON格式

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

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 IllegalParam.IpVersion The specified IpVersion is illegal.
400 UnsupportedFeature.PublicIpamScopeType The feature of PublicIpamScopeType is not supported.
400 IllegalParam.IpamPool The specified IPAM pool cannot be empty.
400 OperationDenied.PoolRegionNotSupportAddPoolCidr The operation is not allowed because pool region does not support adding CIDR.
400 OperationDenied.CidrConflictWithTopCidrs 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.
400 OperationDenied.CidrNotInSourceCidr The operation is not allowed because the input CIDR is not in source CIDR.
400 ResourceNotFound.SourceIpamPool The dependent source IPAM pool is not found.
400 OperationDenied.CidrConflictWithExistAllocation The operation is not allowed because the input CIDR conflicts with the existing allocation.
400 DryRunOperation Request validation has been passed with DryRun flag set.
400 IllegalParam.Cidr The specified CIDR is illegal.
400 QuotaExceeded.IpamCidrQuotaPerIpamPool The quota of ipamCidrQuotaPerIpamPool count is exceeded.
400 OperationDenied.OperateShareResource The operation is not allowed because the instance is a shared resource.
400 IncorrectStatus.IpamPool The status of the IPAM pool is incorrect.
400 MissingParam.CidrOrNetmaskLength 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.
400 Mismatch.CidrAndNetmaskLength 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.
400 UnsupportedFeature.AddCidrForIpamPrivateIpv6Pool 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.
400 IllegalParam.NetmaskLength The specified NetmaskLength is illegal.
400 OperationDenied.CidrConflictWithOfficialGuaCidrs 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.
400 OperationDenied.AvailableCidrInsufficient The operation is not allowed because available CIDR is insufficient.
400 OperationDenied.OfficialCidrInsufficient 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.
400 OperationDenied.OfficialCidrTmpUnavailable 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.
400 OperationDenied.CidrMaskTooLarge The operation is not allowed because the CIDR mask length %s is larger than the maximum allowed %s.
404 ResourceNotFound.IpamPool The dependent IPAM pool is not found.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情