调用BatchAddCdnDomain可以实现批量添加加速域名,一次最多可以添加50个加速域名。
接口说明
添加加速域名之前,必须先开通 CDN 服务。具体操作,请参见开通 CDN 服务。
如果加速区域选择的是仅中国内地或者全球,则加速域名必须已完成备案。
支持批量查询域名,多个域名用半角逗号(,)分隔,一次最多支持 50 个域名查询。
每个用户每小时最多调用 100 次。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
cdn:BatchAddCdnDomain |
create |
*Domain
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| CdnType |
string |
是 |
加速域名的业务类型。取值:
|
web |
| DomainName |
string |
是 |
需要接入 CDN 的加速域名,多个域名用英文逗号(,)分隔。 |
example.com,aliyundoc.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。 |
url |
| Scope |
string |
否 |
加速区域。取值:
|
domestic |
| TopLevelDomain |
string |
否 |
顶级接入域。 |
example.com |
Sources 各字段含义如下所示。
| 参数 | 类型 | 是否必选 | 描述 |
| type | String | 是 | 源站类型。 ipaddr:IP 源站。 domain:域名源站。 oss:OSS Bucket 为源站。 fc_domain:函数计算源站。 |
| content | String | 是 | 回源地址,可以是 IP 或域名。 |
| port | Integer | 否 | 端口,可以指定 443、80(默认值),也可以自定义端口。443 是 HTTPS 协议回源。 |
| priority | String | 否 | 源站地址对应的优先级,支持 20(默认值)和 30。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 | InvalidTypeAndContent.MissMatch | |
| 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. | 泛域名不支持该业务类型,目前泛域名只支持图片小文件加速,大文件下载加速,视频点播加速,请知悉。 |
| 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 | 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 | 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. | 您所添加的域名可能存在风险,如有任何疑问,请提交工单。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。