skipcheck

TM1 client · Docs · Security

JobService

using Skipcheck.Tm1.Client.Services;

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 (WaitingOnAsync 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
return tm1
    .Jobs.ListAsync(ODataQuery.None().Select(Job.Fields.Id, Job.Fields.Description, Job.Fields.State, Job.Fields.ElapsedTime))
    .Select(job => $"{job.Id}: {job.Description} ({job.State})");

Cancel a running job:

// Cancel an active job by its ID
return tm1.Jobs.CancelAsync(jobId);

Members

JobService constructorA service that sends its requests through session.
ListAsyncGET Jobs, streamed.
GetAsyncGET Jobs('id'), or a Tm1NotFoundException if it's gone.
WaitingOnAsyncGET Jobs('id')/WaitingOn, streamed.
SessionAsyncThe session this job is servicing.
ReplicaAsyncThe database replica this job is running on.
CancelAsyncAsks the job to stop what it's doing.

JobService

constructor
JobService(Tm1Session session)

A service that sends its requests through session.

ListAsync

IAsyncEnumerable<Job> ListAsync(ODataQuery? query = null, CancellationToken cancellationToken = default)

GET Jobs, streamed. Needs schema 12.2.0.

TM1 REST EntitySet Jobs

GetAsync

Task<Job> GetAsync(string id, ODataQuery? query = null, CancellationToken cancellationToken = default)

GET Jobs('id'), or a Tm1NotFoundException if it's gone. Needs schema 12.2.0.

TM1 REST EntitySet Jobs

WaitingOnAsync

IAsyncEnumerable<Job> WaitingOnAsync(string id, ODataQuery? query = null, CancellationToken cancellationToken = default)

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

TM1 REST Navigation Job/WaitingOn

SessionAsync

Task<ServerSession> SessionAsync(string id, ODataQuery? query = null, CancellationToken cancellationToken = default)

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

TM1 REST Navigation Job/Session

ReplicaAsync

Task<DatabaseReplica> ReplicaAsync(string id, ODataQuery? query = null, CancellationToken cancellationToken = default)

GET Jobs('id')/Replica: the database replica this job is running on. Needs schema 12.2.0.

TM1 REST Navigation Job/Replica

CancelAsync

Task CancelAsync(string id, CancellationToken cancellationToken = default)

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

TM1 REST Action Job/Cancel