pauseJob()
Signature
client.pauseJob(id: string): Promise<SimpleResponse>Parameters#
| Param | Type | Description |
|---|---|---|
id | string | UUID of the job to pause |
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'
// Pause before a deployment window
console.log('Pausing job before deploy...')
const result = await client.pauseJob(jobId)
console.log(result.msg) // "Job paused"
// ... run your deployment ...
// Resume after deploy
const resume = await client.resumeJob(jobId)
console.log(resume.msg) // "Job resumed"Response#
SimpleResponse
{
"id": "9f4a1c2b-3d4e-5f6a-7b8c-9d0e1f2a3b4c",
"msg": "Job paused"
}Pausing an already-paused job is a no-op — the API returns 200 with the same response.
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 |