URL Callback¶
Introduction¶
The seal-dpf-urlcallback
service provides the option of an active answer back to the assigning party of a job. It will perform a PUT request of the URL given containing the tracker url of the job, if the job parameter DpfControlCallbackUrl
ist set. The response is triggered by these job states:
-
job_sending
: entering working unitsendback
, i. e. waiting for the client to fetch the result file(s) -
job_finished
: DPF job reached end, either normally or abnormally/erroneously.
Usage¶
Using DPF Batch Client you can supply a callback URL for your DPF job and thus trigger a callback request.
Example
dpfclient -wf example -s DpfControlCallbackUrl=http://callbackhost:port/ourjobmanager/ourjobno/12345
Data Delivery¶
The seal-dpf-urlcallback
service performs a PUT request containing a JSON data structure.
It contains these elements:
jobId
: DPF internal job idjobIdFs
: name of the DPF job directory, also shown in DPF Tracker as job subtitle in smaller letters or as job name if none supplied on job assigningjobState
: current state of the jobexitStatus
: final status of the job, optional, only if the job is finished, either normally or abnormally/erroneouslyerrorReason
: error reason, optional, only if the job ends in an errordpfTrackerUrl
: link to the job in DPF Tracker
In all cases the structure sent is the same, but unused elements have null
value.
Example - JSON data for job state sending
{
"jobId": "4711",
"jobIdFs": "201602231834182304",
"jobState": "SENDING",
"dpfTrackerUrl": "http://dpfsrv03:9125/cgi-bin/dpftracker?job=201602231834182304"
}
If the jobs ended successfully, jobstate
is FINISHED
and exitStatus
has the value OK
.
Example - JSON data for a sucessful job
{
"jobId": "4711",
"jobIdFs": "201602231834182304",
"jobState": "FINISHED",
"exitStatus": "OK",
"dpfTrackerUrl": "http://dpfsrv03:9125/cgi-bin/dpftracker?job=201602231834182304"
}
If the job finished with an error, you receive jobState
ERROR
and additional information in the elements exitStatus
and errorReason
.
Example - JSON data for an erroneous job
{
"jobId": "4711",
"jobIdFs": "201602231834182304",
"jobState": "ERROR",
"exitStatus": "ERR_EXTERN_PROG_CALL",
"errorReason": "Error: This CURRFILETYPE -bat- is not supported!",
"dpfTrackerUrl": "http://dpfsrv03:9125/cgi-bin/dpftracker?job=201604081202570010"
}
Error Analysis¶
If the callback does not seem to work as expected, i. e. callback URL not requested, do any of the following:
-
In a PowerShell or Command Line (not DPF environment), check the status of
seal-dpf-urlcallback
service.dpf service status seal-dpf-urlcallback
-
Check in the log file whether the callback request was successful.
- Windows:
C:\ProgramData\SEAL Systems\log\seal-dpf-urlcallback.log
- Linux:
/opt/seal/log/seal-dpf-urlcallback.log
Hint - use Elastic Stack
The log file contains machine-readable entries in JSON format. Use Elastic Stack for a human-readable view. For how to install and configure Elastic Stack, refer to SEAL Elastic Stack documentation.
If the log file provides too few information, you can raise the
LOG_LEVEL
. - Windows: