Request URL: stat/log/getList (GET)
Endpoint Domain Name:
cdn.api.baishan.com
Endpoint Version:v2
Get the download URL of raw logs for the specified domain name.
Note: Logs are reserved for 14 days. Please make sure to download before the expiration. Request frequency limit can be found the response header, X-Ratelimit-Limit.
Note:Please request an API token from your BaishanCloud account team.
Specify request parameters in the URL query strings, i.e. ?key1=value1&key2=value2.
Parameter | Data Type | Requirement | Description |
---|---|---|---|
domains | string | Required | A single domain name. E.g. aa.qingcdn.com |
start_time | string | Required | Start time, format (YYYY-MM-DD and YYYY-MM-DD HH:ii). If 2017-04-26 is the value, the system will interpret the start time as 2017-04-26 00:00. |
end_time | string | Required | End time, format (YYYY-MM-DD and YYYY-MM-DD-HH:ii). If 2017-04-26 is the value, the system will interpret the end time as 2017-04-26 23:59. |
with_type | string | Optional | Use the value Video_log to retrieve live streaming logs. E.g.with_type=video_log |
need_md5 | int | Optional | 0 : Default. Does not return MD5 data.1 : Download log data with MD5 information. |
need_size | int | Optional | 0 : Default. Does not return size data.1 : Download log data with size information. |
curl -X GET
"https://cdn.api.baishan.com/v2/stat/log/getList?token=xxx&start_time=2018-02-03&end_time=2018-02-03&domain=aa.qingcdn.com&need_md5=1&need_size=1"
{
"code": 0, //0 = Success. Other code is displayed if the request failed.
"data": [
{
"domain": "aa.qingcdn.com",
"date": "2018-02-03 00:00",
"type": "1",//1=General log, 2=Live streaming log
"url": "http://xxxxx/cdnlog/aa.qingcdn.com/201802030000.gz?AWSAccessKeyId=v0l8ci2mrxowhnbz6e1q&Expires=1518197410&Signature=NvmPNmztJHO9C4ZIYZScH2wJO7s%3D"
"md5": "12ee210scb41cfd6311ec22c2c9ssf64",
"size": 4235
}
]
}
Note: When the domain name does not have traffic, the returned data is empty.
{
"code":0,
"data":[]
}
HTTP/1.0 200 OK
Api-Id: 63832415
Content-Type: application/json; charset=utf-8
X-Ratelimit-Grad: minute
X-Ratelimit-Limit: 300
X-Ratelimit-Remaining: 299
X-Retry-After: 50
Error Code | Description |
---|---|
404 | Bad request URLs. |
401 | Authorization Error: Invalid token or lack of access. |
400 | Bad request parameters. |
200 | Success. |
5xx | Please contact your account team. |