JobStateUpdateClient

class DIRAC.WorkloadManagementSystem.FutureClient.JobStateUpdateClient.JobStateUpdateClient

Bases: FutureClient

sendHeartBeat(jobID: str | int, dynamicData: dict, staticData: dict) DOKReturnType[T] | DErrorReturnType

Send a heartbeat from a Job.

The behaviour of this function is not strictly the same as in legacy DIRAC. Most notably, in legacy DIRAC the heartbeat always overrides the job status to Running whereas in DiracX the job state machine is still respected. Additionally, DiracX updates the job logging information when status transitions occur as a result of the heartbeat.

setJobApplicationStatus(jobID: str | int, appStatus: str, source: str = 'Unknown') DOKReturnType[T] | DErrorReturnType
setJobAttribute(jobID: str | int, attribute: str, value: str) DOKReturnType[T] | DErrorReturnType
setJobParameter(jobID: str | int, name: str, value: str) DOKReturnType[T] | DErrorReturnType
setJobParameters(jobID: str | int, parameters: list) DOKReturnType[T] | DErrorReturnType
setJobSite(jobID: str | int, site: str) DOKReturnType[T] | DErrorReturnType
setJobStatus(jobID: str | int, status: str = '', minorStatus: str = '', source: str = 'Unknown', datetime_=None, force=False) DOKReturnType[T] | DErrorReturnType
setJobStatusBulk(jobID: str | int, statusDict: dict, force=False) DOKReturnType[T] | DErrorReturnType
setJobsParameter(jobsParameterDict: dict) DOKReturnType[T] | DErrorReturnType
updateJobFromStager(jobID: str | int, status: str) DOKReturnType[T] | DErrorReturnType
DIRAC.WorkloadManagementSystem.FutureClient.JobStateUpdateClient.stripValueIfOK(func)

Decorator to remove S_OK[“Value”] from the return value of a function if it is OK.

This is done as some update functions return the number of modified rows in the database. This likely not actually useful so it isn’t supported in DiracX. Stripping the “Value” key of the dictionary means that we should get a fairly straight forward error if the assumption is incorrect.