Updated on 2024-08-07 GMT+08:00

Querying Logs

Function

This API is used to query the link of downloading logs. Logs generated within 30 days can be queried.

URI

GET /v1.0/cdn/logs

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

domain_name

Yes

String

Domain name to be queried, for example, www.test1.com.

start_time

No

Long

Query start time. The value is a timestamp in milliseconds at the top of an hour. If this parameter is left empty, 00:00 of the current day is used by default.

end_time

No

Long

Query end time (excluding the end time point). The value is a timestamp in milliseconds at the top of an hour. The maximum time span between the start time and end time is 30 days. If this parameter is left empty, the start time plus one day is used by default.

page_size

No

Integer

Maximum number of records on a page. The value ranges from 1 to 10,000. The default value is 10.

page_number

No

Integer

Number of the page to be queried. The value ranges from 1 to 65,535. The default value is 1.

enterprise_project_id

No

String

ID of the enterprise project to which the resource belongs. This parameter is valid only when the enterprise project function is enabled. The value all indicates all projects. This parameter is mandatory when you use an IAM user to call this API.

Obtain the enterprise project ID by calling the ListEnterpriseProject API of Enterprise Project Management Service (EPS).

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

total

Integer

Total number of records.

logs

Array of LogObject objects

Log list.

Table 4 LogObject

Parameter

Type

Description

domain_name

String

Domain name.

start_time

Long

Query start time. The value is the number of milliseconds since the UNIX epoch (Jan 1, 1970).

end_time

Long

Query end time. The value is the number of milliseconds since the UNIX epoch (Jan 1, 1970).

name

String

Log file name.

size

Long

File size, in bytes.

link

String

Download link.

Example Requests

GET https://{endpoint}/v1.0/cdn/logs?start_time=1502380500000&end_time=1502384100000&domain_name=www.example.com&page_size=10&page_number=1&enterprise_project_id=0

Example Responses

Status code: 200

OK

{
  "logs" : [ {
    "domain_name" : "www.example.com",
    "start_time" : 1498838400000,
    "end_time" : 1502380500000,
    "name" : "www.xxxx.com-2017080315",
    "link" : "www.xxxx.web",
    "size" : 4096
  } ],
  "total" : 1
}

Status Codes

Status Code

Description

200

OK