UNDER PROGRESS
Web Services
Any job or job chain in the JobScheduler can be exposed as a Web Service. The JobScheduler accept SOAP requests and send a standard SOAP response.
The JobScheduler can be configured to except start job and job chain requests either
via a generic JobScheduler Webservice interface or
<web_service ... name = "scheduler" url_path = "/scheduler" > </web_service>
via specific Webservice interface for a individual job or job chain.
<web_service ... name = "start_backup" url_path = "/start_backup" > </web_service>
Configure JobScheduler
Update
scheduler.xml
with a generic web service interface. Following configuration will enable the JobScheduler to accept variety of SOAP requests.<http_server > <web_service debug = "no" request_xslt_stylesheet = "config/scheduler_soap_request.xslt" response_xslt_stylesheet = "config/scheduler_soap_response.xslt" name = "scheduler" url_path = "/scheduler" > </web_service> </http_server>
- After
scheduler.xml
update to make configuration effective, restart the JobScheduler service ( Windows ) or demon ( Linux ). Now the JobScheduler is accessible via a SOAP web service. Web service can be accessed with URL
http://<jobscheduler-host>:<jobscheduler-port>/scheduler
e.g. http://localhost:4444/scheduler
Web Services
It is important here to differentiate between the two types of Web Service requests:
Asynchronous Web Service Requests
This feature is marked as deprecated see - JS-1347Getting issue details... STATUS for more information.
The caller receives an acknowledgement that his request has been accepted by the JobScheduler and will be processed. Job execution is done asynchronously i.e. at a later run time. This is useful if batch jobs need execution time or should start at a predefined point in time.No changes to job implementations are required with asynchronous Web Services processing.
Start a job chain
To start a job chain via SOAP web service SOAP client should send a post request to the JobScheduler with following SOAP format
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <addOrder xmlns="http://www.sos-berlin.com/scheduler"> <jobchain>examples/01_JobChainShellJobs/01_JobChainA</jobchain> <title>soaptest</title> <param> <name>SOAP_PARAM1</name> <value>Value1</value> </param> <param> <name>SOAP_PARAM2</name> <value>Value2</value> </param> </addOrder> </soapenv:Body> </soapenv:Envelope>
- Above given SOAP request will submit a order to the job chain
example/01_JobChainShellJobs/01_JobChainA
. The order will also have two parametersSOAP_PARAM1=Value1
andSOAP_PARAM2=Value2
, which will be passed to the job chain. SOAP request received by the JobScheduler will processed immediately and order id will be send back with response as success token.
<?xml version="1.0" encoding="ISO-8859-1"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <sos:orderId xmlns:sos="http://www.sos-berlin.com/scheduler">100635</sos:orderId> </soapenv:Body> </soapenv:Envelope>
Check Order Status
To Check the status of order's status sent to JobSceduler send following SOAP request to the JobScheduler
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <showOrder xmlns="http://www.sos-berlin.com/scheduler"> <jobchain>examples/01_JobChainShellJobs/01_JobChainA</jobchain> <order>100638</order> </showOrder> </soapenv:Body> </soapenv:Envelope>
Start a Job
To start a job via SOAP web service SOAP client should send a post request to the JobScheduler with following SOAP format
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <startJob xmlns="http://www.sos-berlin.com/scheduler"> <job>sos/housekeeping/scheduler_rotate_log</job> <at>now+60</at> </startJob> </soapenv:Body> </soapenv:Envelope>
- Above given SOAP request will start the job
sos/housekeeping/scheduler_rotate_log
. The job will be started after 60 seconds of time of SOAP request. SOAP request received by the JobScheduler will processed immediately and task id will be send back with response as success token.
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <sos:taskId xmlns:sos="http://www.sos-berlin.com/scheduler">17641247</sos:taskId> </soapenv:Body> </soapenv:Envelope>
Synchronous Web Service Requests
Should a request be received by the JobScheduler then it will be instantly processed. The caller receives the job execution result on the fly. Jobs must be developed to handle this kind of request.
Change Management References