Schedulers

Schedulers

스케줄러 프로젝트를 API로 생성하고 스케줄을 관리합니다. 한 프로젝트에 여러 스케줄을 둘 수 있으며 각각 추가·수정·일시정지·삭제하고, 즉시 실행할 수 있습니다.

POST/organizations/:orgId/projects

스케줄러 프로젝트를 생성합니다. 기본 스케줄 1개(매시간, UTC)로 시작하며, 아래 엔드포인트로 스케줄을 관리합니다.

Request body
{
  "name": "nightly-report",
  "type": "cron"
}
응답
{
  "project": {
    "id": "p1234567-abcd-...",
    "name": "nightly-report",
    "description": null,
    "region": "us-east-1",
    "type": "cron",
    "createdAt": "2026-07-11T...",
    "updatedAt": "2026-07-11T..."
  }
}
GET/organizations/:orgId/projects/:projectId/schedules

프로젝트의 스케줄 목록을 조회합니다.

응답
{
  "schedules": [
    {
      "id": 42,
      "expression": "0 * * * *",
      "timezone": "UTC",
      "enabled": true,
      "createdAt": "2026-07-11T...",
      "updatedAt": "2026-07-11T..."
    }
  ]
}
POST/organizations/:orgId/projects/:projectId/schedules

스케줄을 추가합니다. "expression"은 표준 5필드 cron 표현식이고 "timezone"(IANA)·"enabled"는 선택입니다. 한 프로젝트에 최대 5개의 스케줄을 둘 수 있으며, 초과하면 409를 반환합니다.

Request body
{
  "expression": "0 9 * * MON-FRI",
  "timezone": "America/New_York",
  "enabled": true
}
응답
{
  "schedule": {
    "id": 43,
    "expression": "0 9 * * MON-FRI",
    "timezone": "America/New_York",
    "enabled": true,
    "createdAt": "2026-07-11T...",
    "updatedAt": "2026-07-11T..."
  }
}
PUT/organizations/:orgId/projects/:projectId/schedules/:scheduleId

스케줄 하나를 수정합니다. "expression"·"timezone"·"enabled" 중 일부만 보내도 됩니다. "enabled"를 false로 하면 일시정지, true면 재개.

Request body
{
  "expression": "30 6 * * *",
  "timezone": "America/New_York",
  "enabled": false
}
응답
{
  "schedule": {
    "id": 43,
    "expression": "30 6 * * *",
    "timezone": "America/New_York",
    "enabled": false,
    "updatedAt": "2026-07-11T..."
  }
}
DELETE/organizations/:orgId/projects/:projectId/schedules/:scheduleId

스케줄 하나를 삭제합니다. 프로젝트는 최소 1개를 유지해야 하며, 마지막 1개 삭제는 400을 반환합니다.

POST/organizations/:orgId/projects/:projectId/run

일정과 무관하게 즉시 한 번 실행합니다. 비동기 호출이라 출력은 Logs에서 확인합니다.

응답
{
  "invoked": true
}