网页加速、下载分发、全站加速、应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案、点播分发、直播分发、移动加速
为指定的域名申请加速服务
单用户调用频率:300/5min
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
version | String | 否 | 版本号,当前版本号1.0.0 |
domain-name | String | 是 | 需要接入CDN的域名。支持泛域名,以符号“.”开头,如:.example.com,泛域名也包含多级“a.b.example.com”。 如果example.com已备案,那么域名xx.example.com则不需要备案。 |
service-type | String | 否 | 加速域名的服务类型(一次只能提交一个服务类型): web/web-https:网页加速/网页加速-https wsa/wsa-https:全站加速/全站加速-https vodstream/vod-https:点播加速/点播加速-https download/dl-https:下载加速/下载加速-https livestream/live-https/cloudv-live:直播加速 v6sa/osv6:ipv6安全加速解决方案/IPv6一体化解决方案 注意: 1、service-type中的https不代表立即开启https,比如web-https中的https并不代表立刻支持https访问,需上传完证书后才可以支持https,切记! |
service-areas | String | 否 | 加速域名的加速区域,如果有需要根据区域限定资源覆盖时,才需要指定加速区域。未指定加速区域时,我们将按照客户开通的服务区域,以最优的资源覆盖提供加速服务。多个区域以分号分隔,支持配置的区域如下:cn(中国大陆)、am(美洲)、emea(欧洲、中东、非洲)、apac(亚太地区) |
comment | String | 否 | 备注信息,最大限制1000个字符 |
config-form-id | Integer | 否 | 配置单模板,特定的使用场景下,如果希望新增的加速域名参照某些指定配置时,可以指定配置单模板,具体使用请咨询对应的客户负责人。 |
referenced-domain-name | String | 否 | 参照指定域名的配置,来创建加速域名。 注意: 1.参照域名如果有使用证书,新增域名也要在对应证书授权范围内。 2.参照未备案域名,新增的域名如果已备案,可能影响资源使用和服务质量。 3.参照备案域名,新增的域名如果未备案,若资源不满足政策要求,可能重选。 4.不允许参照免流域名创建新域名。 |
cname-label | String | 否 | 共用一级标签,若有多个加速域名需要共用一级域名,则可以使用该参数。即拥有相同cname-label的一组域名,共用一级cname。 注意: 1、拥有相同cname-label的域名共用一级cname,且有完全一致的dns覆盖 2、共用一级的约束:加速类型一致(service-type)、证书id一致(certificate-id,如果有证书)、加速区域一致(service-areas) 3、多个http域名可共用一级,多个sni https域名可共用一级 4、单个域名使用cname-label时,域名可cancel;多个域名共用一级时,不允许cancel这些域名 5、支持通过修改cname-label达到修改cname的目的。) |
cname-with-customized-prefix | String | 否 | 一级cname前缀,true表示使用域名名称作为cname前缀,否则,使用14位随机串(数字+字母)作为cname前缀。 注意:当前缀是泛域名时,则再增加wsall作为前缀。如.baidu.com.wscloudcdn.com,会生成wsall.baidu.com.wscloudcdn.com |
origin-config | Object | 否 | 回源策略设置,用于设置加速域名的源站信息和回源策略 |
origin-ips | String | 否 | 回源地址,可以是IP或域名。 1、IP以分号分隔,支持多个。 2、域名只能输入一个。IP与域名不能同时输入。 3、限制最大不能超过500个字符长度。 4、源IP个数不能超过15个。 |
default-origin-host-header | String | 否 | 回源HOST,用于更改回源HTTP请求头中的HOST字段。支持格式为: 域名,每段(点号分隔)长度小于等于62,域名总长度小于等于128。 |
live-config | Object | 否 | 直播域名配置,用于设置rtmp直播加速域名的推拉流(使用需申请) 注意:该节点下的相关参数配置,除开通API调用权限外,还需要联系专属客服申请开通对应的API客户模板 |
stream-type | String | 否 | 直播推拉流类型,可选值为pull和push,pull表示拉流; push表示推流。 |
origin-push-host | String | 否 | 配套推流域名,用于设置rtmp直播拉流域名对应的推流域名,当stream-type为pull时,源站IP和配套推流域名至少一个不为空;当stream-type为push时,无需传入。 |
origin-ips | String | 否 | 源站IP,当stream-type为pull时,源站IP和配套推流域名至少一个不为空。 1、如果是推拉流配套,则填写127.0.0.1,不传系统也默认为127.0.0.1 2、如果是直接回源拉流,则填写回源拉流的源站IP |
accelerate-no-china | String | 否 | 标识域名是否是纯海外加速的。 默认是否(false) true :表示客户域名纯海外加速 false:表示客户域名有在中国加速 |
header-of-clientip | String | 否 | 传递客户端ip的响应头部,可选值为Cdn-Src-Ip、X-Forwarded-For、ori_X-Forwarded-For 1) Cdn-Src-Ip: 回源头部名称为Cdn-Src-Ip,获取与节点进行建联的IP作为客户端IP传递回源。 2) X-Forwarded-For: 回源头部名称为X-Forwarded-For,携带的客户端IP值是Cdn-Src-Ip获取到的建联IP。 3) ori_X-Forwarded-For:客户端请求CDN节点时会自带X-Forwarded-For,则CDN透传此头部和值回源。 |
upstream-host | String | 否 | 直播拉流域名,直接回源校验配置。 可以是IP或域名。ip和域名只能一种。不支持多个入参。 |
publish-points | List | 否 | 设置直播推拉流域名的发布点 注意: 1、拉流和对应的推流域名,必须配置相同的发布点; 2、不想修改发布点时,不要传入该节点及以下入参; 3、发布点采用覆盖式更新,每次修改时,需要提交全部发布点,不能仅提交需要修改的部分。 |
uri | String | 否 | 发布点,支持多个,不传系统默认生成一条发布点uri为“/” |
参数名称 | 类型 | 描述 |
---|---|---|
http status code | Integer | httpstatus=202; 表示成功调用新增域名接口,可使用header中的x-cnc-request-id查看当前新增域名的部署情况 |
x-cnc-request-id | String | 唯一标示的id,用于查询每次请求的任务 (适用全部接口) |
Location | String | 用于访问该域名信息的URL,其中domain-id为我司云平台为该域名生成的唯一标示,其值为字符串。 |
cname | String | 由我司自动生成的服务域名名称,例如:xxxx.cdn30.com |
code | String | 错误代码,当HTTPStatus不为202时出现,表示当前请求调用的错误类型 |
message | String | 响应信息,成功时为success |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
InternalError | We encountered an internal error. Please try again. | 500 | 服务器异常,数据获取失败等内部错误 |
DomainAlreadyExists | The domain name you provided is already in our system. | 409 | 添加的域名已经存在。 |
ICPNotFound | There is no ICP number for the domain you provided. | 400 | 您提供的域名没有备案号 |
InvalidOrigin | {"$domainName":{"ssl":"No certificate id when use ssl."}} | 400 | 使用证书时没有传入证书id |
CustomizedCnameError | Customized CNAME error. | 409 | 客户共用一级错误 |
ConfigFormNotExists | The configuration does not exist. | 400 | 配置不存在 |
NoSuchConfigTemplet | The specified config templet does not exist. | 404 | 配置单模板不存在 |
NO_AVAILABLE_CONFIG | Can not find effective ConfServiceForm by input parameter custSuitType : [$CustSuitType] | 400 | 根据加速类型找不到合适的服务单 |
PARSE_PARAM_ERROR | Error parameter. | 400 | 入参解析错误 |
SERVICE_TYPE_NOT_MATCH_TEMPLET_ID | The service-type does not match the service-type associated with the value of templetId. | 400 | 加速类型与模板id的加速类型不匹配 |
MAIN_DOMAIN_NAME_EXIST | Main domain names exists for domain [$errDomainNames] | 400 | 主域名已存在 |
MalformedXML | The XML you provided was not well-formed or did not validate against our published schema. | 400 | 提供的xml不正确或者不符合规则 |
ConfigError | the non-back-origin-src rtmp-pull domains can not find corresponding push domain name! | 400 | 非直接回源拉流域名没有关联配套推流 |
DomainExistsCdnAreaError | The domain's service area is invalid. | 409 | 入参服务区域错误 |
CnameError | The cname label has one more templet forms | 400 | 共用一级属于多个配置单模板 |
NULL_DOMAIN_NAME | Domain name is null. | 400 | 域名为空 |
DOMAIN_NOT_IN_SSL_DNS_DOMAIN | The domain is not in ssl dns domains. | 400 | 域名不在证书允许使用范围内 |
NOT_HTTPS_IN_SERVICEFORMS | not https in serviceforms | 400 | 没有匹配的https服务单 |
STAGING_SUIT_ERROR | can not find any suit | 400 | 找不到套餐 |
SERVICE_TYPE_NOT_USE_SNI_SSL | The domain service type can't use sni ssl. | 400 | 域名配置不能使用sni证书 |
SUIT_HAS_NOT_CONFIG_CERTIFICATE_SERVICE | The suit belong to serviceForm does not have a certificate service. | 400 | 服务单是https类型,但是所属套餐没有配置证书的相关二级服务 |
ERROR_CONFIG_PARAM | {"$configXmlTag":"$msg"} | 400 | 配置单配置项错误 |
NOT_ALLOW_SRC_IP_AS_ACCELERATE_DOMAIN | The back-to-origin domain of this domain is also another accelerated domain, which may lead to abnormal access to the accelerated domain . | 400 | 回源域名是另一个加速域名,这种情况可能导致加速域名访问异常 |
NOT_ALLOW_ACCELERATE_DOMAIN_AS_SRC_IP | This accelerated domain is duplicated with another back-to-origin domain, which may lead to abnormal access to the accelerated domain. | 400 | 此加速域名和另外一个回源域名重名,这种情况可能导致加速域名访问异常。 |
REFERENCE_FREE_FLOW_DOMAIN | Can not add domain. The reference domain is free flow domain. Please contact technical support for help. | 400 | 不能参照免流域名创建域名。 |
ERROR_CONFIG_PARAM | Wrong delete data id $dataId | 400 | 配置单配置项错误 |
ERROR_CONFIG_PARAM | Wrong data id $dataId | 400 | 配置单配置项错误 |
ConfigError | Accelerate type error, please contact technical support. | 400 | 加速类型错误,请联系技术支持。 |
#!/bin/bash username="example_username" apiKey="example_apiKey" date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"` password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64` curl -i --url "https://open.chinanetcenter.com/api/domain" \ -X "POST" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -H "Content-Type:application/json" \ -d ' { "version":"1.0.0", "domain-name":"test12.eaxmple1.com", "service-areas":"cn", "comment":"", "service-type":"web", "origin-config":{ "origin-ips":"127.0.0.1", "default-origin-host-header":"" }, "referenced-domain-name":"aaa.linlytest.com" }'
HTTP/1.1 202 Accepted Date: Fri, 17 May 2017 06:33:26 GMT Content-Type: application/json;charset=utf-8 x-cnc-request-id:c54cbbb4-19fe-407a-930c-3988b62ed2fd Location:https://open.chinanetcenter.com/api/domain/1234567 cname: 7nt6mrh7sdkslj.cdn30.com {"message":"success"}