刷新URL (数据格式为数组)
post:/v1/jobs
*type#任务类型,clean_url为刷新URL任务
*json:data#格式为json,如{"url":"http://www.qq.com/"},表示清理www.qq.com的首页。
<<<
返回结果
{
"code":0,
"data": ["1","2"],
"msg": "添加成功"
}
<<<
请求内容
[{
"type": "clean_url",
"data": {
"url": "http://for-test.cdnfly.cn/"
}
}, {
"type": "clean_url",
"data": {
"url": "http://www.qq.com/"
}
}]
刷新目录
post:/v1/jobs
*type#任务类型,clean_dir为刷新目录
*json:data#格式为json,如{"url":"http://www.qq.com/"},表示清理www.qq.com全站。
<<<
返回结果
{
"code":0,
"data": ["1","2"],
"msg": "添加成功"
}
<<<
请求内容
[{
"type": "clean_dir",
"data": {
"url": "http://for-test.cdnfly.cn/"
}
}, {
"type": "clean_dir",
"data": {
"url": "http://www.qq.com/"
}
}]
预热URL
post:/v1/jobs
*type#任务类型,pre_cache_url为预热URL
*json:data#格式为json,如{"url":"http://www.qq.com/"},表示预热www.qq.com首页。
<<<
返回结果
{
"code":0,
"data": ["1","2"],
"msg": "添加成功"
}
<<<
请求内容
[{
"type": "pre_cache_url",
"data": {
"url": "http://for-test.cdnfly.cn/"
}
}, {
"type": "pre_cache_url",
"data": {
"url": "http://www.qq.com/"
}
}]
查询刷新URL、刷新目录、预热URL任务
get:/v1/jobs
integer:page=1#当前页码
integer:limit=10#单页显示数量
type#任务类型,可选为clean_url、clean_dir、pre_cache_url
key1#搜索刷新的域名
key2#搜索刷新的url,需要经过urlencode,如http://www.qq.com/ urlencode后为http%3A%2F%2Fwww.qq.com%2F。
<<<
返回结果
{
"code": 0,
"count": 6,
"data": [
{
"create_at": null,
"create_at2": "2021-11-26 19:59:37",
"data": "{\"url\": \"http://for-test.cdnfly.cn/\"}",
"end_at": "2021-11-26 19:59:41",
"id": 32348,
"key1": "for-test.cdnfly.cn",
"key2": "http://for-test.cdnfly.cn/",
"progress": null,
"ret": null,
"state": "done",
"task_id": 120624,
"type": "clean_url",
"uid": 2
},
{
"create_at": null,
"create_at2": "2021-11-26 19:47:05",
"data": "{\"url\": \"http://www.qq.com/\"}",
"end_at": "2021-11-26 19:47:05",
"id": 32341,
"key1": "www.qq.com",
"key2": "http://www.qq.com/",
"progress": null,
"ret": null,
"state": "done",
"task_id": 120595,
"type": "clean_url",
"uid": 2
}
]
}
解锁黑名单
post:/v1/jobs
*type#任务类型,unlock_ip为解锁黑名单
*json:data#格式为json,如{"site_id":"327","ip":"1.1.1.1","key1":"site_id"},表示解锁网站ID为327,IP为1.1.1.1的黑名单;{"site_id":"327","key1":"site_id"}表示解锁网站id为327的全部黑名单。
<<<
返回结果
{
"code":0,
"data": ["1","2"],
"msg": "添加成功"
}
<<<
请求内容
[{
"type": "unlock_ip",
"data": {
"site_id": "327",
"ip": "2.2.2.2",
"key1": "site_id"
}
}, {
"type": "unlock_ip",
"data": {
"site_id": "327",
"ip": "1.1.1.1",
"key1": "site_id"
}
}]
查询解锁黑名单任务
get:/v1/jobs
integer:page=1#当前页码
integer:limit=10#单页显示数量
*type#任务类型,unlock_ip为解锁黑名单
key1#查询指定网站的解锁任务,填入网站ID
<<<
返回结果
{
"code": 0,
"count": 3,
"data": [{
"create_at": null,
"create_at2": "2021-11-26 21:03:08",
"data": "{\"ip\": \"__all__\", \"site_id\": \"327\"}",
"end_at": null,
"id": 1010611,
"key1": "327",
"key2": null,
"progress": null,
"ret": null,
"state": "pending",
"task_id": 4275092,
"type": "unlock_ip",
"uid": 2
}, {
"create_at": null,
"create_at2": "2021-11-26 21:02:45",
"data": "{\"ip\": \"__all__\", \"site_id\": \"327\"}",
"end_at": "2021-11-26 21:14:24",
"id": 1010610,
"key1": "327",
"key2": null,
"progress": null,
"ret": "",
"state": "process",
"task_id": 4275090,
"type": "unlock_ip",
"uid": 2
}, {
"create_at": null,
"create_at2": "2021-11-26 21:02:10",
"data": "{\"ip\": \"39.101.140.2\", \"site_id\": \"327\"}",
"end_at": "2021-11-26 21:06:16",
"id": 1010606,
"key1": "327",
"key2": null,
"progress": null,
"ret": null,
"state": "done",
"task_id": 4275080,
"type": "unlock_ip",
"uid": 2
}]
}
申请日志下载
get:/v1/jobs
*type#任务类型,down_http_access_log为日志下载任务
*json:data#日志筛选,如{"log_time":"2021-11-26","host":"for-test.cdnfly.cn","addr":"1.1.1.1","req_uri":"/index.php/index/pay/juhe_notify","status":"444","cache_status":"HIT"},log_time为日志时间,host为域名,addr来访客IP,req_uri为请求的uri,status为状态码,cache_status为缓存状态,可选为HIT或MISS。需要筛选的项才指定,比如只指定日志时间和域名{"log_time":"2021-11-26","host":"for-test.cdnfly.cn"}。
<<<
返回结果
{
"code":0,
"data": ["1","2"],
"msg": "添加成功"
}
<<<
请求内容
{
"type": "down_http_access_log",
"data": {
"log_time": "2021-11-26",
"host": "for-test.cdnfly.cn",
"addr": "1.1.1.1",
"req_uri": "/index.php/index/pay/juhe_notify",
"status": "444",
"cache_status": "HIT"
}
}
查询日志下载任务
get:/v1/jobs
integer:page=1#当前页码
integer:limit=10#单页显示数量
*type#任务类型,down_http_access_log为日志下载任务
<<<
返回结果
{
"code": 0,
"count": 4,
"data": [ {
"create_at": null,
"create_at2": "2021-11-26 21:18:38",
"data": "{\"log_time\": \"2021-11-26\", \"host\": \"for-test.cdnfly.cn\", \"addr\": \"1.1.1.1\"}",
"end_at": "2021-11-26 21:18:40",
"id": 1010621,
"key1": null,
"key2": null,
"progress": "100%",
"ret": null,
"state": "done",
"task_id": 4275118,
"type": "down_http_access_log",
"uid": 2
}, {
"create_at": null,
"create_at2": "2021-11-17 09:14:42",
"data": "{\"log_time\": \"2021-11-17\", \"host\": \"\"}",
"end_at": "2021-11-17 09:14:46",
"id": 1003129,
"key1": null,
"key2": null,
"progress": "100%",
"ret": null,
"state": "done",
"task_id": 4253184,
"type": "down_http_access_log",
"uid": 2
}]
}
下载日志
get:/v1/monitor/site/download-access-log/<任务ID>
*string:access_token#登录后返回的access_token,需要把/替换_,+替换为-,如javascript替换代码为access_token = access_token.replace(/\//g,"_");access_token = access_token.replace(/\+/g,"-")
<<<
返回结果
返回字节流