...
Method | Arguments | Description |
---|---|---|
com.sos.jitl.restclient.JobSchedulerRestClient.executeRestService | execute a GET operation and return the result object | |
url | a URL that includes host and port of the web service, e.g. http://localhost:44445/jobscheduler/agent/api/ | |
com.sos.jitl.restclient.JobSchedulerRestClient.executeRestServiceCommand | execute a configurable operation and return the result object | |
operation | one of the HTTP verbs:
POST|PUT can be parameterized with the body
| |
url | a URL that includes host and port of the web service, e.g.http://localhost:44445/jobscheduler/agent/api/ | |
com.sos.jitl.restclient.JobSchedulerRestClient.getRestService | execute the web service operation using GET | |
host | hostname or ip address of the web service, e.g.
| |
port | port for which the web service is accessible, e.g. 4445 | |
path | path and query string of the web service URL, e.g.
| |
protocol | protocol in use including | |
com.sos.jitl.restclient.JobSchedulerRestClient.postRestService | execute the web service operation using POST | |
host | hostname or ip address of the web service, e.g.
| |
port | port for which the web service is accessible, e.g. 4445 | |
path | path and query string of the web service URL, e.g.
| |
body | The body for the POST | |
com.sos.jitl.restclient.JobSchedulerRestClient.putRestService | execute the web service operation using PUT | |
host | hostname or ip address of the web service, e.g.
| |
port | port for which the web service is accessible, e.g. 4445 | |
path | path and query string of the web service URL, e.g.
| |
body | The body for the PUT | |
com.sos.jitl.restclient.JobSchedulerRestClient.setProxy | set Http proxy without credentials | |
proxyHost | hostname or ip address of the http proxy | |
proxyPort | port of the http proxy | |
com.sos.jitl.restclient.JobSchedulerRestClient.setProxy | set Http proxy with credentials if necessary | |
proxyHost / proxyPort | see setProxy without credentials | |
proxyUser | user of the http proxy if necessary | |
proxyPassword | user's password of the http proxy if necessary |
...
Find additional orders for REST operations with the download of this example.
Example for HTTPS
- We assume that a SSL certificate is imported in a Java truststore
/path/to/java/myTruststore.jks
- Please note that the REST client varify the hostname of the URL with the certificate
Code Block language xml collapse true <job stop_on_error="no" > <params/> <script language="java:javascript"> <![CDATA[ function spooler_process() { //set location of the java truststore with ssl certificates java.lang.System.setProperty("javax.net.ssl.trustStore", "/path/to/java/truststore.jks"); //add an authorization if necessary com.sos.jitl.restclient.JobSchedulerRestClient.headers.put("Authorization","Basic cm9vdDpyOm9vdA=="); //request with https url var response = com.sos.jitl.restclient.JobSchedulerRestClient.executeRestServiceCommand("get", "https://..." ); spooler_log.info(response); return false; } ]]> </script> <run_time/> </job>
References
See also
...