space.schedule.get()

Read one job by its ID.

Reads one job by its ID.

function get(id: string, options?: CallOptions): Promise<Job>

Parameters

idstringRequired

The job’s ID: 26 lowercase letters and digits.

options.signalAbortSignal

Cancels the call.

options.timeoutMsnumber

How long the call may take, in milliseconds. The timeoutMs set in createSpace when you leave it out, 30,000 by default.

Returns

A promise of the job.

The call is sent again, up to retries times, when it fails in a way that may pass, such as a network failure or 503.

Errors

CodeWhen
validation_failedid is not a job ID
not_foundThe project has no job with that ID

Every call can also fail with the codes shared by all of space, such as missing_project or network_error. See SpaceError.

Example

get-job.ts
import { space } from "digitospace"

const job = await space.schedule.get("01m3c081d2wj4g63qcr53pa1yh")

console.log(job.name, job.state, job.nextRunAt)

Last updated