skipcheck

TM1 client · Docs · Security

JobService

from skipcheck_tm1.services import JobService

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 (waiting_on needs 12.3.0); on TM1 11, every method fails with Tm1UnsupportedOperationError before sending a request (use ThreadService on TM1 11).

See what the server is busy with:

# Active jobs running on TM1 12
query = ODataQuery.none().select(Job.ID, Job.DESCRIPTION, Job.STATE, Job.ELAPSED_TIME)
return [f"{job.id}: {job.description} ({job.state})" for job in tm1.jobs.list(query)]

Cancel a running job:

# Cancel an active job by its ID
tm1.jobs.cancel(job_id)

The asyncio flavor, skipcheck_tm1.aio, has the same methods to await, on AsyncJobService.

Members

listGET Jobs.
getThe job, or a Tm1NotFoundError if it's gone.
waiting_onThe jobs blocking this job.
sessionThe session this job is servicing.
replicaThe database replica this job is running on.
cancelAsks the job to stop what it's doing.

list

list(query: ODataQuery | None = None, **options: Any) -> list[Job]

GET Jobs. Needs schema 12.2.0.

TM1 REST EntitySet Jobs

get

get(id: str, query: ODataQuery | None = None, **options: Any) -> Job

GET Jobs('id'): the job, or a Tm1NotFoundError if it's gone. Needs schema 12.2.0.

TM1 REST EntitySet Jobs

waiting_on

waiting_on(id: str, query: ODataQuery | None = None, **options: Any) -> list[Job]

GET Jobs('id')/WaitingOn: the jobs blocking this job. Needs schema 12.3.0.

TM1 REST Navigation Job/WaitingOn

session

session(id: str, query: ODataQuery | None = None, **options: Any) -> Session

GET Jobs('id')/Session: the session this job is servicing. Needs schema 12.2.0.

TM1 REST Navigation Job/Session

replica

replica(id: str, query: ODataQuery | None = None, **options: Any) -> 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: str) -> None

tm1.Cancel: asks the job to stop what it's doing. Needs schema 12.2.0.

TM1 REST Action Job/Cancel