更新构建托管路径

OpenAPI 契约

方法
PATCH
路径
/api/v1/builds/{taskId}/hosting
认证
jwtBearer (bearer) OR automationKey (bearer)
响应状态
200 400 401 403 404 429 500
请求与响应 Schema
JSON
{
  "requestBody": {
    "application/json": {
      "$ref": "#/components/schemas/UpdateHostingPathRequest"
    }
  },
  "responses": {
    "200": {
      "description": "Hosting updated",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/CompileTaskResponse"
        }
      }
    },
    "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:write 的 nfy_ 密钥重命名构建的 hosted 路径。project task 还要求调用方对项目拥有有效 build:write capability;legacy 或 ad-hoc task 使用 exact-owner fallback。发送 URL 安全的相对路径,而不是完整 URL。首尾斜杠会被规范化;路径段可使用字母、数字、点、下划线和连字符。空路径、遍历段、反斜杠、查询/片段字符、百分号、冒号、超长路径及冲突都会被拒绝。

此接口改变的是路由地址,不是访问权限。获取新路径下的成功 artifact 仍需要 dashboard JWT 或带 artifact:read 的 nfy_ 密钥,并且 project task 需要有效 artifact:output:read,legacy/ad-hoc task 需要 exact ownership。难以猜测的路径不是权限控制。任务响应是当前 hostingPath 的来源。

json
{"hostingPath":"releases/example/native.jar"}