JobService
import { JobService } from "@skipcheck/tm1-client"; Active jobs on TM1 12 (/Jobs): what each database replica is running right now,
which jobs are blocking it, its session and replica, and cancelling a job. Needs schema
12.2.0 (waitingOn needs 12.3.0); on TM1 11, every method fails with
Tm1UnsupportedOperationException before sending a request (use
ThreadService on TM1 11).
See what the server is busy with:
// Active jobs running on TM1 12
const query = ODataQuery.none().select(Job.Fields.ID, Job.Fields.Description, Job.Fields.State, Job.Fields.ElapsedTime);
const jobs = await tm1.jobs.list(query).toArray();
return jobs.map((job) => `${job.ID}: ${job.Description} (${job.State})`);
Cancel a running job:
// Cancel an active job by its ID
await tm1.jobs.cancel(jobId);
Members
JobService constructor | A service sending its requests through session. |
list | GET Jobs, streamed. |
get | The job, or a Tm1NotFoundException if it's gone. |
waitingOn | GET Jobs('id')/WaitingOn, streamed. |
session | The session this job is servicing. |
replica | The database replica this job is running on. |
cancel | Asks the job to stop what it's doing. |
JobService
constructorconstructor(session: Tm1Session)A service sending its requests through session.
list
list(query?: ODataQuery | null, options?: Tm1CallOptions): Tm1Stream<Job>GET Jobs, streamed. Needs schema 12.2.0.
TM1 REST EntitySet Jobs
get
get(id: string, query?: ODataQuery | null, options?: Tm1CallOptions): Promise<Job>GET Jobs('id'): the job, or a Tm1NotFoundException if it's gone. Needs schema 12.2.0.
TM1 REST EntitySet Jobs
waitingOn
waitingOn(id: string, query?: ODataQuery | null, options?: Tm1CallOptions): Tm1Stream<Job>GET Jobs('id')/WaitingOn, streamed: the jobs blocking this job. Needs schema 12.3.0.
TM1 REST Navigation Job/WaitingOn
session
session(id: string, query?: ODataQuery | null, options?: Tm1CallOptions): Promise<Session>GET Jobs('id')/Session: the session this job is servicing. Needs schema 12.2.0.
TM1 REST Navigation Job/Session
replica
replica(id: string, query?: ODataQuery | null, options?: Tm1CallOptions): Promise<DatabaseReplica>GET Jobs('id')/Replica: the database replica this job is running on. Needs schema 12.2.0.
TM1 REST Navigation Job/Replica
cancel
cancel(id: string, options?: Tm1CallOptions): Promise<void>tm1.Cancel: asks the job to stop what it's doing. Needs schema 12.2.0.
TM1 REST Action Job/Cancel