网页加速、下载分发、动态加速、全站加速、点播分发、直播分发、上传加速、移动加速、上网加速、S-P2P、PCDN、应用性能管理、WEB应用防火墙、BotGuard爬虫管理、WSS、DMS、DDoS云清洗、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案
支持修改回源协议和端口
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
domain-name | String | 是 | 需要查询配置的域名或域名id |
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
backToOriginRewriteRule | Object | 是 | 修改回源协议和端口 |
protocol | String | 否 | 改写后的回源协议,可选值:http、https |
port | String | 否 | 改写后的回源端口,若protocol为http时,默认为80,若protocol为https时,默认为443 |
参数名称 | 类型 | 描述 |
---|---|---|
code | String | 错误代码,当HTTPStatus不为202时出现,表示当前请求调用的错误类型 |
message | String | 响应信息,成功时为success |
data | String | 响应数据 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
26939999 | We encountered an system error. Please try again. | 500 | 系统内部异常,请稍后重试 |
26938016 | This operation requires a body. Ensure that the body is present and the Content-Type header is set. | 400 | body内容为空 |
26938017 | The body of your HTTP request does not match with the content-type [xml/json]. | 400 | 请求报文与Content-Type描述不一致 |
26932001 | The specified domain does not exist. | 404 | 域名资源项不存在 |
26932002 | customer not own domain name[XXX] | 400 | 域名不属于该客户 |
26938003 | The config {0} does not access. | 400 | 某个配置无法访问 |
26938005 | example: 1. No domain was specified. 2.The {0} is invalid. | 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/config/back2originrewrite/123344" \ -X "PUT" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/xml" \ -H "Content-Type:application/xml" \ -d '<?xml version="1.0" encoding="utf-8"?> <domain> <backToOriginRewriteRule> <protocol>http</protocol> <port>81</port> </backToOriginRewriteRule> </domain>'
HTTP/1.1 202 Accepted Date: Sun, 05 May 2019 09:08:53 GMT Content-Type: application/xml;charset=utf-8 x-cnc-request-id: 83bbebc7-2c95-47d7 <?xml version="1.0" encoding="UTF-8"?> <response> <code>0</code> <message>success</message> <data></data> </response>