itecdn 5.x / 用户 API
下载已生成的访问日志文件
GET
/v1/monitor/site/download-access-log/{job_id}下载由 POST /v1/jobs 的 down_http_access_log 任务生成的 gzip 访问日志。接口要求登录,仅任务创建者可下载;关联 task 状态必须为 done,且临时下载文件尚未被清理。成功下载时文件名优先使用任务数据中 host 的第一个域名加 job ID。
身份认证
access-token
api-key + api-secret
认证定义
{
"AccessToken": {
"type": "apiKey",
"in": "header",
"name": "access-token",
"description": "通过登录接口获得的短期访问令牌。"
},
"ApiKey": {
"type": "apiKey",
"in": "header",
"name": "api-key",
"description": "API Key;必须和 api-secret 同时发送。"
},
"ApiSecret": {
"type": "apiKey",
"in": "header",
"name": "api-secret",
"description": "API Secret;必须和 api-key 同时发送。"
}
}请求参数
| 参数 | 位置 | 类型 | 必填 | 说明与约束 |
|---|---|---|---|---|
job_id | path | integer | 必填 | 访问日志下载任务(job)ID。 完整参数定义 |
响应
HTTP 200
下载成功时返回 gzip 二进制附件;响应的 Content-Disposition 文件名为 {host}-{job_id}.log.gz 或 {job_id}.log.gz。
application/gzip
string (binary)
gzip 压缩的访问日志文件。
完整 Schema
{
"type": "string",
"format": "binary",
"description": "gzip 压缩的访问日志文件。"
}响应头
{
"Content-Disposition": {
"schema": {
"type": "string"
},
"description": "附件下载头,包含服务端生成的日志文件名。"
}
}HTTP 403
任务存在但不属于当前登录用户。响应为中文纯文本 无权限。
text/plain
string
完整 Schema
{
"type": "string",
"enum": [
"无权限"
]
}示例
{
"code": 0,
"msg": "成功",
"data": null
}HTTP 404
任务不存在、任务尚未完成或已生成文件被清理。响应为中文纯文本。
text/plain
string
完整 Schema
{
"type": "string",
"enum": [
"任务不存在",
"任务未完成",
"文件不存在或已被清理"
]
}示例
{
"code": 0,
"msg": "成功",
"data": null
}cURL 示例
根据文档生成;请替换主控地址、路径参数和凭证,并按上表补充查询参数。
curl --request GET \
"https://master.example.invalid/v1/monitor/site/download-access-log/{job_id}" \
--header "access-token: YOUR_ACCESS_TOKEN"