网页加速、下载分发、动态加速、全站加速、点播分发、直播分发、上传加速、移动加速、上网加速、S-P2P、PCDN、应用性能管理、WEB应用防火墙、BotGuard爬虫管理、WSS、DMS、DDoS云清洗、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案
修改拉取跳转后的文件
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
domain-name | String | 是 | 需要查询配置的域名或域名id |
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
origin-related-after-redirect | UpdateAfterRedirectRequestOriginRelatedAfterRedirect | 是 | 拉取302后的文件设置,设置参数如下:
1、拉取跳转后的文件
2、不根据dns缓存都进行302跳转
3、支持最多跳转次数
4、是否多次跟随跳转
5、是否将回源HOST替换成IP
6、是否仅用locaiton的域名做DNS解析
7、清空拉取302后的文件内容,则只传入标签 |
after-redirect | String | 否 | 拉取跳转后的文件,可选值:301|302|301;302
301:301跳转
302:302跳转
301;302:301与302两种跳转
示例: |
ignore-dns-cache | String | 否 | 不根据dns缓存都进行302跳转,可选值:true(即不根据dns缓存全部进行302跳转)、false(根据dns缓存全部进行302跳转)
示例: |
max-times | Integer | 否 | 支持最多跳转次数,数值为正整数
示例: |
control-follow-jump | String | 否 | 该配置项用于控制是否多次跟随跳转,可选值:true(只要原频道允许302跳转则能持续跳转)、false(不进行多次跟随跳转)
示例: |
replace-source-mode | String | 否 | 该配置项用于将回源HOST替换成IP,可选值:true(当302跳转响应的host为ip时,设置回源host头为该ip)、false(设置回源host头为原始域名)
示例: |
location-dns-resolution | String | 否 | 该配置项用于判断是否仅用locaiton的域名做DNS解析,可选值:true(在302获取到location后,仅仅使用locaiton的域名做DNS解析,回源及后续阶段依然读取原始域名的配置)、false(根据原始域名的配置做DNS解析)
示例: |
参数名称 | 类型 | 描述 |
---|---|---|
http status code | Integer | httpstatus=202; 表示成功调用新增域名接口,可使用header中的x-cnc-request-id查看当前新增域名的部署情况 |
x-cnc-request-id | String | 唯一标示的id,用于查询每次请求的任务 (适用全部接口) |
code | String | 错误代码,当HTTPStatus不为202时出现,表示当前请求调用的错误类型 |
message | String | 响应信息,成功时为success |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
InvalidParameter | No origin-related-after-redirect was specified. | 400 | origin-related-after-redirect字段不存在 |
InvalidParameter | The specified after-redirect was invalid. | 400 | after-redirect值不合法 |
InvalidParameter | The specified ignore-dns-cache must be true or false. | 400 | ignore-dns-cache值不合法 |
InvalidParameter | The specified max-times must be greater than 0. | 400 | max-times值不合法 |
InvalidParameter | The specified control-follow-jump must be true or false. | 400 | control-follow-jump值不合法 |
InvalidParameter | The specified replace-source-mode must be true or false. | 400 | replace-source-mode值不合法 |
InvalidParameter | The specified location-dns-resolution must be true or false. | 400 | location-dns-resolution值不合法 |
InvalidHTTPRequest | There was an error in the body of your HTTP request. | 400 | 请求requestBody为空 |
NoSuchDomain | The specified domain does not exist. | 404 | 域名不存在 |
CustomerNoOwnDomain | customer not own domain name[{0}] | 400 | 域名不属于当前客户 |
#!/bin/bash username="nicole" apiKey="abcde" 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/afterredirect/www.bblinly.com" \ -X "PUT" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -H "Content-type: application/json" \ -d '{ "origin-related-after-redirect":{ "after-redirect":"301;302", "ignore-dns-cache":"true", "max-times":"5", "control-follow-jump":"true", "replace-source-mode":"true", "location-dns-resolution":"true" } }'
HTTP/1.1 202 Accepted Server: openresty/1.11.2.2 Date: Wed, 15 May 2019 07:31:43 GMT Content-Type: application/json;charset=utf-8 Content-Length: 60 Connection: keep-alive App-Name: service_confApi x-cnc-request-id: 5c429816-5fda-4d6d { "message":"success", "code":"" }