获取构建分析
OpenAPI 契约
- 方法
- GET
- 路径
/api/v1/analytics/builds- 认证
- jwtBearer (bearer) OR automationKey (bearer)
- 响应状态
- 200 400 401 403 429 500
请求与响应 Schema
JSON
{
"requestBody": {},
"responses": {
"200": {
"description": "Build analytics",
"content": {
"application/json": {
"$ref": "#/components/schemas/AnalyticsBuildsResponse"
}
}
},
"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"
}
}
},
"429": {
"description": "Rate limit exceeded",
"content": {
"application/json": {
"$ref": "#/components/schemas/SecurityError"
}
}
},
"500": {
"description": "Unexpected server error",
"content": {
"application/json": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}GET /api/v1/analytics/builds 接受 JWT 或带 analytics:read 的 nfy_ 密钥。它只包含当前认证用户在请求窗口之后创建的非草稿构建。range 可为 7d、30d(默认)、90d 或 1y;interval 可为 1h、6h、1d(默认)或 7d。
响应包含时间桶,其中有构建总数、成功数、失败或取消数,以及同时具有开始和完成时间的成功构建的平均毫秒时长。空时间段会被省略。
http
GET /api/v1/analytics/builds?range=30d&interval=1d
Authorization: Bearer <access token>