resumeJob()
Signature
client.resumeJob(id: string): Promise<SimpleResponse>Parameters#
| Param | Type | Description |
|---|---|---|
id | string | UUID of the job to resume |
Usage#
ts
import { VeloraClient } from '@rimora/velora'
import fetch from 'node-fetch'
const client = new VeloraClient({
apiKey: process.env.VELORA_API_KEY,
fetch: fetch as any
})
const jobId = '9f4a1c2b-3d4e-5f6a-7b8c-9d0e1f2a3b4c'
const result = await client.resumeJob(jobId)
console.log(result.msg) // "Job resumed from paused status" or "Job revived from dead status"
// Confirm the new next_run_at
const job = await client.getJob(jobId)
console.log('Next run:', job.next_run_at)Response#
SimpleResponse (from paused)
{
"id": "9f4a1c2b-3d4e-5f6a-7b8c-9d0e1f2a3b4c",
"msg": "Job resumed from paused status"
}SimpleResponse (from dead)
{
"id": "9f4a1c2b-3d4e-5f6a-7b8c-9d0e1f2a3b4c",
"msg": "Job revived from dead status"
}Calling
resumeJob on an already-active job is a no-op. next_run_at is not changed in that case.Required scope#
Requires: jobs:update or jobs:write (or admin, *)
Common errors#
| Status | error | Cause |
|---|---|---|
401 | invalid_api_key | Missing or revoked API key |
403 | insufficient_scope | Key lacks jobs:update scope |
404 | not_found | Job does not exist |