Baidu AI Cloud
中国站

百度智能云

CDN

Log Interface

Get Single Domain Name Log

This interface is used to get the log download address of a certain domain name within a specified time period. Logs are stored for 180 days.

Method Path Description
GET /v2/log/{domain}/log Provide the log download address of a certain domain name

domain: You have to get the domain name of logs.

URL parameters:

Parameter Optional Type Description
startTime Required Timestamp Time to start getting the log, UTC time
endTime Required Timestamp Time to end getting the log, UTC time

Response body

Parameter Type Description
logs List type, LogEntry content is as follows:
- url: String type, indicating the downloaded logs.
- name: String type, indicating the log file name.
- size: Int type, indicating the file size.
- startTime: Timestamp type, indicating the start time of logs in the file, UTC time.
- endTime: Timestamp type, indicating the end time of logs in the file, UTC time.
Log url list

Access Multiple Logs of Domain Name

This interface is used to get the log download address of multiple domain names within a specified time period. Logs are stored for 180 days, that is, you can only download logs which are within 180 days.

Method Path Description
POST /v2/log/list Provide the download links of the logs of multiple domain names

Request body

Parameter Optional Type Description
startTime Required Timestamp Time to start getting the log, UTC time
endTime Required Timestamp Time to end getting the log, UTC time
type Optional Long 2 -> dsa logs; Others -> Access logs
domains Optional List<String> Domain name list
pageNo Optional int Page number, starting from 1
pageSize Optional int Count of returned log per page

Response body

Parameter Type Description
startTime Timestamp Time to start getting the log, UTC time
endTime Timestamp Time to end getting the log, UTC time
urls list<LogEntry> Log url list
totalCount int Count of url lists

LogEntry :

Parameter Type Description
domain String Domain name
url String Download logs
name String The log file name
size Int File size
logTimeBegin Timestamp Log start time in the file, UTC time
logTimeEnd Timestamp Log end time in the file, UTC time

Request example

POST /v2/log/list HTTP/1.1 
Host: cdn.baidubce.com 
  
{"type":2,"domains":["xiao01097.baidu.com"],"startTime":"2019-03-04T00:00:00Z","endTime":"2019-03-04T23:00:00Z","pageNo":1,"pageSize":1000} 

Return example

HTTP/1.1 200
Content-Length: 190
Content-Type: application/json;utf-8
x-bce-request-id: 81d0b05f-5ad4-1f22-8068-d5c9de60a1d7
Server: BCE-CDN 
 
{ 
    "startTime": "2019-03-04T00:00:00Z", 
    "endTime": "2019-03-04T23:00:00Z", 
    "urls": [ 
        {"domain": "xiao01097.baidu.com","name": "1.text","logTimeBegin": "2019-03-04T04:00:00Z","logTimeEnd": "2019-03-04T05:00:00Z","size": 100,"url": "http://XXX"} 
    ], 
    "totalCount": 1 
}
Previous
Dynamic Acceleration Interface
Next
Usage Query