status
- compute.status(job)
- compute.status(opts)
Returns the status of jobs deployed to the scheduler.
- Arguments:
job (Job|string) – An instance or id of the
Job().opts (object) – Query options – see Form 2, below.
- Return type:
object|Array<object>
Note
There is no ownerKeystore argument – this function takes exactly one argument in either form. Passing a second argument has no effect; it’s silently ignored.
See compute.status in the Compute API spec for the current, authoritative parameter and return-shape description.
Forms
Form 1
compute.status(job);
Returns a status object for a given job (a job id string, or a Job instance).
Example:
job.on('result', async (ev) => {
const status = await compute.status(job);
console.log('status:', status);
});
Form 2
Returns an array of status objects for jobs belonging to the currently authenticated user, optionally filtered by startTime/endTime/statuses.
compute.status({ startTime, endTime });
Example:
job.on('result', async (ev) => {
const status = await compute.status({ startTime: 0, endTime: Date.now() });
console.log('status:', status);
});