修改域名配置

更新时间:2024-04-17 14:52:04

适用产品

网页加速、下载分发、动态加速、全站加速、点播分发、直播分发、上传加速、移动加速、上网加速、S-P2P、PCDN、应用性能管理、WEB应用防火墙、BotGuard爬虫管理、WSS、DMS、DDoS云清洗、应用加速、应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案

接口描述

修改指定加速域名的基础配置。接口调用url的*可为域名名称或域名ID

调用频率

单用户调用频率:300/5min

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Path 参数

参数名称描述
*domainString
需要修改的域名,可以是域名名称或域名id。

Body 参数

参数名称描述
versionString
版本号,当前版本号1.0.0
commentString
备注信息,最大限制1000个字符
service-areasString
加速域名的加速区域,如果有需要根据区域限定资源覆盖时,才需要指定加速区域。未指定加速区域时,我们将按照客户开通的服务区域,以最优的资源覆盖提供加速服务。多个区域以分号分隔,支持配置的区域如下:cn(中国大陆)、am(美洲)、emea(欧洲、中东、非洲)、apac(亚太地区)
cname-labelString
共用一级标签,若有多个加速域名需要共用一级域名,则可以使用该参数。即拥有相同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-configObject
回源策略设置,用于设置加速域名的源站信息和回源策略
origin-ipsString
回源地址,可以是IP或域名。 1、IP以分号分隔,支持多个。 2、域名只能输入一个。IP与域名不能同时输入。 3、限制最大不能超过500个字符长度。 4、IP最多15个。
default-origin-host-headerString
回源HOST,用于更改回源HTTP请求头中的HOST字段。支持格式为: ①域名;②ip; 注意: 1、必须符合ip/域名格式规范。如果是域名,则域名长度小于等于128。
sslObject
ssl证书设置,用于设置加速域名的ssl证书配置。上传证书请使用接口:【新增证书V2】;若要修改证书,请使用接口:【修改证书V2】
use-sslString
使用证书,可选值为true和false,true表示使用证书,false表示不使用证书
use-for-sniString
使用sni证书,可选值为true和false,true表示使用sni证书,false表示使用合用证书(暂不支持)
ssl-certificate-idInteger
证书ID,新增证书成功后,系统返回的证书ID use-ssl为true时,才能传ssl-certificate-id。
cache-hostString
缓存文件HOST。缓存HOST域名和加速域名的缓存规则必须一致。
enable-httpdnsString
启用httpdns设置(使用需申请) 可选值为true和false,true表示启用;false表示关闭 注意:该功能默认不开启,若您有需要,请联系专属客服申请开通。
header-of-clientipString
传递客户端ip的响应头部,可选值为Cdn-Src-Ip和X-Forwarded-For,默认值为Cdn-Src-Ip
live-configObject
直播域名配置,用于设置直播加速域名的推拉流
origin-ipsString
源站IP,当stream-type为pull时,源站IP和配套推流域名至少一个不为空。 1、如果是推拉流配套,则填写127.0.0.1,不传系统也默认为127.0.0.1 2、如果是直接回源拉流,则填写回源拉流的源站IP
origin-push-hostString
配套推流域名,用于设置直播拉流域名对应的推流域名,当stream-type为pull时,源站IP和配套推流域名至少一个不为空;当stream-type为push时,无需传入。
publish-pointsList
设置直播推拉流域名的发布点 注意: 1、拉流和对应的推流域名,必须配置相同的发布点; 2、不想修改发布点时,不要传入该节点及以下入参; 3、发布点采用覆盖式更新,每次修改时,需要提交全部发布点,不能仅提交需要修改的部分。
uriString
发布点,支持多个,不传系统默认生成一条发布点uri为“/”

返回参数

Body 参数

参数名称描述
http status codeInteger
httpstatus=202; 表示成功调用接口,可使用header中的x-cnc-request-id查看域名的部署情况
x-cnc-request-idString
唯一标示的id,用于查询每次请求的任务 (适用全部接口)
x-cnc-deploy-versionString
本次修改对应的部署版本号
codeString
错误代码,当HTTPStatus不为202时出现,表示当前请求调用的错误类型
messageString
响应信息,成功时为success

