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
list | GET Jobs. |
get | The job, or a Tm1NotFoundError if it's gone. |
waiting_on | The jobs blocking this job. |
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. |
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) -> JobGET 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) -> SessionGET 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) -> DatabaseReplicaGET 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) -> Nonetm1.Cancel: asks the job to stop what it's doing. Needs schema 12.2.0.
TM1 REST Action Job/Cancel