跳转到内容
Rayrun
登录注册

文件

工作区内的列目录 / 下载 / 上传。 完整参数、请求 / 响应 schema 见下方(本页只渲染该组):

v0.1.0
OpenAPI 3.0.3

Rayrun API

Rayrun REST API —— 控制台与命令行(rayrun CLI)的统一接口,也是自托管部署的 第三方集成的接入点。共 13 组、93 个端点(分组见左侧栏或「介绍」页的接口一览)。 基地址与部署同源:<实例地址>/v1(如 https://rayrun.example.com/v1)。 认证:Bearer Token(控制台「设置 → 我的 API Token」或 rayrun login 创建) 或浏览器会话 Cookie;GET /health 免认证。详见「介绍」页的认证一节。

Server:https://api.rayrunos.com/v1

Rayrun 托管平台

Client Libraries

文件

​

工作区内的列目录 / 下载 / 上传。

列目录

​

Path Parameters

  • sandbox_id(UUIDv7)

Query Parameters

  • workdir 相对路径;空串/缺省 = workdir 根

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for get/sandboxes/{id}/files
curl https://api.rayrunos.com/v1/sandboxes/123e4567-e89b-12d3-a456-426614174000/files \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "entries": [
    {
      "name": "string",
      "type": "file",
      "size": null
    }
  ]
}

下载文件

​

文件字节流。Content-Disposition: attachment; filename=""。 走 vsock read_file(workspace 块设备被 VM 独占挂载,host 不能直读)。 前端用 直连下载。

Path Parameters

  • sandbox_id(UUIDv7)

  • workdir 相对路径(Gin 通配 *path;经规范化与前缀校验,失败 → 400 invalid_path)

Responses

  • application/octet-stream
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for get/sandboxes/{id}/files/{path}
curl 'https://api.rayrunos.com/v1/sandboxes/123e4567-e89b-12d3-a456-426614174000/files/{path}' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
null

上传文件

​

Content-Type: application/octet-stream。daemon 边读边按 512 KiB 分块发往 guestd(vsock 单帧 1 MiB 上限),不设总体上限 —— 唯一边界是 guest workspace 容量,写满 → 500 internal_error(io_error)。 前端(Dashboard)另有 100 MiB 预检,那是 UX 拦截,不是服务端契约。

Path Parameters

  • sandbox_id(UUIDv7)

  • workdir 相对路径(Gin 通配 *path;经规范化与前缀校验,失败 → 400 invalid_path)

Body

required
application/json

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for put/sandboxes/{id}/files/{path}
curl 'https://api.rayrunos.com/v1/sandboxes/123e4567-e89b-12d3-a456-426614174000/files/{path}' \
  --request PUT \
  --header 'Content-Type: application/octet-stream' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data-binary 'null'
{
  "path": "string",
  "size": 1
}

Models