文档

BatchAddCdnDomain - 批量添加域名

更新时间:

调用BatchAddCdnDomain可以实现批量添加加速域名,一次最多可以添加50个加速域名。

接口说明

  • 添加加速域名之前,必须先开通 CDN 服务。具体操作,请参见开通 CDN 服务
  • 如果加速区域选择的是仅中国内地或者全球,则加速域名必须已完成备案。
  • 支持批量查询域名,多个域名用半角逗号(,)分隔,一次最多支持 50 个域名查询。
  • 其他配置相关的详细说明,具体请参见添加加速域名
  • 单用户调用频率:30 次/秒。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
cdn:BatchAddCdnDomainWrite
  • Domain
    acs:cdn:*:{#accountId}:domain/*

请求参数

名称类型必填描述示例值
CdnTypestring

加速域名的业务类型。取值:

  • web:图片小文件。

  • download:大文件下载。

  • video:视音频点播。

web
DomainNamestring

需要接入 CDN 的加速域名,多个域名用英文逗号(,)分隔。

example.com,aliyundoc.com
ResourceGroupIdstring

资源组 ID,不传时,自动补全默认资源组 ID。

rg-acfmyuji4b6r4**
Sourcesstring

回源地址列表。

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

检测 URL。

url
Scopestring

加速区域。取值:

  • domestic:仅中国内地。

  • overseas:全球(不包含中国内地)。

  • global:全球。

domestic
TopLevelDomainstring

顶级接入域。

example.com

Sources 各字段含义如下所示。

参数类型是否必选描述
typeString源站类型。
ipaddr:IP 源站。
domain:域名源站。
oss:OSS Bucket 为源站。
fc_domain:函数计算源站。
contentString回源地址,可以是 IP 或域名。
portInteger端口,可以指定 443、80(默认值),也可以自定义端口。443 是 HTTPS 协议回源。
priorityString源站地址对应的优先级,支持 20(默认值)和 30。20 是主源,30 是备源。
weightString回源权重,100 以内,默认值为 10。

返回参数

名称类型描述示例值
object
RequestIdstring

请求 ID。

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

示例

正常返回示例

JSON格式

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

错误码

HTTP status code错误码错误信息描述
400InvalidDomainName.MalformedSpecified DomainName is malformed.域名格式错误或批量新增不支持泛域名。
400MissingParameterThe input parameter cdnType that is mandatory for processing this request is not supplied.参数cdnType为必填。
400InvalidCdnType.MalformedSpecified CdnType is malformed.参数CdnType不支持该参数值, 取值:web:图片及小文件分发;download:大文件下载加速;video:视音频点播加速;
400InvalidSources.MalformedSpecified Sources is malformed.源站地址格式错误。
400MissingParameterThe Source Content must be specified.-
400MissingParameterThe input parameter sourceType that is mandatory for processing this request is not supplied.参数sourceType为必填。
400InvalidSourceType.MalformedSpecified CdnType is malformed.CdnType格式错误。
400InvalidSource.Priority.MalformedThe specified Source Priority is invalid.-
400InvalidTypeAndContent.MissMatchInvalidTypeAndContent.MissMatch-
400InvalidScope.MalformedSpecified Scope is malformed.Scope格式错误。
400SourceIp.ExceedThe Certificate you provided is malformed证书格式不正确。
400InvalidCertificateThe Certificate you provided is malformed证书格式不正确。
400InvalidCertificate.TooLongThe Certificate you provided is over the max length证书和私钥长度超出限制。
400InnerAddDomainDeniedYour account has not bind aoneId, can not add domain.您的帐户没有绑定aoneId,不能添加域名。
400CheckSourceHealthFailedsources ip or source domain check health failed,please input right source.源IP或源域检查错误, 请输入正确的源。
400ExtensiveAndAllBothExistExtensive domain and the domain begins with all. can not exist at the same time.泛域名与all.开头域名不能同时存在。
400CdnTypeNotSupportExtensiveDomainExtensive domain not supported for this cdn type.泛域名不支持该业务类型,目前泛域名只支持图片小文件加速,大文件下载加速,视频点播加速,请知悉。
400ExtensiveAndSpecificDomainConflictThe number of wildcard domain names exceeds the limit.-
400InvalidResourceGroupId.MalformedSpecified ResourceGroupId is malformed.参数ResourceGroupId格式错误。
400DomainReservedThe root domain of your domain is reserved by another account. Submit a ticket to contact customer support.-
400InvalidDomainNameLevelDomain name suffixed with alicdn.com only support third level.alicdn.com(针对泛域名)最多支持三级域名。
400InvalidTopLevelDomain.MalformedSpecified TopLevelDomain is malformed.参数TopLevelDomain错误。
400TopLevelDomain.NotFoundTopLevelDomain is not exist.TopLevelDomain不存在。
400EntityNotExists.ResourceGroupThe resource group does not exist.资源组不存在。
400EntityNotExist.ResourceGroupThe resource group does not exist.该资源组不存在。
400InvalidStatus.ResourceGroupIt is not allowed to do this operation because of the current status of resource-group.资源组当前状态不允许进行此操作。
400NotInternationRealIdentityYou need to do real name authentication when you use Chinese mainland resources.根据中华人民共和国法律规定,在中国境内购买使用信息服务的用户需要进行实名登记。
400RecordCheckNotAvailableThe ICP filing interface is unavailable. Please try again later.-
400IcpBlackThe domain is on the ICP blacklist.-
400IspBlackThe domain is on the ISP blacklist.-
400DomainOwnerVerifyFailOwner verification of the root domain failed.当您首次将新域名添加至阿里云CDN时,需按要求做域名归属权验证,当您按要求配置DNS解析或文件验证后,才能正常成功添加域名。 
400TopLevelDomain.MismatchThe specified TopLevelDomain does not match webSiteType.顶级接入域和域名类型不匹配。
400DomainOverLimitThe maximum number of domains is exceeded.域名数量超过上限

访问错误中心查看更多错误码。

  • 本页导读 (1)
文档反馈