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

说明
  • 添加加速網域名稱之前,您需要先開通CDN服務。具體操作,請參見開通CDN服務
  • 加速網域名稱必須已成功備案。
  • 每次只能添加一個加速網域名稱,每個使用者最多可以添加50個網域名稱。
  • 來源站點內容如果不在阿里雲平台上,需進行審核,審核工作會在下一個工作日前完成。
  • 單個使用者的調用頻率為30次/秒。

調試

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

請求參數

名稱 類型 是否必選 樣本值 描述
Action String AddCdnDomain

系統規定參數。取值:AddCdnDomain

CdnType String web

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

  • web:圖片小檔案。
  • download:大檔案下載。
  • video:視音頻點播。
DomainName String .example.com

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

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

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

回源地址清單。

ResourceGroupId String rg-acfmyuji4b6r4**

資源群組ID。

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

CheckUrl String www.yourdomain.com/test.html

健康檢測URL。

Scope String domestic

加速地區。取值:

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

預設取值為domestic

TopLevelDomain String example.com

頂級接入域。

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。

返回資料

名稱 類型 樣本值 描述
RequestId String 15C66C7B-671A-4297-9187-2C4477247A74

請求ID。

樣本

請求樣本

http(s)://cdn.aliyuncs.com/?Action=AddCdnDomain
&CdnType=web
&DomainName=.example.com
&Sources=[{"content":"10.10.10.10","type":"ipaddr","priority":"20","port":80,"weight":"15"}]
&<公用請求參數>

正常返回樣本

XML格式

<AddCdnDomainReesponse>
      <RequestId>15C66C7B-671A-4297-9187-2C4477247A74</RequestId>
</AddCdnDomainReesponse>

JSON格式

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

錯誤碼

HttpCode 錯誤碼 錯誤資訊 描述
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:視音頻點播加速;liveStream:直播流媒體加速。
400 InvalidSources.Malformed Specified Sources is malformed. 來源站點地址格式錯誤。
400 MissingParameter The input parameter sourceType that is mandatory for processing this request is not supplied. 參數sourceType為必填。
400 InvalidSourceType.Malformed Specified CdnType is malformed. CdnType格式錯誤。
400 InvalidScope.Malformed Specified Scope is malformed. Scope格式錯誤。
400 CdnTypeNotSupportExtensiveDomain Extensive domain not supported for this cdn type. 泛網域名稱不支援該業務類型,目前泛網域名稱只支援圖片小檔案加速,大檔案下載加速,ApsaraVideo for VOD加速,請知悉。
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 NotInternationRealIdentity You need to do real name authentication when you use Chinese mainland resources. 根據中華人民共和國法律規定,在中國境內購買使用資訊服務的使用者需要進行實名登記。
400 DomainOwnerVerifyFail Owner verification of the root domain failed. 當您首次將新網域名稱添加至阿里雲CDN時,需按要求做網域名稱歸屬權驗證,當您按要求配置DNS解析或檔案驗證後,才能正常成功添加網域名稱。

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