文档中心 API文档 查询回源协议接口

查询回源协议接口

更新时间:2022-12-13 11:28:30

适用产品

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

接口描述

支持查询回源协议和端口

推荐使用 Open API在线调试

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

请求参数

Path 参数

参数名称类型必填描述
domain
String需要查询配置的域名(domainName)或域名id(domainId)

返回参数

Body 参数

参数名称类型描述
code
String错误代码,当HTTPStatus不为202时出现,表示当前请求调用的错误类型
message
String响应信息,成功时为success
data
String响应数据
domainId
Integer域名ID
domainName
String域名
backToOriginRewriteRule
Map回源协议配置,父标签 1.需要设置回源协议改写配置时,此项必填 2.为时清空配置
protocol
String改写后的回源协议,可选值:http、https
port
String改写后的回源端口,若protocol为http时,默认为80,若protocol为https时,默认为443

错误码

错误代码(code)描述(message)HTTP状态码语义
26939999We encountered an system error. Please try again.500系统内部异常,请稍后重试
26938016This operation requires a body. Ensure that the body is present and the Content-Type header is set.400body内容为空
26938017The body of your HTTP request does not match with the content-type [xml/json].400请求报文与Content-Type描述不一致
26932001The specified domain does not exist.404域名资源项不存在
26932002customer not own domain name[XXX]400域名不属于该客户

示例

XML
JSON
XML
请求示例
复制代码 复制成功
#!/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 "GET" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/xml" \
-H "Content-Type:application/xml"
返回示例
复制代码 复制成功
HTTP/1.1 200 OK
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>
  <domainId>123344</domainId>
  <domainName>www.example.com</domainName>
   <backToOriginRewriteRule>
      <protocol>http</protocol>
      <port>81</port>
   </backToOriginRewriteRule>
</data>
</response>
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!