스토리지 API

조직의 파일 스토리지를 관리합니다. JustDeploy가 발급한 presigned URL로 파일을 업로드하고 조회하거나 삭제합니다.

GET/organizations/:orgId/storages

조직의 모든 스토리지를 조회합니다.

응답
{
  "storages": [
    {
      "id": "stor_abc123",
      "name": "My Storage",
      "status": "active",
      "createdAt": "2026-03-20T...",
      "updatedAt": "2026-03-20T..."
    }
  ]
}
GET/organizations/:orgId/storages/:storageId/files

스토리지의 파일을 조회합니다. 한 번에 받을 개수는 limit(1~200, 기본값 50)으로 정하고, 다음 페이지는 cursor로 요청하세요.

응답
{
  "files": [
    {
      "id": "f1234567-abcd-...",
      "name": "photo.png",
      "path": "photo.png",
      "mime": "image/png",
      "size": 102400,
      "status": "active",
      "error": null,
      "createdAt": "2026-03-20T...",
      "updatedAt": "2026-03-20T..."
    }
  ],
  "nextCursor": null
}
POST/organizations/:orgId/storages/:storageId/files

파일 정보를 등록하면 업로드용 presigned URL이 반환됩니다. 1시간 안에 해당 URL로 파일을 업로드하세요.

요청 본문
{
  "files": [
    { "name": "photo.png", "mime": "image/png" },
    { "name": "data.json", "mime": "application/json" }
  ]
}
응답
{
  "files": [
    {
      "id": "f1234567-abcd-...",
      "name": "photo.png",
      "path": "photo.png",
      "mime": "image/png",
      "size": 0,
      "status": "pending",
      "error": null,
      "createdAt": "2026-03-20T...",
      "updatedAt": "2026-03-20T...",
      "url": "https://upload.justdeploy.net/..." // Presigned upload URL
    }
  ]
}

발급받은 presigned URL로 파일을 업로드하세요.

업로드
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: image/png" \
  --data-binary @photo.png
GET/organizations/:orgId/storages/:storageId/files/:fileId

파일 메타데이터와 서명된 다운로드 URL을 가져옵니다. URL은 1시간 후 만료됩니다.

응답
{
  "file": {
    "id": "f1234567-abcd-...",
    "name": "photo.png",
    "path": "photo.png",
    "mime": "image/png",
    "size": 102400,
    "status": "active",
    "error": null,
    "createdAt": "2026-03-20T...",
    "updatedAt": "2026-03-20T...",
    "url": "https://cdn.justdeploy.net/..." // Signed download URL
  }
}
DELETE/organizations/:orgId/storages/:storageId/files/:fileId

스토리지에서 파일을 삭제합니다.