AddCdnDomain - 添加域名

调用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:函数计算为源站。



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. 泛域名不支持该业务类型,目前泛域名只支持图片小文件加速,大文件下载加速,视频点播加速,请知悉。
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.

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

变更历史

更多信息,参考变更详情