Class JobServices
- Namespace
- ArcanaDevelopment.adTempus.Client
- Assembly
- ArcanaDevelopment.adTempus.Client.dll
Methods for working with job execution and history
public class JobServices
- Inheritance
-
objectJobServices
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
| Name | Type | Description |
|---|---|---|
jobOIDs |
OID[] | The OID(s) of the job(s) to acknowledge the status for. |
Remarks
Requires ServerVersion 5.0 or later.
- See Also
-
AcknowledgeStatus(int)
AcknowledgeInstanceStatus(OID[])
Marks job instances as Acknowledged
public void AcknowledgeInstanceStatus(OID[] instanceOIDs)
Parameters
| Name | Type | Description |
|---|---|---|
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
-
AcknowledgeStatus(int)
AcknowledgeLogMessageStatus(OID[])
Acknowledges the status of a log message
public void AcknowledgeLogMessageStatus(OID[] messageOIDs)
Parameters
| Name | Type | Description |
|---|---|---|
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
-
Acknowledge(int)
ClearJobHistory(OID, HistoryClearOptions)
Clears the history for the job, optionally resetting the statistics for the job.
public void ClearJobHistory(OID jobOID, HistoryClearOptions options)
Parameters
| Name | Type | Description |
|---|---|---|
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
ExecuteJob(OID, JobExecutionSettings)
Submits a job for execution.
public ExecuteJobResult ExecuteJob(OID jobOID, JobExecutionSettings settings)
Parameters
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
requestID |
Guid | The ExecutionRequestID of the JobExecutionSettings used in a call to ExecuteJob(OID, JobExecutionSettings) or Execute(JobExecutionSettings) |
Returns
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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