列出构建日志
OpenAPI 契约
- 方法
- GET
- 路径
/api/v1/builds/{taskId}/logs- 认证
- jwtBearer (bearer) OR automationKey (bearer)
- 响应状态
- 200 400 401 403 404 429 500
请求与响应 Schema
JSON
{
"requestBody": {},
"responses": {
"200": {
"description": "Build logs",
"content": {
"application/json": {
"$ref": "#/components/schemas/CompileLogPage"
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"$ref": "#/components/schemas/RequestError"
}
}
},
"401": {
"description": "Authentication required or invalid",
"content": {
"application/json": {
"$ref": "#/components/schemas/SecurityError"
}
}
},
"403": {
"description": "Authenticated but not permitted",
"content": {
"application/json": {
"$ref": "#/components/schemas/SecurityError"
}
}
},
"404": {
"description": "Requested build was not found",
"content": {
"application/json": {
"$ref": "#/components/schemas/ApiError"
}
}
},
"429": {
"description": "HTTP rate limit or API-key NCU usage limit exceeded",
"content": {
"application/json": {
"$ref": "#/components/schemas/RateLimitError"
}
}
},
"500": {
"description": "Unexpected server error",
"content": {
"application/json": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}使用 JWT 或带 build:read 的 nfy_ 密钥读取构建日志的有界切片。project task 还要求调用方对项目拥有有效 build:read capability;legacy 或 ad-hoc task 使用 exact-owner fallback。from 是从零开始的行偏移,limit 最大为 5,000 行。负数会钳制为零;超过当前末尾的偏移会产生空切片。
将返回的 to 偏移作为下一次的 from,并用 totalLines 了解当前末尾。构建可能尚未创建日志,此时结果为空。日志存储会随任务清理,因此保留的任务元数据不保证历史日志仍可用。