全部產品
Search
文件中心

:AddCdnDomain - 添加網域名稱

更新時間:Aug 21, 2025

調用AddCdnDomain添加加速網域名稱。

介面說明

  • 添加網域名稱之前,您需要先開通 CDN 服務。具體操作,請參見開通 CDN 服務

  • 加速網域名稱必須已成功備案。

  • 每次只能添加一個加速網域名稱,每個使用者最多可以添加 50 個網域名稱。

  • 來源站點內容如果不在阿里雲平台上,需進行審核,審核工作會在下一個工作日前完成。

  • 單個使用者的調用頻率:30 次/秒。

注意事項

  • 通過介面添加了網域名稱之後,將會有 3~5 分鐘的網域名稱生效時間,在這段時間內請不要添加任何配置,待網域名稱狀態處於 online 以後再進行下一步的配置。

調試

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

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

cdn:AddCdnDomain

create

*Domain

acs:cdn:*:{#accountId}:domain/{#DomainName}

請求參數

名稱

類型

必填

描述

樣本值

CdnType

string

加速網域名稱的業務類型。取值:

  • web:圖片小檔案。

  • download:大檔案下載。

  • video:視音頻點播。

web

DomainName

string

需要接入 CDN 的加速網域名稱。

支援泛網域名稱,以英文句號(.)開頭,例如.example.com。

.example.com

ResourceGroupId

string

資源群組 ID。

不傳該參數時,系統自動補全為預設資源群組 ID。

rg-acfmyuji4b6r4**

Sources

string

回源地址清單。

[ { "content": "192.0.2.0", "type": "ipaddr", "priority": "20", "port": 80, "weight": "15" } ]

CheckUrl

string

健康檢測 URL。

www.example.com/test.html

Scope

string

加速地區。取值:

  • domestic(預設值):僅中國內地。

  • overseas:全球(不包含中國內地)。

  • global:全球。

domestic

TopLevelDomain

string

頂級接入域。

example.com

Tag

array<object>

標籤資訊列表。最大可填入 20 個標籤資訊。

object

Key

string

標籤鍵。

env

Value

string

標籤值。

value

Sources 參數的各欄位含義如下表所示。

參數

類型

是否必選

描述

type

String

來源站點類型。取值:
ipaddr:IP 來源站點。
domain:標題來源站。
oss:OSS Bucket 為來源站點。
fc_domain:Function Compute為來源站點。










content

String

回源地址,可以是 IP 或網域名稱。

port

Integer

連接埠。
您可以指定 443 或 80 連接埠,也可以自訂連接埠,預設值為 80 連接埠。443 連接埠支援 HTTPS 協議回源。

priority

String

來源站點地址對應的優先順序。
支援 20 和 30,預設值為 20。20 是主源,30 是備源。

weight

String

回源權重,取值範圍為 100 以內,預設值為 10。

返回參數

名稱

類型

描述

樣本值

object

RequestId

string

請求 ID。

15C66C7B-671A-4297-9187-2C4477247A74

樣本

正常返回樣本

JSON格式

{
  "RequestId": "15C66C7B-671A-4297-9187-2C4477247A74"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 InvalidDomainName.Malformed Specified DomainName is malformed. 網域名稱格式錯誤或批量新增不支援泛網域名稱。
400 MissingParameter The input parameter cdnType that is mandatory for processing this request is not supplied. 參數cdnType為必填。
400 InvalidCdnType.Malformed Specified CdnType is malformed. 參數CdnType不支援該參數值, 取值:web:圖片及小檔案分發;download:大檔案下載加速;video:視音頻點播加速;
400 InvalidSources.Malformed Specified Sources is malformed. 來源站點地址格式錯誤。
400 InvalidSourceType.Malformed Specified CdnType is malformed. CdnType格式錯誤。
400 InvalidSource.Priority.Malformed The specified Source Priority is invalid.
400 InvalidTypeAndContent.MissMatch The specified source type does not match the specified source content.
400 InvalidScope.Malformed Specified Scope is malformed. Scope格式錯誤。
400 SourceIp.Exceed The Certificate you provided is malformed 認證格式不正確。
400 InvalidCertificate The Certificate you provided is malformed 認證格式不正確。
400 InvalidCertificate.TooLong The Certificate you provided is over the max length 認證和私密金鑰長度超出限制。
400 InnerAddDomainDenied Your account has not bind aoneId, can not add domain. 您的帳戶沒有綁定aoneId,不能添加網域名稱。
400 CheckSourceHealthFailed sources ip or source domain check health failed,please input right source. 源IP或源域檢查錯誤, 請輸入正確的源。
400 ExtensiveAndAllBothExist Extensive domain and the domain begins with all. can not exist at the same time. 泛網域名稱與all.開頭網域名稱不能同時存在。
400 CdnTypeNotSupportExtensiveDomain Extensive domain not supported for this cdn type. 泛網域名稱不支援該業務類型,目前泛網域名稱只支援圖片小檔案加速,大檔案下載加速,ApsaraVideo for VOD加速,請知悉。
400 ExtensiveAndSpecificDomainConflict The number of wildcard domain names exceeds the limit.
400 InvalidResourceGroupId.Malformed Specified ResourceGroupId is malformed. 參數ResourceGroupId格式錯誤。
400 DomainReserved The root domain of your domain is reserved by another account. Submit a ticket to contact customer support.
400 InvalidDomainNameLevel Domain name suffixed with alicdn.com only support third level. alicdn.com(針對泛網域名稱)最多支援第三層網域名。
400 InvalidTopLevelDomain.Malformed Specified TopLevelDomain is malformed. 參數TopLevelDomain錯誤。
400 TopLevelDomain.NotFound TopLevelDomain is not exist. TopLevelDomain不存在。
400 EntityNotExists.ResourceGroup The resource group does not exist. 資源群組不存在。
400 EntityNotExist.ResourceGroup The resource group does not exist. 該資源群組不存在。
400 InvalidStatus.ResourceGroup It is not allowed to do this operation because of the current status of resource-group. 資源群組目前狀態不允許進行此操作。
400 NotInternationRealIdentity You need to do real name authentication when you use Chinese mainland resources. 根據中華人民共和國法律規定,在中國境內購買使用資訊服務的使用者需要進行實名登記。
400 Abs.CheckUrl.Malformed The CheckUrl you provided is malformed.
400 RecordCheckNotAvailable The ICP filing interface is unavailable. Please try again later.
400 IcpBlack The domain is on the ICP blacklist.
400 IspBlack The domain is on the ISP blacklist.
400 DomainOwnerVerifyFail Owner verification of the root domain failed. 當您首次將新網域名稱添加至阿里雲CDN時,需按要求做網域名稱歸屬權驗證,當您按要求配置DNS解析或檔案驗證後,才能正常成功添加網域名稱。 
400 TopLevelDomain.Mismatch The specified TopLevelDomain does not match webSiteType. 頂級接入域和網域名稱類型不符。
400 DomainInBlacklist The domain is in the blacklist. 該網域名稱在黑名單中。
400 InvalidTagKey The specified TagKey is invalid. 參數TagKey無效。
400 InvalidTagValue The specified TagValue is invalid.
400 InvalidTagKey.Repeated The specified TagKey is duplicated.
400 InvalidTag The specified Tag is Invalid.
400 InvalidTagKey.OverLimit The number of Tag can not over limit 20.
400 SourceInBlacklist Source is in the blacklist. 來源站點在黑名單中。
400 ReservedTagKey The tag key is used internally as a reserved field and is not allowed to be used. 該標籤鍵被用作內部保留欄位,不允許使用。
400 DomainOverLimit The maximum number of domains is exceeded. 網域名稱數量超過上限
400 DomainInRiskList The domain you added may be at risk. If you have any questions, please submit a ticket. 您所添加的網域名稱可能存在風險,如有任何疑問,請提交工單。
400 RegionNoResource Resource allocation failed. Please submit a work order to contact customer service. 資源分派失敗,請提交工單聯絡客服。
403 AccountException Account exception. Please open ticket to make an appeal.

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

變更歷史

更多資訊,參考變更詳情