网页加速、下载分发、动态加速、全站加速、点播分发、直播分发、上传加速、移动加速、上网加速、S-P2P、PCDN、应用性能管理、WEB应用防火墙、BotGuard爬虫管理、WSS、DMS、DDoS云清洗、应用加速、应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案
修改指定加速域名的基础配置。接口调用url的*可为域名名称或域名ID
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
domain | String | 是 | 需要修改的域名,可以是域名名称或域名id。 |
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
version | String | 否 | 版本号,当前版本号1.0.0 |
comment | String | 否 | 备注信息,最大限制1000个字符 |
service-areas | String | 否 | 加速域名的加速区域,如果有需要根据区域限定资源覆盖时,才需要指定加速区域。未指定加速区域时,我们将按照客户开通的服务区域,以最优的资源覆盖提供加速服务。多个区域以分号分隔,支持配置的区域如下:cn(中国大陆)、am(美洲)、emea(欧洲、中东、非洲)、apac(亚太地区) |
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的目的。 |
origin-config | Object | 否 | 回源策略设置,用于设置加速域名的源站信息和回源策略 |
origin-ips | String | 否 | 回源地址,可以是IP或域名。 1、IP以分号分隔,支持多个。 2、域名只能输入一个。IP与域名不能同时输入。 3、限制最大不能超过500个字符长度。 4、IP最多15个。 |
default-origin-host-header | String | 否 | 回源HOST,用于更改回源HTTP请求头中的HOST字段。支持格式为: ①域名;②ip; 注意: 1、必须符合ip/域名格式规范。如果是域名,则域名长度小于等于128。 |
ssl | Object | 否 | ssl证书设置,用于设置加速域名的ssl证书配置。上传证书请使用接口:【新增证书V2】;若要修改证书,请使用接口:【修改证书V2】 |
use-ssl | String | 否 | 使用证书,可选值为true和false,true表示使用证书,false表示不使用证书 |
use-for-sni | String | 否 | 使用sni证书,可选值为true和false,true表示使用sni证书,false表示使用合用证书(暂不支持) |
ssl-certificate-id | Integer | 否 | 证书ID,新增证书成功后,系统返回的证书ID use-ssl为true时,才能传ssl-certificate-id。 |
cache-host | String | 否 | 缓存文件HOST。缓存HOST域名和加速域名的缓存规则必须一致。 |
enable-httpdns | String | 否 | 启用httpdns设置(使用需申请) 可选值为true和false,true表示启用;false表示关闭 注意:该功能默认不开启,若您有需要,请联系专属客服申请开通。 |
header-of-clientip | String | 否 | 传递客户端ip的响应头部,可选值为Cdn-Src-Ip和X-Forwarded-For,默认值为Cdn-Src-Ip |
live-config | Object | 否 | 直播域名配置,用于设置直播加速域名的推拉流 |
origin-ips | String | 否 | 源站IP,当stream-type为pull时,源站IP和配套推流域名至少一个不为空。 1、如果是推拉流配套,则填写127.0.0.1,不传系统也默认为127.0.0.1 2、如果是直接回源拉流,则填写回源拉流的源站IP |
origin-push-host | String | 否 | 配套推流域名,用于设置直播拉流域名对应的推流域名,当stream-type为pull时,源站IP和配套推流域名至少一个不为空;当stream-type为push时,无需传入。 |
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,用于查询每次请求的任务 (适用全部接口) |
x-cnc-deploy-version | String | 本次修改对应的部署版本号 |
code | String | 错误代码,当HTTPStatus不为202时出现,表示当前请求调用的错误类型 |
message | String | 响应信息,成功时为success |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
InternalError | We encountered an internal error. Please try again. | 500 | 服务器异常,数据获取失败等内部错误 |
NoSuchDomain | The specified domain does not exist. | 404 | 指定的域名不存在 |
Forbidden | The domain is being deleted | 403 | 域名被删除 |
CustomizedCnameError | Customized CNAME error. | 409 | 客户共用一级错误 |
CnameError | CNAME cancel. | 400 | 共用一级错误 |
DomainExistsCdnAreaError | The domain's service area is invalid. | 409 | 域名的服务区域入参解析错误 |
ConfigFormNotExists | The configuration does not exist. | 400 | 配置不存在 |
PARAM_INVALID | param: {0} is null or invalid. | 400 | 参数{0}为空或非法 |
PARSE_PARAM_ERROR | Error parameter. | 400 | 入参解析错误 |
NO_DOMAIN_2_UPDATE | No domain to update. | 400 | 修改域名配置时找不到域名 |
ERROR_CONFIG_PARAM | {"$configXmlTag" : "$msg"} OR "Wrong delete data id $dataId." OR "Wrong data id $dataId" | 400 | 配置单配置项错误 |
CONFIG_NOT_OWN_DOMAIN_NAME | Can not deal with domain name [{$name}]. | 400 | 不能处理该域名 |
DUPLICATE_DOMAIN_NAME | Can not operate 2 domain with the same name. | 400 | 入参中域名重复 |
InvalidBanUrl | ban-url is not unique. | 400 | 屏蔽url不是唯一 |
banUrlsExcessive | The number of ban-url is excessive once. | 403 | 屏蔽url的数量过多 |
banUrlsExist | The specified ban-url does already exist. | 400 | 屏蔽的url已经存在 |
banUrlsNotExist | The specified ban-url not exist. | 400 | 取消屏蔽的url不存在 |
DOMAIN_NOT_USE_SSL | The domain $domainName does not use ssl. | 400 | 域名没有关联证书 |
NO_AVAILABLE_HTTPS_SERVICE_FORM | IsUseSsl not all used for domains in the same configForm. | 400 | 同一个配置单下的所有域名必须同时使用证书 |
APPG_NAME_EMPTY | The appGroupName is empty. | 400 | 应用服务组检查不通过(应用服务组名称为空) |
APPG_NOT_SUPPORT_HTTPS_8_API | The appGroup does not support HTTPS by API. | 400 | 应用服务组检查不通过(应用服务组不对外开放HTTPS自助) |
APPG_NOT_SUPPORT_HTTPS | The appGroup does not support HTTPS. | 400 | 应用服务组检查不通过(应用服务组不支持HTTPS功能) |
MissingBody | This operation requires a body. Ensure that the body is present and the Content-Type header is set. | 400 | 缺少请求体 |
MalformedXML | The XML you provided was not well-formed or did not validate against our published schema. | 400 | 提供的xml不正确或者不符合规则 |
ConfigError | The suit does not match the suit associated with the value of cname-label. | 409 | 指定配置与指定共用一级域名不匹配 |
InvalidOrigin | Can not change advanced source ip or source domain name. | 400 | 不能修改域名的高级源 |
ConfigVersionOutOfDate | The specified version is out of date. | 409 | 您提供的版本已经过期 |
AtLeastHasOneResult | [authorize-sucess-code|authorize-failure-code|authorize-sucess-content|authorize-failure-content] must be at least have one. | 400 | 直播鉴权结果格式不能为空 |
DuplicateAuthorizeCustomParam | Authorize Custom Param key [{0}] is not repeatable. | 400 | 直播回源鉴权可变参数Key唯一校验 |
ERROR_CONFIG_PARAM_SERVICE | Wrong config value | 400 | 二级服务后台校验不通过 |
NOT_SUPPORT_CERTIFICATE_CONFIG | use tra but cnameLabel certId and use certId diff | 400 | 使用传统证书,但是cnamelabel对应的证书与使用的证书不一致 |
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类型,但是所属套餐没有配置证书的相关二级服务 |
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 | 此加速域名和另外一个回源域名重名,这种情况可能导致加速域名访问异常。 |
#!/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/123344" \ -X "PUT" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -H "Content-Type:application/json" \ -d '{ "comment": "my comment here", "origin-config": { "origin-ips": "www.wss.com", "default-origin-host-header": "www.baidu.co121" }, "ssl":{ "use-ssl":"", "use-for-sni":"", "ssl-certificate-id":"" } }'
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 {"message":"success"}