batchResumeJobs()
Signature
client.batchResumeJobs(payload: JobBatchResumePayload): Promise<JobBatchResumeResponse>Parameters#
| Param | Type | Description |
|---|---|---|
ids | string[] | Array of job UUIDs to resume (max 100) |
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 jobIds = ['9f4a1c2b-3d4e-5f6a-7b8c-9d0e1f2a3b4c', 'a1b2c3d4-5e6f-7g8h-9i0j-1k2l3m4n5o6p']
const result = await client.batchResumeJobs({ ids: jobIds })
console.log(`Resumed ${result.resumed} jobs, skipped ${result.skipped}`)
// The endpoint is: POST /api/v1/jobs/resume/batchResponse#
JobBatchResumeResponse
{
"jobs": [
{ "id": "9f4a1c2b-3d4e-5f6a-7b8c-9d0e1f2a3b4c", "status": "active" },
{ "id": "a1b2c3d4-5e6f-7g8h-9i0j-1k2l3m4n5o6p", "status": "active" }
],
"total": 2,
"resumed": 2,
"skipped": 0
}Maximum 100 IDs per request. Jobs that are already active will be skipped and included in the 'skipped' count.
Required scope#
Requires: jobs:write (or admin, *)
Common errors#
| Status | error | Cause |
|---|---|---|
400 | validation_error | ids is required and must be an array |
400 | validation_error | Maximum 100 IDs per request |
401 | invalid_api_key | Missing or revoked API key |
403 | insufficient_scope | Key lacks jobs:write scope |