{
  "tags": [
    "网站监控"
  ],
  "description": "下载由 `POST /v1/jobs` 的 `down_http_access_log` 任务生成的 gzip 访问日志。接口要求登录，仅任务创建者可下载；关联 task 状态必须为 `done`，且临时下载文件尚未被清理。成功下载时文件名优先使用任务数据中 host 的第一个域名加 job ID。",
  "operationId": "user_get_v1_monitor_site_download_access_log_job_id",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "下载成功时返回 gzip 二进制附件；响应的 Content-Disposition 文件名为 `{host}-{job_id}.log.gz` 或 `{job_id}.log.gz`。",
      "headers": {
        "Content-Disposition": {
          "schema": {
            "type": "string"
          },
          "description": "附件下载头，包含服务端生成的日志文件名。"
        }
      },
      "content": {
        "application/gzip": {
          "schema": {
            "type": "string",
            "format": "binary",
            "description": "gzip 压缩的访问日志文件。"
          }
        }
      }
    },
    "403": {
      "description": "任务存在但不属于当前登录用户。响应为中文纯文本 `无权限`。",
      "content": {
        "text/plain": {
          "schema": {
            "type": "string",
            "enum": [
              "无权限"
            ]
          },
          "example": {
            "code": 0,
            "msg": "成功",
            "data": null
          }
        }
      }
    },
    "404": {
      "description": "任务不存在、任务尚未完成或已生成文件被清理。响应为中文纯文本。",
      "content": {
        "text/plain": {
          "schema": {
            "type": "string",
            "enum": [
              "任务不存在",
              "任务未完成",
              "文件不存在或已被清理"
            ]
          },
          "example": {
            "code": 0,
            "msg": "成功",
            "data": null
          }
        }
      }
    }
  },
  "x-python-handler": "monitor.DownloadAccessLogAPI",
  "x-python-route-line": 792,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [
    {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "integer"
      },
      "description": "访问日志下载任务（job）ID。",
      "example": 501
    }
  ],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "monitor.DownloadAccessLogAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 792
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "user"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "get",
  "path": "/v1/monitor/site/download-access-log/{job_id}",
  "servers": [
    {
      "url": "https://master.example.invalid",
      "description": "不可调用的示例地址；复制示例后替换为自己的主控域名。"
    }
  ],
  "securitySchemes": {
    "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 同时发送。"
    }
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "下载已生成的访问日志文件",
    "description": {
      "content": "下载由 `POST /v1/jobs` 的 `down_http_access_log` 任务生成的 gzip 访问日志。接口要求登录，仅任务创建者可下载；关联 task 状态必须为 `done`，且临时下载文件尚未被清理。成功下载时文件名优先使用任务数据中 host 的第一个域名加 job ID。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "monitor",
        "site",
        "download-access-log",
        ":job_id"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": [
        {
          "disabled": false,
          "description": {
            "content": "(Required) 访问日志下载任务（job）ID。",
            "type": "text/plain"
          },
          "type": "any",
          "value": "",
          "key": "job_id"
        }
      ]
    },
    "header": [
      {
        "key": "Accept",
        "value": "application/gzip"
      }
    ],
    "method": "GET",
    "auth": {
      "type": "apikey",
      "apikey": [
        {
          "type": "any",
          "value": "access-token",
          "key": "key"
        },
        {
          "type": "any",
          "value": "{{apiKey}}",
          "key": "value"
        },
        {
          "type": "any",
          "value": "header",
          "key": "in"
        }
      ]
    }
  }
}