jobs jobs (http://api.3plcentral.com/rels/jobs/jobs)
Resource:
Collection: of job
C# Rel Const:
Rels.JobSvc.Jobs
URI template:
{?pgsiz,pgnum,rql,sort,methodParams,getTotal}
Obtain URI from:
jobs, with current state info; for all states of a given job, follow the JobHistory link;
rql-able fields are currentstate: jobstate, reason, enteredstatedateutcall; jobinfo: all but threeplidentifier.id, methodparams, tracemessages
only the == rql operator is supported for jobinfo.customerid, methodname, registeredbyjobid and threeplidentifier.guid;
so to perform the equivalent of =in= do the following: rql=...(jobinfo.customerid==5,jobinfo.customerid==6,jobinfo.customerid==9)...
Hint: example GET for determining if job is already scheduled (as used by HH enqueueing machinery):
/jobs?pgsiz=1&rql=jobinfo.methodname==mmm;currentstate.jobstate=in=(1,2,3);jobinfo.threeplidentifier.guid==ggg&methodparams=a|b|c
Hint: methodParams value must be cognizant of strings containing backslashes; for example, for C:\hh\2 pass in "C:\\\\hh\\\\2"
the surrounding quotes because it's a string, the backslashes quadrupled because of json encoding
no need to take my word for it -- see what hangfire stores in its job.arguments column and reason it out
Success status: 200
Name Data Type Description
pgsiz int must be positive; limit 4000, specifying more is an error; default 100; max records to return per response; use "next" or "prev" link to paginate
pgnum int considering pgsiz, returns the pgnum-th page, 1-indexed
rql string see RQL documentation
sort string see RQL documentation
methodParams string bar (|) delim list of param vals, positionally significant, i.e., 1st val is 1st param, 2nd is 2nd, ...; Getting the total number of records cause the db to be queried twice. If you don't need the total turn it off. each val is quoted if data type is string, proper date format for dates, ...; an empty string to signify any value for the given positional param; please specify all params, even if empty; for example: 12|"/customers/1024"||2020-12-11T11:12:56.0000000|| means int p1 val 12 + string p2 val given + any p3 val + p4 date val given + p5 any + p6 any
getTotal bool
list of jobs
Type Description
TotalResults int
ResourceList IList<Job.Models.Job>
JobInfo Job.Models.JobInfo
Retries int? ...
RecurringJobName string template from which job was enqueued due to appropriate time elapsing
JobId Int64
ThreePlIdentifier Generic.Models.ThreePlIdentifier
Guid string
Name string
Id int
CustomerId int? ...
RegisteredByJobId Int64? ...
MethodName string partially-qualified name of job method, beginning with top-level namespace after HH preramble, ending with a specific interface method
MethodParams String[] values of each of the method parameters, encoded as JSON; for parameter names see JobMethod
TraceMessages String[] concatenation of trace messages for all occurrences of a processing state
CreatedAt DateTime
ExpireAt DateTime? ...
CurrentState Job.Models.StateTransition a job state transition
JobState Common.Enum.JobState
- 1: Scheduled job will fire at EnqueueAt time
- 2: Enqueued job ready to run now as soon as a server has time
- 3: Processing job is now running
- 4: Succeeded job finished in a successful state
- 5: Failed job finished in a failed state, perhaps after having reached its max retry count
- 6: Deleted job has been dele--ggg--aaahh...
Reason string varies based on Name Scheduled: a) NULL, b) Retry attempt m of n: then first few chars of exception msg Enqueued: a) NULL, b) Triggered by DelayedJobScheduler, c) Triggered by recurring job scheduler, d) Triggered via Dashboard UI Processing: NULL Succeeded: NULL Failed: An exception occurred during performance of the job. Deleted: Triggered via Dashboard UI other states not expected to encounter: Awaiting, Deleted
EnteredStateDateUtc DateTime When the job entered this particular state
EnqueuedQueue string relevant if state is Enqueued
ScheduledEnqueueAt DateTime? ... relevant if state is Scheduled
ProcessingServerName string relevant if state is Processing
ProcessingWorkerName string relevant if state is Processing
SucceededElapsedMilliseconds Int64? ... relevant if state is Succeeded
FailedExceptionType string relevant if state is Failed
FailedMessage string relevant if state is Failed
FailedStackTrace string relevant if state is Failed
Sample accept: application/hal+json
{
  "totalResults": 1,
  "_embedded": {
    "http://api.3plCentral.com/rels/jobs/job": [
      {
        "jobInfo": {
          "retries": 1,
          "recurringJobName": "str",
          "jobId": 2,
          "threePlIdentifier": {
            "guid": "str",
            "name": "str",
            "id": 3
          },
          "customerId": 1,
          "registeredByJobId": 1,
          "methodName": "str",
          "methodParams": [
            "str"
          ],
          "traceMessages": [
            "str"
          ],
          "createdAt": "2016-12-25T23:00:00",
          "expireAt": "2016-12-25T23:00:00"
        },
        "currentState": {
          "jobState": 1,
          "reason": "str",
          "enteredStateDateUtc": "2016-12-25T23:00:00",
          "enqueuedQueue": "str",
          "scheduledEnqueueAt": "2016-12-25T23:00:00",
          "processingServerName": "str",
          "processingWorkerName": "str",
          "succeededElapsedMilliseconds": 1,
          "failedExceptionType": "str",
          "failedMessage": "str",
          "failedStackTrace": "str"
        }
      }
    ]
  }
}

This documentation is subject to change, and is updated often and without warning. The models documented may or may not be available to users now or in the future. Use this documentation at your own risk.
Contact api@3plcentral.com with any questions about this documentation.