Table of Contents

Class JobServices

Namespace
ArcanaDevelopment.adTempus.Client
Assembly
ArcanaDevelopment.adTempus.Client.dll

Methods for working with job execution and history

public class JobServices
Inheritance
object
JobServices

Methods

AcknowledgeAllInstances(OID[])

Acknowledges the status for all instances of the specified job(s)

[RequiredVersion(5, 0, 0, 0)]
public void AcknowledgeAllInstances(OID[] jobOIDs)

Parameters

NameTypeDescription
jobOIDs OID[]

The OID(s) of the job(s) to acknowledge the status for.

Remarks

Requires ServerVersion 5.0 or later.

See Also

AcknowledgeInstanceStatus(OID[])

Marks job instances as Acknowledged

public void AcknowledgeInstanceStatus(OID[] instanceOIDs)

Parameters

NameTypeDescription
instanceOIDs OID[]

The OID(s) of the instance(s) to acknowledge

Remarks

Marking an instance as Acknowledged removes it from the Failed Jobs view in the Console and clears its Failed or Warning status indicator.

The caller must have Execute permission for the job.

See Also

AcknowledgeLogMessageStatus(OID[])

Acknowledges the status of a log message

public void AcknowledgeLogMessageStatus(OID[] messageOIDs)

Parameters

NameTypeDescription
messageOIDs OID[]

The OID(s) of the LogMessages to acknowledge

Remarks

Marking a message as Acknowledged removes it from the Alerts view in the Console.

The caller must have Execute or Manage permission for the job or for the server if the message is not related to a job.

See Also

ClearJobHistory(OID, HistoryClearOptions)

Clears the history for the job, optionally resetting the statistics for the job.

public void ClearJobHistory(OID jobOID, HistoryClearOptions options)

Parameters

NameTypeDescription
jobOID OID

The OID of the Job to clear history for

options HistoryClearOptions

Options for the operation

Remarks

Calling this method signals the server to purge the history and returns immediately; there may be a delay before the purge completes. If options contains ResetStatistics, the statistics tracked in the JobStatus are all reset to zero.

Clearing the history does not reset the instance numbering for the job back to 1.

See Also

DeleteInstances(OID[])

Deletes the specified instances from the job history

[RequiredVersion(5, 1, 272, 0)]
public void DeleteInstances(OID[] instanceOIDs)

Parameters

NameTypeDescription
instanceOIDs OID[]

The OID(s) of the instance(s) to delete.

Remarks

Requires ServerVersion 5.1.272 or later.

This method queues the specified instance(s) for deletion and returns immediately. Deletion may take several seconds or longer to complete. No feedback is provided about the status of the request.

This functionality is disabled by default. To enable it, you must set the "InstanceDeletion:Allow" server option to True. By default only members of the adTempus Administrators group are allowed to delete instances. If the "InstanceDeletion:RequireAdminPermission" server option is False, any user with Modify permission for a job is allowed to delete instances for that job.

If instances are submitted for multiple jobs and the user does not have permission to delete instances for any of those jobs, the method fails with a PermissionDeniedException and no instances are deleted (including those the caller has permission for).

Deleting instances using this method does not recalculate statistics stored in the JobStatus.

ExecuteJob(OID, JobExecutionSettings)

Submits a job for execution.

public ExecuteJobResult ExecuteJob(OID jobOID, JobExecutionSettings settings)

Parameters

NameTypeDescription
jobOID OID

The OID of the Job to execute.

settings JobExecutionSettings

The settings to use for executing the job.

Returns

ExecuteJobResult

An ExecuteJobResult object containing the results of the operation.

See Also

GetInstancesForRequest(Guid)

Gets the instances created by a specific job execution request

public ExecutionHistoryItemCollection GetInstancesForRequest(Guid requestID)

Parameters

NameTypeDescription
requestID Guid

The ExecutionRequestID of the JobExecutionSettings used in a call to ExecuteJob(OID, JobExecutionSettings) or Execute(JobExecutionSettings)

Returns

ExecutionHistoryItemCollection

Remarks

This method returns the instances that were created by an on-demand job execution request. There may be one more instance if the job is configured to run on multiple agents.

Calling this method refreshes the instances from the server.

OverrideInstanceStatus(OID, JobState, string)

Overrides the status of an instance

public void OverrideInstanceStatus(OID instanceOID, JobState newStatus, string reason = "")

Parameters

NameTypeDescription
instanceOID OID

The OID of the ExecutionHistoryItem representing the instance

newStatus JobState

The new status for the instance

reason string

The reason for the override

Remarks

The caller must have Modify or Execute permission for the job.

Exceptions

PermissionDeniedException

Thrown if the caller does not have the necessary permission.

See Also

ReleaseWaitingInstance(OID, int, string)

Forces immediate execution of an instance that is waiting for execution.

public void ReleaseWaitingInstance(OID instanceOID, int options = 0, string reason = "")

Parameters

NameTypeDescription
instanceOID OID

The OID of the ExecutionHistoryItem representing the waiting instance

options int

Reserved. Must be set to 0.

reason string

Optional reason for the forced execution.

Remarks

This forces the job to continue execution if it is waiting for a condition or available queue slot.

See Also

TerminateJob(OID, TerminationOptions, int, OID, string)

Terminates one or more instances of a running job

public void TerminateJob(OID jobOID, TerminationOptions options = TerminationOptions.None, int instanceID = 0, OID agentOID = null, string reason = "")

Parameters

NameTypeDescription
jobOID OID

The OID of the job to terminate

options TerminationOptions

Options specifying which instances are terminated

instanceID int

The InstanceID of the instance to terminate, if you only want to terminate a specific instance.

agentOID OID

The OID of the RemoteAgent to terminate instances on

reason string

The reason for termination. This is recorded in the Job Log for the instance(s).

See Also

See Also