調用BatchAddCdnDomain大量新增加速網域名稱,一個使用者最多可以添加20個網域名稱。
说明
- 添加加速網域名稱之前,必須先開通CDN服務。具體操作,請參見開通CDN服務。
- 加速網域名稱必須已成功備案。
- 如果來源站點內容不在阿里雲平台上,需要審核,審核工作會在下一個工作日前完成。
- 單使用者調用頻率:30次/秒。
- 單次配置的網域名稱數量不超過50個。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
請求參數
名稱 | 類型 | 是否必選 | 樣本值 | 描述 |
---|---|---|---|---|
Action | String | 是 | BatchAddCdnDomain |
系統規定參數。 取值:BatchAddCdnDomain。 |
CdnType | String | 是 | web |
加速網域名稱的業務類型。取值:
|
DomainName | String | 是 | example1.com,example2.com |
需要接入CDN的加速網域名稱,多個網域名稱用英文逗號(,)分隔。 |
Sources | String | 是 | [{"content":"1.1.1.1","type":"ipaddr","priority":"20","port":80,"weight":"15"}] |
回源地址清單。 |
ResourceGroupId | String | 否 | rg-acfmyuji4b6r4** |
資源群組ID,不傳時,自動補全預設資源群組ID。 |
CheckUrl | String | 否 | url |
檢測URL。 |
Scope | String | 否 | domestic |
加速地區。取值:
|
TopLevelDomain | String | 否 | www.yourdomain.com |
頂級接入域。 |
Sources各欄位含義如下所示。
參數 |
類型 |
是否必選 |
描述 |
---|---|---|---|
type |
String |
是 |
來源站點類型。 ipaddr:IP來源站點。 domain:標題來源站。 oss:OSS Bucket為來源站點。 fc_domain:Function Compute來源站點。 |
content |
String |
是 |
回源地址,可以是IP或網域名稱。 |
port |
Integer |
否 |
連接埠,可以指定443、80(預設值),也可以自訂連接埠。443是HTTPS協議回源。 |
priority |
String |
否 |
來源站點地址對應的優先順序,支援20(預設值)和30。20是主源,30是備源。 |
weight |
String |
否 |
回源權重,100以內,預設值為10。 |
返回資料
名稱 | 類型 | 樣本值 | 描述 |
---|---|---|---|
RequestId | String | 15C66C7B-671A-4297-9187-2C4477247A74 |
請求ID。 |
樣本
請求樣本
http(s)://cdn.aliyuncs.com/?Action=BatchAddCdnDomain
&CdnType=web
&DomainName=example1.com,example2.com
&Sources=[{"content":"1.1.1.1","type":"ipaddr","priority":"20","port":80,"weight":"15"}]
&<公用請求參數>
正常返回樣本
XML
格式
<BatchAddCdnDomainResponse>
<RequestId>15C66C7B-671A-4297-9187-2C4477247A74</RequestId>
</BatchAddCdnDomainResponse>
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解析或檔案驗證後,才能正常成功添加網域名稱。 |
訪問錯誤中心查看更多錯誤碼。