错误码

错误代码(code)描述(message)HTTP状态码语义
InternalErrorWe encountered an internal error. Please try again.500服务器异常,数据获取失败等内部错误
NoSuchDomainThe specified domain does not exist.404指定的域名不存在
ForbiddenThe domain is being deleted403域名被删除
CustomizedCnameErrorCustomized CNAME error.409客户共用一级错误
CnameErrorCNAME cancel.400共用一级错误
DomainExistsCdnAreaErrorThe domain's service area is invalid.409域名的服务区域入参解析错误
ConfigFormNotExistsThe configuration does not exist.400配置不存在
PARAM_INVALIDparam: {0} is null or invalid.400参数{0}为空或非法
PARSE_PARAM_ERRORError parameter.400入参解析错误
NO_DOMAIN_2_UPDATENo 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_NAMECan not deal with domain name [{$name}].400不能处理该域名
DUPLICATE_DOMAIN_NAMECan not operate 2 domain with the same name.400入参中域名重复
InvalidBanUrlban-url is not unique.400屏蔽url不是唯一
banUrlsExcessiveThe number of ban-url is excessive once.403屏蔽url的数量过多
banUrlsExistThe specified ban-url does already exist.400屏蔽的url已经存在
banUrlsNotExistThe specified ban-url not exist.400取消屏蔽的url不存在
DOMAIN_NOT_USE_SSLThe domain $domainName does not use ssl.400域名没有关联证书
NO_AVAILABLE_HTTPS_SERVICE_FORMIsUseSsl not all used for domains in the same configForm.400同一个配置单下的所有域名必须同时使用证书
APPG_NAME_EMPTYThe appGroupName is empty.400应用服务组检查不通过(应用服务组名称为空)
APPG_NOT_SUPPORT_HTTPS_8_APIThe appGroup does not support HTTPS by API.400应用服务组检查不通过(应用服务组不对外开放HTTPS自助)
APPG_NOT_SUPPORT_HTTPSThe appGroup does not support HTTPS.400应用服务组检查不通过(应用服务组不支持HTTPS功能)
MissingBodyThis operation requires a body. Ensure that the body is present and the Content-Type header is set.400缺少请求体
MalformedXMLThe XML you provided was not well-formed or did not validate against our published schema.400提供的xml不正确或者不符合规则
ConfigErrorThe suit does not match the suit associated with the value of cname-label.409指定配置与指定共用一级域名不匹配
InvalidOriginCan not change advanced source ip or source domain name.400不能修改域名的高级源
ConfigVersionOutOfDateThe 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直播鉴权结果格式不能为空
DuplicateAuthorizeCustomParamAuthorize Custom Param key [{0}] is not repeatable.400直播回源鉴权可变参数Key唯一校验
ERROR_CONFIG_PARAM_SERVICEWrong config value400二级服务后台校验不通过
NOT_SUPPORT_CERTIFICATE_CONFIGuse tra but cnameLabel certId and use certId diff400使用传统证书,但是cnamelabel对应的证书与使用的证书不一致
SERVICE_TYPE_NOT_USE_SNI_SSLThe domain service type can't use sni ssl.400域名配置不能使用sni证书
SUIT_HAS_NOT_CONFIG_CERTIFICATE_SERVICEThe suit belong to serviceForm does not have a certificate service.400服务单是https类型,但是所属套餐没有配置证书的相关二级服务
NOT_ALLOW_SRC_IP_AS_ACCELERATE_DOMAINThe 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_IPThis accelerated domain is duplicated with another back-to-origin domain, which may lead to abnormal access to the accelerated domain.400此加速域名和另外一个回源域名重名,这种情况可能导致加速域名访问异常。

示例

JSON
XML
JSON
请求示例
复制代码 复制成功
#!/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"}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!