阅读411 返回首页    go 阿里云 go 技术社区[云栖]


添加加速域名__域名操作接口_API 手册_CDN-阿里云

描述

添加加速域名,一次只能提交一个加速域名,一个用户最多添加20个域名。

限制条件:

  • 创建加速域名之前, 必须先开通CDN服务。
  • 加速域名必须已备案完成。
  • 源站内容,如果不在阿里云平台上,需要审核,审核工作会在下一工作日前完成。

请求参数

参数 类型 必须? 描述
Action String 操作接口名,系统规定参数 取值:AddCdnDomain
DomainName String 需要接入CDN的域名。支持泛域名,以符号“.”开头,如:.a.com
CdnType String 加速域名的业务类型; 取值:web:图片及小文件分发;download:大文件下载加速;video:视音频点播加速;liveStream:直播流媒体加速
SourceType String 源站类型 取值:ipaddr、 domain、OSS分别表示:IP源站、域名源站、OSS Bucket为源站。注:若选择了直播流媒体加速的业务类型,无需填写源站类型和信息
SourcePort Integer 可以指定443,80。默认值80。443的话走https回源。oss不支持443
Sources String 回源地址,可以是IP或域名;IP支持最多20个,以逗号区分,域名只能输入一个。IP与域名不能同时输入。除了业务类型为直播流媒体加速无需输入源站地址外,其他业务类型源站地址必填(内部用户,类型为common公有源,可以填写类型枚举值)

返回参数

名称 类型 描述
RequestID String 该条任务请求ID

特殊错误码(公共错误码)

ErrorCode 错误码 Message 错误信息 HTTP 状态 语义
InvalidDomainName.Malformed Specified DomainName is malformed. 400 DomainName 参数错误
InvalidCdnType.Malformed Specified CdnType is malformed. 400 CdnType 参数错误
InvalidSourceType.Malformed Specified SourceType is malformed. 400 SourceType 参数错误
InvalidSources.Malformed Specified SourceStr is malformed. 400 回源地址与源站类型不一致
InvaildParameter The Certificate you provided is malformed! 400 https安全加速时证书和密钥长度和过长
BusinessExist Business exist do not repeated submission 400 该域名正在添加,不用重复提交
DomainAlreadyExist This domain name is exist already 400 该域名已经添加
DomainOverLimit The Number of Domain is over the limit 403 超过域名个数限制
DomainNotRegistration The Domain name is not registered 404 该域名没有备案
IllegalOperation Illegal domain operate is not permitted. 403 没有权限执行当前操作
ServiceBusy The specified Domain is configuring, please retry later. 403 域名正在配置中, 请稍后再试
InvalidDomain.NotFound The domain provided does not belong to you. 404 域名不存在或不属于当前用户
InnerAddDomainDenied Your account haven’t bind aoneId, can not add domain. 400 内部账号未绑定aoneId,不能添加域名
ExtensiveAndAllBothExist Extensive domain and the domain begins with ‘all.’ can not exist at the same time. 400 泛域名与all.开头域名不能同时存在
CdnTypeNotSupportExtensiveDomain Extensive domain not supported for this cdn type. 400 泛域名不支持该业务类型
ExtensiveAndSpecificDomainConflict Extensive domain and corresponding specific domain are mutually exclusive. 400 泛域名与对应同级别精确域名互斥

示例

请求示例:

  1. https://cdn.aliyuncs.com?Action=AddCdnDomain&CdnType=web&SourceType=domain&DomainName=test.com&Sources=test.com&<公共请求参数>

返回示例

JSON格式:

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

XML格式:

  1. <AddCdnDomainResponse>
  2. <RequestId>A22F5DDD-E6B8-4DB4-A210-FF3CA5A82644</RequestId>
  3. </AddCdnDomainResponse>

最后更新:2016-11-23 17:16:03

  上一篇:go CDN API概述__API 手册_CDN-阿里云
  下一篇:go 查询域名列表__域名操作接口_API 手册_CDN-阿里云