请求URL: domain/config (POST)
接口请求域名:
cdn.api.baishan.com
接口版本:v2
对加速域名各项配置进行设置和修改,例如:缓存规则,IP黑名单,referer防盗链,源站,回源host等。
注意: 接口调用频率不超过30次/分钟。
各项配置(referer、origin、cache_rule)可以一并提交,也可以单独提交,当多个配置一起提交时,如果存在某一项配置规则不合法,那么单次提交的所有配置均无法保存。
公有参数:用户的 token 可向值班同事获取。
参数支持 form-data、x-www-form-urlencoded、json 等格式
| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| domains | string | 是 | 可传入多个域名进行批量配置,以英文逗号(,)分隔,单次不超过10个, 例如:aa.qingcdn.com,bb.qingcdn.com |
| config | array | 是 | 配置项参数, {"referer":json, "cache_rule":json} |
| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| default_master | string | 是 | 主回源, 可填ip, 域名, 多个以逗号(,)分隔 例如: "133.233.133.33,133.233.22.33", 主源/备源最多6个ip |
| default_slave | string | 否 | 备回源, 可填ip, 域名, 多个以逗号(,)分隔 例如: "133.233.133.33,133.233.22.33" 注:主备源不可设置为一样, 不可与主源存在重复 |
| origin_mode | string | 否 | 回源方式, 默认为default, 可选值有:http,https,default,customorigin_mode=http:表示回源方式以http回源, 即http,和80端口origin_mode=https:表示回源方式以https回源, 即https,和443端口origin_mode=default:表示回源以用户访问协议跟随回源,origin_mode=custom:表示回源方式以自定义回源, ori_https和port可自定义 |
| ori_https | string | 否 | 回源是否https, 可选值: yes,no, 当origin_mode=custom时, 该值可设置 |
| port | int | 否 | 回源端口, 默认为空, 以80端口回源, 当origin_mode=custom时, 该值可设置(0-65535) |
#回源配置
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H 'content-type: application/json' \
-d '{
"token":"xxx",
"domains":"example.com",
"config": {
"origin": {
"default_master":"1.1.1.1,1.1.1.2",
"default_slave":"2.2.2.2",
"origin_mode":"custom",
"ori_https":"yes",
"port":1040
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| host | string | 是 | 回源host 例如: "test.qingcdn.com",不支持IP |
# 设置源站host
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H 'content-type: application/json' \
-d '{
"token":"xxx",
"domains":"example.com",
"config": {
"origin_host": {
"host": "www.example.com"
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| type | int | 是 | 防盗链类型,1:配置的list为黑名单,2:配置的list为白名单 |
| list | array | 是 | 黑白名单域名列表,可设置多个,以逗号分隔,最多200个,目前不支持正则;泛域名请以【*.】开头, 例如:["*.aaa.qingcdn.com", "www.qingcdn.com","*.test.com"] , " *.test.com" 包括任意的匹配主机头,包括空主机头 |
| allow_empty | boolean | 否 | 默认为true, true=允许referer为空也能正常访问, false=不允许referer为空访问 |
# 设置referer黑名单
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H 'content-type: application/json' \
-d '{
"token":"xxx",
"domains":"example.com",
"config": {
"referer": {
"type":"1",
"list":[
"*.example.com",
"www.example2.com"
],
"allow_empty":true
}
}
}'# 设置referer白名单
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H 'content-type: application/json' \
-d '{
"token":"xxx",
"domains":"example.com",
"config": {
"referer": {
"type":"2",
"list":[
"*.example.com",
"www.example2.com"
],
"allow_empty":false
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| type | int | 是 | 缓存类型,1:文件名后缀,2:目录,3:完整路径匹配,4:正则 |
| pattern | string | 是 | 缓存规则,多个以逗号分隔, 例如: type=1时 jpg,png,giftype=2时 /product/index,/test/index,/user/indextype=3时 /index.html,/test/*.jpg,/user/get?indextype=4时 例子见下面说明 设置对应的正则, 设置了正则后, 对请求访问的url与正则做匹配, 匹配成功则使用该缓存规则.默认是带参数缓存,忽略过期时间,不忽略 不缓存头 |
| time | int | 是 | 缓存时间, 配合timeunit使用, 最大时间不超过2年, 当time=0时, 不对指定pattern进行缓存(即禁止缓存) |
| timeunit | string | 否 | 缓存时间单位,默认值为s, 可选值有(Y年,M月,D日,h时,i分,s秒) |
ignore_no_cache | string | 否 | 缓存时间time大于0时有效, 忽略源站不缓存头, 默认值为off, 可选参数: on,off |
ignore_expired | string | 否 | 缓存时间time大于0时有效, 忽略源站过期时间, 默认值为on, 可选参数: on,off |
ignore_query | string | 否 | 缓存时间time大于0时有效, 忽略参数缓存并且忽略参数回源, 默认值为off, 可选参数: on,off |
缓存优先级说明 : 优先级按规则数组排序,由高至低排序
缓存规则正则使用说明 : 正则规则是作为一般类型无法满足情形下的补充,使用不当会引起缓存不必要的故障, 建议有一定正则基础的开发者使用, 请理解清楚正则的使用规则后再应用到线上服务中, 设置缓存规则为正则, 会将请求的url地址(url地址:包含http/https协议部分、域名、端口[有的话]、路径、参数等几个部分)与正则去做匹配, 匹配成功则会使用该规则设定的缓存时间.
- 举例1:
.*\.(gif|png|jpg)$, 那么他将匹配所有含(gif,png,jpg)文件名后缀的url- 举例2:
^https?://[^/]+/dir1/dir2/(dir3_1|dir3_2)\.html, 该规则匹配当前域名下/dir1/dir2/dir3_1.html和/dir1/dir2/dir3_2.html规则.
# 添加缓存规则(可以为多个缓存规则)
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H 'content-type: application/json' \
-d '{
"token":"xxx",
"domains":"aa.qingcdn.com",
"config": {
"cache_rule":[
{
"type":1,
"pattern":"jpg,png,gif",
"time":3600
},
{
"type":1,
"pattern":"avi,mp4,mpeg",
"time":3600
}
]
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| match_method | string | 是 | 缓存类型,ext:文件名后缀,dir:目录,route:完整路径匹配,regex:正则 |
| pattern | string | 是 | 缓存规则,多个以逗号分隔, 例如: type=ext时 jpg,png,giftype=dir时 /product/index,/test/index,/user/indextype=route时 /index.html,/test/*.jpg,/user/get?indextype=regex时 例子见下面说明 设置对应的正则, 设置了正则后, 对请求访问的url与正则做匹配, 匹配成功则使用该缓存规则.默认是带参数缓存,忽略过期时间,不忽略 不缓存头 |
| case_ignore | string | 否 | 是否忽略大小写,yes忽略,no不忽略。默认yes |
| expire | int | 是 | 缓存时间, 配合expire_unit使用, 最大时间不超过2年, 当time=0时, 不对指定pattern进行缓存(即禁止缓存) |
| expire_unit | string | 否 | 缓存时间单位,默认值为s, 可选值有(Y年,M月,D日,h时,i分,s秒) |
| ignore_no_cache_headers | string | 否 | 是否忽略源站响应头中的不缓存信息<br/>如Cache-Control:no-cache等, 默认值为no, 可选参数: no,yes ignore_no_cache_headers=no:表示不忽略ignore_no_cache_headers=yes:表示忽略 |
| follow_expired | string | 否 | 是否遵循源站缓存时间, 默认值为no, 可选参数: no,yes follow_expired=no:表示不循源 follow_expired=yes:表示循源 |
| query_params_op | string | 否 | 问号后参数处理方式, 默认值为do_nothing, 可选参数: do_nothing,cache_back_source_remove do_nothing:不处理cache_back_source_remove:缓存/回源均去除 customer:自定义,配合这部分参数进行使用query_params_op_way, query_params_op_when, params |
| priority | int | 否 | 排序值,priority值越低,优先级越高,不允许重复 |
| cache_or_not | string | 否 | 是否缓存,可选值:["yes","no"],不传默认按照expire来判断是否开启缓存 |
| query_params_op_way | string | 否 | 必须在query_params_op=customer才能生效,可选值:keep :保留, remove :去除 |
| query_params_op_when | string | 否 | 必须在query_params_op=customer才能生效,可选值:cache : 仅缓存时处理/缓存, cache_back_source :回源均作处理 |
| params | string | 否 | 必须在query_params_op=customer才能生效,参数列表 |
# 添加缓存规则(可以为多个缓存规则)
curl -X POST "http://cdn.api.baishan.com/v2/domain/config"\
-H 'content-type: application/json' \
-d '{
"token":"xxx",
"domains":"test.aa.qingcdn.com",
"config": {
"cache_rule_list":[
{
"match_method":"dir",
"pattern":"/www/html,/www/aaa",
"case_ignore":"no",
"priority":13,
"expire":60,
"expire_unit":"i",
"ignore_no_cache_headers":"yes",
"follow_expired":"no",
"query_params_op":"do_nothing"
},
{
"match_method":"ext",
"pattern":"php,jsp,asp,aspx",
"case_ignore":"no",
"priority":15,
"expire":3600,
"expire_unit":"s",
"ignore_no_cache_headers":"yes",
"follow_expired":"no",
"query_params_op":"cache_back_source_remove"
}
]
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| list | array | 是 | ip黑名单列表,多个以逗号分隔,最多可设置200个, 例如:["1.1.1.0/24", "2.2.2.2", "3.3.3.3"] ;支持/8,/16,/24格式的网段设置,网段不能存在交叉重复, 注意: 黑白名单只能同时存在一种, 设置了黑名单, 白名单将被清除 |
| mode | string | 否 | append:追加模式 cover:覆盖模式,默认cover |
# 设置ip黑名单
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H 'content-type: application/json' \
-d '{
"token":"xxx",
"domains":"example.com",
"config": {
"ip_black_list": {
"list": [
"14.12.11.0/24",
"1.2.3.4"
],
"mode": "cover"
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| list | array | 是 | ip白名单列表,多个以逗号分隔,最多可设置200个, 例如:["1.1.1.0/24", "2.2.2.2", "3.3.3.3"] ;支持/8,/16,/24格式的网段设置,网段不能存在交叉重复, 注意: 黑白名单只能同时存在一种, 设置了白名单, 黑名单将被清除 |
| mode | string | 否 | append:追加模式 cover:覆盖模式,默认cover |
# 设置ip黑名单
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H 'content-type: application/json' \
-d '{
"token":"xxx",
"domains":"example.com",
"config": {
"ip_white_list": {
"list": [
"14.12.11.0/24",
"1.2.3.4"
],
"mode": "cover"
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| type | string | 否 | 不传该参数时, 默认为reset, 可选值: reset,add,remove, reset表示清空之前的头, 重置为本次设置的值; add表示新增一个响应头, 存在则覆盖, remove表示删除响应头(参数于add,reset有所差异)) |
| list | array | 是 | 响应头列表: type为reset和add时, 如: [{"name":"Content-Type","value":"text/html.."},{"name":"Cache-Control","value":"max-age..."}], type为remove时, 只需传入头的名称, 如 ["Content-Type","Cache-Control"] |
#添加响应头
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token":"xxx",
"domains":"aa.qingcdn.com",
"config": {
"add_response_head": {
"type":"add",
"list":[
{
"name":"Content-Type",
"value":"text/html; charset=ISO-8859-4"
},
{
"name":"Cache-Control",
"value":"max-age=300, must-revalidate"
}
]
}
}
}'
#删除响应头
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token":"xxx",
"domains":"aa.qingcdn.com",
"config": {
"add_response_head": {
"type":"remove",
"list":["Content-Type","Cache-Control"]
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| head_name | string | 是 | 回源请求头的名称,最多可以添加20个。 |
| head_value | string | 是 | 回源请求头的值 |
| write_when_exists | string | 否 | 若存在相同请求头时是否覆盖yes:覆盖no:不覆盖不填充时,默认值为yes。 |
#添加回源请求头
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token":"xxx",
"domains":"example.com",
"config": {
"add_back_source_head":[
{
"head_name":"name",
"head_value":"value1",
"write_when_exists":"yes"
},
{
"head_name":"name2",
"head_value":"value2",
"write_when_exists":"no"
}
]
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| cert_id | int | 是 | 证书ID, 注意: 当设置为0时, 可解除证书绑定并降级为http |
| http2 | string | 否 | 可选值:on、off, on=开启http2, off=关闭http2 |
| force_https | integer | 否 | 是否强制跳转为https, 0:否(默认), 302:以状态码=302的方式跳转, 301:以状态码=301的方式跳转 |
| ocsp | string | 否 | OCSP[on,off] 不填时不作变更 |
| ssl_protocol | string[] | 否 | 值范围:["TLSv1","TLSv1.1","TLSv1.2","TLSv1.3"] |
# 设置https证书
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H 'content-type: application/json' \
-d '{
"token":"xxx",
"domains":"example.com",
"config": {
"https": {
"cert_id": 10101,
"http2":"on",
"force_https":"301",
"ocsp": "on"
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| pattern | string | 是 | 匹配url的正则表达式, url格式为$scheme://$domain/$uri?$args, 正则应按需要匹配的url进行设置, 例如.*, 匹配所有访问的url地址 |
| time_format | string | 是 | 时间格式, 可选值有timestamp_hex(16进制时间戳), date_minute(日期, 格式为YYYYmmddHHii, 例如201805211010), timestamp(十进制时间戳), |
| key | string | 是 | 参与生成签名的秘钥, 多个用空格分隔 |
| deadtime | int | 是 | url的存活时间, 例如3600, 参数要求大于0, 单位为秒(s), 超过该时间则认为是无效的url链接 |
| req_uri_type | int | 是 | url的匹配模式, 目前共4中url模式: 1: $scheme://$domain/$uri?$args&{keyname}=$key&{timename}=$time&$args2: $scheme://$domain/$uri?$args&{timename}=$time&{keyname}=$key&$args3: $scheme://$domain/$time/$key/$uri?$args4: $scheme://$domain/$key/$time/$uri?$args |
| origin_type | int | 否 | 回源方式是否带参数, 可选值有1,2, 默认为1, 1表示不带加密串回源,2:带加密串回源 |
| style | string | 否 | 参数加密的排序组合, $ourkey$uri$time, 更换排序可更换($ourkey,$uri,$time)三个变量的顺序, 暂不支持加入额外的字段和信息 |
| timename | string | 否 | 默认值为time, 在url中传参用的参数名, 仅通过?传参时需要 |
| keyname | string | 否 | 默认值为key, 将(path,key,time)用md5生成签名, 通过参数名在url中传递 |
时间戳防盗链: 在查询配置或创建成功后返回的参数中有
request_style, 表示根据时间戳防盗链相关的参数进行配置后, 生成的匹配规则, 供参考用.
| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| protocol | string | 是 | 禁止访问的协议,可选值为http,https |
| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| bcache | string | 是 | 是否开启缓存,可选值为on,off |
| code | array | 是 | 状态码列表,可设置多个,以逗号分隔,可选值为400,403,404,414,500,501,502,503,504,506,5xx, 其中5xx包括500,501,502,503,504,506。 例如: ["400","403","5xx"] |
| cache_time | string | 否 | 缓存时间, 配合cache_unit使用, 最大时间不超过2年, 注意: bcache=on时,该参数必传 |
| cache_unit | string | 否 | 缓存时间单位, 可选值有(year:年,month月,day:日,hour:时,minute:分,second:秒)注意: bcache=on时,该参数必传 |
| 参数名 | 数据类型 | 是否必须 | 说明 | |||
|---|---|---|---|---|---|---|
| url | string | 是 | 匹配的url规则, 例如: \.(mp4 | flv | f4v | m4v) |
| mp4 | string | 是 | 是否开启mp4拖拉, 可选值: on/off | |||
| flv | string | 是 | 是否开启flv拖拉, 可选值: on/off | |||
| start | string | 是 | 开始参数, 例如: start, 参数名允许字符为: '字母,数字,下划线, 且不能为数字开头' | |||
| end | string | 是 | 结束参数, 例如: end, 参数名允许字符为: '字母,数字,下划线, 且不能为数字开头' |
| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| content_type | array | 是 | 对应的头, 例如: ["text/plain","application/x-javascript"] |
| min_size | int | 是 | 最小尺寸, 例如: 2, 该参数与min_size_unit配合使用, 表示最小多大尺寸的文件开始压缩 |
| min_size_unit | string | 是 | 最小尺寸单位, 例如: KB, 可选值有: KB/MB |
| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| type | string | 是 | URL匹配类型,ext:文件名后缀,dir:目录,route:完整路径匹配,regex:正则,all: 所有 |
| pattern | string | 是 | url匹配规则,多个以逗号分隔, 例如: type=all时:只支持 .*type=ext时: jpg,png,giftype=dir时: /product/index,/test/index,/user/indextype=route时: /index.html,/test/*.jpg,/user/get?indextype=regex时: 例子见下面说明 设置对应的正则, 设置了正则后, 对请求访问的url与正则做匹配, 匹配成功则使用该限速规则. |
| speed | string | 是 | 限速值,单位 Kbps,实际生效会转换为 KB |
| begin_time | string | 是 | 限速生效开始时间,形如 HH:ii,比如( 08:30 )24小时制 |
| end_time | string | 是 | 限速生效结束时间,形如 HH:ii,比如( 08:30 )24小时制 |
配置生效方式:覆盖式更新
规则总数:最多只能有100条规则。
限速时间:结束时间必须大于开始时间
限速值:会转换为 KB,并向上取整,比如填入 12 kbps,则生效的限速值为 2KB
URL匹配正则使用说明 : 正则规则是作为一般类型无法满足情形下的补充,
使用不当会引起限速规则不必要的故障, 建议有一定正则基础的开发者使用, 请理解清楚正则的使用规则后再应用到线上服务中, 设置URL匹配规则为正则, 会将请求的url地址(url地址:包含http/https协议部分、域名、端口[有的话]、路径、参数等几个部分)与正则去做匹配, 匹配成功则会使用该规则设定的限速规则.
- 举例1:
.*\.(gif|png|jpg)$, 那么他将匹配所有含(gif,png,jpg)文件名后缀的url- 举例2:
^https?://[^/]+/dir1/dir2/(dir3_1|dir3_2)\.html, 该规则匹配当前域名下/dir1/dir2/dir3_1.html和/dir1/dir2/dir3_2.html规则.
#添加单链接限速
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token":"xxx",
"domains":"aa.qingcdn.com",
"config": {
"speed_limit": [
{
"type":"ext",
"speed":"80",
"begin_time":"12:00",
"end_time":"13:00",
"pattern":"jpg"
}
]
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| url | string | 是 | 必填项,设置url路径:/user/get?index |
| turn_on | boolean | 是 | 可选值:true、false, true=开启当前url白名单, false=去除当前url防盗链白名单设置 |
#添加防盗链白名单
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token":"xxx",
"domains":"aa.qingcdn.com",
"config": {
"visit_deny_whitelist": [
{"url":"/user/get?index","turn_on":true},
{"url":"/contract/get?index","turn_on":true}
]
}
}'
#删除防盗链白名单
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token":"xxx",
"domains":"aa.qingcdn.com",
"config": {
"visit_deny_whitelist": [
{"url":"/user/get?index","turn_on":false},
{"url":"/contract/get?index","turn_on":false}
]
}
}'防盗链白名单设置成功后会输出对应设置成功后的配置参数
{
"code": 0,//0操作成功, 非0时会给出对应的错误提示
"data": {
"config": {
"visit_deny_whitelist": {
"url": [
"/user/get?index",
"/contract/get?index"
]
},
...
}
}
}| 参数名 | 数据类型 | 是否必须 | 说明 | |
|---|---|---|---|---|
| - | string | 是 | 默认开启分片回源,配置off关闭分片回源。 | 备注:配置on在域名详情不展示,配置off可以在域名详情展示 |
curl -X POST "http://cdn.api.baishan.com/v2/domain/config"\
-H 'content-type: application/json' \
-d '{
"token":"xx",
"domains":"aa.qingcdn.com",
"config": {
"range_back_source":"off"
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| squid | string | 是 | 必填项,squid扩展配置,使用rn换行 |
#Squid扩展配置
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token":"xxx",
"domains":"aa.qingcdn.com",
"config": {
"extend":{
"squid":"acl url_host url_regex -i ^https?://[^/]+/[^/]*c_scale.*\r\ncache_peer_access xuntiku-static allow !url_host"
}
}
}'
| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| max_rate_count | int | 是 | 必填项,限速值 |
| leading_flow_count | int | 否 | 非必填,前面多少字节不限速 |
| leading_flow_unit | string | 否 | 非必填,前面多少字节不限速单位,值范围:[KB,MB],默认MB |
| max_rate_unit | string | 否 | 非必填,限速单位,值范围:[KB,MB],默认MB |
#Squid扩展配置
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token":"xxx",
"domains":"aa.qingcdn.com",
"config": {
"rate_limit": {
"max_rate_count":10
}
}
}'
| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| origin | string | 是 | 必填项,源站地址 |
| port | int | 否 | 非必填,回源端口,不填时根据protocol参数来决定,protocol=http时,port=80;protocol=https时,port=443;protocol=default时,port传入值不生效,固定为0,参数范围(0,65535) |
| protocol | string | 否 | 非必填,回源协议;可选值[default,http,https];默认值default;default:遵循请求端口和请求协议回源(请求xx端口则回源xx端口,请求https协议回源走https协议);http:回源固定走http协议;https:回源固定走https协议 |
| host | string | 否 | 非必填,回源host;默认值"",需要为域名格式;当没有设置回源host时,回源host头部会和加速域名一致 |
| level | int | 否 | 非必填,主备等级,数值越大优先级越大;可选值[10,20];默认值"20";注:当多个源站主备等级一致时,则均为主源,如果多个源站主备等级不同,则数值最大的为主源,其余的为备源,且备源的主备等级数值越大优先级越高;例如某加速域名设置了4个回源IP,A和B主备等级均为20,C的主备等级为15,D的主备等级为10,则在A和B源正常时,优先回AB源,当A和B均异常时,优先回C源,ABC均异常时,回D源 |
| weight_level | int | 否 | 非必填,权重等级;可选值[1,10000];默认值"1";注:权重等级数值越高,权重越大,当主备等级一致时,会根据权重比例回源;例如:某加速域名设置了2个源站,A源和B源主备等级均为20,A源权重等级为60,B源权重等级为40,则A源的回源请求数约为该域名总回源请求数的60%,B源的回源请求数约为该域名总回源请求数的40% |
| isp | string | 否 | 非必填,运营商,指定运营商回源;可选值[default.dx.lt.yd];默认值"default";注:当设置了该项配置时,默认源"default"值必须设置;例如某加速域名设置了电信源A,则必须设置默认源B,指定电信请求回到A源站,其他请求回到B源站; |
| connect_time | int | 否 | 非必填,TCP建联时间,TCP建联时间指 回源时的TCP建联超时时间,默认15秒, 可设置3~60秒之间的正整数 |
特殊说明 :
1.和域名源/回源HOST 子服务和此子服务配置存在冲突,该子服务的优先级更高
2.当host配置为空且配置有回源HOST有配置时,以回源HOST为准
3.该子服务优先级低于拓展配置
4.配置是覆盖模式,当前不支持追加
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token": "xxx",
"domains": "aa.qingcdn.com",
"config": {
"new_origin": [
{
"origin": "1.1.1.1",
"port": 80,
"protocol": "http",
"host": "example.com",
"level": 20,
"weight_level": 1,
"isp": "default"
}
]
}
}'
| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| share_way | string | 是 | 必填项,共用方式,值范围:[inner_share,cross_single_share,cross_all_share]inner_share:本域名内HTTP、HTTPS共用缓存;cross_single_share:不同域名间HTTP、HTTPS分别共用缓存cross_all_share:不同域名间HTTP、HTTPS全部共用缓存 |
| domain | string | 是 | 必填项,待共享的域名share_way为cross_single_share和cross_all_share此项才生效 |
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token":"xxx",
"domains":"aa.qingcdn.com",
"config": {
"cache_share": {
"share_way": "cross_single_share",
"domain": "bb.qingcdn.com"
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| regex | string | 是 | 必填项,匹配的url |
| head_op | string | 是 | 必填项,操作内容,值范围:[ADD,DEL,ALT];ADD:增加;DEL:删除;ALT:修改; |
| head_direction | string | 是 | 必填项,方向,值范围:[CLI_REQ,CLI_REP,SER_REQ,SER_REP];CLI_REQ:客户端请求头;CLI_REP:客户端响应头;SER_REQ:回源请求头;SER_REP:源响应头; |
| head | string | 是 | 必填项,HTTP头名称 |
| value | string | 是 | 必填项(head_op = DEL时为非必填,其余为必填),头部值 |
| order | int | 是 | 必填项,优先级 |
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token":"xxx",
"domains":"aa.qingcdn.com",
"config": {
"head_control": {
"list": [
{
"regex": ".*",
"head_op": "ADD",
"head_direction": "CLI_REQ",
"head": "test_header",
"value": "X-test",
"order": 1
}
]
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| time | string | 是 | 必填项,超时时间,单位s,值范围:[5-300] |
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token":"xxx",
"domains":"aa.qingcdn.com",
"config": {
"timeout": {
"time": "6"
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| origin_connect_timeout | string | 是 | 必填项,回源建联超时时间,单位s,值范围:[5-60] |
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token":"xxx",
"domains":"aa.qingcdn.com",
"config": {
"connect_timeout": {
"origin_connect_timeout": "10"
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| auth_url | string | 是 | 仅支持http协议开头的url,例如http://test.com/ |
| match_method | string | 否 | 默认【default】,【default】所有,【ext】仅匹配对应后缀,【regex】仅匹配正则内容 |
| pattern | string | 否 | 默认为空匹配所有,match_method=ext时,必填后缀逗号,隔开,match_method=regex时,必填正则匹配 |
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token":"xxx",
"domains":"test.com",
"config": {
"qiniu_origin_auth": {
"auth_url": "http://test.com/",
"match_method": "ext",
"pattern": "jpg,web,html"
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| codes | array | 是 | 继续跳转的参数类型; 301:301跳转;302:302跳转 301和302为int类型 |
# 添加继续取跳转后内容
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H 'content-type: application/json' \
-d '{
"token":"xxx",
"domains":"aa.qingcdn.com",
"config": {
"forward_status" : {
"codes": [
301,
302
]
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| code | array | 是 | 需要缓存的错误状态码; 可选值:400、403、404、414、500、501、502、503、504、506、5XX,均为string类型 |
| bcache | string | 是 | 是否需要缓存; 不缓存:off,缓存:on |
| cache_time | int | 否 | 缓存的单位时间,可选范围1-65535;注意,在bcache为on时,此参数必填 |
| cache_unit | string | 否 | 缓存的单位, 可选值有(year:年,month月,day:日,hour:时,minute:分,second:秒);注意,在bcache为on时,此参数必填 |
# 错误状态码缓存
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H 'content-type: application/json' \
-d '{
"token": "xxx",
"domains": "aa.qingcdn.com",
"config": {
"cache_error_code" : {
"code": [
"403"
],
"bcache": "off"
}
}
}'curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H "Content-Type: application/json"\
-d '{
"token":"xxx",
"domains":"aa.qingcdn.com,bb.qingcdn.com",
"config": {
"origin": {
"default_master": "133.233.133.33",
"default_slave": "12.13.41.21"
},
"origin_host": {
"host": "test.qingcdn.com"
},
"referer": {
"type": 1,
"list": [
"*.qingcdn.com",
"new.vx.qingcdn.com"
],
"allow_empty": false
},
"ip_black_list": {
"list": [
"14.12.11.0/24",
"1.2.3.1"
]
},
"ip_white_list": {
"list": [
"14.12.11.0/24",
"1.2.3.1"
]
},
"add_response_head":{
"type":"add",
"list":[
{
"name":"Content-Type",
"value":"text/html; charset=ISO-8859-4"
},
{
"name":"Cache-Control",
"value":"max-age=300, must-revalidate"
}
]
},
"https":{
"cert_id":123
},
"visit_timestamp": {
"pattern": ".*",
"time_format": "timestamp",
"key": "c3RyaWN0b",
"keyname": "sign",
"timename": "time",
"deadtime": "3600",
"req_uri_type": "2",
"origin_type": "2",
"error_page": "",
"style": "$ourkey$uri$time"
},
"cache_rule": [
{
"type": "2",
"pattern": "/product/index,/test/index,/user/index",
"time": 86400,
"timeunit": "s"
},
{
"type": "1",
"pattern": "jpg,png,gif",
"time": 86400,
"timeunit": "s"
},
{
"type": "3",
"pattern": "/index.html,/test/*.jpg,/user/get?index",
"time": 86400,
"timeunit": "s"
}
],
"video_drag": {
"url": "\\.(mp4|flv|f4v|m4v)",
"mp4": "off",
"flv": "off",
"start": "start",
"end": "end"
},
"compress_response": {
"content_type": [
"text/plain",
"application/x-javascript"
],
"min_size": "2",
"min_size_unit": "KB"
}
}
}'JSON格式(请求时传对应的参数, 设置成功后会输出对应设置成功后的配置参数)
{
"code": 0,//0操作成功, 非0时会给出对应的错误提示
"data": {
"config": {
"origin": {
"default_master": "133.233.133.33",
"default_slave": "12.13.41.21"
},
...
}
}
}| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| error_status_code | int | 是 | 错误状态码,取值范围为400<=x<=599 |
| redirect_status_code | int | 是 | 重定向状态码,取值范围为301,302 |
| redirect_url | string | 是 | 重定向URL,必须使用,http:// 或 https:// 开头,并且符合URL的格式 |
curl -X POST 'http://cdn.api.baishan.com/v2/domain/config' \
--header 'content-type: application/json' \
-d '{
"domains": "a.baishan.com",
"token": "xxxxxx",
"config": {
"error_page_rewrite": [
{
"error_status_code": 400,
"redirect_url": "http://a.baishan.com/err.html",
"redirect_status_code": 301
}
]
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| limit_value | int | 是 | 限制大小值,取值范围为1<=x<=1024,单位M |
curl -X POST 'http://cdn.api.baishan.com/v2/domain/config' \
--header 'content-type: application/json' \
-d '{
"domains": "a.baishan.com",
"token": "xxxxxx",
"config": {
"post_upload_size_limit": {
"limit_value": 30
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| origin_url | string | 是 | 改写前的原始Path 正则表达式。注:以/开头,匹配原始的客户端访问路径+请求参数,并且需要使用正则表达式(例如:/test/a.jpg?a=1),正则相关特殊字符可以使用进行转义。同时,您可以在正则表达式中指定组,组是由 () 包裹的。这些组可以在目标回源路径中使用$n引用。例如,/aaa/bbb/(.*) 表示路径/aaa/bbb/下的所有目录和文件。该例子包含了一个组。 |
| target_url | string | 是 | 改写后的目标Path 正则表达式。注:以/开头,包含回源路径+请求参数,(例如:/newtest/b.jpg?a=1)。举例:待重写回源路径设置为/test/(.)/(.).jpg,目标回源路径设置为/newtest/$1/$2.apk,则用户访问请求的回源路径为/test/a/b.jpg时,根据$1将捕获第一个正则括号内的内容,即为a;$2将捕获第二个正则括号内的内容,即为b,则实际回源路径将被改写为/newtest/a/b.apk。 |
curl -X POST 'http://cdn.api.baishan.com/v2/domain/config' \
--header 'content-type: application/json' \
-d '{
"domains": "a.baishan.com",
"token": "xxxxxx",
"config": {
"source_url_rewrite": [
{
"origin_url": "/aaa/(*).html",
"target_url": "/bbb/$1"
}
]
}
}'备注:combined_ban [] 里面 每一个{} 表示一条规则,configs 里面 每个封禁类型配置 对应组合的封装项
| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| action | string | 否 | 组合封禁方式,默认:封禁 ban,注当前只支持封禁ban方式 |
| configs | array | 是 | 规则组配置信息key |
| * method(例配置method 请求方式封禁) | string | 是 | 封禁类型key,当前只支持 method、ip、referer、url、ua |
| is_match | string | 否 | 所有封禁类型都支持,是否匹配,不匹配则按非范围处理,默认:yes,可选:yes,no |
| case_insensitive | string | 否 | 仅封禁类型(ua、url)支持,区分大小写,默认:区分 yes,可选:区分 yes,不区分 no |
| method_type | string | 是(封禁类型为method必填) | http请求方式,默认:get,可选:get,post |
| list | string | 是(封禁类型为ip、referer、url、ua必填) | 名单列表, 支持正则表达式,传入的内容默认是模糊匹配,精确匹配需要加上^$ 如: ^test\-yp$ |
组合封禁优先级说明 : 优先级按规则数组排序,由高至低排序
组合封禁类型说明 : 一组{}规则,configs里面的method、ip、referer、url、ua,封禁类型不能重复
组合封禁规则名单列表使用说明 :
1.ip列表 正常的IP地址,支持
/8,/16,/24格式的网段设置,网段不能存在交叉重复.例如:
["1.1.1.0/24", "2.2.2.2", "3.3.3.3"]2.referer列表,默认模糊匹配,不区分大小写.
例如:
["*.aaa.qingcdn.com", "www.qingcdn.com","*.test.com"]3.url列表,支持正则表达式,传入的内容默认是模糊匹配,精确匹配需要加上^$
例如:
模糊匹配:http://.www.ttt1.com/1.txt
精确匹配:^https?://
[^/]+/dir1/dir2/(dir3_1|dir3_2).html$该规则匹配当前域名下/dir1/dir2/dir3_1.html和/dir1/dir2/dir3_2.html规则.
4.ua列表,传入的内容默认是模糊匹配,精确匹配需要加上^$ 。
例如: 模糊匹配: test-yp, 精确匹配: ^test-yp$
{
"domains": "testxx.xxx.com",
"config": {
"combined_ban": [
//第一条规则 配置ua、url、referer组合封禁
{
"action": "ban",
"configs": {
"ua": {
"is_match": "yes",
"case_insensitive": "yes",
"list": [
"^test\\-yp$",
"test\\.com"
]
},
"url": {
"is_match": "yes",
"case_insensitive": "yes",
"list": [
"^http://.www.ttt1.com/1.txt",
"http://.www.ttt2.com/2.txt",
"^http://[^/]+www.ttt2.com/2.txt"
]
},
"referer": {
"is_match": "no",
"list": [
"www.baidu.com",
"test.test.com"
]
}
}
},
//第二条规则 method(请求方式)、ip组合封禁
{
"action": "ban",
"configs": {
"method": {
"is_match": "yes",
"method_type": "post"
},
"ip": {
"is_match": "yes",
"list": [
"2.2.2.2",
"1.1.1.1"
]
}
}
},
//第二条规则 method(请求方式)组合封禁
{
"action": "ban",
"configs": {
"method": {
"is_match": "no",
"method_type": "get"
}
}
}
]
}
}JSON格式(请求时传对应的参数, 设置成功后会输出对应设置成功后的配置参数)
备注:combined_ban [] 里面 每一个{} 表示一条规则,configs 里面 每个封禁类型配置 对应组合的封装项
{
"code": 0,//0操作成功, 非0时会给出对应的错误提示
"domains": [
{
"id": "310649",
"domain": "testxx.xxx.com"
}
],
"data": {
"config": {
"combined_ban": [
//第一条规则
{
"action": "ban",
"configs": {
"ua": {
"is_match": "yes",
"case_insensitive": "yes",
"list": [
"^test\\-yp$",
"test\\.com"
]
},
"referer": {
"is_match": "no",
"list": [
"www.baidu.com",
"test.test.com"
]
},
"url": {
"is_match": "yes",
"case_insensitive": "yes",
"list": [
"^http://.www.ttt1.com/1.txt",
"http://.www.ttt2.com/2.txt",
"^http://[^/]+www.ttt2.com/2.txt"
]
}
}
},
//第二条规则
{
"action": "ban",
"configs": {
"ip": {
"is_match": "yes",
"list": [
"2.2.2.2",
"1.1.1.1"
]
},
"method": {
"is_match": "yes",
"method_type": "post"
}
}
},
//第三条规则
{
"action": "ban",
"configs": {
"method": {
"is_match": "no",
"method_type": "get"
}
}
}
]
}
}
}| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| urls | string[] | 是 | 封禁的URL列表 |
curl -X POST 'http://cdn.api.baishan.com/v2/domain/config' \
--header 'content-type: application/json' \
-d '{
"domains": "a.baishan.com",
"token": "xxxxxx",
"config": {
"deny_url": {
"urls": [
"http://www.test.com/5.txt",
"^http://[^/]+www.ttt2.com/2.txt",
"^https?://[^/]+/test1/test2\\?cd=sad($|\\?)"
]
}
}
}'JSON格式(请求时传对应的参数, 设置成功后会输出对应设置成功后的配置参数)
{
"code": 0,
"data": {
"domains": [
{
"id": "123",
"domain": "a.baishan.com"
}
],
"config": {
"deny_url": {
"urls": [
"http://www.test.com/5.txt",
"^http://[^/]+www.ttt2.com/2.txt",
"^https?://[^/]+/test1/test2\\?cd=sad($|\\?)"
]
}
}
}
}| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| isp | string | 是 | 运营商,必须默认运营商default,可选范围:【default,dx,lt,yd】 |
| ips | string[] | 是 | 回源,可配置ip或者域名,注:同一条配置[]回源类型只能一种 |
| group_sort | int | 是 | 主备顺序,取值范围1~10 |
| weight | int | 否 | 权重,取值范围1~10000 |
| origin_mode | string | 否 | 回源模式默认default,可选范围:【default,http,https,custom】,注:选custom可自定义回源协议和端口 |
| protocol | string | 否 | 回源协议 |
| port | int | 否 | 回源端口 |
| host_mode | string | 否 | 回源host模式默认default, 可选范围:【default,custom】,注:选custom可自定义回源host |
| host | string | 否 | 回源host |
| auth_type | string | 否 | 鉴权类型默认default无鉴权, 可选范围:【default,oss,tos】,注:选oss可配置【auth_bucket_name】,选tos可配置【auth_expire,auth_cdn_tag】, 鉴权通用参数auth_secret_key,auth_access_key |
| auth_secret_key | string | 否 | secret_key秘钥 |
| auth_access_key | string | 否 | access_key秘钥 |
| auth_bucket_name | string | 否 | bucket_name存储桶名 |
| auth_expire | int | 否 | expire过期时间,如:300 五分钟到期 |
| auth_cdn_tag | string | 否 | cdn_tag标识 |
| parse_priority | string | 否 | 源站优先解析设置默认default,可选范围:【default,v4,v4v6,v6v4,v6】,注:v4v6表示先v4后v6 |
curl -X POST 'https://cdn.portal.baishan.com/v2/domain/config?token=xxx' \
--header 'Content-Type: application/json' \
-d '{
"domains": "www.test.com",
"config": {
"tos_origin": [
{//第一条
"isp": "default",
"group_sort": 3,
"ips": [
"www.text1.com",
"www.text2.com"
],
"origin_mode": "default"
},
{//第二条
"isp": "default",
"port": 443456,
"group_sort": 1,
"weight": 1000,
"auth_expire": 600,
"ips": [
"1.1.1.1"
],
"protocol": "httpsav",
"host": "www.test.com",
"auth_bucket_name": "",
"auth_secret_key": "xxx",
"auth_access_key": "xxx",
"auth_cdn_tag": "xxxx",
"origin_mode": "custom",
"host_mode": "custom",
"auth_type": "tos",
"parse_priority": "v4v6"
}
]
}
}'返回示例
{
"code": 0,
"data": {
"domains": [
{
"id": "56784",
"domain": "www.test.com"
}
],
"config": {
"tos_origin": [
{//第一条
"isp": "default",
"group_sort": 3,
"ips": [
"www.text1.com",
"www.text2.com"
],
"origin_mode": "default"
},
{//第二条
"isp": "default",
"port": 443456,
"group_sort": 1,
"weight": 1000,
"auth_expire": 600,
"ips": [
"1.1.1.1"
],
"protocol": "httpsav",
"host": "www.test.com",
"auth_bucket_name": "",
"auth_secret_key": "xxx",
"auth_access_key": "xxx",
"auth_cdn_tag": "xxxx",
"origin_mode": "custom",
"host_mode": "custom",
"auth_type": "tos",
"parse_priority": "v4v6"
}
]
}
}
}| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| head | string | 是 | 客户端真实ip头 |
curl -X POST 'https://cdn.portal.baishan.com/v2/domain/config?token=xxx' \
--header 'Content-Type: application/json' \
-d '{
"token": "{{token}}",
"domains": "www.example.com",
"config": {
"client_real_ip": {
"head":"xxx-xxx-xxx"
}
}
}'| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| ua_list | string | 是 | User-Agent列表 |
| url_pattern | string | 是 | URL规则 |
| url_case_insensitive | string | 是 | URL忽略大小写,值范围["yes", "no"] |
| allow_empty_ua | string | 是 | 允许空User-Agent,值范围["yes", "no"] |
| ua_case_insensitive | string | 是 | User-Agent忽略大小写,值范围['yes', 'no'] |
| url_match_type | string | 是 | URL匹配类型,值范围['all'(所有), 'ext'(后缀), 'dir'(目录), 'route'(路径), 'regex'(正则)] |
| ua_type | string | 是 | User-Agent黑白名单类型,值范围["black"(UA黑名单模式), "white"(UA白名单模式)] |
| ua_match_type | string | 是 | User-Agent匹配模式,值范围["pattern"(模糊匹配), "exact"(精确匹配)] |
调用示例:
curl -X POST 'https://cdn.portal.baishan.com/v2/domain/config?token=xxx' \
--header 'Content-Type: application/json' \
-d '{
"token": "{{token}}",
"domains": "www.example.com",
"config": {
"user_agent": {
"ua_type": "black",
"allow_empty_ua": "no",
"ua_match_type": "pattern",
"ua_list": "curl\nCurl\nwget\nWget\ngo\nGo",
"ua_case_insensitive": "yes",
"url_case_insensitive": "yes",
"url_match_type": "all",
"url_pattern": ".*"
}
}
}'响应示例:
{
"code": 0,
"data": {
"domains": [
{
"id": "1",
"domain": "www.example.com"
}
],
"config": {
"user_agent": {
"ua_list": "curl\nCurl\nwget\nWget\ngo\nGo",
"url_pattern": ".*",
"url_case_insensitive": "yes",
"allow_empty_ua": "no",
"ua_case_insensitive": "yes",
"url_match_type": "all",
"ua_type": "black",
"ua_match_type": "pattern"
}
}
}
}| 参数名 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| limit_type | string | 是 | 限制类型:white:白名单black:黑名单 |
| country_list | string | 是 | 国家列表,多个国家用英文逗号隔开(,):china:中国republic of korea:韩国viet nam:越南thailand:泰国japan:日本india:印度singapore:新加坡indonesia:印度尼西亚malaysia:马来西亚bahrain:巴林iran:伊朗iraq:伊拉克qatar:卡塔尔cambodia:柬埔寨saudi arabia:沙特阿拉伯kuwait:科威特pakistan:巴基斯坦myanmar:缅甸united arab emirates:阿联酋philippines:菲律宾turkey:土耳其bangladesh:孟加拉国laos:老挝italy:意大利russian federation:俄罗斯spain:西班牙germany:德国france:法国netherlands:荷兰united kingdom:英国brazil:巴西colombia:哥伦比亚nigeria:尼日利亚egypt:埃及south africa:南非australia:澳大利亚mexico:墨西哥united states:美国 |
# 访问区域黑白名单
curl -X POST "https://cdn.api.baishan.com/v2/domain/config"\
-H 'content-type: application/json' \
-d '{
"token": "xxx",
"domains": "aa.qingcdn.com",
"config": {
"visit_areas_limit" : {
"limit_type": "white",
"country_list": "china"
}
}
}'HTTP/1.0 200 OK
Api-Id: 221328331
Content-Type: application/json; charset=utf-8
X-Ratelimit-Grad: minute //接口调用频率限制粒度(分/小时/天)
X-Ratelimit-Limit: 50 //当前每分钟请求次数上限
X-Ratelimit-Remaining: 29 //每分钟剩余请求次数
X-Retry-After: 43 //xx秒后重置当前粒度(分/小时/天)请求次数限制| 错误状态码 | 说明 |
|---|---|
| 404 | 您输入的 URL 错误 |
| 401 | 鉴权错误,您的token错误,或者没有开通接口权限 |
| 400 | 请求参数有误 |
| 200 | 执行成功,返回请求的数据 |
| 5xx | 请联系值班同事 |